Merge tag 'android-15.0.0_r3' into merge-aosp15

Android 15.0.0 Release 3 (AP3A.241005.015.A2)

// -----BEGIN PGP SIGNATURE-----
//
// iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCZw2BYwAKCRDorT+BmrEO
// eHPtAJ4rLx60T4gWyux/4VDjJi/4Y/6RUACaAvTmhyrPzNXiobu4zTOCi89cu6U=
// =izgM
// -----END PGP SIGNATURE-----
// gpg: Signature made Tue Oct 15 04:38:59 2024 CST
// gpg:                using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
// gpg: Can't check signature: No public key

// Conflicts:
//	quickstep/src/com/android/quickstep/TaskAnimationManager.java
This commit is contained in:
Goooler
2024-11-03 21:14:22 +08:00
2 changed files with 86 additions and 3 deletions

View File

@@ -100,6 +100,11 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
TaskAnimationManager(Context ctx) {
mCtx = ctx;
}
SystemUiProxy getSystemUiProxy() {
return SystemUiProxy.INSTANCE.get(mCtx);
}
/**
* Preloads the recents animation.
*/
@@ -153,7 +158,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
final BaseContainerInterface containerInterface = gestureState.getContainerInterface();
mLastGestureState = gestureState;
RecentsAnimationCallbacks newCallbacks = new RecentsAnimationCallbacks(
SystemUiProxy.INSTANCE.get(mCtx), containerInterface.allowMinimizeSplitScreen());
getSystemUiProxy(), containerInterface.allowMinimizeSplitScreen());
mCallbacks = newCallbacks;
mCallbacks.addListener(new RecentsAnimationCallbacks.RecentsAnimationListener() {
@Override
@@ -260,7 +265,7 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
}
RemoteAnimationTarget[] nonAppTargets = ENABLE_SHELL_TRANSITIONS
? null : SystemUiProxy.INSTANCE.get(mCtx).onStartingSplitLegacy(
? null : getSystemUiProxy().onStartingSplitLegacy(
appearedTaskTargets);
if (nonAppTargets == null) {
nonAppTargets = new RemoteAnimationTarget[0];
@@ -327,12 +332,13 @@ public class TaskAnimationManager implements RecentsAnimationCallbacks.RecentsAn
if (ENABLE_SHELL_TRANSITIONS) {
final ActivityOptions options = ActivityOptions.makeBasic();
options.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
// Use regular (non-transient) launch for all apps page to control IME.
if (!containerInterface.allowAllAppsFromOverview()) {
options.setTransientLaunch();
}
options.setSourceInfo(ActivityOptions.SourceInfo.TYPE_RECENTS_ANIMATION, eventTime);
mRecentsAnimationStartPending = SystemUiProxy.INSTANCE.get(mCtx)
mRecentsAnimationStartPending = getSystemUiProxy()
.startRecentsActivity(intent, options, mCallbacks);
if (enableHandleDelayedGestureCallbacks()) {
ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(

View File

@@ -0,0 +1,77 @@
/*
* Copyright (C) 2024 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.
*/
package com.android.quickstep;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
public class TaskAnimationManagerTest {
@Mock
private Context mContext;
@Mock
private SystemUiProxy mSystemUiProxy;
private TaskAnimationManager mTaskAnimationManager;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mTaskAnimationManager = new TaskAnimationManager(mContext) {
@Override
SystemUiProxy getSystemUiProxy() {
return mSystemUiProxy;
}
};
}
@Test
public void startRecentsActivity_allowBackgroundLaunch() {
assumeTrue(TaskAnimationManager.ENABLE_SHELL_TRANSITIONS);
final LauncherActivityInterface activityInterface = mock(LauncherActivityInterface.class);
final GestureState gestureState = mock(GestureState.class);
final RecentsAnimationCallbacks.RecentsAnimationListener listener =
mock(RecentsAnimationCallbacks.RecentsAnimationListener.class);
doReturn(activityInterface).when(gestureState).getContainerInterface();
mTaskAnimationManager.startRecentsAnimation(gestureState, new Intent(), listener);
final ArgumentCaptor<ActivityOptions> optionsCaptor =
ArgumentCaptor.forClass(ActivityOptions.class);
verify(mSystemUiProxy).startRecentsActivity(any(), optionsCaptor.capture(), any());
assertTrue(optionsCaptor.getValue()
.isPendingIntentBackgroundActivityLaunchAllowedByPermission());
}
}