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

View File

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

View File

@ -164,7 +164,6 @@ public class Utils {
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("enable_quicktile", false)) {
SetupQuickSettingsTile(context);
}
UpdateRootFragmentUI(context);
}
static List<String> getModList(String path) {
@ -373,18 +372,8 @@ public class Utils {
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
// 0 for root disabled, 1 for root enabled (no auto), 2 for auto-root
public static int CheckRootsState(Context mContext) {
if (autoToggleEnabled(mContext)) {
return 2;