Loading core/java/android/app/Notification.java +4 −17 Original line number Diff line number Diff line Loading @@ -6046,21 +6046,18 @@ public class Notification implements Parcelable /** * Removes RemoteViews that were created for compatibility from {@param n}, if they did not * change. Also removes extenders on low ram devices, as * {@link android.service.notification.NotificationListenerService} services are disabled. * change. * * @return {@param n}, if no stripping is needed, otherwise a stripped clone of {@param n}. * * @hide */ public static Notification maybeCloneStrippedForDelivery(Notification n, boolean isLowRam, Context context) { public static Notification maybeCloneStrippedForDelivery(Notification n) { String templateClass = n.extras.getString(EXTRA_TEMPLATE); // Only strip views for known Styles because we won't know how to // re-create them otherwise. if (!isLowRam && !TextUtils.isEmpty(templateClass) if (!TextUtils.isEmpty(templateClass) && getNotificationStyleClass(templateClass) == null) { return n; } Loading @@ -6077,8 +6074,7 @@ public class Notification implements Parcelable n.headsUpContentView.getSequenceNumber(); // Nothing to do here, no need to clone. if (!isLowRam && !stripContentView && !stripBigContentView && !stripHeadsUpContentView) { if (!stripContentView && !stripBigContentView && !stripHeadsUpContentView) { return n; } Loading @@ -6095,15 +6091,6 @@ public class Notification implements Parcelable clone.headsUpContentView = null; clone.extras.remove(EXTRA_REBUILD_HEADS_UP_CONTENT_VIEW_ACTION_COUNT); } if (isLowRam) { String[] allowedServices = context.getResources().getStringArray( R.array.config_allowedManagedServicesOnLowRamDevices); if (allowedServices.length == 0) { clone.extras.remove(Notification.TvExtender.EXTRA_TV_EXTENDER); clone.extras.remove(WearableExtender.EXTRA_WEARABLE_EXTENSIONS); clone.extras.remove(CarExtender.EXTRA_CAR_EXTENDER); } } return clone; } Loading core/java/android/app/NotificationManager.java +1 −4 Original line number Diff line number Diff line Loading @@ -592,10 +592,7 @@ public class NotificationManager { } notification.reduceImageSizes(mContext); ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); boolean isLowRam = am.isLowRamDevice(); return Builder.maybeCloneStrippedForDelivery(notification, isLowRam, mContext); return Builder.maybeCloneStrippedForDelivery(notification); } private void fixLegacySmallIcon(Notification n, String pkg) { Loading core/java/android/service/notification/ConditionProviderService.java +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ import android.util.Log; * </service></pre> * * <p> Condition providers cannot be bound by the system on * {@link ActivityManager#isLowRamDevice() low ram} devices</p> * {@link ActivityManager#isLowRamDevice() low ram} devices running Android Q (and below)</p> * * @deprecated Instead of using an automatically bound service, use * {@link android.app.NotificationManager#setAutomaticZenRuleState(String, Condition)} to tell the Loading core/java/android/service/notification/NotificationListenerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -86,8 +86,8 @@ import java.util.Objects; * or after {@link #onListenerDisconnected()}. * </p> * <p> Notification listeners cannot get notification access or be bound by the system on * {@linkplain ActivityManager#isLowRamDevice() low-RAM} devices. The system also ignores * notification listeners running in a work profile. A * {@linkplain ActivityManager#isLowRamDevice() low-RAM} devices running Android Q (and below). * The system also ignores notification listeners running in a work profile. A * {@link android.app.admin.DevicePolicyManager} might block notifications originating from a work * profile.</p> * <p> Loading core/res/res/values/config.xml +0 −3 Original line number Diff line number Diff line Loading @@ -3534,9 +3534,6 @@ <item>com.android.dialer</item> </string-array> <!-- An array of packages which can listen for notifications on low ram devices. --> <string-array translatable="false" name="config_allowedManagedServicesOnLowRamDevices" /> <!-- The default value for transition animation scale found in developer settings. 1.0 corresponds to 1x animator scale, 0 means that there will be no transition animations. Note that this is only a default and will be overridden by a Loading Loading
core/java/android/app/Notification.java +4 −17 Original line number Diff line number Diff line Loading @@ -6046,21 +6046,18 @@ public class Notification implements Parcelable /** * Removes RemoteViews that were created for compatibility from {@param n}, if they did not * change. Also removes extenders on low ram devices, as * {@link android.service.notification.NotificationListenerService} services are disabled. * change. * * @return {@param n}, if no stripping is needed, otherwise a stripped clone of {@param n}. * * @hide */ public static Notification maybeCloneStrippedForDelivery(Notification n, boolean isLowRam, Context context) { public static Notification maybeCloneStrippedForDelivery(Notification n) { String templateClass = n.extras.getString(EXTRA_TEMPLATE); // Only strip views for known Styles because we won't know how to // re-create them otherwise. if (!isLowRam && !TextUtils.isEmpty(templateClass) if (!TextUtils.isEmpty(templateClass) && getNotificationStyleClass(templateClass) == null) { return n; } Loading @@ -6077,8 +6074,7 @@ public class Notification implements Parcelable n.headsUpContentView.getSequenceNumber(); // Nothing to do here, no need to clone. if (!isLowRam && !stripContentView && !stripBigContentView && !stripHeadsUpContentView) { if (!stripContentView && !stripBigContentView && !stripHeadsUpContentView) { return n; } Loading @@ -6095,15 +6091,6 @@ public class Notification implements Parcelable clone.headsUpContentView = null; clone.extras.remove(EXTRA_REBUILD_HEADS_UP_CONTENT_VIEW_ACTION_COUNT); } if (isLowRam) { String[] allowedServices = context.getResources().getStringArray( R.array.config_allowedManagedServicesOnLowRamDevices); if (allowedServices.length == 0) { clone.extras.remove(Notification.TvExtender.EXTRA_TV_EXTENDER); clone.extras.remove(WearableExtender.EXTRA_WEARABLE_EXTENSIONS); clone.extras.remove(CarExtender.EXTRA_CAR_EXTENDER); } } return clone; } Loading
core/java/android/app/NotificationManager.java +1 −4 Original line number Diff line number Diff line Loading @@ -592,10 +592,7 @@ public class NotificationManager { } notification.reduceImageSizes(mContext); ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); boolean isLowRam = am.isLowRamDevice(); return Builder.maybeCloneStrippedForDelivery(notification, isLowRam, mContext); return Builder.maybeCloneStrippedForDelivery(notification); } private void fixLegacySmallIcon(Notification n, String pkg) { Loading
core/java/android/service/notification/ConditionProviderService.java +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ import android.util.Log; * </service></pre> * * <p> Condition providers cannot be bound by the system on * {@link ActivityManager#isLowRamDevice() low ram} devices</p> * {@link ActivityManager#isLowRamDevice() low ram} devices running Android Q (and below)</p> * * @deprecated Instead of using an automatically bound service, use * {@link android.app.NotificationManager#setAutomaticZenRuleState(String, Condition)} to tell the Loading
core/java/android/service/notification/NotificationListenerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -86,8 +86,8 @@ import java.util.Objects; * or after {@link #onListenerDisconnected()}. * </p> * <p> Notification listeners cannot get notification access or be bound by the system on * {@linkplain ActivityManager#isLowRamDevice() low-RAM} devices. The system also ignores * notification listeners running in a work profile. A * {@linkplain ActivityManager#isLowRamDevice() low-RAM} devices running Android Q (and below). * The system also ignores notification listeners running in a work profile. A * {@link android.app.admin.DevicePolicyManager} might block notifications originating from a work * profile.</p> * <p> Loading
core/res/res/values/config.xml +0 −3 Original line number Diff line number Diff line Loading @@ -3534,9 +3534,6 @@ <item>com.android.dialer</item> </string-array> <!-- An array of packages which can listen for notifications on low ram devices. --> <string-array translatable="false" name="config_allowedManagedServicesOnLowRamDevices" /> <!-- The default value for transition animation scale found in developer settings. 1.0 corresponds to 1x animator scale, 0 means that there will be no transition animations. Note that this is only a default and will be overridden by a Loading