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

Commit 1a578f8e authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/23710185',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/23710185', 'googleplex-android-review.googlesource.com/23817530', 'googleplex-android-review.googlesource.com/23816915', 'googleplex-android-review.googlesource.com/23753323', 'googleplex-android-review.googlesource.com/23810723', 'googleplex-android-review.googlesource.com/23817723'] into udc-release.

Change-Id: Ife2ace81858a4d497d6b1aae01e1cab3625b04e5
parents 45afb122 0889b07c
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -567,7 +567,16 @@ public class PipTransition extends PipTransitionController {
                mPipBoundsState.getDisplayBounds());
        mFinishCallback = (wct, wctCB) -> {
            mPipOrganizer.onExitPipFinished(taskInfo);
            if (!Transitions.SHELL_TRANSITIONS_ROTATION && toFullscreen) {

            // TODO(b/286346098): remove the OPEN app flicker completely
            // not checking if we go to fullscreen helps avoid getting pip into an inconsistent
            // state after the flicker occurs. This is a temp solution until flicker is removed.
            if (!Transitions.SHELL_TRANSITIONS_ROTATION) {
                // will help to debug the case when we are not exiting to fullscreen
                if (!toFullscreen) {
                    ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                            "%s: startExitAnimation() not exiting to fullscreen", TAG);
                }
                wct = wct != null ? wct : new WindowContainerTransaction();
                wct.setBounds(pipTaskToken, null);
                mPipOrganizer.applyWindowingModeChangeOnExit(wct, TRANSITION_DIRECTION_LEAVE_PIP);
+24 −17
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ public class InfoMediaManager extends MediaManager {
    MediaRouter2Manager mRouterManager;
    @VisibleForTesting
    String mPackageName;
    boolean mIsScanning = false;

    private MediaDevice mCurrentConnectedDevice;
    private LocalBluetoothManager mBluetoothManager;
@@ -110,22 +111,29 @@ public class InfoMediaManager extends MediaManager {

    @Override
    public void startScan() {
        if (!mIsScanning) {
            mMediaDevices.clear();
            mRouterManager.registerCallback(mExecutor, mMediaRouterCallback);
            mRouterManager.registerScanRequest();
            mIsScanning = true;
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE
                    && !TextUtils.isEmpty(mPackageName)) {
                RouteListingPreference routeListingPreference =
                        mRouterManager.getRouteListingPreference(mPackageName);
            Api34Impl.onRouteListingPreferenceUpdated(routeListingPreference, mPreferenceItemMap);
                Api34Impl.onRouteListingPreferenceUpdated(routeListingPreference,
                        mPreferenceItemMap);
            }
            refreshDevices();
        }
    }

    @Override
    public void stopScan() {
        if (mIsScanning) {
            mRouterManager.unregisterCallback(mMediaRouterCallback);
            mRouterManager.unregisterScanRequest();
            mIsScanning = false;
        }
    }

    /**
@@ -701,20 +709,19 @@ public class InfoMediaManager extends MediaManager {
                List<MediaRoute2Info> selectedRouteInfos, List<MediaRoute2Info> infolist,
                List<RouteListingPreference.Item> preferenceRouteListing) {
            final List<MediaRoute2Info> sortedInfoList = new ArrayList<>(selectedRouteInfos);
            infolist.removeAll(selectedRouteInfos);
            sortedInfoList.addAll(infolist.stream().filter(
                    MediaRoute2Info::isSystemRoute).collect(Collectors.toList()));
            for (RouteListingPreference.Item item : preferenceRouteListing) {
                for (MediaRoute2Info info : infolist) {
                    if (item.getRouteId().equals(info.getId())
                            && !selectedRouteInfos.contains(info)) {
                            && !selectedRouteInfos.contains(info)
                            && !info.isSystemRoute()) {
                        sortedInfoList.add(info);
                        break;
                    }
                }
            }
            if (sortedInfoList.size() != infolist.size()) {
                infolist.removeAll(sortedInfoList);
                sortedInfoList.addAll(infolist.stream().filter(
                        MediaRoute2Info::isSystemRoute).collect(Collectors.toList()));
            }
            return sortedInfoList;
        }

+29 −6
Original line number Diff line number Diff line
@@ -113,6 +113,23 @@ public class InfoMediaManagerTest {
        mInfoMediaManager.mRouterManager = MediaRouter2Manager.getInstance(mContext);
    }

    @Test
    public void stopScan_notStartFirst_notCallsUnregister() {
        mInfoMediaManager.mRouterManager = mRouterManager;
        mInfoMediaManager.stopScan();

        verify(mRouterManager, never()).unregisterScanRequest();
    }

    @Test
    public void stopScan_startFirst_callsUnregister() {
        mInfoMediaManager.mRouterManager = mRouterManager;
        mInfoMediaManager.startScan();
        mInfoMediaManager.stopScan();

        verify(mRouterManager).unregisterScanRequest();
    }

    @Test
    public void onRouteAdded_getAvailableRoutes_shouldAddMediaDevice() {
        final List<RoutingSessionInfo> routingSessionInfos = new ArrayList<>();
@@ -327,11 +344,12 @@ public class InfoMediaManagerTest {
                routeListingPreference);
        mInfoMediaManager.mMediaRouterCallback.onRoutesUpdated();

        assertThat(mInfoMediaManager.mMediaDevices).hasSize(3);
        assertThat(mInfoMediaManager.mMediaDevices).hasSize(4);
        assertThat(mInfoMediaManager.mMediaDevices.get(0).getId()).isEqualTo(TEST_ID);
        assertThat(mInfoMediaManager.mMediaDevices.get(1).getId()).isEqualTo(TEST_ID_4);
        assertThat(mInfoMediaManager.mMediaDevices.get(1).isSuggestedDevice()).isTrue();
        assertThat(mInfoMediaManager.mMediaDevices.get(2).getId()).isEqualTo(TEST_ID_3);
        assertThat(mInfoMediaManager.mMediaDevices.get(1).getId()).isEqualTo(TEST_ID_1);
        assertThat(mInfoMediaManager.mMediaDevices.get(2).getId()).isEqualTo(TEST_ID_4);
        assertThat(mInfoMediaManager.mMediaDevices.get(2).isSuggestedDevice()).isTrue();
        assertThat(mInfoMediaManager.mMediaDevices.get(3).getId()).isEqualTo(TEST_ID_3);
    }

    @Test
@@ -405,8 +423,13 @@ public class InfoMediaManagerTest {
        when(availableInfo3.getClientPackageName()).thenReturn(packageName);
        availableRoutes.add(availableInfo3);

        when(mRouterManager.getAvailableRoutes(packageName)).thenReturn(
                availableRoutes);
        final MediaRoute2Info availableInfo4 = mock(MediaRoute2Info.class);
        when(availableInfo4.getId()).thenReturn(TEST_ID_1);
        when(availableInfo4.isSystemRoute()).thenReturn(true);
        when(availableInfo4.getClientPackageName()).thenReturn(TEST_PACKAGE_NAME);
        availableRoutes.add(availableInfo4);

        when(mRouterManager.getAvailableRoutes(packageName)).thenReturn(availableRoutes);

        return availableRoutes;
    }
+38 −0
Original line number Diff line number Diff line
@@ -122,6 +122,44 @@
       Try again in <xliff:g id="number">%3$d</xliff:g> seconds.
    </string>

    <!-- Title for notification & dialog that the user's phone last shut down because it got too hot. [CHAR LIMIT=40] -->
    <string name="thermal_shutdown_title" product="default">Phone turned off due to heat</string>
    <!-- Title for notification & dialog that the user's device last shut down because it got too hot. [CHAR LIMIT=40] -->
    <string name="thermal_shutdown_title" product="device">Device turned off due to heat</string>
    <!-- Title for notification & dialog that the user's tablet last shut down because it got too hot. [CHAR LIMIT=40] -->
    <string name="thermal_shutdown_title" product="tablet">Tablet turned off due to heat</string>
    <!-- Message body for notification that user's phone last shut down because it got too hot. [CHAR LIMIT=120] -->
    <string name="thermal_shutdown_message" product="default">Your phone is now running normally.\nTap for more info</string>
    <!-- Message body for notification that user's device last shut down because it got too hot. [CHAR LIMIT=120] -->
    <string name="thermal_shutdown_message" product="device">Your device is now running normally.\nTap for more info</string>
    <!-- Message body for notification that user's tablet last shut down because it got too hot. [CHAR LIMIT=120] -->
    <string name="thermal_shutdown_message" product="tablet">Your tablet is now running normally.\nTap for more info</string>
    <!-- Text body for dialog alerting user that their phone last shut down because it got too hot. [CHAR LIMIT=500] -->
    <string name="thermal_shutdown_dialog_message" product="default">Your phone was too hot, so it turned off to cool down. Your phone is now running normally.\n\nYour phone may get too hot if you:\n\t&#8226; Use resource-intensive apps (such as gaming, video, or navigation apps)\n\t&#8226; Download or upload large files\n\t&#8226; Use your phone in high temperatures</string>
    <!-- Text body for dialog alerting user that their device last shut down because it got too hot. [CHAR LIMIT=500] -->
    <string name="thermal_shutdown_dialog_message" product="device">Your device was too hot, so it turned off to cool down. Your device is now running normally.\n\nYour device may get too hot if you:\n\t&#8226; Use resource-intensive apps (such as gaming, video, or navigation apps)\n\t&#8226; Download or upload large files\n\t&#8226; Use your device in high temperatures</string>
    <!-- Text body for dialog alerting user that their tablet last shut down because it got too hot. [CHAR LIMIT=500] -->
    <string name="thermal_shutdown_dialog_message" product="tablet">Your tablet was too hot, so it turned off to cool down. Your tablet is now running normally.\n\nYour tablet may get too hot if you:\n\t&#8226; Use resource-intensive apps (such as gaming, video, or navigation apps)\n\t&#8226; Download or upload large files\n\t&#8226; Use your tablet in high temperatures</string>

    <!-- Title for notification (and dialog) that user's phone has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=30] -->
    <string name="high_temp_title" product="default">Phone is getting warm</string>
    <!-- Title for notification (and dialog) that user's phone has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=30] -->
    <string name="high_temp_title" product="device">Device is getting warm</string>
    <!-- Title for notification (and dialog) that user's phone has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=30] -->
    <string name="high_temp_title" product="tablet">Tablet is getting warm</string>
    <!-- Message body for notification that user's phone has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=120] -->
    <string name="high_temp_notif_message" product="default">Some features limited while phone cools down.\nTap for more info</string>
    <!-- Message body for notification that user's device has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=120] -->
    <string name="high_temp_notif_message" product="device">Some features limited while device cools down.\nTap for more info</string>
    <!-- Message body for notification that user's tablet has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=120] -->
    <string name="high_temp_notif_message" product="tablet">Some features limited while tablet cools down.\nTap for more info</string>
    <!-- Text body for dialog alerting user that their phone has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=350] -->
    <string name="high_temp_dialog_message" product="default">Your phone will automatically try to cool down. You can still use your phone, but it may run slower.\n\nOnce your phone has cooled down, it will run normally.</string>
    <!-- Text body for dialog alerting user that their phone has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=350] -->
    <string name="high_temp_dialog_message" product="device">Your device will automatically try to cool down. You can still use your device, but it may run slower.\n\nOnce your device has cooled down, it will run normally.</string>
    <!-- Text body for dialog alerting user that their phone has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=350] -->
    <string name="high_temp_dialog_message" product="tablet">Your tablet will automatically try to cool down. You can still use your tablet, but it may run slower.\n\nOnce your tablet has cooled down, it will run normally.</string>

    <!-- Content description of the fingerprint icon when the system-provided fingerprint dialog is showing, to locate the sensor (tablet) for accessibility (not shown on the screen). [CHAR LIMIT=NONE]-->
    <string name="security_settings_sfps_enroll_find_sensor_message" product="tablet">The fingerprint sensor is on the power button. It’s the flat button next to the raised volume button on the edge of the tablet.</string>
    <!-- Content description of the fingerprint icon when the system-provided fingerprint dialog is showing, to locate the sensor (device) for accessibility (not shown on the screen). [CHAR LIMIT=NONE]-->
+0 −12
Original line number Diff line number Diff line
@@ -2089,23 +2089,11 @@
    <!-- Tuner string -->
    <!-- Tuner string -->

    <!-- Title for notification & dialog that the user's phone last shut down because it got too hot. [CHAR LIMIT=40] -->
    <string name="thermal_shutdown_title">Phone turned off due to heat</string>
    <!-- Message body for notification that user's phone last shut down because it got too hot. [CHAR LIMIT=120] -->
    <string name="thermal_shutdown_message">Your phone is now running normally.\nTap for more info</string>
    <!-- Text body for dialog alerting user that their phone last shut down because it got too hot. [CHAR LIMIT=500] -->
    <string name="thermal_shutdown_dialog_message">Your phone was too hot, so it turned off to cool down. Your phone is now running normally.\n\nYour phone may get too hot if you:\n\t&#8226; Use resource-intensive apps (such as gaming, video, or navigation apps)\n\t&#8226; Download or upload large files\n\t&#8226; Use your phone in high temperatures</string>
    <!-- Text help link for care instructions for overheating devices [CHAR LIMIT=40] -->
    <string name="thermal_shutdown_dialog_help_text">See care steps</string>
    <!-- URL for care instructions for overheating devices -->
    <string name="thermal_shutdown_dialog_help_url" translatable="false"></string>

    <!-- Title for notification (and dialog) that user's phone has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=30] -->
    <string name="high_temp_title">Phone is getting warm</string>
    <!-- Message body for notification that user's phone has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=120] -->
    <string name="high_temp_notif_message">Some features limited while phone cools down.\nTap for more info</string>
    <!-- Text body for dialog alerting user that their phone has reached a certain temperature and may start to slow down in order to cool down. [CHAR LIMIT=350] -->
    <string name="high_temp_dialog_message">Your phone will automatically try to cool down. You can still use your phone, but it may run slower.\n\nOnce your phone has cooled down, it will run normally.</string>
    <!-- Text help link for care instructions for overheating devices [CHAR LIMIT=40] -->
    <string name="high_temp_dialog_help_text">See care steps</string>
    <!-- URL for care instructions for overheating devices -->
Loading