app: Don't restart zygote manually on soft reboot (#40)

* zygote will be automatically restrarted as surfacelinger
   has 'onrestart restart zygote' in service definition since N.
This commit is contained in:
Wang Han 2021-02-02 10:51:09 +08:00 committed by GitHub
parent 5220cf5ea5
commit aa0d587be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -38,7 +38,6 @@ public class RebootUtil {
try { try {
if (mode == RebootType.USERSPACE && !supportUserspaceReboot()) { if (mode == RebootType.USERSPACE && !supportUserspaceReboot()) {
ShizukuSystemProperties.set("ctl.restart", "surfaceflinger"); ShizukuSystemProperties.set("ctl.restart", "surfaceflinger");
ShizukuSystemProperties.set("ctl.restart", "zygote");
} else { } else {
POWER_MANAGER.get().reboot(BuildConfig.DEBUG, mode.toString(), false); POWER_MANAGER.get().reboot(BuildConfig.DEBUG, mode.toString(), false);
} }
@ -80,7 +79,7 @@ public class RebootUtil {
if (supportUserspaceReboot()) { if (supportUserspaceReboot()) {
command = "/system/bin/svc power reboot userspace"; command = "/system/bin/svc power reboot userspace";
} else { } else {
command = "setprop ctl.restart surfaceflinger; setprop ctl.restart zygote"; command = "setprop ctl.restart surfaceflinger";
} }
} else if (mode == RebootType.NORMAL) { } else if (mode == RebootType.NORMAL) {
command = "/system/bin/svc power reboot"; command = "/system/bin/svc power reboot";
@ -96,4 +95,4 @@ public class RebootUtil {
private static boolean supportUserspaceReboot() { private static boolean supportUserspaceReboot() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && ((PowerManager) App.getInstance().getSystemService(Context.POWER_SERVICE)).isRebootingUserspaceSupported(); return Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && ((PowerManager) App.getInstance().getSystemService(Context.POWER_SERVICE)).isRebootingUserspaceSupported();
} }
} }