Merge "getActivityTokenBelow should exclude finishing activity" into sc-v2-dev am: 6a458ebd69
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15650745 Change-Id: Ief2fecee291102bc24cc64b1d8b17dd6d1444cb3
This commit is contained in:
@@ -207,7 +207,8 @@ public class ActivityClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the activity token below in the same task if it belongs to the same process.
|
||||
* Returns the non-finishing activity token below in the same task if it belongs to the same
|
||||
* process.
|
||||
*/
|
||||
@Nullable
|
||||
public IBinder getActivityTokenBelow(IBinder activityToken) {
|
||||
|
||||
@@ -554,7 +554,9 @@ class ActivityClientController extends IActivityClientController.Stub {
|
||||
if (ar == null) {
|
||||
return null;
|
||||
}
|
||||
final ActivityRecord below = ar.getTask().getActivityBelow(ar);
|
||||
// Exclude finishing activity.
|
||||
final ActivityRecord below = ar.getTask().getActivity((r) -> !r.finishing,
|
||||
ar, false /*includeBoundary*/, true /*traverseTopToBottom*/);
|
||||
if (below != null && below.getUid() == ar.getUid()) {
|
||||
return below.appToken.asBinder();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user