OSDN Git Service

Include reason when wiping data.
authorJeff Sharkey <jsharkey@android.com>
Wed, 24 Sep 2014 18:46:51 +0000 (11:46 -0700)
committerJeff Sharkey <jsharkey@android.com>
Wed, 24 Sep 2014 18:46:51 +0000 (11:46 -0700)
This will help us track down who requested a data wipe.

Bug: 17412160
Change-Id: I5ab39a4de03c973ed151d703d6462a172ee043fd

cryptfs.c

index 020fc7e..3d1dddd 100644 (file)
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -3044,7 +3044,8 @@ int cryptfs_enable_internal(char *howarg, int crypt_type, char *passwd,
             mkdir("/cache/recovery", 0700);
             int fd = open("/cache/recovery/command", O_RDWR|O_CREAT|O_TRUNC, 0600);
             if (fd >= 0) {
-                write(fd, "--wipe_data", strlen("--wipe_data") + 1);
+                write(fd, "--wipe_data\n", strlen("--wipe_data\n") + 1);
+                write(fd, "--reason=cryptfs_enable_internal\n", strlen("--reason=cryptfs_enable_internal\n") + 1);
                 close(fd);
             } else {
                 SLOGE("could not open /cache/recovery/command\n");