diff options
author | Yo Chiang <yochiang@google.com> | 2020-10-30 06:55:43 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-10-30 06:55:43 +0000 |
commit | 0b6bf88ccde00c2eb7d9ed426ad1762e5c3914a6 (patch) | |
tree | 7296e4ac794ef80730031c7b66952ad140fa8fad /packages/DynamicSystemInstallationService/src | |
parent | a49fb9831e2133f7fb3452bcc62c0e6802fbd36d (diff) | |
parent | 68e2d6b36049bdff1825ac86b36e8e46fc5ed0b1 (diff) |
Merge "Disable DSU in executeRebootToNormalCommand()"
Diffstat (limited to 'packages/DynamicSystemInstallationService/src')
-rw-r--r-- | packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java index 12505bc55b15..ac2758011816 100644 --- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java +++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java @@ -375,8 +375,17 @@ public class DynamicSystemInstallationService extends Service return; } - // Per current design, we don't have disable() API. AOT is disabled on next reboot. - // TODO: Use better status query when b/125079548 is done. + if (!mDynSystem.setEnable(/* enable = */ false, /* oneShot = */ false)) { + Log.e(TAG, "Failed to disable DynamicSystem."); + + // Dismiss status bar and show a toast. + sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); + Toast.makeText(this, + getString(R.string.toast_failed_to_disable_dynsystem), + Toast.LENGTH_LONG).show(); + return; + } + PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); if (powerManager != null) { |