Disable bubbles for low ram devices

Fixes: 167677013
Test: set low ram true => bubble settings hidden
Test: make -j80 RunSettingsRoboTests ROBOTEST_FILTER="Bubble"

Change-Id: I1c40a05404ea7c78cc82102b33e4bc3cb3528075
This commit is contained in:
Lyn Han
2020-09-17 12:02:47 -07:00
parent f537a702dd
commit 29559b1645
8 changed files with 103 additions and 5 deletions

View File

@@ -19,6 +19,7 @@ package com.android.settings.notification.app;
import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE;
import static android.provider.Settings.Global.NOTIFICATION_BUBBLES;
import android.app.ActivityManager;
import android.annotation.Nullable;
import android.content.Context;
import android.provider.Settings;
@@ -139,7 +140,8 @@ public class BubblePreferenceController extends NotificationPreferenceController
}
private boolean isGloballyEnabled() {
return Settings.Global.getInt(mContext.getContentResolver(),
ActivityManager am = mContext.getSystemService(ActivityManager.class);
return !am.isLowRamDevice() && Settings.Global.getInt(mContext.getContentResolver(),
NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF) == SYSTEM_WIDE_ON;
}