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

Commit 85b764e2 authored by Craig Mautner's avatar Craig Mautner
Browse files

Update window always on convertTo/FromTranslucent

Previously we would only update the window if the activity's
translucency was changed. That meant that if the window was
opaque for a translucent activity, transitioning to translucent
would not change the window to translucent. This change forces
the window to follow the convertToTranslucent and
convertFromTranslucent calls.

Also fix for setting background on enter and exit transitions.

Partial fix for 16215650.

Change-Id: I86ea68e4bbf604d0cc60cc6e34bf8090199525d6
parent eee0ea20
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.graphics.drawable.ColorDrawable;
@@ -221,10 +222,7 @@ class ExitTransitionCoordinator extends ActivityTransitionCoordinator {
            delayCancel();
            moveSharedElementsToOverlay();
            if (getDecor().getBackground() == null) {
                ColorDrawable black = new ColorDrawable(0xFF000000);
                black.setAlpha(0);
                getWindow().setBackgroundDrawable(black);
                black.setAlpha(255);
                getWindow().setBackgroundDrawable(new ColorDrawable(Color.BLACK));
            }
            ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(mActivity, this,
                    mAllSharedElementNames, resultCode, data);
+8 −10
Original line number Diff line number Diff line
@@ -10229,13 +10229,13 @@ public final class ActivityManagerService extends ActivityManagerNative
                if (r == null) {
                    return false;
                }
                if (r.changeWindowTranslucency(true)) {
                    mWindowManager.setAppFullscreen(token, true);
                final boolean translucentChanged = r.changeWindowTranslucency(true);
                if (translucentChanged) {
                    r.task.stack.releaseBackgroundResources();
                    mStackSupervisor.ensureActivitiesVisibleLocked(null, 0);
                    return true;
                }
                return false;
                mWindowManager.setAppFullscreen(token, true);
                return translucentChanged;
            }
        } finally {
            Binder.restoreCallingIdentity(origId);
@@ -10256,15 +10256,13 @@ public final class ActivityManagerService extends ActivityManagerNative
                    ActivityRecord under = r.task.mActivities.get(index - 1);
                    under.returningOptions = options;
                }
                if (r.changeWindowTranslucency(false)) {
                final boolean translucentChanged = r.changeWindowTranslucency(false);
                if (translucentChanged) {
                    r.task.stack.convertToTranslucent(r);
                    mWindowManager.setAppFullscreen(token, false);
                    mStackSupervisor.ensureActivitiesVisibleLocked(null, 0);
                    return true;
                } else {
                    mStackSupervisor.ensureActivitiesVisibleLocked(null, 0);
                    return false;
                }
                mWindowManager.setAppFullscreen(token, false);
                return translucentChanged;
            }
        } finally {
            Binder.restoreCallingIdentity(origId);
+1 −5
Original line number Diff line number Diff line
@@ -4313,11 +4313,7 @@ public class WindowManagerService extends IWindowManager.Stub
        AppWindowToken atoken = findAppWindowToken(token);
        if (atoken != null) {
            atoken.appFullscreen = toOpaque;
            // When making translucent, wait until windows below have been drawn.
            if (toOpaque) {
                // Making opaque so do it now.
                setWindowOpaque(token, true);
            }
            setWindowOpaque(token, toOpaque);
            requestTraversal();
        }
    }