Whoop whoop

This commit is contained in:
d8ahazard
2016-09-21 16:55:20 -05:00
parent 5d8f9f1a5a
commit 41a5639711
22 changed files with 574 additions and 62 deletions
@@ -6,6 +6,7 @@ import android.content.Intent;
import android.util.Log;
import com.topjohnwu.magisk.services.MonitorService;
import com.topjohnwu.magisk.utils.PrefHelper;
import com.topjohnwu.magisk.utils.Utils;
public class AutoStartReceiver extends BroadcastReceiver {
@@ -14,7 +15,13 @@ public class AutoStartReceiver extends BroadcastReceiver {
Log.d("Magisk", "Received Boot call, attempting to start service");
Intent myIntent = new Intent(context, MonitorService.class);
context.startService(myIntent);
Utils.SetupQuickSettingsTile(context);
if (PrefHelper.CheckBool("keep_root_off")) {
Utils.toggleRoot(false);
}
if (PrefHelper.CheckBool("enable_quicktile")) {
Utils.SetupQuickSettingsTile(context);
}
}
}
@@ -0,0 +1,25 @@
package com.topjohnwu.magisk.receivers;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.topjohnwu.magisk.services.TileService;
public class TileReceiver extends BroadcastReceiver {
private static final String TAG = "MainReceiver";
public TileReceiver() {
}
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG,"RECEIVED");
String action = intent.getAction();
if (action.equals(Intent.ACTION_BOOT_COMPLETED) || action.equals(Intent.ACTION_USER_PRESENT) || action.equals(Intent.ACTION_SCREEN_ON)) {
context.startService(new Intent(context,TileService.class));
}
}
}