Don't overwrite the host FRP when running a GSI.
Bug: 123777418
Test: manual test
Change-Id: Ia251dd939af71126a8236bc5c5cfed6622b2c946
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index a6017f2..1fdf106 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -277,6 +277,8 @@
private static final String UNCRYPT_PACKAGE_FILE = "/cache/recovery/uncrypt_file";
private static final String BLOCK_MAP_FILE = "/cache/recovery/block.map";
+ private static final String GSI_RUNNING_PROP = "ro.gsid.image_running";
+
// maximum number of binder threads used for system_server
// will be higher than the system default
private static final int sMaxBinderThreads = 31;
@@ -1166,7 +1168,8 @@
traceEnd();
final boolean hasPdb = !SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("");
- if (hasPdb) {
+ final boolean hasGsi = SystemProperties.getInt(GSI_RUNNING_PROP, 0) > 0;
+ if (hasPdb && !hasGsi) {
traceBeginAndSlog("StartPersistentDataBlock");
mSystemServiceManager.startService(PersistentDataBlockService.class);
traceEnd();