summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian DC <radian.dc@gmail.com>2017-12-07 22:42:34 +0100
committerArne Coucheron <arco68@gmail.com>2018-01-19 00:27:13 +0100
commit9aa7d299551bb5f9f8922fa979515264a8034f5b (patch)
tree5b39b02216c94298b7cea3b99d739890e5afb482
parentd8576a1164f65265ff4d64c7dedd028a78b64fa5 (diff)
downloadandroid_packages_apps_Trebuchet-9aa7d299551bb5f9f8922fa979515264a8034f5b.tar.gz
android_packages_apps_Trebuchet-9aa7d299551bb5f9f8922fa979515264a8034f5b.tar.bz2
android_packages_apps_Trebuchet-9aa7d299551bb5f9f8922fa979515264a8034f5b.zip
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 d40ac8f97..811defe0e 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.