Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 859bbfcb authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Support disabled by default adjustment types

Test: NotificationAssistantsTest
Test: NotificationAssistantServiceTest
Test: NotificationManagerServiceTest
Fixes: 388485761
Flag: EXEMPT bug fix
Change-Id: Ib2250eb31948bef9e170b5e1b7680d7c15640e21
parent 44307e2b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -7310,4 +7310,8 @@

    <!-- Whether the device supports Wi-Fi USD feature. -->
    <bool name="config_deviceSupportsWifiUsd">false</bool>

    <!-- Array containing the notification assistant service adjustments that are not supported by
     default on this device-->
    <string-array translatable="false" name="config_notificationDefaultUnsupportedAdjustments" />
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -5838,4 +5838,6 @@
  <!-- Whether the device supports Wi-Fi USD feature. -->
  <java-symbol type="bool" name="config_deviceSupportsWifiUsd" />

  <java-symbol type="array" name="config_notificationDefaultUnsupportedAdjustments" />

</resources>
+7 −0
Original line number Diff line number Diff line
@@ -754,6 +754,7 @@ public class NotificationManagerService extends SystemService {
    private int mWarnRemoteViewsSizeBytes;
    private int mStripRemoteViewsSizeBytes;
    private String[] mDefaultUnsupportedAdjustments;
    @VisibleForTesting
    protected boolean mShowReviewPermissionsNotification;
@@ -2864,6 +2865,9 @@ public class NotificationManagerService extends SystemService {
        mShowReviewPermissionsNotification = getContext().getResources().getBoolean(
                R.bool.config_notificationReviewPermissions);
        mDefaultUnsupportedAdjustments = getContext().getResources().getStringArray(
                R.array.config_notificationDefaultUnsupportedAdjustments);
        init(handler, new RankingHandlerWorker(mRankingThread.getLooper()),
                AppGlobals.getPackageManager(), getContext().getPackageManager(),
                getLocalService(LightsManager.class),
@@ -11877,6 +11881,9 @@ public class NotificationManagerService extends SystemService {
                }
            } else {
                mAllowedAdjustmentKeyTypes.addAll(List.of(DEFAULT_ALLOWED_ADJUSTMENT_KEY_TYPES));
                if (mDefaultUnsupportedAdjustments != null) {
                    mAllowedAdjustments.removeAll(List.of(mDefaultUnsupportedAdjustments));
                }
            }
        }