diff options
| -rw-r--r-- | core/java/android/os/VibrationEffect.java | 11 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/AppWindowToken.java | 15 |
2 files changed, 19 insertions, 7 deletions
diff --git a/core/java/android/os/VibrationEffect.java b/core/java/android/os/VibrationEffect.java index 035061b614f8..702b41beb071 100644 --- a/core/java/android/os/VibrationEffect.java +++ b/core/java/android/os/VibrationEffect.java @@ -330,18 +330,25 @@ public abstract class VibrationEffect implements Parcelable { @TestApi @Nullable public static VibrationEffect get(Uri uri, Context context) { + final ContentResolver cr = context.getContentResolver(); + Uri uncanonicalUri = cr.uncanonicalize(uri); + if (uncanonicalUri == null) { + // If we already had an uncanonical URI, it's possible we'll get null back here. In + // this case, just use the URI as passed in since it wasn't canonicalized in the first + // place. + uncanonicalUri = uri; + } String[] uris = context.getResources().getStringArray( com.android.internal.R.array.config_ringtoneEffectUris); for (int i = 0; i < uris.length && i < RINGTONES.length; i++) { if (uris[i] == null) { continue; } - ContentResolver cr = context.getContentResolver(); Uri mappedUri = cr.uncanonicalize(Uri.parse(uris[i])); if (mappedUri == null) { continue; } - if (mappedUri.equals(uri)) { + if (mappedUri.equals(uncanonicalUri)) { return get(RINGTONES[i]); } } diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index cae7612e0fcc..4a9a3f71f90e 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -176,6 +176,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree boolean inPendingTransaction; boolean allDrawn; private boolean mLastAllDrawn; + private boolean mUseTransferredAnimation; // Set to true when this app creates a surface while in the middle of an animation. In that // case do not clear allDrawn until the animation completes. @@ -618,9 +619,12 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree boolean runningAppAnimation = false; if (transit != WindowManager.TRANSIT_UNSET) { - if (applyAnimationLocked(lp, transit, visible, isVoiceInteraction)) { - delayed = runningAppAnimation = true; + if (mUseTransferredAnimation) { + runningAppAnimation = isReallyAnimating(); + } else if (applyAnimationLocked(lp, transit, visible, isVoiceInteraction)) { + runningAppAnimation = true; } + delayed = runningAppAnimation; final WindowState window = findMainWindow(); if (window != null && accessibilityController != null) { accessibilityController.onAppWindowTransitionLocked(window, transit); @@ -667,6 +671,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree getDisplayContent().getInputMonitor().updateInputWindowsLw(false /*force*/); } } + mUseTransferredAnimation = false; if (isReallyAnimating()) { delayed = true; @@ -1531,9 +1536,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree transferAnimation(fromToken); // When transferring an animation, we no longer need to apply an animation to the - // the token we transfer the animation over. Thus, remove the animation from - // pending opening apps. - getDisplayContent().mOpeningApps.remove(this); + // the token we transfer the animation over. Thus, set this flag to indicate we've + // transferred the animation. + mUseTransferredAnimation = true; mWmService.updateFocusedWindowLocked( UPDATE_FOCUS_WILL_PLACE_SURFACES, true /*updateInputWindows*/); |