diff options
6 files changed, 63 insertions, 13 deletions
diff --git a/core/tests/coretests/src/android/app/KeyguardManagerTest.java b/core/tests/coretests/src/android/app/KeyguardManagerTest.java index 7231fbd3b7eb..958906c36d05 100644 --- a/core/tests/coretests/src/android/app/KeyguardManagerTest.java +++ b/core/tests/coretests/src/android/app/KeyguardManagerTest.java @@ -19,6 +19,7 @@ package android.app; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.doReturn; @@ -26,6 +27,7 @@ import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; import android.app.admin.DevicePolicyManager; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -209,6 +211,42 @@ public class KeyguardManagerTest { verifyDeviceLockedAndRemoveLock(); } + @Test + public void createConfirmDeviceCredentialForRemoteValidationIntent() { + RemoteLockscreenValidationSession remoteLockscreenValidationSession = + new RemoteLockscreenValidationSession.Builder() + .setSourcePublicKey("sourcePublicKey".getBytes()) + .build(); + ComponentName componentName = new ComponentName("pkg", "cls"); + String title = "title"; + String description = "description"; + String checkboxLabel = "checkboxLabel"; + String alternateButtonLabel = "alternateButtonLabel"; + + Intent intent = mKeyguardManager.createConfirmDeviceCredentialForRemoteValidationIntent( + remoteLockscreenValidationSession, + componentName, + title, + description, + checkboxLabel, + alternateButtonLabel + ); + + assertNotNull(intent); + assertEquals(KeyguardManager.ACTION_CONFIRM_REMOTE_DEVICE_CREDENTIAL, intent.getAction()); + assertEquals(remoteLockscreenValidationSession, + intent.getParcelableExtra( + KeyguardManager.EXTRA_REMOTE_LOCKSCREEN_VALIDATION_SESSION, + RemoteLockscreenValidationSession.class)); + assertEquals(componentName, + intent.getParcelableExtra(Intent.EXTRA_COMPONENT_NAME, ComponentName.class)); + assertEquals(title, intent.getStringExtra(KeyguardManager.EXTRA_TITLE)); + assertEquals(description, intent.getStringExtra(KeyguardManager.EXTRA_DESCRIPTION)); + assertEquals(checkboxLabel, intent.getStringExtra(KeyguardManager.EXTRA_CHECKBOX_LABEL)); + assertEquals(alternateButtonLabel, + intent.getStringExtra(KeyguardManager.EXTRA_ALTERNATE_BUTTON_LABEL)); + } + private void verifyDeviceLockedAndRemoveLock() { assertTrue(mKeyguardManager.isDeviceSecure()); assertTrue("Failed to remove new password that was set in the test case.", diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index da14d03adb35..964ba9f9aa7c 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -2365,6 +2365,11 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, prepareExitSplitScreen(STAGE_TYPE_UNDEFINED, out); } } + + // When split in the background, it should be only opening/dismissing transition and + // would keep out not empty. Prevent intercepting all transitions for split screen when + // it is in the background and not identify to handle it. + return (!out.isEmpty() || isSplitScreenVisible()) ? out : null; } else { if (isOpening && getStageOfTask(triggerTask) != null) { // One task is appearing into split, prepare to enter split screen. @@ -2373,8 +2378,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mSplitTransitions.setEnterTransition(transition, request.getRemoteTransition(), TRANSIT_SPLIT_SCREEN_PAIR_OPEN, !mIsDropEntering); } + return out; } - return out; } /** @@ -2506,8 +2511,9 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, && getStageType(dismissStages.valueAt(0)) == STAGE_TYPE_MAIN) || mMainStage.getChildCount() == 0 ? STAGE_TYPE_SIDE : STAGE_TYPE_MAIN; // If there is a fullscreen opening change, we should not bring stage to top. - prepareExitSplitScreen(record.mContainShowFullscreenChange - ? STAGE_TYPE_UNDEFINED : dismissTop, wct); + prepareExitSplitScreen( + !record.mContainShowFullscreenChange && isSplitScreenVisible() + ? dismissTop : STAGE_TYPE_UNDEFINED, wct); mSplitTransitions.startDismissTransition(wct, this, dismissTop, EXIT_REASON_APP_FINISHED); // This can happen in some pathological cases. For example: diff --git a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/ClockRegistry.kt b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/ClockRegistry.kt index 8cba2ab0b70b..702cc05f7f5f 100644 --- a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/ClockRegistry.kt +++ b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/ClockRegistry.kt @@ -56,7 +56,6 @@ private val KNOWN_PLUGINS = "com.android.systemui.falcon.four" to listOf(ClockMetadata("DIGITAL_CLOCK_GROWTH")), "com.android.systemui.falcon.five" to listOf(ClockMetadata("DIGITAL_CLOCK_HANDWRITTEN")), "com.android.systemui.falcon.six" to listOf(ClockMetadata("DIGITAL_CLOCK_INFLATE")), - "com.android.systemui.falcon.seven" to listOf(ClockMetadata("DIGITAL_CLOCK_METRO")), "com.android.systemui.falcon.eight" to listOf(ClockMetadata("DIGITAL_CLOCK_NUMBEROVERLAP")), "com.android.systemui.falcon.nine" to listOf(ClockMetadata("DIGITAL_CLOCK_WEATHER")), ) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java index a2c940bd298c..e6053fb3e352 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java @@ -80,6 +80,8 @@ import com.android.wm.shell.util.CounterRotator; import com.android.wm.shell.util.TransitionUtil; import java.util.ArrayList; +import java.util.Map; +import java.util.WeakHashMap; import javax.inject.Inject; @@ -192,7 +194,8 @@ public class KeyguardService extends Service { private final CounterRotator mCounterRotator = new CounterRotator(); @GuardedBy("mLeashMap") - private IRemoteTransitionFinishedCallback mFinishCallback = null; + private final Map<IBinder, IRemoteTransitionFinishedCallback> mFinishCallbacks = + new WeakHashMap<>(); @Override public void startAnimation(IBinder transition, TransitionInfo info, @@ -206,7 +209,7 @@ public class KeyguardService extends Service { synchronized (mLeashMap) { apps = wrap(info, false /* wallpapers */, t, mLeashMap, mCounterRotator); wallpapers = wrap(info, true /* wallpapers */, t, mLeashMap, mCounterRotator); - mFinishCallback = finishCallback; + mFinishCallbacks.put(transition, finishCallback); } // Set alpha back to 1 for the independent changes because we will be animating @@ -229,7 +232,7 @@ public class KeyguardService extends Service { @Override public void onAnimationFinished() throws RemoteException { Slog.d(TAG, "Finish IRemoteAnimationRunner."); - finish(); + finish(transition); } }); } @@ -246,7 +249,7 @@ public class KeyguardService extends Service { try { runner.onAnimationCancelled(); - finish(); + finish(currentTransition); } catch (RemoteException e) { // nothing, we'll just let it finish on its own I guess. } @@ -260,7 +263,7 @@ public class KeyguardService extends Service { } } - private void finish() throws RemoteException { + private void finish(IBinder transition) throws RemoteException { IRemoteTransitionFinishedCallback finishCallback = null; SurfaceControl.Transaction finishTransaction = null; @@ -271,8 +274,7 @@ public class KeyguardService extends Service { mCounterRotator.cleanUp(finishTransaction); } mLeashMap.clear(); - finishCallback = mFinishCallback; - mFinishCallback = null; + finishCallback = mFinishCallbacks.remove(transition); } if (finishCallback != null) { diff --git a/services/core/java/com/android/server/audio/AudioDeviceInventory.java b/services/core/java/com/android/server/audio/AudioDeviceInventory.java index ec85d577a8e7..0c7f11f98809 100644 --- a/services/core/java/com/android/server/audio/AudioDeviceInventory.java +++ b/services/core/java/com/android/server/audio/AudioDeviceInventory.java @@ -1199,11 +1199,16 @@ public class AudioDeviceInventory { AudioDeviceInfo device = Stream.of(connectedDevices) .filter(d -> d.getInternalType() == ada.getInternalType()) .filter(d -> (!AudioSystem.isBluetoothDevice(d.getInternalType()) - || (d.getAddress() == ada.getAddress()))) + || (d.getAddress().equals(ada.getAddress())))) .findFirst() .orElse(null); if (device == null) { + if (AudioService.DEBUG_DEVICES) { + Slog.i(TAG, "purgeRoles() removing device: " + ada.toString() + + ", for strategy: " + keyRole.first + + " and role: " + keyRole.second); + } asi.deviceRoleAction(keyRole.first, keyRole.second, Arrays.asList(ada)); itDev.remove(); } diff --git a/services/core/java/com/android/server/audio/BtHelper.java b/services/core/java/com/android/server/audio/BtHelper.java index c8a17e5eea5a..3560797ce2cf 100644 --- a/services/core/java/com/android/server/audio/BtHelper.java +++ b/services/core/java/com/android/server/audio/BtHelper.java @@ -218,8 +218,8 @@ public class BtHelper { if (AudioService.DEBUG_VOL) { AudioService.sVolumeLogger.enqueue(new EventLogger.StringEvent( "setAvrcpAbsoluteVolumeIndex: bailing due to null mA2dp").printLog(TAG)); - return; } + return; } if (!mAvrcpAbsVolSupported) { AudioService.sVolumeLogger.enqueue(new EventLogger.StringEvent( |