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

Commit 2623b922 authored by wilsonshih's avatar wilsonshih Committed by Wei Sheng Shih
Browse files

Send client relaunch event to WMCore.

By sending the local relaunch event to server side, WMCore can keep
the starting window when client remove the original window, and because
client won't preserve the original window, the result of redrawed view
will match the new configuration.

Bug: 230998394
Test: launch chrome => swipe to go home => change toggle to either light
or dark theme => launch chrome again. Verify the app won't become transparent and the starting window remains on screen until client
report finish draw.
Change-Id: Ic8f1ebaf0bbaf2b060338ca08a11069481c09b9a
parent 7284a6a9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -98,6 +98,15 @@ public class ActivityClient {
        }
    }

    /** Reports the activity starts local relaunch. */
    public void activityLocalRelaunch(IBinder token) {
        try {
            getActivityClientController().activityLocalRelaunch(token);
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
    }

    /** Reports the activity has completed relaunched. */
    public void activityRelaunched(IBinder token) {
        try {
+1 −0
Original line number Diff line number Diff line
@@ -5728,6 +5728,7 @@ public final class ActivityThread extends ClientTransactionHandler
            return;
        }

        ActivityClient.getInstance().activityLocalRelaunch(r.token);
        // Initialize a relaunch request.
        final MergedConfiguration mergedConfiguration = new MergedConfiguration(
                r.createdConfig != null
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ interface IActivityClientController {
    oneway void activityStopped(in IBinder token, in Bundle state,
            in PersistableBundle persistentState, in CharSequence description);
    oneway void activityDestroyed(in IBinder token);
    oneway void activityLocalRelaunch(in IBinder token);
    oneway void activityRelaunched(in IBinder token);

    oneway void reportSizeConfigurations(in IBinder token,
+12 −0
Original line number Diff line number Diff line
@@ -245,6 +245,18 @@ class ActivityClientController extends IActivityClientController.Stub {
        }
    }

    @Override
    public void activityLocalRelaunch(IBinder token) {
        final long origId = Binder.clearCallingIdentity();
        synchronized (mGlobalLock) {
            final ActivityRecord r = ActivityRecord.forTokenLocked(token);
            if (r != null) {
                r.startRelaunching();
            }
        }
        Binder.restoreCallingIdentity(origId);
    }

    @Override
    public void activityRelaunched(IBinder token) {
        final long origId = Binder.clearCallingIdentity();