From 91317107a39a4f2a9347105b96aafcb98fe21fee Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Thu, 11 Sep 2014 11:47:12 -0700 Subject: Create correct files in dropbox on encrypted boot On the minimal framework start, don't mark ro.runtime.firstboot, allowing the real framework to properly create the dropbox files in the real /data Bug: 17450632 Change-Id: Ic53b3471b44e69f3eea7e3f3de18e789f51192bc --- core/java/com/android/server/BootReceiver.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/java/com/android/server/BootReceiver.java b/core/java/com/android/server/BootReceiver.java index 724998570cb0..468d7f1f15a9 100644 --- a/core/java/com/android/server/BootReceiver.java +++ b/core/java/com/android/server/BootReceiver.java @@ -123,8 +123,15 @@ public class BootReceiver extends BroadcastReceiver { } if (SystemProperties.getLong("ro.runtime.firstboot", 0) == 0) { - String now = Long.toString(System.currentTimeMillis()); - SystemProperties.set("ro.runtime.firstboot", now); + if ("encrypted".equals(SystemProperties.get("ro.crypto.state")) + && "trigger_restart_min_framework".equals(SystemProperties.get("vold.decrypt"))){ + // Encrypted, first boot to get PIN/pattern/password so data is tmpfs + // Don't set ro.runtime.firstboot so that we will do this again + // when data is properly mounted + } else { + String now = Long.toString(System.currentTimeMillis()); + SystemProperties.set("ro.runtime.firstboot", now); + } if (db != null) db.addText("SYSTEM_BOOT", headers); // Negative sizes mean to take the *tail* of the file (see FileUtils.readTextFile()) -- cgit v1.2.3-59-g8ed1b