summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2014-06-05 03:28:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-06-05 03:28:21 +0000
commite34fcf8ff9a023641505a8decdeb1b77232d8a16 (patch)
treeda15347d2a1cc8dffff2638d2563b263a036b6a8 /services
parentb766edcea3dfdc6513218649b9ad2030bc195c23 (diff)
parentd94b47f3b671f5afbc79b061a9b8fa7aa8b22f87 (diff)
downloadframeworks_base-e34fcf8ff9a023641505a8decdeb1b77232d8a16.zip
frameworks_base-e34fcf8ff9a023641505a8decdeb1b77232d8a16.tar.gz
frameworks_base-e34fcf8ff9a023641505a8decdeb1b77232d8a16.tar.bz2
Merge "Add callback when ActivityView activities complete" into klp-modular-dev
Diffstat (limited to 'services')
-rwxr-xr-xservices/core/java/com/android/server/am/ActivityStack.java1
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java29
2 files changed, 24 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index e4b196e..685da13 100755
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -3669,6 +3669,7 @@ final class ActivityStack {
mStacks.remove(this);
mStacks.add(0, this);
}
+ mActivityContainer.onTaskListEmpty();
}
}
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index be37ee2..5a79e66 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -126,6 +126,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
static final int HANDLE_DISPLAY_CHANGED = FIRST_SUPERVISOR_STACK_MSG + 6;
static final int HANDLE_DISPLAY_REMOVED = FIRST_SUPERVISOR_STACK_MSG + 7;
static final int CONTAINER_CALLBACK_VISIBILITY = FIRST_SUPERVISOR_STACK_MSG + 8;
+ static final int CONTAINER_CALLBACK_TASK_LIST_EMPTY = FIRST_SUPERVISOR_STACK_MSG + 9;
private final static String VIRTUAL_DISPLAY_BASE_NAME = "ActivityViewVirtualDisplay";
@@ -523,7 +524,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
}
void pauseChildStacks(ActivityRecord parent, boolean userLeaving, boolean uiSleeping) {
- // TODO: Put all stacks in supervisor and iterate through them instead.
+ // TODO: Put all stacks in supervisor and iterate through them instead.
for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) {
ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
@@ -2931,12 +2932,24 @@ public final class ActivityStackSupervisor implements DisplayListener {
} break;
case CONTAINER_CALLBACK_VISIBILITY: {
final ActivityContainer container = (ActivityContainer) msg.obj;
- try {
- // We only send this message if mCallback is non-null.
- container.mCallback.setVisible(container.asBinder(), msg.arg1 == 1);
- } catch (RemoteException e) {
+ final IActivityContainerCallback callback = container.mCallback;
+ if (callback != null) {
+ try {
+ callback.setVisible(container.asBinder(), msg.arg1 == 1);
+ } catch (RemoteException e) {
+ }
}
- }
+ } break;
+ case CONTAINER_CALLBACK_TASK_LIST_EMPTY: {
+ final ActivityContainer container = (ActivityContainer) msg.obj;
+ final IActivityContainerCallback callback = container.mCallback;
+ if (callback != null) {
+ try {
+ callback.onAllActivitiesComplete(container.asBinder());
+ } catch (RemoteException e) {
+ }
+ }
+ } break;
}
}
}
@@ -3141,6 +3154,10 @@ public final class ActivityStackSupervisor implements DisplayListener {
return true;
}
+ void onTaskListEmpty() {
+ mHandler.obtainMessage(CONTAINER_CALLBACK_TASK_LIST_EMPTY, this).sendToTarget();
+ }
+
@Override
public String toString() {
return mIdString + (mActivityDisplay == null ? "N" : "A");