summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorYo Chiang <yochiang@google.com>2020-12-29 18:03:05 +0800
committerYo Chiang <yochiang@google.com>2021-01-05 15:38:42 +0800
commit848bcdc42a694bdca561d9cdb6b2f8ae8b1618f5 (patch)
tree544289d243b6457e5d85c5bc29555628c31b0f9d /core/java/android
parentd15cbc37d5694f35568ab0aa5fa3ed5f260efee6 (diff)
DynamicSystemInstallationService: Support remount for DSU guest system
DSU service would try to install a DSU scratch partition if host system is debuggable. If the scratch partition failed to install, then skip installing scratch, as remount support should be optional. Otherwise if the guest system is non-debuggable, then the scratch partition would be ignored by guest, which is harmless. Otherwise the guest system is debuggable, which means the guest system would be able to do adb remount. Relax partition allocation status polling rate from 10ms -> 100ms, because there's no point polling faster than the screen framerate. Bug: 165925766 Test: TH Test: Install a DSU system on a debuggable host, reboot into the guest system, and guest system can remount. Change-Id: I9a8255483cc963ebcf7a2909e68ac69371cb369f
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/os/image/DynamicSystemManager.java12
-rw-r--r--core/java/android/os/image/IDynamicSystemService.aidl5
2 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/os/image/DynamicSystemManager.java b/core/java/android/os/image/DynamicSystemManager.java
index 7f01cad940ec..e8e47857ecba 100644
--- a/core/java/android/os/image/DynamicSystemManager.java
+++ b/core/java/android/os/image/DynamicSystemManager.java
@@ -269,4 +269,16 @@ public class DynamicSystemManager {
throw new RuntimeException(e.toString());
}
}
+
+ /**
+ * Returns the suggested scratch partition size for overlayFS.
+ */
+ @RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
+ public long suggestScratchSize() {
+ try {
+ return mService.suggestScratchSize();
+ } catch (RemoteException e) {
+ throw new RuntimeException(e.toString());
+ }
+ }
}
diff --git a/core/java/android/os/image/IDynamicSystemService.aidl b/core/java/android/os/image/IDynamicSystemService.aidl
index df0a69b47225..a5a40ad55853 100644
--- a/core/java/android/os/image/IDynamicSystemService.aidl
+++ b/core/java/android/os/image/IDynamicSystemService.aidl
@@ -125,4 +125,9 @@ interface IDynamicSystemService
* valid VBMeta block to retrieve the AVB key from.
*/
boolean getAvbPublicKey(out AvbPublicKey dst);
+
+ /**
+ * Returns the suggested scratch partition size for overlayFS.
+ */
+ long suggestScratchSize();
}