Loading core/java/com/android/internal/app/ChooserActivity.java +3 −1 Original line number Diff line number Diff line Loading @@ -3134,8 +3134,10 @@ public class ChooserActivity extends ResolverActivity implements // ends up disabled. That's because at some point the old tab's vertical scrolling is // disabled and the new tab's is enabled. For context, see b/159997845 setVerticalScrollEnabled(true); if (mResolverDrawerLayout != null) { mResolverDrawerLayout.scrollNestedScrollableChildBackToTop(); } } @Override protected WindowInsets onApplyWindowInsets(View v, WindowInsets insets) { Loading packages/CarSystemUI/tests/src/com/android/systemui/car/voicerecognition/ConnectedDeviceVoiceRecognitionNotifierTest.java +27 −6 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.systemui.car.voicerecognition; import static com.android.systemui.car.voicerecognition.ConnectedDeviceVoiceRecognitionNotifier.INVALID_VALUE; import static com.android.systemui.car.voicerecognition.ConnectedDeviceVoiceRecognitionNotifier.VOICE_RECOGNITION_STARTED; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; Loading @@ -40,11 +42,13 @@ import com.android.systemui.car.CarSystemUiTest; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; @CarSystemUiTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper @SmallTest // TODO(b/162866441): Refactor to use the Executor pattern instead. public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { private static final String BLUETOOTH_PERM = android.Manifest.permission.BLUETOOTH; Loading @@ -52,13 +56,15 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { private ConnectedDeviceVoiceRecognitionNotifier mVoiceRecognitionNotifier; private TestableLooper mTestableLooper; private Handler mHandler; private Handler mTestHandler; private BluetoothDevice mBluetoothDevice; @Before public void setUp() throws Exception { mTestableLooper = TestableLooper.get(this); mTestHandler = spy(new Handler(mTestableLooper.getLooper())); mHandler = new Handler(mTestableLooper.getLooper()); mTestHandler = spy(mHandler); mBluetoothDevice = BluetoothAdapter.getDefaultAdapter().getRemoteDevice( BLUETOOTH_REMOTE_ADDRESS); mVoiceRecognitionNotifier = new ConnectedDeviceVoiceRecognitionNotifier( Loading @@ -74,8 +80,14 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { mContext.sendBroadcast(intent, BLUETOOTH_PERM); mTestableLooper.processAllMessages(); verify(mTestHandler).post(any()); waitForIdleSync(); mHandler.post(() -> { ArgumentCaptor<Runnable> argumentCaptor = ArgumentCaptor.forClass(Runnable.class); verify(mTestHandler).post(argumentCaptor.capture()); assertThat(argumentCaptor.getValue()).isNotNull(); assertThat(argumentCaptor.getValue()).isNotEqualTo(this); }); } @Test Loading @@ -86,8 +98,11 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { mContext.sendBroadcast(intent, BLUETOOTH_PERM); mTestableLooper.processAllMessages(); waitForIdleSync(); mHandler.post(() -> { verify(mTestHandler, never()).post(any()); }); } @Test Loading @@ -97,8 +112,11 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { mContext.sendBroadcast(intent, BLUETOOTH_PERM); mTestableLooper.processAllMessages(); waitForIdleSync(); mHandler.post(() -> { verify(mTestHandler, never()).post(any()); }); } @Test Loading @@ -108,7 +126,10 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { mContext.sendBroadcast(intent, BLUETOOTH_PERM); mTestableLooper.processAllMessages(); waitForIdleSync(); mHandler.post(() -> { verify(mTestHandler, never()).post(any()); }); } } packages/SystemUI/src/com/android/systemui/controls/controller/ControlsProviderLifecycleManager.kt +2 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,8 @@ class ControlsProviderLifecycleManager( private const val LOAD_TIMEOUT_SECONDS = 20L // seconds private const val MAX_BIND_RETRIES = 5 private const val DEBUG = true private val BIND_FLAGS = Context.BIND_AUTO_CREATE or Context.BIND_FOREGROUND_SERVICE private val BIND_FLAGS = Context.BIND_AUTO_CREATE or Context.BIND_FOREGROUND_SERVICE or Context.BIND_NOT_PERCEPTIBLE } private val intent = Intent().apply { Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ class ControlActionCoordinatorImpl @Inject constructor( override fun setValue(cvh: ControlViewHolder, templateId: String, newValue: Float) { bouncerOrRun(Action(cvh.cws.ci.controlId, { cvh.action(FloatAction(templateId, newValue)) }, true /* blockable */)) }, false /* blockable */)) } override fun longPress(cvh: ControlViewHolder) { Loading packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotNotificationsController.java +4 −2 Original line number Diff line number Diff line Loading @@ -205,7 +205,8 @@ public class ScreenshotNotificationsController { mPublicNotificationBuilder .setContentTitle(mResources.getString(R.string.screenshot_saved_title)) .setContentText(mResources.getString(R.string.screenshot_saved_text)) .setContentIntent(PendingIntent.getActivity(mContext, 0, launchIntent, 0)) .setContentIntent(PendingIntent .getActivity(mContext, 0, launchIntent, PendingIntent.FLAG_IMMUTABLE)) .setWhen(now) .setAutoCancel(true) .setColor(mContext.getColor( Loading @@ -213,7 +214,8 @@ public class ScreenshotNotificationsController { mNotificationBuilder .setContentTitle(mResources.getString(R.string.screenshot_saved_title)) .setContentText(mResources.getString(R.string.screenshot_saved_text)) .setContentIntent(PendingIntent.getActivity(mContext, 0, launchIntent, 0)) .setContentIntent(PendingIntent .getActivity(mContext, 0, launchIntent, PendingIntent.FLAG_IMMUTABLE)) .setWhen(now) .setAutoCancel(true) .setColor(mContext.getColor( Loading Loading
core/java/com/android/internal/app/ChooserActivity.java +3 −1 Original line number Diff line number Diff line Loading @@ -3134,8 +3134,10 @@ public class ChooserActivity extends ResolverActivity implements // ends up disabled. That's because at some point the old tab's vertical scrolling is // disabled and the new tab's is enabled. For context, see b/159997845 setVerticalScrollEnabled(true); if (mResolverDrawerLayout != null) { mResolverDrawerLayout.scrollNestedScrollableChildBackToTop(); } } @Override protected WindowInsets onApplyWindowInsets(View v, WindowInsets insets) { Loading
packages/CarSystemUI/tests/src/com/android/systemui/car/voicerecognition/ConnectedDeviceVoiceRecognitionNotifierTest.java +27 −6 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.systemui.car.voicerecognition; import static com.android.systemui.car.voicerecognition.ConnectedDeviceVoiceRecognitionNotifier.INVALID_VALUE; import static com.android.systemui.car.voicerecognition.ConnectedDeviceVoiceRecognitionNotifier.VOICE_RECOGNITION_STARTED; import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; Loading @@ -40,11 +42,13 @@ import com.android.systemui.car.CarSystemUiTest; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; @CarSystemUiTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper @SmallTest // TODO(b/162866441): Refactor to use the Executor pattern instead. public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { private static final String BLUETOOTH_PERM = android.Manifest.permission.BLUETOOTH; Loading @@ -52,13 +56,15 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { private ConnectedDeviceVoiceRecognitionNotifier mVoiceRecognitionNotifier; private TestableLooper mTestableLooper; private Handler mHandler; private Handler mTestHandler; private BluetoothDevice mBluetoothDevice; @Before public void setUp() throws Exception { mTestableLooper = TestableLooper.get(this); mTestHandler = spy(new Handler(mTestableLooper.getLooper())); mHandler = new Handler(mTestableLooper.getLooper()); mTestHandler = spy(mHandler); mBluetoothDevice = BluetoothAdapter.getDefaultAdapter().getRemoteDevice( BLUETOOTH_REMOTE_ADDRESS); mVoiceRecognitionNotifier = new ConnectedDeviceVoiceRecognitionNotifier( Loading @@ -74,8 +80,14 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { mContext.sendBroadcast(intent, BLUETOOTH_PERM); mTestableLooper.processAllMessages(); verify(mTestHandler).post(any()); waitForIdleSync(); mHandler.post(() -> { ArgumentCaptor<Runnable> argumentCaptor = ArgumentCaptor.forClass(Runnable.class); verify(mTestHandler).post(argumentCaptor.capture()); assertThat(argumentCaptor.getValue()).isNotNull(); assertThat(argumentCaptor.getValue()).isNotEqualTo(this); }); } @Test Loading @@ -86,8 +98,11 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { mContext.sendBroadcast(intent, BLUETOOTH_PERM); mTestableLooper.processAllMessages(); waitForIdleSync(); mHandler.post(() -> { verify(mTestHandler, never()).post(any()); }); } @Test Loading @@ -97,8 +112,11 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { mContext.sendBroadcast(intent, BLUETOOTH_PERM); mTestableLooper.processAllMessages(); waitForIdleSync(); mHandler.post(() -> { verify(mTestHandler, never()).post(any()); }); } @Test Loading @@ -108,7 +126,10 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase { mContext.sendBroadcast(intent, BLUETOOTH_PERM); mTestableLooper.processAllMessages(); waitForIdleSync(); mHandler.post(() -> { verify(mTestHandler, never()).post(any()); }); } }
packages/SystemUI/src/com/android/systemui/controls/controller/ControlsProviderLifecycleManager.kt +2 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,8 @@ class ControlsProviderLifecycleManager( private const val LOAD_TIMEOUT_SECONDS = 20L // seconds private const val MAX_BIND_RETRIES = 5 private const val DEBUG = true private val BIND_FLAGS = Context.BIND_AUTO_CREATE or Context.BIND_FOREGROUND_SERVICE private val BIND_FLAGS = Context.BIND_AUTO_CREATE or Context.BIND_FOREGROUND_SERVICE or Context.BIND_NOT_PERCEPTIBLE } private val intent = Intent().apply { Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ class ControlActionCoordinatorImpl @Inject constructor( override fun setValue(cvh: ControlViewHolder, templateId: String, newValue: Float) { bouncerOrRun(Action(cvh.cws.ci.controlId, { cvh.action(FloatAction(templateId, newValue)) }, true /* blockable */)) }, false /* blockable */)) } override fun longPress(cvh: ControlViewHolder) { Loading
packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotNotificationsController.java +4 −2 Original line number Diff line number Diff line Loading @@ -205,7 +205,8 @@ public class ScreenshotNotificationsController { mPublicNotificationBuilder .setContentTitle(mResources.getString(R.string.screenshot_saved_title)) .setContentText(mResources.getString(R.string.screenshot_saved_text)) .setContentIntent(PendingIntent.getActivity(mContext, 0, launchIntent, 0)) .setContentIntent(PendingIntent .getActivity(mContext, 0, launchIntent, PendingIntent.FLAG_IMMUTABLE)) .setWhen(now) .setAutoCancel(true) .setColor(mContext.getColor( Loading @@ -213,7 +214,8 @@ public class ScreenshotNotificationsController { mNotificationBuilder .setContentTitle(mResources.getString(R.string.screenshot_saved_title)) .setContentText(mResources.getString(R.string.screenshot_saved_text)) .setContentIntent(PendingIntent.getActivity(mContext, 0, launchIntent, 0)) .setContentIntent(PendingIntent .getActivity(mContext, 0, launchIntent, PendingIntent.FLAG_IMMUTABLE)) .setWhen(now) .setAutoCancel(true) .setColor(mContext.getColor( Loading