Minor fixes

This commit is contained in:
topjohnwu 2016-09-25 21:59:54 +08:00
parent 89932b325d
commit 859a984ec8
3 changed files with 9 additions and 32 deletions

View File

@ -51,16 +51,11 @@ public class ReposFragment extends Fragment {
View view = inflater.inflate(R.layout.repos_fragment, container, false); View view = inflater.inflate(R.layout.repos_fragment, container, false);
mView = view; mView = view;
ButterKnife.bind(this, view); ButterKnife.bind(this, view);
// prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); swipeRefreshLayout.setOnRefreshListener(() -> {
// if (prefs.contains("ignoreUpdateAlerts")) { this.LoadRepo(true);
// ignoreAlertUpdate = prefs.getBoolean("ignoreUpdateAlerts", false); ignoreAlertUpdate = false;
// }
// swipeRefreshLayout.setOnRefreshListener(() -> { });
// this.LoadRepo(true);
// ignoreAlertUpdate = false;
// prefs.edit().putBoolean("ignoreUpdateAlerts",false).apply();
//
// });
LoadRepo(false); LoadRepo(false);
setHasOptionsMenu(false); setHasOptionsMenu(false);
alertUpdate = false; alertUpdate = false;
@ -76,13 +71,6 @@ public class ReposFragment extends Fragment {
return view; return view;
} }
@Override
public void onStart() {
super.onStart();
NotifyOfAlerts();
}
private void CheckForUpdates() { private void CheckForUpdates() {
for (int i = 0; i < mListRepos.size(); i++) { for (int i = 0; i < mListRepos.size(); i++) {
if (mListRepos.get(i).canUpdate()) { if (mListRepos.get(i).canUpdate()) {
@ -178,7 +166,7 @@ public class ReposFragment extends Fragment {
if (swipeRefreshLayout.isRefreshing()) { if (swipeRefreshLayout.isRefreshing()) {
swipeRefreshLayout.setRefreshing(false); swipeRefreshLayout.setRefreshing(false);
CheckForUpdates(); CheckForUpdates();
NotifyOfAlerts(); //NotifyOfAlerts();
} }
} }

View File

@ -50,6 +50,8 @@ public class SplashActivity extends AppCompatActivity {
if (!Utils.hasServicePermission(getApplicationContext())) { if (!Utils.hasServicePermission(getApplicationContext())) {
Utils.toggleAutoRoot(false, getApplicationContext()); Utils.toggleAutoRoot(false, getApplicationContext());
} }
}
if (Utils.autoToggleEnabled(getApplicationContext())) {
if (!Utils.isMyServiceRunning(MonitorService.class, getApplicationContext())) { if (!Utils.isMyServiceRunning(MonitorService.class, getApplicationContext())) {
Intent myIntent = new Intent(getApplication(), MonitorService.class); Intent myIntent = new Intent(getApplication(), MonitorService.class);
getApplication().startService(myIntent); getApplication().startService(myIntent);
@ -59,9 +61,7 @@ public class SplashActivity extends AppCompatActivity {
} }
// Set up quick settings tile // Set up quick settings tile
if (defaultPrefs.getBoolean("enable_quicktile", false)) { Utils.SetupQuickSettingsTile(getApplicationContext());
Utils.SetupQuickSettingsTile(getApplicationContext());
}
// Initialize // Initialize
Utils.init(this); Utils.init(this);

View File

@ -164,7 +164,6 @@ public class Utils {
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("enable_quicktile", false)) { if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("enable_quicktile", false)) {
SetupQuickSettingsTile(context); SetupQuickSettingsTile(context);
} }
UpdateRootFragmentUI(context);
} }
static List<String> getModList(String path) { static List<String> getModList(String path) {
@ -373,18 +372,8 @@ public class Utils {
context.startService(new Intent(context, TileServiceCompat.class)); context.startService(new Intent(context, TileServiceCompat.class));
} }
public static void UpdateRootFragmentUI(Context context) {
Logger.dh("Magisk", "Utils: UpdateRF called");
Intent intent = new Intent(context, RootFragment.class);
intent.setAction("com.magisk.UPDATE");
context.sendBroadcast(intent);
}
// Gets an overall state for the quick settings tile // Gets an overall state for the quick settings tile
// 0 for root disabled, 1 for root enabled (no auto), 2 for auto-root // 0 for root disabled, 1 for root enabled (no auto), 2 for auto-root
public static int CheckRootsState(Context mContext) { public static int CheckRootsState(Context mContext) {
if (autoToggleEnabled(mContext)) { if (autoToggleEnabled(mContext)) {
return 2; return 2;