diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index ae0afa02fad27..0163fc0e20ce8 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -744,10 +744,6 @@
-
- false
-
false
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index c8228a6660ad3..b87381364b1a1 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1909,7 +1909,6 @@
-
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index f9c4eafbc2eb0..f2e56b589bd5f 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -454,7 +454,6 @@ public class NotificationManagerService extends SystemService {
private int mAutoGroupAtCount;
private boolean mIsTelevision;
private boolean mIsAutomotive;
- private boolean mNotificationEffectsEnabledForAutomotive;
private MetricsLogger mMetricsLogger;
private TriPredicate mAllowedManagedServicePackages;
@@ -1681,8 +1680,6 @@ public class NotificationManagerService extends SystemService {
mIsAutomotive =
mPackageManagerClient.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE, 0);
- mNotificationEffectsEnabledForAutomotive =
- resources.getBoolean(R.bool.config_enableServerNotificationEffectsForAutomotive);
mPreferencesHelper.lockChannelsForOEM(getContext().getResources().getStringArray(
com.android.internal.R.array.config_nonBlockableNotificationPackages));
@@ -5557,9 +5554,6 @@ public class NotificationManagerService extends SystemService {
@VisibleForTesting
@GuardedBy("mNotificationLock")
void buzzBeepBlinkLocked(NotificationRecord record) {
- if (mIsAutomotive && !mNotificationEffectsEnabledForAutomotive) {
- return;
- }
boolean buzz = false;
boolean beep = false;
boolean blink = false;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java b/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java
index 49ee8b3bba190..6be2c2e8c59ef 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java
@@ -48,8 +48,8 @@ import android.app.Notification;
import android.app.Notification.Builder;
import android.app.NotificationChannel;
import android.app.NotificationManager;
+import android.content.Context;
import android.content.pm.PackageManager;
-import android.content.res.Resources;
import android.graphics.Color;
import android.media.AudioAttributes;
import android.media.AudioManager;
@@ -63,7 +63,6 @@ import android.provider.Settings;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
import android.test.suitebuilder.annotation.SmallTest;
-import android.testing.TestableContext;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.IAccessibilityManager;
@@ -71,7 +70,6 @@ import android.view.accessibility.IAccessibilityManagerClient;
import androidx.test.runner.AndroidJUnit4;
-import com.android.internal.R;
import com.android.internal.util.IntPair;
import com.android.server.UiServiceTestCase;
import com.android.server.lights.Light;
@@ -88,7 +86,6 @@ import org.mockito.MockitoAnnotations;
@RunWith(AndroidJUnit4.class)
public class BuzzBeepBlinkTest extends UiServiceTestCase {
- private TestableContext mContext = spy(getContext());
@Mock AudioManager mAudioManager;
@Mock Vibrator mVibrator;
@Mock android.media.IRingtonePlayer mRingtonePlayer;
@@ -99,8 +96,6 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase {
NotificationUsageStats mUsageStats;
@Mock
IAccessibilityManager mAccessibilityService;
- @Mock
- Resources mResources;
private NotificationManagerService mService;
private String mPkg = "com.android.server.notification";
@@ -150,7 +145,7 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase {
verify(mAccessibilityService).addClient(any(IAccessibilityManagerClient.class), anyInt());
assertTrue(accessibilityManager.isEnabled());
- mService = spy(new NotificationManagerService(mContext));
+ mService = spy(new NotificationManagerService(getContext()));
mService.setAudioManager(mAudioManager);
mService.setVibrator(mVibrator);
mService.setSystemReady(true);
@@ -280,7 +275,7 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase {
boolean isLeanback) {
NotificationChannel channel =
new NotificationChannel("test", "test", IMPORTANCE_HIGH);
- final Builder builder = new Builder(mContext)
+ final Builder builder = new Builder(getContext())
.setContentTitle("foo")
.setSmallIcon(android.R.drawable.sym_def_app_icon)
.setPriority(Notification.PRIORITY_HIGH)
@@ -326,14 +321,15 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase {
n.flags |= Notification.FLAG_INSISTENT;
}
- PackageManager packageManager = spy(mContext.getPackageManager());
- when(mContext.getPackageManager()).thenReturn(packageManager);
+ Context context = spy(getContext());
+ PackageManager packageManager = spy(context.getPackageManager());
+ when(context.getPackageManager()).thenReturn(packageManager);
when(packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK))
.thenReturn(isLeanback);
StatusBarNotification sbn = new StatusBarNotification(mPkg, mPkg, id, mTag, mUid,
mPid, n, mUser, null, System.currentTimeMillis());
- NotificationRecord r = new NotificationRecord(mContext, sbn, channel);
+ NotificationRecord r = new NotificationRecord(context, sbn, channel);
mService.addNotification(r);
return r;
}
@@ -459,25 +455,7 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase {
}
@Test
- public void testNoBeepForAutomotiveIfEffectsDisabled() throws Exception {
- when(mContext.getResources()).thenReturn(mResources);
- when(mResources.getBoolean(R.bool.config_enableServerNotificationEffectsForAutomotive))
- .thenReturn(false);
- mService.setIsAutomotive(true);
-
- NotificationRecord r = getBeepyNotification();
-
- mService.buzzBeepBlinkLocked(r);
-
- verifyNeverBeep();
- assertFalse(r.isInterruptive());
- }
-
- @Test
- public void testNoBeepForImportanceDefaultInAutomotiveIfEffectsEnabled() throws Exception {
- when(mContext.getResources()).thenReturn(mResources);
- when(mResources.getBoolean(R.bool.config_enableServerNotificationEffectsForAutomotive))
- .thenReturn(true);
+ public void testNoBeepForImportanceDefaultInAutomotive() throws Exception {
mService.setIsAutomotive(true);
NotificationRecord r = getBeepyNotification();
@@ -490,10 +468,7 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase {
}
@Test
- public void testBeepForImportanceHighInAutomotiveIfEffectsEnabled() throws Exception {
- when(mContext.getResources()).thenReturn(mResources);
- when(mResources.getBoolean(R.bool.config_enableServerNotificationEffectsForAutomotive))
- .thenReturn(true);
+ public void testBeepForImportanceHighInAutomotive() throws Exception {
mService.setIsAutomotive(true);
NotificationRecord r = getBeepyNotification();
@@ -1040,12 +1015,12 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase {
public void testEmptyUriSoundTreatedAsNoSound() throws Exception {
NotificationChannel channel = new NotificationChannel("test", "test", IMPORTANCE_HIGH);
channel.setSound(Uri.EMPTY, null);
- final Notification n = new Builder(mContext, "test")
+ final Notification n = new Builder(getContext(), "test")
.setSmallIcon(android.R.drawable.sym_def_app_icon).build();
StatusBarNotification sbn = new StatusBarNotification(mPkg, mPkg, 0, mTag, mUid,
mPid, n, mUser, null, System.currentTimeMillis());
- NotificationRecord r = new NotificationRecord(mContext, sbn, channel);
+ NotificationRecord r = new NotificationRecord(getContext(), sbn, channel);
mService.addNotification(r);
mService.buzzBeepBlinkLocked(r);
@@ -1094,13 +1069,13 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase {
@Test
public void testCrossUserSoundMuted() throws Exception {
- final Notification n = new Builder(mContext, "test")
+ final Notification n = new Builder(getContext(), "test")
.setSmallIcon(android.R.drawable.sym_def_app_icon).build();
int userId = mUser.getIdentifier() + 1;
StatusBarNotification sbn = new StatusBarNotification(mPkg, mPkg, 0, mTag, mUid,
mPid, n, UserHandle.of(userId), null, System.currentTimeMillis());
- NotificationRecord r = new NotificationRecord(mContext, sbn,
+ NotificationRecord r = new NotificationRecord(getContext(), sbn,
new NotificationChannel("test", "test", IMPORTANCE_HIGH));
mService.buzzBeepBlinkLocked(r);