Use REBOOT foreground broadcast

This commit is contained in:
vvb2060
2019-02-02 01:27:51 +08:00
committed by John Wu
parent 5764f0c839
commit 0eef4eacd6
2 changed files with 26 additions and 14 deletions

View File

@@ -40,6 +40,23 @@ public class GeneralReceiver extends BroadcastReceiver {
if (action == null)
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)