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

Commit 23e3db4e authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6740034 from b0c1ac5b to rvc-qpr1-release

Change-Id: Ia375303382867a94794a90dab00a35b7e49c125e
parents 47088491 b0c1ac5b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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) {
+27 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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;
@@ -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(
@@ -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
@@ -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
@@ -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
@@ -108,7 +126,10 @@ public class ConnectedDeviceVoiceRecognitionNotifierTest extends SysuiTestCase {

        mContext.sendBroadcast(intent, BLUETOOTH_PERM);
        mTestableLooper.processAllMessages();
        waitForIdleSync();

        mHandler.post(() -> {
            verify(mTestHandler, never()).post(any());
        });
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -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 {
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+4 −2
Original line number Diff line number Diff line
@@ -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(
@@ -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