diff options
| author | 2020-10-23 14:42:44 +0000 | |
|---|---|---|
| committer | 2020-10-23 14:42:44 +0000 | |
| commit | 39743908c3686353cbfd873a9f88a09dfd5c13da (patch) | |
| tree | 3b91153bbdc461b0d0f8eca000773821c0b440ed | |
| parent | 527e407e2fb83f08bdf54937c4cb60c3bddd541d (diff) | |
| parent | c2eb0503549e9b04c24822b610aeb1f4b756675f (diff) | |
Merge "Remove Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL flag"
16 files changed, 34 insertions, 131 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 59934acdc2f0..a4c8114159d3 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -8936,12 +8936,6 @@ public final class Settings { "packages_to_clear_data_before_full_restore"; /** - * Setting to determine whether to use the new notification priority handling features. - * @hide - */ - public static final String NOTIFICATION_NEW_INTERRUPTION_MODEL = "new_interruption_model"; - - /** * How often to check for location access. * @hide */ diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java index 355b314a0b8f..12ea936e96a1 100644 --- a/core/java/android/view/NotificationHeaderView.java +++ b/core/java/android/view/NotificationHeaderView.java @@ -16,6 +16,7 @@ package android.view; +import android.annotation.NonNull; import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; @@ -54,7 +55,6 @@ public class NotificationHeaderView extends ViewGroup { private CachingIconView mIcon; private View mProfileBadge; private View mFeedbackIcon; - private boolean mShowExpandButtonAtEnd; private boolean mShowWorkBadgeAtEnd; private int mHeaderTextMarginEnd; private Drawable mBackground; @@ -86,14 +86,15 @@ public class NotificationHeaderView extends ViewGroup { this(context, attrs, defStyleAttr, 0); } - public NotificationHeaderView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + public NotificationHeaderView(Context context, AttributeSet attrs, int defStyleAttr, + int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); Resources res = getResources(); mChildMinWidth = res.getDimensionPixelSize(R.dimen.notification_header_shrink_min_width); mContentEndMargin = res.getDimensionPixelSize(R.dimen.notification_content_margin_end); mEntireHeaderClickable = res.getBoolean(R.bool.config_notificationHeaderClickableForExpand); - int[] attrIds = { android.R.attr.gravity }; + int[] attrIds = {android.R.attr.gravity}; TypedArray ta = context.obtainStyledAttributes(attrs, attrIds, defStyleAttr, defStyleRes); mGravity = ta.getInt(0, 0); ta.recycle(); @@ -102,13 +103,14 @@ public class NotificationHeaderView extends ViewGroup { @Override protected void onFinishInflate() { super.onFinishInflate(); - mAppName = findViewById(com.android.internal.R.id.app_name_text); - mHeaderText = findViewById(com.android.internal.R.id.header_text); - mSecondaryHeaderText = findViewById(com.android.internal.R.id.header_text_secondary); - mExpandButton = findViewById(com.android.internal.R.id.expand_button); - mIcon = findViewById(com.android.internal.R.id.icon); - mProfileBadge = findViewById(com.android.internal.R.id.profile_badge); - mFeedbackIcon = findViewById(com.android.internal.R.id.feedback); + mAppName = findViewById(R.id.app_name_text); + mHeaderText = findViewById(R.id.header_text); + mSecondaryHeaderText = findViewById(R.id.header_text_secondary); + mExpandButton = findViewById(R.id.expand_button); + mIcon = findViewById(R.id.icon); + mProfileBadge = findViewById(R.id.profile_badge); + mFeedbackIcon = findViewById(R.id.feedback); + setClipToPadding(false); } @Override @@ -134,9 +136,7 @@ public class NotificationHeaderView extends ViewGroup { lp.topMargin + lp.bottomMargin, lp.height); child.measure(childWidthSpec, childHeightSpec); // Icons that should go at the end - if ((child == mExpandButton && mShowExpandButtonAtEnd) - || child == mProfileBadge - || child == mFeedbackIcon) { + if (child == mExpandButton || child == mProfileBadge || child == mFeedbackIcon) { iconWidth += lp.leftMargin + lp.rightMargin + child.getMeasuredWidth(); } else { totalWidth += lp.leftMargin + lp.rightMargin + child.getMeasuredWidth(); @@ -198,9 +198,7 @@ public class NotificationHeaderView extends ViewGroup { int top = (int) (getPaddingTop() + (ownHeight - childHeight) / 2.0f); int bottom = top + childHeight; // Icons that should go at the end - if ((child == mExpandButton && mShowExpandButtonAtEnd) - || child == mProfileBadge - || child == mFeedbackIcon) { + if (child == mExpandButton || child == mProfileBadge || child == mFeedbackIcon) { if (end == getMeasuredWidth()) { layoutRight = end - mContentEndMargin; } else { @@ -227,7 +225,7 @@ public class NotificationHeaderView extends ViewGroup { @Override public LayoutParams generateLayoutParams(AttributeSet attrs) { - return new ViewGroup.MarginLayoutParams(getContext(), attrs); + return new MarginLayoutParams(getContext(), attrs); } /** @@ -256,7 +254,7 @@ public class NotificationHeaderView extends ViewGroup { } @Override - protected boolean verifyDrawable(Drawable who) { + protected boolean verifyDrawable(@NonNull Drawable who) { return super.verifyDrawable(who) || who == mBackground; } @@ -292,26 +290,17 @@ public class NotificationHeaderView extends ViewGroup { updateTouchListener(); } + /** + * Sets whether or not the work badge appears at the end of the NotificationHeaderView. + * The expand button will always be closer to the end. + */ public void setShowWorkBadgeAtEnd(boolean showWorkBadgeAtEnd) { if (showWorkBadgeAtEnd != mShowWorkBadgeAtEnd) { - setClipToPadding(!showWorkBadgeAtEnd); mShowWorkBadgeAtEnd = showWorkBadgeAtEnd; } } /** - * Sets whether or not the expand button appears at the end of the NotificationHeaderView. If - * both this and {@link #setShowWorkBadgeAtEnd(boolean)} have been set to true, then the - * expand button will appear closer to the end than the work badge. - */ - public void setShowExpandButtonAtEnd(boolean showExpandButtonAtEnd) { - if (showExpandButtonAtEnd != mShowExpandButtonAtEnd) { - setClipToPadding(!showExpandButtonAtEnd); - mShowExpandButtonAtEnd = showExpandButtonAtEnd; - } - } - - /** * Sets the margin end for the text portion of the header, excluding right-aligned elements * @param headerTextMarginEnd margin size */ @@ -331,7 +320,10 @@ public class NotificationHeaderView extends ViewGroup { return mHeaderTextMarginEnd; } - public class HeaderTouchListener implements View.OnTouchListener { + /** + * Handles clicks on the header based on the region tapped. + */ + public class HeaderTouchListener implements OnTouchListener { private final ArrayList<Rect> mTouchRects = new ArrayList<>(); private Rect mExpandButtonRect; diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java index c1bdb56b9da7..c4b36fb1ab29 100644 --- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java +++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java @@ -142,7 +142,6 @@ public class SecureSettings { Settings.Secure.CHARGING_VIBRATION_ENABLED, Settings.Secure.ACCESSIBILITY_NON_INTERACTIVE_UI_TIMEOUT_MS, Settings.Secure.ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS, - Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL, Settings.Secure.TRUST_AGENTS_EXTEND_UNLOCK, Settings.Secure.UI_NIGHT_MODE, Settings.Secure.DARK_THEME_CUSTOM_START_TIME, diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java index 388bf283625c..7f694ad5d375 100644 --- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java +++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java @@ -206,7 +206,6 @@ public class SecureSettingsValidators { Secure.ACCESSIBILITY_INTERACTIVE_UI_TIMEOUT_MS, NON_NEGATIVE_INTEGER_VALIDATOR); VALIDATORS.put(Secure.USER_SETUP_COMPLETE, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.ASSIST_GESTURE_SETUP_COMPLETE, BOOLEAN_VALIDATOR); - VALIDATORS.put(Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.TRUST_AGENTS_EXTEND_UNLOCK, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE, JSON_OBJECT_VALIDATOR); VALIDATORS.put(Secure.LOCK_SCREEN_WHEN_TRUST_LOST, BOOLEAN_VALIDATOR); diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index d63724df0163..57ce0b5da7c1 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -387,9 +387,6 @@ off-screen. --> <bool name="config_fadeDependingOnAmountSwiped">false</bool> - <!-- Whether or not to show the expand button at the end of the notification header. --> - <bool name="config_showNotificationExpandButtonAtEnd">false</bool> - <!-- Whether or the notifications should be clipped to be reduced in height if it has been scrolled to the top of the screen. --> <bool name="config_clipNotificationScrollToTop">true</bool> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java index 8d82270c9ca7..3c4830272099 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java @@ -54,7 +54,6 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.statusbar.notification.NotificationEntryManager; -import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.logging.NotificationLogger; import com.android.systemui.statusbar.policy.DeviceProvisionedController; @@ -345,8 +344,7 @@ public class NotificationLockscreenUserManagerImpl implements return false; } boolean exceedsPriorityThreshold; - if (NotificationUtils.useNewInterruptionModel(mContext) - && hideSilentNotificationsOnLockscreen()) { + if (hideSilentNotificationsOnLockscreen()) { exceedsPriorityThreshold = entry.getBucket() == BUCKET_MEDIA_CONTROLS || (entry.getBucket() != BUCKET_SILENT diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManager.kt index ce6013f776af..cd8897ea229d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManager.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManager.kt @@ -61,10 +61,8 @@ class NotificationSectionsFeatureManager @Inject constructor( isFilteringEnabled() && !isMediaControlsEnabled() -> intArrayOf(BUCKET_HEADS_UP, BUCKET_FOREGROUND_SERVICE, BUCKET_PEOPLE, BUCKET_ALERTING, BUCKET_SILENT) - NotificationUtils.useNewInterruptionModel(context) -> - intArrayOf(BUCKET_ALERTING, BUCKET_SILENT) else -> - intArrayOf(BUCKET_ALERTING) + intArrayOf(BUCKET_ALERTING, BUCKET_SILENT) } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.java index 1af47dd0f4c0..cbc113ba91bf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationUtils.java @@ -16,12 +16,9 @@ package com.android.systemui.statusbar.notification; -import static android.provider.Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL; - import android.annotation.Nullable; import android.content.Context; import android.graphics.Color; -import android.provider.Settings; import android.view.View; import android.widget.ImageView; @@ -76,15 +73,4 @@ public class NotificationUtils { return (int) (dimensionPixelSize * factor); } - /** - * Returns the value of the new interruption model setting. This result is cached and cannot - * change except through reboots/process restarts. - */ - public static boolean useNewInterruptionModel(Context context) { - if (sUseNewInterruptionModel == null) { - sUseNewInterruptionModel = Settings.Secure.getInt(context.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 1) != 0; - } - return sUseNewInterruptionModel; - } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java index 318cdb171fa5..b1c6f535ba87 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java @@ -37,7 +37,6 @@ import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.NotificationLockscreenUserManager; -import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.collection.GroupEntry; import com.android.systemui.statusbar.notification.collection.ListEntry; import com.android.systemui.statusbar.notification.collection.NotifPipeline; @@ -150,8 +149,7 @@ public class KeyguardCoordinator implements Coordinator { if (entry == null) { return false; } - if (NotificationUtils.useNewInterruptionModel(mContext) - && mHideSilentNotificationsOnLockscreen) { + if (mHideSilentNotificationsOnLockscreen) { return mHighPriorityProvider.isHighPriority(entry); } else { return entry.getRepresentativeEntry() != null diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 3f13306b7cf2..5ee66fabe55a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -1643,19 +1643,15 @@ public class ExpandableNotificationRow extends ActivatableNotificationView /** Sets the last time the notification being displayed audibly alerted the user. */ public void setLastAudiblyAlertedMs(long lastAudiblyAlertedMs) { - if (NotificationUtils.useNewInterruptionModel(mContext)) { - long timeSinceAlertedAudibly = System.currentTimeMillis() - lastAudiblyAlertedMs; - boolean alertedRecently = - timeSinceAlertedAudibly < RECENTLY_ALERTED_THRESHOLD_MS; + long timeSinceAlertedAudibly = System.currentTimeMillis() - lastAudiblyAlertedMs; + boolean alertedRecently = timeSinceAlertedAudibly < RECENTLY_ALERTED_THRESHOLD_MS; - applyAudiblyAlertedRecently(alertedRecently); + applyAudiblyAlertedRecently(alertedRecently); - removeCallbacks(mExpireRecentlyAlertedFlag); - if (alertedRecently) { - long timeUntilNoLongerRecent = - RECENTLY_ALERTED_THRESHOLD_MS - timeSinceAlertedAudibly; - postDelayed(mExpireRecentlyAlertedFlag, timeUntilNoLongerRecent); - } + removeCallbacks(mExpireRecentlyAlertedFlag); + if (alertedRecently) { + long timeUntilNoLongerRecent = RECENTLY_ALERTED_THRESHOLD_MS - timeSinceAlertedAudibly; + postDelayed(mExpireRecentlyAlertedFlag, timeUntilNoLongerRecent); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java index 8c8275628fac..0fc4c42599cf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java @@ -34,12 +34,10 @@ import com.android.internal.widget.CachingIconView; import com.android.internal.widget.NotificationExpandButton; import com.android.settingslib.Utils; import com.android.systemui.Interpolators; -import com.android.systemui.R; import com.android.systemui.statusbar.TransformableView; import com.android.systemui.statusbar.ViewTransformationHelper; import com.android.systemui.statusbar.notification.CustomInterpolatorTransformation; import com.android.systemui.statusbar.notification.ImageTransformState; -import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.TransformState; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; @@ -67,13 +65,9 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper { private boolean mIsLowPriority; private boolean mTransformLowPriorityTitle; - private boolean mShowExpandButtonAtEnd; protected NotificationHeaderViewWrapper(Context ctx, View view, ExpandableNotificationRow row) { super(ctx, view, row); - mShowExpandButtonAtEnd = ctx.getResources().getBoolean( - R.bool.config_showNotificationExpandButtonAtEnd) - || NotificationUtils.useNewInterruptionModel(ctx); mTransformationHelper = new ViewTransformationHelper(); // we want to avoid that the header clashes with the other text when transforming @@ -115,9 +109,6 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper { mNotificationHeader = mView.findViewById(com.android.internal.R.id.notification_header); mAudiblyAlertedIcon = mView.findViewById(com.android.internal.R.id.alerted_icon); mFeedbackIcon = mView.findViewById(com.android.internal.R.id.feedback); - if (mNotificationHeader != null) { - mNotificationHeader.setShowExpandButtonAtEnd(mShowExpandButtonAtEnd); - } } private void addFeedbackOnClickListener(ExpandableNotificationRow row) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java index 808f17b8ba70..2a5027309aec 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java @@ -18,7 +18,6 @@ package com.android.systemui.statusbar; import static android.app.NotificationManager.IMPORTANCE_LOW; import static android.content.Intent.ACTION_USER_SWITCHED; -import static android.provider.Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL; import static com.android.systemui.statusbar.notification.stack.NotificationSectionsManagerKt.BUCKET_MEDIA_CONTROLS; import static com.android.systemui.statusbar.notification.stack.NotificationSectionsManagerKt.BUCKET_PEOPLE; @@ -322,8 +321,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1); Settings.Secure.putInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 1); - Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 1); NotificationEntry entry = new NotificationEntryBuilder() @@ -339,8 +336,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1); Settings.Secure.putInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 1); - Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 0); final Notification notification = mock(Notification.class); @@ -358,8 +353,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1); Settings.Secure.putInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 1); - Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 0); final Notification notification = mock(Notification.class); @@ -377,8 +370,6 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1); Settings.Secure.putInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 1); - Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 0); final Notification notification = mock(Notification.class); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManagerTest.kt index 8948fd07379b..3a948f18ad82 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManagerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManagerTest.kt @@ -18,7 +18,6 @@ package com.android.systemui.statusbar.notification import android.provider.DeviceConfig import android.provider.Settings -import android.provider.Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL import android.testing.AndroidTestingRunner import androidx.test.filters.SmallTest @@ -43,8 +42,6 @@ class NotificationSectionsFeatureManagerTest : SysuiTestCase() { @Before public fun setup() { - Settings.Secure.putInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 1) manager = NotificationSectionsFeatureManager(proxyFake, mContext) manager!!.clearCache() originalQsMediaPlayer = Settings.System.getInt(context.getContentResolver(), diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java index 02a3e11f312b..b482968fed59 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java @@ -22,7 +22,6 @@ import static android.app.NotificationManager.IMPORTANCE_LOW; import static android.app.NotificationManager.IMPORTANCE_MIN; import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED; import static android.print.PrintManager.PRINT_SPOOLER_PACKAGE_NAME; -import static android.provider.Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL; import static android.view.View.GONE; import static android.view.View.VISIBLE; @@ -50,7 +49,6 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.os.UserHandle; -import android.provider.Settings; import android.service.notification.StatusBarNotification; import android.test.suitebuilder.annotation.SmallTest; import android.testing.AndroidTestingRunner; @@ -69,7 +67,6 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder; -import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -163,15 +160,6 @@ public class NotificationInfoTest extends SysuiTestCase { mSbn = new StatusBarNotification(TEST_PACKAGE_NAME, TEST_PACKAGE_NAME, 0, null, TEST_UID, 0, new Notification(), UserHandle.CURRENT, null, 0); mEntry = new NotificationEntryBuilder().setSbn(mSbn).build(); - - Settings.Secure.putInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 1); - } - - @After - public void tearDown() { - Settings.Secure.putInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 0); } @Test diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java index 99e8c7e2df76..37e82185d228 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java @@ -14,7 +14,6 @@ package com.android.systemui.statusbar.notification.row; -import static android.provider.Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL; import static android.provider.Settings.Secure.SHOW_NOTIFICATION_SNOOZE; import static junit.framework.Assert.assertEquals; @@ -43,7 +42,6 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntryB import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier; import com.android.systemui.utils.leaks.LeakCheckedTest; -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -66,12 +64,6 @@ public class NotificationMenuRowTest extends LeakCheckedTest { when(mRow.getEntry()).thenReturn(entry); } - @After - public void tearDown() { - Settings.Secure.putInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 0); - } - @Test public void testAttachDetach() { NotificationMenuRowPlugin row = diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java index bb85cec5c099..ceb4d84fe6aa 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.notification.stack; import static android.provider.Settings.Secure.NOTIFICATION_HISTORY_ENABLED; -import static android.provider.Settings.Secure.NOTIFICATION_NEW_INTERRUPTION_MODEL; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_ALL; import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_GENTLE; @@ -64,7 +63,6 @@ import com.android.systemui.statusbar.notification.stack.NotificationStackScroll import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.StatusBar; -import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -102,17 +100,12 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Mock private SysuiStatusBarStateController mStatusBarStateController; @Mock private NotificationSwipeHelper mNotificationSwipeHelper; @Mock private NotificationStackScrollLayoutController mStackScrollLayoutController; - private int mOriginalInterruptionModelSetting; @Before @UiThreadTest public void setUp() throws Exception { allowTestableLooperAsMainThread(); - mOriginalInterruptionModelSetting = Settings.Secure.getInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 0); - Settings.Secure.putInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, 1); Settings.Secure.putIntForUser(mContext.getContentResolver(), NOTIFICATION_HISTORY_ENABLED, 1, UserHandle.USER_CURRENT); @@ -166,12 +159,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { doNothing().when(notificationShelf).setAnimationsEnabled(anyBoolean()); } - @After - public void tearDown() { - Settings.Secure.putInt(mContext.getContentResolver(), - NOTIFICATION_NEW_INTERRUPTION_MODEL, mOriginalInterruptionModelSetting); - } - @Test public void testNotDimmedOnKeyguard() { when(mBarState.getState()).thenReturn(StatusBarState.SHADE); |