From 164a99681ba089762a00e5213231e675e7b783aa Mon Sep 17 00:00:00 2001 From: John Wu Date: Wed, 27 Feb 2019 16:38:16 -0500 Subject: [PATCH] Make case Intent.ACTION_REBOOT fall through --- .../magisk/components/GeneralReceiver.java | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/app/src/full/java/com/topjohnwu/magisk/components/GeneralReceiver.java b/app/src/full/java/com/topjohnwu/magisk/components/GeneralReceiver.java index 8918eee28..2310c5aaf 100644 --- a/app/src/full/java/com/topjohnwu/magisk/components/GeneralReceiver.java +++ b/app/src/full/java/com/topjohnwu/magisk/components/GeneralReceiver.java @@ -41,27 +41,11 @@ public class GeneralReceiver extends BroadcastReceiver { return; switch (action) { case Intent.ACTION_REBOOT: - String rebootAction = intent.getStringExtra("action"); - switch (rebootAction) { - case "request": - Intent i = new Intent(app, ClassMap.get(SuRequestActivity.class)) - .putExtra("socket", intent.getStringExtra("socket")) - .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - app.startActivity(i); - break; - case "log": - SU_LOGGER.handleLogs(intent); - break; - case "notify": - SU_LOGGER.handleNotify(intent); - break; - } - break; case Intent.ACTION_BOOT_COMPLETED: - String bootAction = intent.getStringExtra("action"); - if (bootAction == null) - bootAction = "boot"; - switch (bootAction) { + String realAction = intent.getStringExtra("action"); + if (realAction == null) + realAction = "boot_complete"; + switch (realAction) { case "request": Intent i = new Intent(app, ClassMap.get(SuRequestActivity.class)) .putExtra("socket", intent.getStringExtra("socket")) @@ -74,7 +58,7 @@ public class GeneralReceiver extends BroadcastReceiver { case "notify": SU_LOGGER.handleNotify(intent); break; - case "boot": + case "boot_complete": default: /* Devices with DTBO might want to patch dtbo.img. * However, that is not possible if Magisk is installed by