Merge "[1/n] Move Letterbox education dialog classes" into tm-qpr-dev am: 812e329173

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21911723

Change-Id: Ie82fa96ac48632c985313c64fc2fc52821040211
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Massimo Carli
2023-03-20 09:11:22 +00:00
committed by Automerger Merge Worker
9 changed files with 23 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
<!-- <!--
~ Copyright (C) 2022 The Android Open Source Project ~ Copyright (C) 2023 The Android Open Source Project
~ ~
~ Licensed under the Apache License, Version 2.0 (the "License"); ~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License. ~ you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
~ See the License for the specific language governing permissions and ~ See the License for the specific language governing permissions and
~ limitations under the License. ~ limitations under the License.
--> -->
<com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogLayout <com.android.wm.shell.compatui.LetterboxEduDialogLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/LetterboxDialog"> style="@style/LetterboxDialog">
@@ -78,13 +78,13 @@
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="48dp"> android:paddingTop="48dp">
<com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogActionLayout <com.android.wm.shell.compatui.LetterboxEduDialogActionLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:icon="@drawable/letterbox_education_ic_reposition" app:icon="@drawable/letterbox_education_ic_reposition"
app:text="@string/letterbox_education_reposition_text"/> app:text="@string/letterbox_education_reposition_text"/>
<com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogActionLayout <com.android.wm.shell.compatui.LetterboxEduDialogActionLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart= android:layout_marginStart=
@@ -118,4 +118,4 @@
</FrameLayout> </FrameLayout>
</com.android.wm.shell.compatui.letterboxedu.LetterboxEduDialogLayout> </com.android.wm.shell.compatui.LetterboxEduDialogLayout>

View File

@@ -42,7 +42,6 @@ import com.android.wm.shell.common.DockStateReader;
import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.compatui.CompatUIWindowManager.CompatUIHintsState; import com.android.wm.shell.compatui.CompatUIWindowManager.CompatUIHintsState;
import com.android.wm.shell.compatui.letterboxedu.LetterboxEduWindowManager;
import com.android.wm.shell.sysui.KeyguardChangeListener; import com.android.wm.shell.sysui.KeyguardChangeListener;
import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.sysui.ShellController;
import com.android.wm.shell.sysui.ShellInit; import com.android.wm.shell.sysui.ShellInit;

View File

@@ -38,7 +38,6 @@ import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.compatui.CompatUIController.CompatUICallback; import com.android.wm.shell.compatui.CompatUIController.CompatUICallback;
import com.android.wm.shell.compatui.letterboxedu.LetterboxEduWindowManager;
import java.util.function.Consumer; import java.util.function.Consumer;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.wm.shell.compatui.letterboxedu; package com.android.wm.shell.compatui;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.wm.shell.compatui.letterboxedu; package com.android.wm.shell.compatui;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.content.Context; import android.content.Context;
@@ -26,7 +26,6 @@ import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import com.android.wm.shell.R; import com.android.wm.shell.R;
import com.android.wm.shell.compatui.DialogContainerSupplier;
/** /**
* Container for Letterbox Education Dialog and background dim. * Container for Letterbox Education Dialog and background dim.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.wm.shell.compatui.letterboxedu; package com.android.wm.shell.compatui;
import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING; import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING;
@@ -36,8 +36,6 @@ import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.DockStateReader; import com.android.wm.shell.common.DockStateReader;
import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.compatui.CompatUIWindowManagerAbstract;
import com.android.wm.shell.compatui.DialogAnimationController;
import com.android.wm.shell.transition.Transitions; import com.android.wm.shell.transition.Transitions;
/** /**

View File

@@ -54,7 +54,6 @@ import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.DockStateReader; import com.android.wm.shell.common.DockStateReader;
import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.compatui.letterboxedu.LetterboxEduWindowManager;
import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.sysui.ShellController;
import com.android.wm.shell.sysui.ShellInit; import com.android.wm.shell.sysui.ShellInit;
import com.android.wm.shell.transition.Transitions; import com.android.wm.shell.transition.Transitions;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.wm.shell.compatui.letterboxedu; package com.android.wm.shell.compatui;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
@@ -58,9 +58,8 @@ public class LetterboxEduDialogLayoutTest extends ShellTestCase {
public void setUp() { public void setUp() {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
mLayout = (LetterboxEduDialogLayout) mLayout = (LetterboxEduDialogLayout) LayoutInflater.from(mContext)
LayoutInflater.from(mContext).inflate(R.layout.letterbox_education_dialog_layout, .inflate(R.layout.letterbox_education_dialog_layout, null);
null);
mDismissButton = mLayout.findViewById(R.id.letterbox_education_dialog_dismiss_button); mDismissButton = mLayout.findViewById(R.id.letterbox_education_dialog_dismiss_button);
mDialogContainer = mLayout.findViewById(R.id.letterbox_education_dialog_container); mDialogContainer = mLayout.findViewById(R.id.letterbox_education_dialog_container);
mLayout.setDismissOnClickListener(mDismissCallback); mLayout.setDismissOnClickListener(mDismissCallback);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 The Android Open Source Project * Copyright (C) 2023 The Android Open Source Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.wm.shell.compatui.letterboxedu; package com.android.wm.shell.compatui;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
@@ -56,7 +56,6 @@ import com.android.wm.shell.ShellTestCase;
import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.DockStateReader; import com.android.wm.shell.common.DockStateReader;
import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.compatui.DialogAnimationController;
import com.android.wm.shell.transition.Transitions; import com.android.wm.shell.transition.Transitions;
import org.junit.After; import org.junit.After;
@@ -400,15 +399,16 @@ public class LetterboxEduWindowManagerTest extends ShellTestCase {
false, isDocked); false, isDocked);
} }
private LetterboxEduWindowManager createWindowManager(boolean eligible, private LetterboxEduWindowManager createWindowManager(boolean eligible, int userId,
int userId, boolean isTaskbarEduShowing) { boolean isTaskbarEduShowing) {
return createWindowManager(eligible, userId, isTaskbarEduShowing, /* isDocked */false); return createWindowManager(eligible, userId, isTaskbarEduShowing, /* isDocked */false);
} }
private LetterboxEduWindowManager createWindowManager(boolean eligible, private LetterboxEduWindowManager createWindowManager(boolean eligible, int userId,
int userId, boolean isTaskbarEduShowing, boolean isDocked) { boolean isTaskbarEduShowing, boolean isDocked) {
doReturn(isDocked).when(mDockStateReader).isDocked(); doReturn(isDocked).when(mDockStateReader).isDocked();
LetterboxEduWindowManager windowManager = new LetterboxEduWindowManager(mContext, LetterboxEduWindowManager
windowManager = new LetterboxEduWindowManager(mContext,
createTaskInfo(eligible, userId), mSyncTransactionQueue, mTaskListener, createTaskInfo(eligible, userId), mSyncTransactionQueue, mTaskListener,
createDisplayLayout(), mTransitions, mOnDismissCallback, createDisplayLayout(), mTransitions, mOnDismissCallback,
mAnimationController, mDockStateReader); mAnimationController, mDockStateReader);