summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian DC <radian.dc@gmail.com>2017-12-07 21:42:34 (GMT)
committerArne Coucheron <arco68@gmail.com>2017-12-16 05:58:07 (GMT)
commit5014b745904b55877fc4e2c4d93a2300cd209f1e (patch)
treee0db04bae95a01c1baa3c14cce3296cd4b13a13d
parentf60f236ae69d142b68733b50310088f852844a67 (diff)
downloadandroid_packages_apps_Trebuchet-5014b745904b55877fc4e2c4d93a2300cd209f1e.zip
android_packages_apps_Trebuchet-5014b745904b55877fc4e2c4d93a2300cd209f1e.tar.gz
android_packages_apps_Trebuchet-5014b745904b55877fc4e2c4d93a2300cd209f1e.tar.bz2
Settings: Hide Notification Dots on low RAM devices
* As the feature is not available for low RAM devices, hide it from the Settings to avoid confusion * Acquire ActivityManager service to read isLowRamDevice Change-Id: I34a6ee1b4838f31194c89327e301d4fd39670c02 Signed-off-by: Adrian DC <radian.dc@gmail.com>
-rw-r--r--src/com/android/launcher3/SettingsActivity.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/launcher3/SettingsActivity.java b/src/com/android/launcher3/SettingsActivity.java
index d40ac8f..811defe 100644
--- a/src/com/android/launcher3/SettingsActivity.java
+++ b/src/com/android/launcher3/SettingsActivity.java
@@ -17,6 +17,7 @@
package com.android.launcher3;
import android.app.Activity;
+import android.app.ActivityManager;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
@@ -98,7 +99,8 @@ public class SettingsActivity extends Activity {
getPreferenceScreen().removePreference(
findPreference(SessionCommitReceiver.ADD_ICON_PREFERENCE_KEY));
getPreferenceScreen().removePreference(iconBadgingPref);
- } else if (!getResources().getBoolean(R.bool.notification_badging_enabled)) {
+ } else if (!getResources().getBoolean(R.bool.notification_badging_enabled)
+ || getContext().getSystemService(ActivityManager.class).isLowRamDevice()) {
getPreferenceScreen().removePreference(iconBadgingPref);
} else {
// Listen to system notification badge settings while this UI is active.