Merge "Send client relaunch event to WMCore." into tm-dev am: a688a7499d am: ad95d22b9d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18367863

Change-Id: I7e0cbe1713b18456605b17098ea8f3e1edcc4ed6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Wei Sheng Shih
2022-05-16 03:53:22 +00:00
committed by Automerger Merge Worker
4 changed files with 23 additions and 0 deletions

View File

@@ -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 {

View File

@@ -5698,6 +5698,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

View File

@@ -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,

View File

@@ -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();