From 657c31ba7639910fe3a565a205d1ce9252990101 Mon Sep 17 00:00:00 2001 From: Adrian DC Date: Thu, 7 Dec 2017 22:42:34 +0100 Subject: Trebuchet: 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 --- src/com/android/launcher3/settings/SettingsActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/launcher3/settings/SettingsActivity.java b/src/com/android/launcher3/settings/SettingsActivity.java index 6209c5ef0..6dafd7d37 100644 --- a/src/com/android/launcher3/settings/SettingsActivity.java +++ b/src/com/android/launcher3/settings/SettingsActivity.java @@ -22,6 +22,7 @@ import static com.android.launcher3.states.RotationHelper.getAllowRotationDefaul import static com.android.launcher3.util.SecureSettingsObserver.newNotificationSettingsObserver; import android.app.Activity; +import android.app.ActivityManager; import android.app.DialogFragment; import android.app.Fragment; import android.content.ComponentName; @@ -199,6 +200,7 @@ public class SettingsActivity extends Activity switch (preference.getKey()) { case NOTIFICATION_DOTS_PREFERENCE_KEY: if (!Utilities.ATLEAST_OREO || + getContext().getSystemService(ActivityManager.class).isLowRamDevice() || !getResources().getBoolean(R.bool.notification_dots_enabled)) { return false; } -- cgit v1.2.3