Loading config/preloaded-classes +3 −0 Original line number Diff line number Diff line Loading @@ -400,6 +400,9 @@ android.app.INotificationManager android.app.IProcessObserver$Stub$Proxy android.app.IProcessObserver$Stub android.app.IProcessObserver android.app.IRequestFinishCallback$Stub$Proxy android.app.IRequestFinishCallback$Stub android.app.IRequestFinishCallback android.app.ISearchManager$Stub$Proxy android.app.ISearchManager$Stub android.app.ISearchManager Loading core/java/android/app/Activity.java +19 −1 Original line number Diff line number Diff line Loading @@ -156,6 +156,7 @@ import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; Loading Loading @@ -3811,6 +3812,22 @@ public class Activity extends ContextThemeWrapper return false; } private static final class RequestFinishCallback extends IRequestFinishCallback.Stub { private final WeakReference<Activity> mActivityRef; RequestFinishCallback(WeakReference<Activity> activityRef) { mActivityRef = activityRef; } @Override public void requestFinish() { Activity activity = mActivityRef.get(); if (activity != null) { activity.mHandler.post(activity::finishAfterTransition); } } } /** * Called when the activity has detected the user's press of the back * key. The default implementation simply finishes the current activity, Loading @@ -3834,7 +3851,8 @@ public class Activity extends ContextThemeWrapper // Inform activity task manager that the activity received a back press while at the // root of the task. This call allows ActivityTaskManager to intercept or move the task // to the back. ActivityClient.getInstance().onBackPressedOnTaskRoot(mToken); ActivityClient.getInstance().onBackPressedOnTaskRoot(mToken, new RequestFinishCallback(new WeakReference<>(this))); // Activity was launched when user tapped a link in the Autofill Save UI - Save UI must // be restored now. Loading core/java/android/app/ActivityClient.java +2 −2 Original line number Diff line number Diff line Loading @@ -480,9 +480,9 @@ public class ActivityClient { } } void onBackPressedOnTaskRoot(IBinder token) { void onBackPressedOnTaskRoot(IBinder token, IRequestFinishCallback callback) { try { getActivityClientController().onBackPressedOnTaskRoot(token); getActivityClientController().onBackPressedOnTaskRoot(token, callback); } catch (RemoteException e) { e.rethrowFromSystemServer(); } Loading core/java/android/app/IActivityClientController.aidl +3 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.app; import android.app.ActivityManager; import android.app.IRequestFinishCallback; import android.app.PictureInPictureParams; import android.content.ComponentName; import android.content.Intent; Loading Loading @@ -141,7 +142,8 @@ interface IActivityClientController { * Reports that an Activity received a back key press when there were no additional activities * on the back stack. */ oneway void onBackPressedOnTaskRoot(in IBinder token); oneway void onBackPressedOnTaskRoot(in IBinder activityToken, in IRequestFinishCallback callback); /** Reports that the splash screen view has attached to activity. */ oneway void splashScreenAttached(in IBinder token); Loading core/java/android/app/IRequestFinishCallback.aidl 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.app; /** * This callback allows ActivityTaskManager to ask the calling Activity * to finish in response to a call to onBackPressedOnTaskRoot. * * {@hide} */ oneway interface IRequestFinishCallback { void requestFinish(); } Loading
config/preloaded-classes +3 −0 Original line number Diff line number Diff line Loading @@ -400,6 +400,9 @@ android.app.INotificationManager android.app.IProcessObserver$Stub$Proxy android.app.IProcessObserver$Stub android.app.IProcessObserver android.app.IRequestFinishCallback$Stub$Proxy android.app.IRequestFinishCallback$Stub android.app.IRequestFinishCallback android.app.ISearchManager$Stub$Proxy android.app.ISearchManager$Stub android.app.ISearchManager Loading
core/java/android/app/Activity.java +19 −1 Original line number Diff line number Diff line Loading @@ -156,6 +156,7 @@ import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; Loading Loading @@ -3811,6 +3812,22 @@ public class Activity extends ContextThemeWrapper return false; } private static final class RequestFinishCallback extends IRequestFinishCallback.Stub { private final WeakReference<Activity> mActivityRef; RequestFinishCallback(WeakReference<Activity> activityRef) { mActivityRef = activityRef; } @Override public void requestFinish() { Activity activity = mActivityRef.get(); if (activity != null) { activity.mHandler.post(activity::finishAfterTransition); } } } /** * Called when the activity has detected the user's press of the back * key. The default implementation simply finishes the current activity, Loading @@ -3834,7 +3851,8 @@ public class Activity extends ContextThemeWrapper // Inform activity task manager that the activity received a back press while at the // root of the task. This call allows ActivityTaskManager to intercept or move the task // to the back. ActivityClient.getInstance().onBackPressedOnTaskRoot(mToken); ActivityClient.getInstance().onBackPressedOnTaskRoot(mToken, new RequestFinishCallback(new WeakReference<>(this))); // Activity was launched when user tapped a link in the Autofill Save UI - Save UI must // be restored now. Loading
core/java/android/app/ActivityClient.java +2 −2 Original line number Diff line number Diff line Loading @@ -480,9 +480,9 @@ public class ActivityClient { } } void onBackPressedOnTaskRoot(IBinder token) { void onBackPressedOnTaskRoot(IBinder token, IRequestFinishCallback callback) { try { getActivityClientController().onBackPressedOnTaskRoot(token); getActivityClientController().onBackPressedOnTaskRoot(token, callback); } catch (RemoteException e) { e.rethrowFromSystemServer(); } Loading
core/java/android/app/IActivityClientController.aidl +3 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.app; import android.app.ActivityManager; import android.app.IRequestFinishCallback; import android.app.PictureInPictureParams; import android.content.ComponentName; import android.content.Intent; Loading Loading @@ -141,7 +142,8 @@ interface IActivityClientController { * Reports that an Activity received a back key press when there were no additional activities * on the back stack. */ oneway void onBackPressedOnTaskRoot(in IBinder token); oneway void onBackPressedOnTaskRoot(in IBinder activityToken, in IRequestFinishCallback callback); /** Reports that the splash screen view has attached to activity. */ oneway void splashScreenAttached(in IBinder token); Loading
core/java/android/app/IRequestFinishCallback.aidl 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.app; /** * This callback allows ActivityTaskManager to ask the calling Activity * to finish in response to a call to onBackPressedOnTaskRoot. * * {@hide} */ oneway interface IRequestFinishCallback { void requestFinish(); }