From 859a984ec860f95a7e339c62c714ef897e4cfaa9 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 25 Sep 2016 21:59:54 +0800 Subject: [PATCH] Minor fixes --- .../com/topjohnwu/magisk/ReposFragment.java | 24 +++++-------------- .../com/topjohnwu/magisk/SplashActivity.java | 6 ++--- .../com/topjohnwu/magisk/utils/Utils.java | 11 --------- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ReposFragment.java b/app/src/main/java/com/topjohnwu/magisk/ReposFragment.java index 2bc59bc01..b7415740b 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ReposFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ReposFragment.java @@ -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(); } } diff --git a/app/src/main/java/com/topjohnwu/magisk/SplashActivity.java b/app/src/main/java/com/topjohnwu/magisk/SplashActivity.java index 888affe51..84ea06023 100644 --- a/app/src/main/java/com/topjohnwu/magisk/SplashActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/SplashActivity.java @@ -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()); - } + Utils.SetupQuickSettingsTile(getApplicationContext()); // Initialize Utils.init(this); diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java b/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java index 132e0a8d8..72df3437d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/Utils.java @@ -164,7 +164,6 @@ public class Utils { if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("enable_quicktile", false)) { SetupQuickSettingsTile(context); } - UpdateRootFragmentUI(context); } static List 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;