Loading packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeaderController.java +2 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ class QuickStatusBarHeaderController extends ViewController<QuickStatusBarHeader mPrivacyIconsController.setChipVisibilityListener(this); mIconContainer.addIgnoredSlot( getResources().getString(com.android.internal.R.string.status_bar_managed_profile)); mIconContainer.addIgnoredSlot( getResources().getString(com.android.internal.R.string.status_bar_alarm_clock)); mIconContainer.setShouldRestrictIcons(false); mStatusBarIconController.addIconGroup(mIconManager); Loading packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt +8 −0 Original line number Diff line number Diff line Loading @@ -270,6 +270,14 @@ class LargeScreenShadeHeaderController @Inject constructor( qsCarrierGroupController = qsCarrierGroupControllerBuilder .setQSCarrierGroup(qsCarrierGroup) .build() if (!combinedHeaders) { // In the new header, we display alarm icon but we ignore it when not using the new // headers. iconContainer.addIgnoredSlot( context.getString(com.android.internal.R.string.status_bar_alarm_clock) ) } } override fun onViewAttached() { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +6 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.content.SharedPreferences; import android.content.res.Resources; import android.media.AudioManager; import android.os.Handler; import android.os.Looper; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; Loading Loading @@ -127,7 +128,7 @@ public class PhoneStatusBarPolicy private final DateFormatUtil mDateFormatUtil; private final TelecomManager mTelecomManager; private final Handler mHandler = new Handler(); private final Handler mHandler; private final CastController mCast; private final HotspotController mHotspot; private final NextAlarmController mNextAlarmController; Loading Loading @@ -166,7 +167,7 @@ public class PhoneStatusBarPolicy @Inject public PhoneStatusBarPolicy(StatusBarIconController iconController, CommandQueue commandQueue, BroadcastDispatcher broadcastDispatcher, @UiBackground Executor uiBgExecutor, @Main Resources resources, @UiBackground Executor uiBgExecutor, @Main Looper looper, @Main Resources resources, CastController castController, HotspotController hotspotController, BluetoothController bluetoothController, NextAlarmController nextAlarmController, UserInfoController userInfoController, RotationLockController rotationLockController, Loading @@ -185,6 +186,7 @@ public class PhoneStatusBarPolicy mIconController = iconController; mCommandQueue = commandQueue; mBroadcastDispatcher = broadcastDispatcher; mHandler = new Handler(looper); mResources = resources; mCast = castController; mHotspot = hotspotController; Loading Loading @@ -332,6 +334,7 @@ public class PhoneStatusBarPolicy mRotationLockController.addCallback(this); mBluetooth.addCallback(this); mProvisionedController.addCallback(this); mCurrentUserSetup = mProvisionedController.isCurrentUserSetup(); mZenController.addCallback(this); mCast.addCallback(mCastCallback); mHotspot.addCallback(mHotspotCallback); Loading Loading @@ -562,6 +565,7 @@ public class PhoneStatusBarPolicy mHandler.post(() -> { updateAlarm(); updateManagedProfile(); onUserSetupChanged(); }); } }; Loading packages/SystemUI/tests/src/com/android/systemui/qs/QuickStatusBarHeaderControllerTest.kt +8 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,14 @@ class QuickStatusBarHeaderControllerTest : SysuiTestCase() { verify(view).setIsSingleCarrier(false) } @Test fun testAlarmIconIgnored() { controller.init() verify(iconContainer).addIgnoredSlot( mContext.getString(com.android.internal.R.string.status_bar_alarm_clock)) } private fun stubViews() { `when`(view.findViewById<View>(anyInt())).thenReturn(mockView) `when`(view.findViewById<QSCarrierGroup>(R.id.carrier_group)).thenReturn(qsCarrierGroup) Loading packages/SystemUI/tests/src/com/android/systemui/shade/LargeScreenShadeHeaderControllerCombinedTest.kt +7 −0 Original line number Diff line number Diff line Loading @@ -607,6 +607,13 @@ class LargeScreenShadeHeaderControllerCombinedTest : SysuiTestCase() { verify(mockConstraintsChanges.largeScreenConstraintsChanges)!!.invoke(any()) } @Test fun alarmIconNotIgnored() { verify(statusIcons, never()).addIgnoredSlot( context.getString(com.android.internal.R.string.status_bar_alarm_clock) ) } private fun createWindowInsets( topCutout: Rect? = Rect() ): WindowInsets { Loading Loading
packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeaderController.java +2 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ class QuickStatusBarHeaderController extends ViewController<QuickStatusBarHeader mPrivacyIconsController.setChipVisibilityListener(this); mIconContainer.addIgnoredSlot( getResources().getString(com.android.internal.R.string.status_bar_managed_profile)); mIconContainer.addIgnoredSlot( getResources().getString(com.android.internal.R.string.status_bar_alarm_clock)); mIconContainer.setShouldRestrictIcons(false); mStatusBarIconController.addIconGroup(mIconManager); Loading
packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt +8 −0 Original line number Diff line number Diff line Loading @@ -270,6 +270,14 @@ class LargeScreenShadeHeaderController @Inject constructor( qsCarrierGroupController = qsCarrierGroupControllerBuilder .setQSCarrierGroup(qsCarrierGroup) .build() if (!combinedHeaders) { // In the new header, we display alarm icon but we ignore it when not using the new // headers. iconContainer.addIgnoredSlot( context.getString(com.android.internal.R.string.status_bar_alarm_clock) ) } } override fun onViewAttached() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +6 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import android.content.SharedPreferences; import android.content.res.Resources; import android.media.AudioManager; import android.os.Handler; import android.os.Looper; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserManager; Loading Loading @@ -127,7 +128,7 @@ public class PhoneStatusBarPolicy private final DateFormatUtil mDateFormatUtil; private final TelecomManager mTelecomManager; private final Handler mHandler = new Handler(); private final Handler mHandler; private final CastController mCast; private final HotspotController mHotspot; private final NextAlarmController mNextAlarmController; Loading Loading @@ -166,7 +167,7 @@ public class PhoneStatusBarPolicy @Inject public PhoneStatusBarPolicy(StatusBarIconController iconController, CommandQueue commandQueue, BroadcastDispatcher broadcastDispatcher, @UiBackground Executor uiBgExecutor, @Main Resources resources, @UiBackground Executor uiBgExecutor, @Main Looper looper, @Main Resources resources, CastController castController, HotspotController hotspotController, BluetoothController bluetoothController, NextAlarmController nextAlarmController, UserInfoController userInfoController, RotationLockController rotationLockController, Loading @@ -185,6 +186,7 @@ public class PhoneStatusBarPolicy mIconController = iconController; mCommandQueue = commandQueue; mBroadcastDispatcher = broadcastDispatcher; mHandler = new Handler(looper); mResources = resources; mCast = castController; mHotspot = hotspotController; Loading Loading @@ -332,6 +334,7 @@ public class PhoneStatusBarPolicy mRotationLockController.addCallback(this); mBluetooth.addCallback(this); mProvisionedController.addCallback(this); mCurrentUserSetup = mProvisionedController.isCurrentUserSetup(); mZenController.addCallback(this); mCast.addCallback(mCastCallback); mHotspot.addCallback(mHotspotCallback); Loading Loading @@ -562,6 +565,7 @@ public class PhoneStatusBarPolicy mHandler.post(() -> { updateAlarm(); updateManagedProfile(); onUserSetupChanged(); }); } }; Loading
packages/SystemUI/tests/src/com/android/systemui/qs/QuickStatusBarHeaderControllerTest.kt +8 −0 Original line number Diff line number Diff line Loading @@ -192,6 +192,14 @@ class QuickStatusBarHeaderControllerTest : SysuiTestCase() { verify(view).setIsSingleCarrier(false) } @Test fun testAlarmIconIgnored() { controller.init() verify(iconContainer).addIgnoredSlot( mContext.getString(com.android.internal.R.string.status_bar_alarm_clock)) } private fun stubViews() { `when`(view.findViewById<View>(anyInt())).thenReturn(mockView) `when`(view.findViewById<QSCarrierGroup>(R.id.carrier_group)).thenReturn(qsCarrierGroup) Loading
packages/SystemUI/tests/src/com/android/systemui/shade/LargeScreenShadeHeaderControllerCombinedTest.kt +7 −0 Original line number Diff line number Diff line Loading @@ -607,6 +607,13 @@ class LargeScreenShadeHeaderControllerCombinedTest : SysuiTestCase() { verify(mockConstraintsChanges.largeScreenConstraintsChanges)!!.invoke(any()) } @Test fun alarmIconNotIgnored() { verify(statusIcons, never()).addIgnoredSlot( context.getString(com.android.internal.R.string.status_bar_alarm_clock) ) } private fun createWindowInsets( topCutout: Rect? = Rect() ): WindowInsets { Loading