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

@@ -20,6 +20,7 @@ import static android.app.NotificationManager.BUBBLE_PREFERENCE_ALL;
import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE;
import static android.provider.Settings.Global.NOTIFICATION_BUBBLES;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
@@ -99,7 +100,8 @@ public class BubbleSummaryPreferenceController extends NotificationPreferenceCon
}
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, ON) == ON;
}
}