summaryrefslogtreecommitdiffstats
path: root/services/core
diff options
context:
space:
mode:
authorPat Erley <perley@cyngn.com>2016-05-20 14:35:13 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-05-23 17:58:48 -0700
commited671ae44aa112b15607731f057f988bde679a5a (patch)
tree44d823e17ab2f5f81a317c4fcb1f8c4981953df4 /services/core
parent2b21b18e109ddab30d7a0ff47dd900e55167ec37 (diff)
downloadframeworks_base-ed671ae44aa112b15607731f057f988bde679a5a.zip
frameworks_base-ed671ae44aa112b15607731f057f988bde679a5a.tar.gz
frameworks_base-ed671ae44aa112b15607731f057f988bde679a5a.tar.bz2
Only call uncrypt when we're encrypted
We were always generating a block map for encrypted update, even when the device was not encrypted. This leads to a spectacular failure. Fix this by only calling uncrypt when we're encrypted. Additionally, only pass block.map as the update file in the case that the device was encrypted and requires it. NIGHTLIES-3012 Change-Id: Ia34eb5115ac4365605fd57f76179854a6042c5e4
Diffstat (limited to 'services/core')
-rw-r--r--services/core/java/com/android/server/power/ShutdownThread.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java
index 4eda3dc..5062244 100644
--- a/services/core/java/com/android/server/power/ShutdownThread.java
+++ b/services/core/java/com/android/server/power/ShutdownThread.java
@@ -630,7 +630,10 @@ public final class ShutdownThread extends Thread {
}
};
- if (mRebootUpdate) {
+ final String cryptoStatus = SystemProperties.get("ro.crypto.state", "unsupported");
+ final boolean isEncrypted = "encrypted".equalsIgnoreCase(cryptoStatus);
+
+ if (mRebootUpdate && isEncrypted) {
sInstance.setRebootProgress(MOUNT_SERVICE_STOP_PERCENT, null);
// If it's to reboot to install update, invoke uncrypt via init service.