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

Commit cf33f1c5 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Add restart button for size compatibility mode activity

- The floating restart button will show when an size compatibility
  mode activity shown with non-native screen configuration. e.g.
  display size changed, move to another display.
- Consolidate onDisplayRemoved into CommandQueue.Callback so the
  components which implement CommandQueue.Callbacks don't need to
  register display listener individually. The leakage of
  AutoHideController when removing display is also fixed by the way.

Bug: 112288258
Test: runtest systemui -c \
      com.android.systemui.SizeCompatModeActivityControllerTest

Change-Id: Ib04efe983ae0d8d21b33fb9fd9c60e7f6f0dc92e
parent 7b766fd3
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2019 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="#aa000000"
        android:pathData="M0,12 a12,12 0 1,0 24,0 a12,12 0 1,0 -24,0" />
    <path
        android:fillColor="@android:color/white"
        android:pathData="M17.65,6.35c-1.63,-1.63 -3.94,-2.57 -6.48,-2.31c-3.67,0.37 -6.69,3.35 -7.1,7.02C3.52,15.91 7.27,20 12,20c3.19,0 5.93,-1.87 7.21,-4.57c0.31,-0.66 -0.16,-1.43 -0.89,-1.43h-0.01c-0.37,0 -0.72,0.2 -0.88,0.53c-1.13,2.43 -3.84,3.97 -6.81,3.32c-2.22,-0.49 -4.01,-2.3 -4.49,-4.52C5.31,9.44 8.26,6 12,6c1.66,0 3.14,0.69 4.22,1.78l-2.37,2.37C13.54,10.46 13.76,11 14.21,11H19c0.55,0 1,-0.45 1,-1V5.21c0,-0.45 -0.54,-0.67 -0.85,-0.35L17.65,6.35z"/>
</vector>
+48 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2019 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@android:color/background_light"
    android:orientation="vertical">

    <TextView
        android:layout_width="180dp"
        android:layout_height="wrap_content"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:paddingTop="10dp"
        android:text="@string/restart_button_description"
        android:textAlignment="viewStart"
        android:textColor="@android:color/primary_text_light"
        android:textSize="16sp" />

    <Button
        android:id="@+id/got_it"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:includeFontPadding="false"
        android:layout_gravity="end"
        android:minHeight="36dp"
        android:background="?android:attr/selectableItemBackground"
        android:text="@string/got_it"
        android:textAllCaps="true"
        android:textColor="#3c78d8"
        android:textSize="16sp"
        android:textStyle="bold" />

</LinearLayout>
+1 −0
Original line number Diff line number Diff line
@@ -311,6 +311,7 @@
        <item>com.android.systemui.ScreenDecorations</item>
        <item>com.android.systemui.biometrics.BiometricDialogImpl</item>
        <item>com.android.systemui.SliceBroadcastRelayHandler</item>
        <item>com.android.systemui.SizeCompatModeActivityController</item>
    </string-array>

    <!-- SystemUI vender service, used in config_systemUIServiceComponents. -->
+3 −0
Original line number Diff line number Diff line
@@ -2373,6 +2373,9 @@
    <!-- What to show on the ambient display player when song doesn't have a title. [CHAR LIMIT=20] -->
    <string name="music_controls_no_title">No title</string>

    <!-- Description of the restart button in the hint of size compatibility mode. [CHAR LIMIT=NONE] -->
    <string name="restart_button_description">Tap to restart this app and go full screen.</string>

    <!-- Text used for content description of deep link button in the header of expanded bubble
         view. [CHAR_LIMIT=NONE] -->
    <string name="bubbles_deep_link_button_description">Open <xliff:g id="app_name" example="YouTube">%1$s</xliff:g></string>
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.shared.system;

import android.app.ActivityManager.RunningTaskInfo;
import android.content.ComponentName;
import android.os.IBinder;
import android.os.UserHandle;
import android.util.Log;

@@ -73,6 +74,7 @@ public abstract class TaskStackChangeListener {
    }

    public void onActivityRequestedOrientationChanged(int taskId, int requestedOrientation) { }
    public void onSizeCompatModeActivityChanged(int displayId, IBinder activityToken) { }

    /**
     * Checks that the current user matches the process. Since
Loading