Commit 09233289 authored by Dianne Hackborn's avatar Dianne Hackborn

Make GET_TASKS signature|system.

Normal apps can't hold it now.  If they try to use
getRecentTasks() or getRunningTasks() without the permission,
they will only see their own tasks and home in the list.

Also took this opportunity to eradicate all of the old pending
thumbnail stuff.

Change-Id: I6dc52a06221c78097162e4a8b482027b798bf3ee
parent 201a24f6
......@@ -78,7 +78,6 @@ LOCAL_SRC_FILES += \
core/java/android/app/IStopUserCallback.aidl \
core/java/android/app/task/ITaskCallback.aidl \
core/java/android/app/task/ITaskService.aidl \
core/java/android/app/IThumbnailReceiver.aidl \
core/java/android/app/IThumbnailRetriever.aidl \
core/java/android/app/ITransientNotification.aidl \
core/java/android/app/IUiAutomationConnection.aidl \
......
......@@ -190,6 +190,7 @@ $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framew
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/core/java/android/view/IMagnificationCallbacks*)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/core/java/android/tv/)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/media/java/android/media/)
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/core/java/android/app)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
......
......@@ -784,42 +784,6 @@ public class ActivityManager {
}
}
/**
* Return a list of the tasks that are currently running, with
* the most recent being first and older ones after in order. Note that
* "running" does not mean any of the task's code is currently loaded or
* activity -- the task may have been frozen by the system, so that it
* can be restarted in its previous state when next brought to the
* foreground.
*
* @param maxNum The maximum number of entries to return in the list. The
* actual number returned may be smaller, depending on how many tasks the
* user has started.
*
* @param flags Optional flags
* @param receiver Optional receiver for delayed thumbnails
*
* @return Returns a list of RunningTaskInfo records describing each of
* the running tasks.
*
* Some thumbnails may not be available at the time of this call. The optional
* receiver may be used to receive those thumbnails.
*
* @throws SecurityException Throws SecurityException if the caller does
* not hold the {@link android.Manifest.permission#GET_TASKS} permission.
*
* @hide
*/
public List<RunningTaskInfo> getRunningTasks(int maxNum, int flags, IThumbnailReceiver receiver)
throws SecurityException {
try {
return ActivityManagerNative.getDefault().getTasks(maxNum, flags, receiver);
} catch (RemoteException e) {
// System dead, we will be dead too soon!
return null;
}
}
/**
* Return a list of the tasks that are currently running, with
* the most recent being first and older ones after in order. Note that
......@@ -849,7 +813,12 @@ public class ActivityManager {
*/
public List<RunningTaskInfo> getRunningTasks(int maxNum)
throws SecurityException {
return getRunningTasks(maxNum, 0, null);
try {
return ActivityManagerNative.getDefault().getTasks(maxNum, 0);
} catch (RemoteException e) {
// System dead, we will be dead too soon!
return null;
}
}
/**
......
......@@ -509,11 +509,7 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
data.enforceInterface(IActivityManager.descriptor);
int maxNum = data.readInt();
int fl = data.readInt();
IBinder receiverBinder = data.readStrongBinder();
IThumbnailReceiver receiver = receiverBinder != null
? IThumbnailReceiver.Stub.asInterface(receiverBinder)
: null;
List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl, receiver);
List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
reply.writeNoException();
int N = list != null ? list.size() : -1;
reply.writeInt(N);
......@@ -712,17 +708,6 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
return true;
}
case REPORT_THUMBNAIL_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
IBinder token = data.readStrongBinder();
Bitmap thumbnail = data.readInt() != 0
? Bitmap.CREATOR.createFromParcel(data) : null;
CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
reportThumbnail(token, thumbnail, description);
reply.writeNoException();
return true;
}
case GET_CONTENT_PROVIDER_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
IBinder b = data.readStrongBinder();
......@@ -2678,14 +2663,12 @@ class ActivityManagerProxy implements IActivityManager
reply.recycle();
return res;
}
public List getTasks(int maxNum, int flags,
IThumbnailReceiver receiver) throws RemoteException {
public List getTasks(int maxNum, int flags) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeInt(maxNum);
data.writeInt(flags);
data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
reply.readException();
ArrayList list = null;
......@@ -2964,25 +2947,6 @@ class ActivityManagerProxy implements IActivityManager
reply.recycle();
return res;
}
public void reportThumbnail(IBinder token,
Bitmap thumbnail, CharSequence description) throws RemoteException
{
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(token);
if (thumbnail != null) {
data.writeInt(1);
thumbnail.writeToParcel(data, 0);
} else {
data.writeInt(0);
}
TextUtils.writeToParcel(description, data, 0);
mRemote.transact(REPORT_THUMBNAIL_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
reply.readException();
data.recycle();
reply.recycle();
}
public ContentProviderHolder getContentProvider(IApplicationThread caller,
String name, int userId, boolean stable) throws RemoteException {
Parcel data = Parcel.obtain();
......
......@@ -821,10 +821,6 @@ public final class ActivityThread {
sendMessage(H.SUICIDE, null);
}
public void requestThumbnail(IBinder token) {
sendMessage(H.REQUEST_THUMBNAIL, token);
}
public void scheduleConfigurationChanged(Configuration config) {
updatePendingConfiguration(config);
sendMessage(H.CONFIGURATION_CHANGED, config);
......@@ -1168,7 +1164,7 @@ public final class ActivityThread {
public static final int CREATE_SERVICE = 114;
public static final int SERVICE_ARGS = 115;
public static final int STOP_SERVICE = 116;
public static final int REQUEST_THUMBNAIL = 117;
public static final int CONFIGURATION_CHANGED = 118;
public static final int CLEAN_UP_CONTEXT = 119;
public static final int GC_WHEN_IDLE = 120;
......@@ -1218,7 +1214,6 @@ public final class ActivityThread {
case CREATE_SERVICE: return "CREATE_SERVICE";
case SERVICE_ARGS: return "SERVICE_ARGS";
case STOP_SERVICE: return "STOP_SERVICE";
case REQUEST_THUMBNAIL: return "REQUEST_THUMBNAIL";
case CONFIGURATION_CHANGED: return "CONFIGURATION_CHANGED";
case CLEAN_UP_CONTEXT: return "CLEAN_UP_CONTEXT";
case GC_WHEN_IDLE: return "GC_WHEN_IDLE";
......@@ -1367,11 +1362,6 @@ public final class ActivityThread {
maybeSnapshot();
Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
break;
case REQUEST_THUMBNAIL:
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "requestThumbnail");
handleRequestThumbnail((IBinder)msg.obj);
Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
break;
case CONFIGURATION_CHANGED:
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "configChanged");
mCurDefaultDisplayDpi = ((Configuration)msg.obj).densityDpi;
......@@ -3817,28 +3807,6 @@ public final class ActivityThread {
handleLaunchActivity(r, currentIntent);
}
private void handleRequestThumbnail(IBinder token) {
ActivityClientRecord r = mActivities.get(token);
Bitmap thumbnail = createThumbnailBitmap(r);
CharSequence description = null;
try {
description = r.activity.onCreateDescription();
} catch (Exception e) {
if (!mInstrumentation.onException(r.activity, e)) {
throw new RuntimeException(
"Unable to create description of activity "
+ r.intent.getComponent().toShortString()
+ ": " + e.toString(), e);
}
}
//System.out.println("Reporting top thumbnail " + thumbnail);
try {
ActivityManagerNative.getDefault().reportThumbnail(
token, thumbnail, description);
} catch (RemoteException ex) {
}
}
ArrayList<ComponentCallbacks2> collectComponentCallbacks(
boolean allActivities, Configuration newConfig) {
ArrayList<ComponentCallbacks2> callbacks
......
......@@ -312,14 +312,6 @@ public abstract class ApplicationThreadNative extends Binder
return true;
}
case REQUEST_THUMBNAIL_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder b = data.readStrongBinder();
requestThumbnail(b);
return true;
}
case SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
......@@ -986,16 +978,6 @@ class ApplicationThreadProxy implements IApplicationThread {
data.recycle();
}
public final void requestThumbnail(IBinder token)
throws RemoteException {
Parcel data = Parcel.obtain();
data.writeInterfaceToken(IApplicationThread.descriptor);
data.writeStrongBinder(token);
mRemote.transact(REQUEST_THUMBNAIL_TRANSACTION, data, null,
IBinder.FLAG_ONEWAY);
data.recycle();
}
public final void scheduleConfigurationChanged(Configuration config)
throws RemoteException {
Parcel data = Parcel.obtain();
......
......@@ -111,8 +111,7 @@ public interface IActivityManager extends IInterface {
public void activityDestroyed(IBinder token) throws RemoteException;
public String getCallingPackage(IBinder token) throws RemoteException;
public ComponentName getCallingActivity(IBinder token) throws RemoteException;
public List<RunningTaskInfo> getTasks(int maxNum, int flags,
IThumbnailReceiver receiver) throws RemoteException;
public List<RunningTaskInfo> getTasks(int maxNum, int flags) throws RemoteException;
public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
int flags, int userId) throws RemoteException;
public ActivityManager.TaskThumbnails getTaskThumbnails(int taskId) throws RemoteException;
......@@ -131,9 +130,6 @@ public interface IActivityManager extends IInterface {
public boolean isInHomeStack(int taskId) throws RemoteException;
public void setFocusedStack(int stackId) throws RemoteException;
public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException;
/* oneway */
public void reportThumbnail(IBinder token,
Bitmap thumbnail, CharSequence description) throws RemoteException;
public ContentProviderHolder getContentProvider(IApplicationThread caller,
String name, int userId, boolean stable) throws RemoteException;
public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
......@@ -571,7 +567,7 @@ public interface IActivityManager extends IInterface {
int MOVE_TASK_TO_BACK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+24;
int MOVE_TASK_BACKWARDS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+25;
int GET_TASK_FOR_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+26;
int REPORT_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27;
int GET_CONTENT_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28;
int PUBLISH_CONTENT_PROVIDERS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29;
int REF_CONTENT_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30;
......
......@@ -101,7 +101,6 @@ public interface IApplicationThread extends IInterface {
Bundle coreSettings) throws RemoteException;
void scheduleExit() throws RemoteException;
void scheduleSuicide() throws RemoteException;
void requestThumbnail(IBinder token) throws RemoteException;
void scheduleConfigurationChanged(Configuration config) throws RemoteException;
void updateTimeZone() throws RemoteException;
void clearDnsCache() throws RemoteException;
......@@ -159,7 +158,7 @@ public interface IApplicationThread extends IInterface {
int SCHEDULE_STOP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+11;
int BIND_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+12;
int SCHEDULE_EXIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13;
int REQUEST_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+14;
int SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+15;
int SCHEDULE_SERVICE_ARGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+16;
int UPDATE_TIME_ZONE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+17;
......
/* //device/java/android/android/app/IThumbnailReceiver.aidl
**
** Copyright 2006, 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;
import android.graphics.Bitmap;
/**
* System private API for receiving updated thumbnails from a checkpoint.
*
* {@hide}
*/
oneway interface IThumbnailReceiver {
void newThumbnail(int id, in Bitmap thumbnail, CharSequence description);
void finished();
}
......@@ -1279,7 +1279,7 @@
or recently running tasks. -->
<permission android:name="android.permission.GET_TASKS"
android:permissionGroup="android.permission-group.APP_INFO"
android:protectionLevel="dangerous"
android:protectionLevel="signature|system"
android:label="@string/permlab_getTasks"
android:description="@string/permdesc_getTasks" />
<!-- @hide Allows an application to call APIs that allow it to do interactions
......
......@@ -131,7 +131,6 @@ final class ActivityRecord {
boolean sleeping; // have we told the activity to sleep?
boolean waitingVisible; // true if waiting for a new act to become vis
boolean nowVisible; // is this activity's window visible?
boolean thumbnailNeeded;// has someone requested a thumbnail?
boolean idle; // has the activity gone idle?
boolean hasBeenLaunched;// has this activity ever been launched?
boolean frozenBeforeDestroy;// has been frozen but not yet destroyed.
......@@ -239,7 +238,6 @@ final class ActivityRecord {
pw.print(" immersive="); pw.print(immersive);
pw.print(" launchMode="); pw.println(launchMode);
pw.print(prefix); pw.print("frozenBeforeDestroy="); pw.print(frozenBeforeDestroy);
pw.print(" thumbnailNeeded="); pw.print(thumbnailNeeded);
pw.print(" forceNewConfig="); pw.println(forceNewConfig);
pw.print(prefix); pw.print("mActivityType=");
pw.println(activityTypeToString(mActivityType));
......@@ -375,7 +373,6 @@ final class ActivityRecord {
visible = true;
waitingVisible = false;
nowVisible = false;
thumbnailNeeded = false;
idle = false;
hasBeenLaunched = false;
mStackSupervisor = supervisor;
......
......@@ -53,7 +53,6 @@ import android.app.ActivityManager;
import android.app.ActivityOptions;
import android.app.AppGlobals;
import android.app.IActivityController;
import android.app.IThumbnailReceiver;
import android.app.ResultInfo;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.ComponentName;
......@@ -73,7 +72,6 @@ import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.util.EventLog;
......@@ -2537,13 +2535,6 @@ final class ActivityStack {
finishActivityResultsLocked(r, resultCode, resultData);
if (!mService.mPendingThumbnails.isEmpty()) {
// There are clients waiting to receive thumbnails so, in case
// this is an activity that someone is waiting for, add it
// to the pending list so we can correctly update the clients.
mStackSupervisor.mCancelledThumbnails.add(r);
}
if (mResumedActivity == r) {
boolean endTask = index <= 0;
if (DEBUG_VISBILITY || DEBUG_TRANSITION) Slog.v(TAG,
......@@ -2782,13 +2773,6 @@ final class ActivityStack {
cleanUpActivityServicesLocked(r);
}
if (!mService.mPendingThumbnails.isEmpty()) {
// There are clients waiting to receive thumbnails so, in case
// this is an activity that someone is waiting for, add it
// to the pending list so we can correctly update the clients.
mStackSupervisor.mCancelledThumbnails.add(r);
}
// Get rid of any pending idle timeouts.
removeTimeoutsForActivityLocked(r);
}
......@@ -3535,9 +3519,7 @@ final class ActivityStack {
return didSomething;
}
ActivityRecord getTasksLocked(IThumbnailReceiver receiver,
PendingThumbnailsRecord pending, List<RunningTaskInfo> list) {
ActivityRecord topRecord = null;
void getTasksLocked(List<RunningTaskInfo> list, int callingUid, boolean allowed) {
for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
final TaskRecord task = mTaskHistory.get(taskNdx);
ActivityRecord r = null;
......@@ -3548,6 +3530,9 @@ final class ActivityStack {
if (activities.isEmpty()) {
continue;
}
if (!allowed && !task.isHomeTask() && task.creatorUid != callingUid) {
continue;
}
for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
r = activities.get(activityNdx);
......@@ -3581,23 +3566,8 @@ final class ActivityStack {
ci.numRunning = numRunning;
//System.out.println(
// "#" + maxNum + ": " + " descr=" + ci.description);
if (receiver != null) {
if (localLOGV) Slog.v(
TAG, "State=" + top.state + "Idle=" + top.idle
+ " app=" + top.app
+ " thr=" + (top.app != null ? top.app.thread : null));
if (top.state == ActivityState.RESUMED || top.state == ActivityState.PAUSING) {
if (top.idle && top.app != null && top.app.thread != null) {
topRecord = top;
} else {
top.thumbnailNeeded = true;
}
}
pending.pendingRecords.add(top);
}
list.add(ci);
}
return topRecord;
}
public void unhandledBackLocked() {
......
......@@ -41,7 +41,6 @@ import android.app.IActivityContainer;
import android.app.IActivityContainerCallback;
import android.app.IActivityManager;
import android.app.IApplicationThread;
import android.app.IThumbnailReceiver;
import android.app.PendingIntent;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.IActivityManager.WaitResult;
......@@ -191,10 +190,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
/** List of activities that are in the process of going to sleep. */
final ArrayList<ActivityRecord> mGoingToSleepActivities = new ArrayList<ActivityRecord>();
/** List of ActivityRecord objects that have been finished and must still report back to a
* pending thumbnail receiver. */
final ArrayList<ActivityRecord> mCancelledThumbnails = new ArrayList<ActivityRecord>();
/** Used on user changes */
final ArrayList<UserStartedState> mStartingUsers = new ArrayList<UserStartedState>();
......@@ -591,10 +586,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
return null;
}
ActivityRecord getTasksLocked(int maxNum, IThumbnailReceiver receiver,
PendingThumbnailsRecord pending, List<RunningTaskInfo> list) {
ActivityRecord r = null;
void getTasksLocked(int maxNum, List<RunningTaskInfo> list, int callingUid, boolean allowed) {
// Gather all of the running tasks for each stack into runningTaskLists.
ArrayList<ArrayList<RunningTaskInfo>> runningTaskLists =
new ArrayList<ArrayList<RunningTaskInfo>>();
......@@ -605,10 +597,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
final ActivityStack stack = stacks.get(stackNdx);
ArrayList<RunningTaskInfo> stackTaskList = new ArrayList<RunningTaskInfo>();
runningTaskLists.add(stackTaskList);
final ActivityRecord ar = stack.getTasksLocked(receiver, pending, stackTaskList);
if (r == null && isFrontStack(stack)) {
r = ar;
}
stack.getTasksLocked(stackTaskList, callingUid, allowed);
}
}
......@@ -635,8 +624,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
break;
}
}
return r;
}
ActivityInfo resolveActivity(Intent intent, String resolvedType, int startFlags,
......@@ -1912,7 +1899,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
ArrayList<UserStartedState> startingUsers = null;
int NS = 0;
int NF = 0;
IApplicationThread sendThumbnail = null;
boolean booting = false;
boolean enableScreen = false;
boolean activityRemoved = false;
......@@ -1940,11 +1926,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
// us, we can now deliver.
r.idle = true;
if (r.thumbnailNeeded && r.app != null && r.app.thread != null) {
sendThumbnail = r.app.thread;
r.thumbnailNeeded = false;
}
//Slog.i(TAG, "IDLE: mBooted=" + mBooted + ", fromTimeout=" + fromTimeout);
if (!mService.mBooted && isFrontStack(r.task.stack)) {
mService.mBooted = true;
......@@ -1976,15 +1957,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
mFinishingActivities.clear();
}
final ArrayList<ActivityRecord> thumbnails;
final int NT = mCancelledThumbnails.size();
if (NT > 0) {
thumbnails = new ArrayList<ActivityRecord>(mCancelledThumbnails);
mCancelledThumbnails.clear();
} else {
thumbnails = null;
}
if (isFrontStack(mHomeStack)) {
booting = mService.mBooting;
mService.mBooting = false;
......@@ -1995,28 +1967,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
mStartingUsers.clear();
}
// Perform the following actions from unsynchronized state.
final IApplicationThread thumbnailThread = sendThumbnail;
mHandler.post(new Runnable() {
@Override
public void run() {
if (thumbnailThread != null) {
try {
thumbnailThread.requestThumbnail(token);
} catch (Exception e) {
Slog.w(TAG, "Exception thrown when requesting thumbnail", e);
mService.sendPendingThumbnail(null, token, null, null, true);
}
}
// Report back to any thumbnail receivers.
for (int i = 0; i < NT; i++) {
ActivityRecord r = thumbnails.get(i);
mService.sendPendingThumbnail(r, null, null, null, true);
}
}
});
// Stop any activities that are scheduled to do so but have been
// waiting for the next one to start.
for (int i = 0; i < NS; i++) {
......
/*
* Copyright (C) 2006 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 com.android.server.am;
import android.app.IThumbnailReceiver;
import java.util.HashSet;
/**
* This class keeps track of calls to getTasks() that are still
* waiting for thumbnail images.
*/
final class PendingThumbnailsRecord
{
final IThumbnailReceiver receiver; // who is waiting.
final HashSet<ActivityRecord> pendingRecords; // HistoryRecord objects we still wait for.
boolean finished; // Is pendingRecords empty?
PendingThumbnailsRecord(IThumbnailReceiver _receiver)
{
receiver = _receiver;
pendingRecords = new HashSet<ActivityRecord>();
finished = false;
}
}
......@@ -52,6 +52,7 @@ final class TaskRecord extends ThumbnailHolder {
String stringName; // caching of toString() result.
int userId; // user for which this task was created
int creatorUid; // The app uid that originally created the task
int numFullscreen; // Number of fullscreen activities.
......@@ -131,9 +132,8 @@ final class TaskRecord extends ThumbnailHolder {
rootWasReset = true;
}
if (info.applicationInfo != null) {
userId = UserHandle.getUserId(info.applicationInfo.uid);
}
userId = UserHandle.getUserId(info.applicationInfo.uid);
creatorUid = info.applicationInfo.uid;
}
void disposeThumbnail() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment