Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
system_vold
Commits
adfba362
Commit
adfba362
authored
12 years ago
by
Ken Sumrall
Browse files
Options
Download
Email Patches
Plain Diff
vold: Use the new method of rebooting by asking init to do it
Change-Id: I7fd5f1048c3cf43fa14597f079c929690cac367c
parent
dfbf110d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
cryptfs.c
cryptfs.c
+17
-5
No files found.
cryptfs.c
View file @
adfba362
...
...
@@ -35,15 +35,14 @@
#include <openssl/evp.h>
#include <openssl/sha.h>
#include <errno.h>
#include <cutils/android_reboot.h>
#include <ext4.h>
#include <linux/kdev_t.h>
#include <fs_mgr.h>
#include "cryptfs.h"
#define LOG_TAG "Cryptfs"
#include "cutils/android_reboot.h"
#include "cutils/log.h"
#include "cutils/properties.h"
#include "cutils/android_reboot.h"
#include "hardware_legacy/power.h"
#include "VolumeManager.h"
...
...
@@ -70,6 +69,19 @@ static struct crypt_persist_data *persist_data = NULL;
extern
struct
fstab
*
fstab
;
static
void
cryptfs_reboot
(
int
recovery
)
{
if
(
recovery
)
{
property_set
(
ANDROID_RB_PROPERTY
,
"reboot,recovery"
);
}
else
{
property_set
(
ANDROID_RB_PROPERTY
,
"reboot"
);
}
sleep
(
20
);
/* Shouldn't get here, reboot should happen before sleep times out */
return
;
}
static
void
ioctl_init
(
struct
dm_ioctl
*
io
,
size_t
dataSize
,
const
char
*
name
,
unsigned
flags
)
{
memset
(
io
,
0
,
dataSize
);
...
...
@@ -1697,7 +1709,7 @@ int cryptfs_enable(char *howarg, char *passwd)
put_crypt_ftr_and_key
(
&
crypt_ftr
);
sleep
(
2
);
/* Give the UI a chance to show 100% progress */
android
_reboot
(
ANDROID_RB_RESTART
,
0
,
0
);
cryptfs
_reboot
(
0
);
}
else
{
char
value
[
PROPERTY_VALUE_MAX
];
...
...
@@ -1713,7 +1725,7 @@ int cryptfs_enable(char *howarg, char *passwd)
}
else
{
SLOGE
(
"could not open /cache/recovery/command
\n
"
);
}
android
_reboot
(
ANDROID_RB_RESTART2
,
0
,
"recovery"
);
cryptfs
_reboot
(
1
);
}
else
{
/* set property to trigger dialog */
property_set
(
"vold.encrypt_progress"
,
"error_partially_encrypted"
);
...
...
@@ -1744,7 +1756,7 @@ error_shutting_down:
* vold to restart the system.
*/
SLOGE
(
"Error enabling encryption after framework is shutdown, no data changed, restarting system"
);
android
_reboot
(
ANDROID_RB_RESTART
,
0
,
0
);
cryptfs
_reboot
(
0
);
/* shouldn't get here */
property_set
(
"vold.encrypt_progress"
,
"error_shutting_down"
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment