The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.app; |
| 18 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 19 | import android.app.ActivityManager.StackInfo; |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 20 | import android.app.ProfilerInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 21 | import android.content.ComponentName; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 22 | import android.content.IIntentReceiver; |
| 23 | import android.content.IIntentSender; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | import android.content.Intent; |
| 25 | import android.content.IntentFilter; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 26 | import android.content.IntentSender; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 27 | import android.content.UriPermission; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 28 | import android.content.pm.ApplicationInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | import android.content.pm.ConfigurationInfo; |
| 30 | import android.content.pm.IPackageDataObserver; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 31 | import android.content.pm.ParceledListSlice; |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 32 | import android.content.pm.UserInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | import android.content.res.Configuration; |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 34 | import android.graphics.Bitmap; |
| 35 | import android.graphics.Point; |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 36 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | import android.net.Uri; |
| 38 | import android.os.Binder; |
| 39 | import android.os.Bundle; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 40 | import android.os.Debug; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | import android.os.IBinder; |
| 42 | import android.os.Parcel; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 43 | import android.os.ParcelFileDescriptor; |
| 44 | import android.os.Parcelable; |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 45 | import android.os.PersistableBundle; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 46 | import android.os.RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 | import android.os.ServiceManager; |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 48 | import android.os.StrictMode; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 49 | import android.service.voice.IVoiceInteractionSession; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | import android.text.TextUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 51 | import android.util.Log; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 52 | import android.util.Singleton; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 53 | import com.android.internal.app.IVoiceInteractor; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 54 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 55 | import java.util.ArrayList; |
| 56 | import java.util.List; |
| 57 | |
| 58 | /** {@hide} */ |
| 59 | public abstract class ActivityManagerNative extends Binder implements IActivityManager |
| 60 | { |
| 61 | /** |
| 62 | * Cast a Binder object into an activity manager interface, generating |
| 63 | * a proxy if needed. |
| 64 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 65 | static public IActivityManager asInterface(IBinder obj) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 66 | if (obj == null) { |
| 67 | return null; |
| 68 | } |
| 69 | IActivityManager in = |
| 70 | (IActivityManager)obj.queryLocalInterface(descriptor); |
| 71 | if (in != null) { |
| 72 | return in; |
| 73 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 74 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 75 | return new ActivityManagerProxy(obj); |
| 76 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 77 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 78 | /** |
| 79 | * Retrieve the system's default/global activity manager. |
| 80 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 81 | static public IActivityManager getDefault() { |
| 82 | return gDefault.get(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Convenience for checking whether the system is ready. For internal use only. |
| 87 | */ |
| 88 | static public boolean isSystemReady() { |
| 89 | if (!sSystemReady) { |
| 90 | sSystemReady = getDefault().testIsSystemReady(); |
| 91 | } |
| 92 | return sSystemReady; |
| 93 | } |
| 94 | static boolean sSystemReady = false; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 95 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 96 | /** |
| 97 | * Convenience for sending a sticky broadcast. For internal use only. |
| 98 | * If you don't care about permission, use null. |
| 99 | */ |
Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 100 | static public void broadcastStickyIntent(Intent intent, String permission, int userId) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 101 | try { |
| 102 | getDefault().broadcastIntent( |
| 103 | null, intent, null, null, Activity.RESULT_OK, null, null, |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 104 | null /*permission*/, AppOpsManager.OP_NONE, false, true, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 105 | } catch (RemoteException ex) { |
| 106 | } |
| 107 | } |
| 108 | |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 109 | static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 110 | try { |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 111 | getDefault().noteWakeupAlarm(ps.getTarget(), sourceUid, sourcePkg); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 112 | } catch (RemoteException ex) { |
| 113 | } |
| 114 | } |
| 115 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 116 | public ActivityManagerNative() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 117 | attachInterface(this, descriptor); |
| 118 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 119 | |
| 120 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 121 | public boolean onTransact(int code, Parcel data, Parcel reply, int flags) |
| 122 | throws RemoteException { |
| 123 | switch (code) { |
| 124 | case START_ACTIVITY_TRANSACTION: |
| 125 | { |
| 126 | data.enforceInterface(IActivityManager.descriptor); |
| 127 | IBinder b = data.readStrongBinder(); |
| 128 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 129 | String callingPackage = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 130 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 131 | String resolvedType = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 132 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 133 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 134 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 135 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 136 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 137 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 138 | Bundle options = data.readInt() != 0 |
| 139 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 140 | int result = startActivity(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 141 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 142 | reply.writeNoException(); |
| 143 | reply.writeInt(result); |
| 144 | return true; |
| 145 | } |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 146 | |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 147 | case START_ACTIVITY_AS_USER_TRANSACTION: |
| 148 | { |
| 149 | data.enforceInterface(IActivityManager.descriptor); |
| 150 | IBinder b = data.readStrongBinder(); |
| 151 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 152 | String callingPackage = data.readString(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 153 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 154 | String resolvedType = data.readString(); |
| 155 | IBinder resultTo = data.readStrongBinder(); |
| 156 | String resultWho = data.readString(); |
| 157 | int requestCode = data.readInt(); |
| 158 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 159 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 160 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 161 | Bundle options = data.readInt() != 0 |
| 162 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 163 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 164 | int result = startActivityAsUser(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 165 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 166 | reply.writeNoException(); |
| 167 | reply.writeInt(result); |
| 168 | return true; |
| 169 | } |
| 170 | |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 171 | case START_ACTIVITY_AS_CALLER_TRANSACTION: |
| 172 | { |
| 173 | data.enforceInterface(IActivityManager.descriptor); |
| 174 | IBinder b = data.readStrongBinder(); |
| 175 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 176 | String callingPackage = data.readString(); |
| 177 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 178 | String resolvedType = data.readString(); |
| 179 | IBinder resultTo = data.readStrongBinder(); |
| 180 | String resultWho = data.readString(); |
| 181 | int requestCode = data.readInt(); |
| 182 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 183 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 184 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 185 | Bundle options = data.readInt() != 0 |
| 186 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 187 | int userId = data.readInt(); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 188 | int result = startActivityAsCaller(app, callingPackage, intent, resolvedType, |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 189 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 190 | reply.writeNoException(); |
| 191 | reply.writeInt(result); |
| 192 | return true; |
| 193 | } |
| 194 | |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 195 | case START_ACTIVITY_AND_WAIT_TRANSACTION: |
| 196 | { |
| 197 | data.enforceInterface(IActivityManager.descriptor); |
| 198 | IBinder b = data.readStrongBinder(); |
| 199 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 200 | String callingPackage = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 201 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 202 | String resolvedType = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 203 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 204 | String resultWho = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 205 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 206 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 207 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 208 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 209 | Bundle options = data.readInt() != 0 |
| 210 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 211 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 212 | WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 213 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 214 | reply.writeNoException(); |
| 215 | result.writeToParcel(reply, 0); |
| 216 | return true; |
| 217 | } |
| 218 | |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 219 | case START_ACTIVITY_WITH_CONFIG_TRANSACTION: |
| 220 | { |
| 221 | data.enforceInterface(IActivityManager.descriptor); |
| 222 | IBinder b = data.readStrongBinder(); |
| 223 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 224 | String callingPackage = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 225 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 226 | String resolvedType = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 227 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 228 | String resultWho = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 229 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 230 | int startFlags = data.readInt(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 231 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 232 | Bundle options = data.readInt() != 0 |
| 233 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 234 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 235 | int result = startActivityWithConfig(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 236 | resultTo, resultWho, requestCode, startFlags, config, options, userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 237 | reply.writeNoException(); |
| 238 | reply.writeInt(result); |
| 239 | return true; |
| 240 | } |
| 241 | |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 242 | case START_ACTIVITY_INTENT_SENDER_TRANSACTION: |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 243 | { |
| 244 | data.enforceInterface(IActivityManager.descriptor); |
| 245 | IBinder b = data.readStrongBinder(); |
| 246 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 247 | IntentSender intent = IntentSender.CREATOR.createFromParcel(data); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 248 | Intent fillInIntent = null; |
| 249 | if (data.readInt() != 0) { |
| 250 | fillInIntent = Intent.CREATOR.createFromParcel(data); |
| 251 | } |
| 252 | String resolvedType = data.readString(); |
| 253 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 254 | String resultWho = data.readString(); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 255 | int requestCode = data.readInt(); |
| 256 | int flagsMask = data.readInt(); |
| 257 | int flagsValues = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 258 | Bundle options = data.readInt() != 0 |
| 259 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 260 | int result = startActivityIntentSender(app, intent, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 261 | fillInIntent, resolvedType, resultTo, resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 262 | requestCode, flagsMask, flagsValues, options); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 263 | reply.writeNoException(); |
| 264 | reply.writeInt(result); |
| 265 | return true; |
| 266 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 267 | |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 268 | case START_VOICE_ACTIVITY_TRANSACTION: |
| 269 | { |
| 270 | data.enforceInterface(IActivityManager.descriptor); |
| 271 | String callingPackage = data.readString(); |
| 272 | int callingPid = data.readInt(); |
| 273 | int callingUid = data.readInt(); |
| 274 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 275 | String resolvedType = data.readString(); |
| 276 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 277 | data.readStrongBinder()); |
| 278 | IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface( |
| 279 | data.readStrongBinder()); |
| 280 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 281 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 282 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 283 | Bundle options = data.readInt() != 0 |
| 284 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 285 | int userId = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 286 | int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent, |
| 287 | resolvedType, session, interactor, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 288 | reply.writeNoException(); |
| 289 | reply.writeInt(result); |
| 290 | return true; |
| 291 | } |
| 292 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 293 | case START_NEXT_MATCHING_ACTIVITY_TRANSACTION: |
| 294 | { |
| 295 | data.enforceInterface(IActivityManager.descriptor); |
| 296 | IBinder callingActivity = data.readStrongBinder(); |
| 297 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 298 | Bundle options = data.readInt() != 0 |
| 299 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 300 | boolean result = startNextMatchingActivity(callingActivity, intent, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 301 | reply.writeNoException(); |
| 302 | reply.writeInt(result ? 1 : 0); |
| 303 | return true; |
| 304 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 305 | |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 306 | case START_ACTIVITY_FROM_RECENTS_TRANSACTION: |
| 307 | { |
| 308 | data.enforceInterface(IActivityManager.descriptor); |
| 309 | int taskId = data.readInt(); |
| 310 | Bundle options = data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data); |
| 311 | int result = startActivityFromRecents(taskId, options); |
| 312 | reply.writeNoException(); |
| 313 | reply.writeInt(result); |
| 314 | return true; |
| 315 | } |
| 316 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 317 | case FINISH_ACTIVITY_TRANSACTION: { |
| 318 | data.enforceInterface(IActivityManager.descriptor); |
| 319 | IBinder token = data.readStrongBinder(); |
| 320 | Intent resultData = null; |
| 321 | int resultCode = data.readInt(); |
| 322 | if (data.readInt() != 0) { |
| 323 | resultData = Intent.CREATOR.createFromParcel(data); |
| 324 | } |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 325 | boolean finishTask = (data.readInt() != 0); |
| 326 | boolean res = finishActivity(token, resultCode, resultData, finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 327 | reply.writeNoException(); |
| 328 | reply.writeInt(res ? 1 : 0); |
| 329 | return true; |
| 330 | } |
| 331 | |
| 332 | case FINISH_SUB_ACTIVITY_TRANSACTION: { |
| 333 | data.enforceInterface(IActivityManager.descriptor); |
| 334 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 335 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 336 | int requestCode = data.readInt(); |
| 337 | finishSubActivity(token, resultWho, requestCode); |
| 338 | reply.writeNoException(); |
| 339 | return true; |
| 340 | } |
| 341 | |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 342 | case FINISH_ACTIVITY_AFFINITY_TRANSACTION: { |
| 343 | data.enforceInterface(IActivityManager.descriptor); |
| 344 | IBinder token = data.readStrongBinder(); |
| 345 | boolean res = finishActivityAffinity(token); |
| 346 | reply.writeNoException(); |
| 347 | reply.writeInt(res ? 1 : 0); |
| 348 | return true; |
| 349 | } |
| 350 | |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 351 | case FINISH_VOICE_TASK_TRANSACTION: { |
| 352 | data.enforceInterface(IActivityManager.descriptor); |
| 353 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 354 | data.readStrongBinder()); |
| 355 | finishVoiceTask(session); |
| 356 | reply.writeNoException(); |
| 357 | return true; |
| 358 | } |
| 359 | |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 360 | case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: { |
| 361 | data.enforceInterface(IActivityManager.descriptor); |
| 362 | IBinder token = data.readStrongBinder(); |
| 363 | boolean res = releaseActivityInstance(token); |
| 364 | reply.writeNoException(); |
| 365 | reply.writeInt(res ? 1 : 0); |
| 366 | return true; |
| 367 | } |
| 368 | |
| 369 | case RELEASE_SOME_ACTIVITIES_TRANSACTION: { |
| 370 | data.enforceInterface(IActivityManager.descriptor); |
| 371 | IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder()); |
| 372 | releaseSomeActivities(app); |
| 373 | reply.writeNoException(); |
| 374 | return true; |
| 375 | } |
| 376 | |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 377 | case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: { |
| 378 | data.enforceInterface(IActivityManager.descriptor); |
| 379 | IBinder token = data.readStrongBinder(); |
| 380 | boolean res = willActivityBeVisible(token); |
| 381 | reply.writeNoException(); |
| 382 | reply.writeInt(res ? 1 : 0); |
| 383 | return true; |
| 384 | } |
| 385 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 386 | case REGISTER_RECEIVER_TRANSACTION: |
| 387 | { |
| 388 | data.enforceInterface(IActivityManager.descriptor); |
| 389 | IBinder b = data.readStrongBinder(); |
| 390 | IApplicationThread app = |
| 391 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 392 | String packageName = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 393 | b = data.readStrongBinder(); |
| 394 | IIntentReceiver rec |
| 395 | = b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 396 | IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data); |
| 397 | String perm = data.readString(); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 398 | int userId = data.readInt(); |
| 399 | Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 400 | reply.writeNoException(); |
| 401 | if (intent != null) { |
| 402 | reply.writeInt(1); |
| 403 | intent.writeToParcel(reply, 0); |
| 404 | } else { |
| 405 | reply.writeInt(0); |
| 406 | } |
| 407 | return true; |
| 408 | } |
| 409 | |
| 410 | case UNREGISTER_RECEIVER_TRANSACTION: |
| 411 | { |
| 412 | data.enforceInterface(IActivityManager.descriptor); |
| 413 | IBinder b = data.readStrongBinder(); |
| 414 | if (b == null) { |
| 415 | return true; |
| 416 | } |
| 417 | IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b); |
| 418 | unregisterReceiver(rec); |
| 419 | reply.writeNoException(); |
| 420 | return true; |
| 421 | } |
| 422 | |
| 423 | case BROADCAST_INTENT_TRANSACTION: |
| 424 | { |
| 425 | data.enforceInterface(IActivityManager.descriptor); |
| 426 | IBinder b = data.readStrongBinder(); |
| 427 | IApplicationThread app = |
| 428 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 429 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 430 | String resolvedType = data.readString(); |
| 431 | b = data.readStrongBinder(); |
| 432 | IIntentReceiver resultTo = |
| 433 | b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 434 | int resultCode = data.readInt(); |
| 435 | String resultData = data.readString(); |
| 436 | Bundle resultExtras = data.readBundle(); |
| 437 | String perm = data.readString(); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 438 | int appOp = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 439 | boolean serialized = data.readInt() != 0; |
| 440 | boolean sticky = data.readInt() != 0; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 441 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 442 | int res = broadcastIntent(app, intent, resolvedType, resultTo, |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 443 | resultCode, resultData, resultExtras, perm, appOp, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 444 | serialized, sticky, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 445 | reply.writeNoException(); |
| 446 | reply.writeInt(res); |
| 447 | return true; |
| 448 | } |
| 449 | |
| 450 | case UNBROADCAST_INTENT_TRANSACTION: |
| 451 | { |
| 452 | data.enforceInterface(IActivityManager.descriptor); |
| 453 | IBinder b = data.readStrongBinder(); |
| 454 | IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 455 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 456 | int userId = data.readInt(); |
| 457 | unbroadcastIntent(app, intent, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 458 | reply.writeNoException(); |
| 459 | return true; |
| 460 | } |
| 461 | |
| 462 | case FINISH_RECEIVER_TRANSACTION: { |
| 463 | data.enforceInterface(IActivityManager.descriptor); |
| 464 | IBinder who = data.readStrongBinder(); |
| 465 | int resultCode = data.readInt(); |
| 466 | String resultData = data.readString(); |
| 467 | Bundle resultExtras = data.readBundle(); |
| 468 | boolean resultAbort = data.readInt() != 0; |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 469 | int intentFlags = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 470 | if (who != null) { |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 471 | finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 472 | } |
| 473 | reply.writeNoException(); |
| 474 | return true; |
| 475 | } |
| 476 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 477 | case ATTACH_APPLICATION_TRANSACTION: { |
| 478 | data.enforceInterface(IActivityManager.descriptor); |
| 479 | IApplicationThread app = ApplicationThreadNative.asInterface( |
| 480 | data.readStrongBinder()); |
| 481 | if (app != null) { |
| 482 | attachApplication(app); |
| 483 | } |
| 484 | reply.writeNoException(); |
| 485 | return true; |
| 486 | } |
| 487 | |
| 488 | case ACTIVITY_IDLE_TRANSACTION: { |
| 489 | data.enforceInterface(IActivityManager.descriptor); |
| 490 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 491 | Configuration config = null; |
| 492 | if (data.readInt() != 0) { |
| 493 | config = Configuration.CREATOR.createFromParcel(data); |
| 494 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 495 | boolean stopProfiling = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 496 | if (token != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 497 | activityIdle(token, config, stopProfiling); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 498 | } |
| 499 | reply.writeNoException(); |
| 500 | return true; |
| 501 | } |
| 502 | |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 503 | case ACTIVITY_RESUMED_TRANSACTION: { |
| 504 | data.enforceInterface(IActivityManager.descriptor); |
| 505 | IBinder token = data.readStrongBinder(); |
| 506 | activityResumed(token); |
| 507 | reply.writeNoException(); |
| 508 | return true; |
| 509 | } |
| 510 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 511 | case ACTIVITY_PAUSED_TRANSACTION: { |
| 512 | data.enforceInterface(IActivityManager.descriptor); |
| 513 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 514 | activityPaused(token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 515 | reply.writeNoException(); |
| 516 | return true; |
| 517 | } |
| 518 | |
| 519 | case ACTIVITY_STOPPED_TRANSACTION: { |
| 520 | data.enforceInterface(IActivityManager.descriptor); |
| 521 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 522 | Bundle map = data.readBundle(); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 523 | PersistableBundle persistentState = data.readPersistableBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 524 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 525 | activityStopped(token, map, persistentState, description); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 526 | reply.writeNoException(); |
| 527 | return true; |
| 528 | } |
| 529 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 530 | case ACTIVITY_SLEPT_TRANSACTION: { |
| 531 | data.enforceInterface(IActivityManager.descriptor); |
| 532 | IBinder token = data.readStrongBinder(); |
| 533 | activitySlept(token); |
| 534 | reply.writeNoException(); |
| 535 | return true; |
| 536 | } |
| 537 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 538 | case ACTIVITY_DESTROYED_TRANSACTION: { |
| 539 | data.enforceInterface(IActivityManager.descriptor); |
| 540 | IBinder token = data.readStrongBinder(); |
| 541 | activityDestroyed(token); |
| 542 | reply.writeNoException(); |
| 543 | return true; |
| 544 | } |
| 545 | |
| 546 | case GET_CALLING_PACKAGE_TRANSACTION: { |
| 547 | data.enforceInterface(IActivityManager.descriptor); |
| 548 | IBinder token = data.readStrongBinder(); |
| 549 | String res = token != null ? getCallingPackage(token) : null; |
| 550 | reply.writeNoException(); |
| 551 | reply.writeString(res); |
| 552 | return true; |
| 553 | } |
| 554 | |
| 555 | case GET_CALLING_ACTIVITY_TRANSACTION: { |
| 556 | data.enforceInterface(IActivityManager.descriptor); |
| 557 | IBinder token = data.readStrongBinder(); |
| 558 | ComponentName cn = getCallingActivity(token); |
| 559 | reply.writeNoException(); |
| 560 | ComponentName.writeToParcel(cn, reply); |
| 561 | return true; |
| 562 | } |
| 563 | |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 564 | case GET_APP_TASKS_TRANSACTION: { |
| 565 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 566 | String callingPackage = data.readString(); |
| 567 | List<IAppTask> list = getAppTasks(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 568 | reply.writeNoException(); |
| 569 | int N = list != null ? list.size() : -1; |
| 570 | reply.writeInt(N); |
| 571 | int i; |
| 572 | for (i=0; i<N; i++) { |
| 573 | IAppTask task = list.get(i); |
| 574 | reply.writeStrongBinder(task.asBinder()); |
| 575 | } |
| 576 | return true; |
| 577 | } |
| 578 | |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 579 | case ADD_APP_TASK_TRANSACTION: { |
| 580 | data.enforceInterface(IActivityManager.descriptor); |
| 581 | IBinder activityToken = data.readStrongBinder(); |
| 582 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 583 | ActivityManager.TaskDescription descr |
| 584 | = ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 585 | Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data); |
| 586 | int res = addAppTask(activityToken, intent, descr, thumbnail); |
| 587 | reply.writeNoException(); |
| 588 | reply.writeInt(res); |
| 589 | return true; |
| 590 | } |
| 591 | |
| 592 | case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: { |
| 593 | data.enforceInterface(IActivityManager.descriptor); |
| 594 | Point size = getAppTaskThumbnailSize(); |
| 595 | reply.writeNoException(); |
| 596 | size.writeToParcel(reply, 0); |
| 597 | return true; |
| 598 | } |
| 599 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 600 | case GET_TASKS_TRANSACTION: { |
| 601 | data.enforceInterface(IActivityManager.descriptor); |
| 602 | int maxNum = data.readInt(); |
| 603 | int fl = data.readInt(); |
Dianne Hackborn | 0923328 | 2014-04-30 11:33:59 -0700 | [diff] [blame] | 604 | List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 605 | reply.writeNoException(); |
| 606 | int N = list != null ? list.size() : -1; |
| 607 | reply.writeInt(N); |
| 608 | int i; |
| 609 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 610 | ActivityManager.RunningTaskInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 611 | info.writeToParcel(reply, 0); |
| 612 | } |
| 613 | return true; |
| 614 | } |
| 615 | |
| 616 | case GET_RECENT_TASKS_TRANSACTION: { |
| 617 | data.enforceInterface(IActivityManager.descriptor); |
| 618 | int maxNum = data.readInt(); |
| 619 | int fl = data.readInt(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 620 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 621 | List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 622 | fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 623 | reply.writeNoException(); |
| 624 | reply.writeTypedList(list); |
| 625 | return true; |
| 626 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 627 | |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 628 | case GET_TASK_THUMBNAIL_TRANSACTION: { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 629 | data.enforceInterface(IActivityManager.descriptor); |
| 630 | int id = data.readInt(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 631 | ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 632 | reply.writeNoException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 633 | if (taskThumbnail != null) { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 634 | reply.writeInt(1); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 635 | taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 636 | } else { |
| 637 | reply.writeInt(0); |
| 638 | } |
| 639 | return true; |
| 640 | } |
| 641 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 642 | case GET_SERVICES_TRANSACTION: { |
| 643 | data.enforceInterface(IActivityManager.descriptor); |
| 644 | int maxNum = data.readInt(); |
| 645 | int fl = data.readInt(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 646 | List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 647 | reply.writeNoException(); |
| 648 | int N = list != null ? list.size() : -1; |
| 649 | reply.writeInt(N); |
| 650 | int i; |
| 651 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 652 | ActivityManager.RunningServiceInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 653 | info.writeToParcel(reply, 0); |
| 654 | } |
| 655 | return true; |
| 656 | } |
| 657 | |
| 658 | case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: { |
| 659 | data.enforceInterface(IActivityManager.descriptor); |
| 660 | List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState(); |
| 661 | reply.writeNoException(); |
| 662 | reply.writeTypedList(list); |
| 663 | return true; |
| 664 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 665 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 666 | case GET_RUNNING_APP_PROCESSES_TRANSACTION: { |
| 667 | data.enforceInterface(IActivityManager.descriptor); |
| 668 | List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses(); |
| 669 | reply.writeNoException(); |
| 670 | reply.writeTypedList(list); |
| 671 | return true; |
| 672 | } |
| 673 | |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 674 | case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: { |
| 675 | data.enforceInterface(IActivityManager.descriptor); |
| 676 | List<ApplicationInfo> list = getRunningExternalApplications(); |
| 677 | reply.writeNoException(); |
| 678 | reply.writeTypedList(list); |
| 679 | return true; |
| 680 | } |
| 681 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 682 | case MOVE_TASK_TO_FRONT_TRANSACTION: { |
| 683 | data.enforceInterface(IActivityManager.descriptor); |
| 684 | int task = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 685 | int fl = data.readInt(); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 686 | Bundle options = data.readInt() != 0 |
| 687 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 688 | moveTaskToFront(task, fl, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 689 | reply.writeNoException(); |
| 690 | return true; |
| 691 | } |
| 692 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 693 | case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: { |
| 694 | data.enforceInterface(IActivityManager.descriptor); |
| 695 | IBinder token = data.readStrongBinder(); |
| 696 | boolean nonRoot = data.readInt() != 0; |
| 697 | boolean res = moveActivityTaskToBack(token, nonRoot); |
| 698 | reply.writeNoException(); |
| 699 | reply.writeInt(res ? 1 : 0); |
| 700 | return true; |
| 701 | } |
| 702 | |
| 703 | case MOVE_TASK_BACKWARDS_TRANSACTION: { |
| 704 | data.enforceInterface(IActivityManager.descriptor); |
| 705 | int task = data.readInt(); |
| 706 | moveTaskBackwards(task); |
| 707 | reply.writeNoException(); |
| 708 | return true; |
| 709 | } |
| 710 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 711 | case MOVE_TASK_TO_STACK_TRANSACTION: { |
| 712 | data.enforceInterface(IActivityManager.descriptor); |
| 713 | int taskId = data.readInt(); |
| 714 | int stackId = data.readInt(); |
| 715 | boolean toTop = data.readInt() != 0; |
| 716 | moveTaskToStack(taskId, stackId, toTop); |
| 717 | reply.writeNoException(); |
| 718 | return true; |
| 719 | } |
| 720 | |
| 721 | case RESIZE_STACK_TRANSACTION: { |
| 722 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 723 | int stackId = data.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 724 | Rect r = Rect.CREATOR.createFromParcel(data); |
| 725 | resizeStack(stackId, r); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 726 | reply.writeNoException(); |
| 727 | return true; |
| 728 | } |
| 729 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 730 | case GET_ALL_STACK_INFOS_TRANSACTION: { |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 731 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 732 | List<StackInfo> list = getAllStackInfos(); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 733 | reply.writeNoException(); |
| 734 | reply.writeTypedList(list); |
| 735 | return true; |
| 736 | } |
| 737 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 738 | case GET_STACK_INFO_TRANSACTION: { |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 739 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 740 | int stackId = data.readInt(); |
| 741 | StackInfo info = getStackInfo(stackId); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 742 | reply.writeNoException(); |
| 743 | if (info != null) { |
| 744 | reply.writeInt(1); |
| 745 | info.writeToParcel(reply, 0); |
| 746 | } else { |
| 747 | reply.writeInt(0); |
| 748 | } |
| 749 | return true; |
| 750 | } |
| 751 | |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 752 | case IS_IN_HOME_STACK_TRANSACTION: { |
| 753 | data.enforceInterface(IActivityManager.descriptor); |
| 754 | int taskId = data.readInt(); |
| 755 | boolean isInHomeStack = isInHomeStack(taskId); |
| 756 | reply.writeNoException(); |
| 757 | reply.writeInt(isInHomeStack ? 1 : 0); |
| 758 | return true; |
| 759 | } |
| 760 | |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 761 | case SET_FOCUSED_STACK_TRANSACTION: { |
| 762 | data.enforceInterface(IActivityManager.descriptor); |
| 763 | int stackId = data.readInt(); |
| 764 | setFocusedStack(stackId); |
| 765 | reply.writeNoException(); |
| 766 | return true; |
| 767 | } |
| 768 | |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 769 | case GET_FOCUSED_STACK_ID_TRANSACTION: { |
| 770 | data.enforceInterface(IActivityManager.descriptor); |
| 771 | int focusedStackId = getFocusedStackId(); |
| 772 | reply.writeNoException(); |
| 773 | reply.writeInt(focusedStackId); |
| 774 | return true; |
| 775 | } |
| 776 | |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 777 | case REGISTER_TASK_STACK_LISTENER_TRANSACTION: { |
| 778 | data.enforceInterface(IActivityManager.descriptor); |
| 779 | IBinder token = data.readStrongBinder(); |
| 780 | registerTaskStackListener(ITaskStackListener.Stub.asInterface(token)); |
| 781 | reply.writeNoException(); |
| 782 | return true; |
| 783 | } |
| 784 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 785 | case GET_TASK_FOR_ACTIVITY_TRANSACTION: { |
| 786 | data.enforceInterface(IActivityManager.descriptor); |
| 787 | IBinder token = data.readStrongBinder(); |
| 788 | boolean onlyRoot = data.readInt() != 0; |
| 789 | int res = token != null |
| 790 | ? getTaskForActivity(token, onlyRoot) : -1; |
| 791 | reply.writeNoException(); |
| 792 | reply.writeInt(res); |
| 793 | return true; |
| 794 | } |
| 795 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 796 | case GET_CONTENT_PROVIDER_TRANSACTION: { |
| 797 | data.enforceInterface(IActivityManager.descriptor); |
| 798 | IBinder b = data.readStrongBinder(); |
| 799 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 800 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 801 | int userId = data.readInt(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 802 | boolean stable = data.readInt() != 0; |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 803 | ContentProviderHolder cph = getContentProvider(app, name, userId, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 804 | reply.writeNoException(); |
| 805 | if (cph != null) { |
| 806 | reply.writeInt(1); |
| 807 | cph.writeToParcel(reply, 0); |
| 808 | } else { |
| 809 | reply.writeInt(0); |
| 810 | } |
| 811 | return true; |
| 812 | } |
| 813 | |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 814 | case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 815 | data.enforceInterface(IActivityManager.descriptor); |
| 816 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 817 | int userId = data.readInt(); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 818 | IBinder token = data.readStrongBinder(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 819 | ContentProviderHolder cph = getContentProviderExternal(name, userId, token); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 820 | reply.writeNoException(); |
| 821 | if (cph != null) { |
| 822 | reply.writeInt(1); |
| 823 | cph.writeToParcel(reply, 0); |
| 824 | } else { |
| 825 | reply.writeInt(0); |
| 826 | } |
| 827 | return true; |
| 828 | } |
| 829 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 830 | case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: { |
| 831 | data.enforceInterface(IActivityManager.descriptor); |
| 832 | IBinder b = data.readStrongBinder(); |
| 833 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 834 | ArrayList<ContentProviderHolder> providers = |
| 835 | data.createTypedArrayList(ContentProviderHolder.CREATOR); |
| 836 | publishContentProviders(app, providers); |
| 837 | reply.writeNoException(); |
| 838 | return true; |
| 839 | } |
| 840 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 841 | case REF_CONTENT_PROVIDER_TRANSACTION: { |
| 842 | data.enforceInterface(IActivityManager.descriptor); |
| 843 | IBinder b = data.readStrongBinder(); |
| 844 | int stable = data.readInt(); |
| 845 | int unstable = data.readInt(); |
| 846 | boolean res = refContentProvider(b, stable, unstable); |
| 847 | reply.writeNoException(); |
| 848 | reply.writeInt(res ? 1 : 0); |
| 849 | return true; |
| 850 | } |
| 851 | |
| 852 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: { |
| 853 | data.enforceInterface(IActivityManager.descriptor); |
| 854 | IBinder b = data.readStrongBinder(); |
| 855 | unstableProviderDied(b); |
| 856 | reply.writeNoException(); |
| 857 | return true; |
| 858 | } |
| 859 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 860 | case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: { |
| 861 | data.enforceInterface(IActivityManager.descriptor); |
| 862 | IBinder b = data.readStrongBinder(); |
| 863 | appNotRespondingViaProvider(b); |
| 864 | reply.writeNoException(); |
| 865 | return true; |
| 866 | } |
| 867 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 868 | case REMOVE_CONTENT_PROVIDER_TRANSACTION: { |
| 869 | data.enforceInterface(IActivityManager.descriptor); |
| 870 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 871 | boolean stable = data.readInt() != 0; |
| 872 | removeContentProvider(b, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 873 | reply.writeNoException(); |
| 874 | return true; |
| 875 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 876 | |
| 877 | case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 878 | data.enforceInterface(IActivityManager.descriptor); |
| 879 | String name = data.readString(); |
| 880 | IBinder token = data.readStrongBinder(); |
| 881 | removeContentProviderExternal(name, token); |
| 882 | reply.writeNoException(); |
| 883 | return true; |
| 884 | } |
| 885 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 886 | case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: { |
| 887 | data.enforceInterface(IActivityManager.descriptor); |
| 888 | ComponentName comp = ComponentName.CREATOR.createFromParcel(data); |
| 889 | PendingIntent pi = getRunningServiceControlPanel(comp); |
| 890 | reply.writeNoException(); |
| 891 | PendingIntent.writePendingIntentOrNullToParcel(pi, reply); |
| 892 | return true; |
| 893 | } |
| 894 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 895 | case START_SERVICE_TRANSACTION: { |
| 896 | data.enforceInterface(IActivityManager.descriptor); |
| 897 | IBinder b = data.readStrongBinder(); |
| 898 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 899 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 900 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 901 | int userId = data.readInt(); |
| 902 | ComponentName cn = startService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 903 | reply.writeNoException(); |
| 904 | ComponentName.writeToParcel(cn, reply); |
| 905 | return true; |
| 906 | } |
| 907 | |
| 908 | case STOP_SERVICE_TRANSACTION: { |
| 909 | data.enforceInterface(IActivityManager.descriptor); |
| 910 | IBinder b = data.readStrongBinder(); |
| 911 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 912 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 913 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 914 | int userId = data.readInt(); |
| 915 | int res = stopService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 916 | reply.writeNoException(); |
| 917 | reply.writeInt(res); |
| 918 | return true; |
| 919 | } |
| 920 | |
| 921 | case STOP_SERVICE_TOKEN_TRANSACTION: { |
| 922 | data.enforceInterface(IActivityManager.descriptor); |
| 923 | ComponentName className = ComponentName.readFromParcel(data); |
| 924 | IBinder token = data.readStrongBinder(); |
| 925 | int startId = data.readInt(); |
| 926 | boolean res = stopServiceToken(className, token, startId); |
| 927 | reply.writeNoException(); |
| 928 | reply.writeInt(res ? 1 : 0); |
| 929 | return true; |
| 930 | } |
| 931 | |
| 932 | case SET_SERVICE_FOREGROUND_TRANSACTION: { |
| 933 | data.enforceInterface(IActivityManager.descriptor); |
| 934 | ComponentName className = ComponentName.readFromParcel(data); |
| 935 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 936 | int id = data.readInt(); |
| 937 | Notification notification = null; |
| 938 | if (data.readInt() != 0) { |
| 939 | notification = Notification.CREATOR.createFromParcel(data); |
| 940 | } |
| 941 | boolean removeNotification = data.readInt() != 0; |
| 942 | setServiceForeground(className, token, id, notification, removeNotification); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 943 | reply.writeNoException(); |
| 944 | return true; |
| 945 | } |
| 946 | |
| 947 | case BIND_SERVICE_TRANSACTION: { |
| 948 | data.enforceInterface(IActivityManager.descriptor); |
| 949 | IBinder b = data.readStrongBinder(); |
| 950 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 951 | IBinder token = data.readStrongBinder(); |
| 952 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 953 | String resolvedType = data.readString(); |
| 954 | b = data.readStrongBinder(); |
| 955 | int fl = data.readInt(); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 956 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 957 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 958 | int res = bindService(app, token, service, resolvedType, conn, fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 959 | reply.writeNoException(); |
| 960 | reply.writeInt(res); |
| 961 | return true; |
| 962 | } |
| 963 | |
| 964 | case UNBIND_SERVICE_TRANSACTION: { |
| 965 | data.enforceInterface(IActivityManager.descriptor); |
| 966 | IBinder b = data.readStrongBinder(); |
| 967 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
| 968 | boolean res = unbindService(conn); |
| 969 | reply.writeNoException(); |
| 970 | reply.writeInt(res ? 1 : 0); |
| 971 | return true; |
| 972 | } |
| 973 | |
| 974 | case PUBLISH_SERVICE_TRANSACTION: { |
| 975 | data.enforceInterface(IActivityManager.descriptor); |
| 976 | IBinder token = data.readStrongBinder(); |
| 977 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 978 | IBinder service = data.readStrongBinder(); |
| 979 | publishService(token, intent, service); |
| 980 | reply.writeNoException(); |
| 981 | return true; |
| 982 | } |
| 983 | |
| 984 | case UNBIND_FINISHED_TRANSACTION: { |
| 985 | data.enforceInterface(IActivityManager.descriptor); |
| 986 | IBinder token = data.readStrongBinder(); |
| 987 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 988 | boolean doRebind = data.readInt() != 0; |
| 989 | unbindFinished(token, intent, doRebind); |
| 990 | reply.writeNoException(); |
| 991 | return true; |
| 992 | } |
| 993 | |
| 994 | case SERVICE_DONE_EXECUTING_TRANSACTION: { |
| 995 | data.enforceInterface(IActivityManager.descriptor); |
| 996 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 997 | int type = data.readInt(); |
| 998 | int startId = data.readInt(); |
| 999 | int res = data.readInt(); |
| 1000 | serviceDoneExecuting(token, type, startId, res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1001 | reply.writeNoException(); |
| 1002 | return true; |
| 1003 | } |
| 1004 | |
| 1005 | case START_INSTRUMENTATION_TRANSACTION: { |
| 1006 | data.enforceInterface(IActivityManager.descriptor); |
| 1007 | ComponentName className = ComponentName.readFromParcel(data); |
| 1008 | String profileFile = data.readString(); |
| 1009 | int fl = data.readInt(); |
| 1010 | Bundle arguments = data.readBundle(); |
| 1011 | IBinder b = data.readStrongBinder(); |
| 1012 | IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 1013 | b = data.readStrongBinder(); |
| 1014 | IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1015 | int userId = data.readInt(); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 1016 | String abiOverride = data.readString(); |
| 1017 | boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId, |
| 1018 | abiOverride); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1019 | reply.writeNoException(); |
| 1020 | reply.writeInt(res ? 1 : 0); |
| 1021 | return true; |
| 1022 | } |
| 1023 | |
| 1024 | |
| 1025 | case FINISH_INSTRUMENTATION_TRANSACTION: { |
| 1026 | data.enforceInterface(IActivityManager.descriptor); |
| 1027 | IBinder b = data.readStrongBinder(); |
| 1028 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1029 | int resultCode = data.readInt(); |
| 1030 | Bundle results = data.readBundle(); |
| 1031 | finishInstrumentation(app, resultCode, results); |
| 1032 | reply.writeNoException(); |
| 1033 | return true; |
| 1034 | } |
| 1035 | |
| 1036 | case GET_CONFIGURATION_TRANSACTION: { |
| 1037 | data.enforceInterface(IActivityManager.descriptor); |
| 1038 | Configuration config = getConfiguration(); |
| 1039 | reply.writeNoException(); |
| 1040 | config.writeToParcel(reply, 0); |
| 1041 | return true; |
| 1042 | } |
| 1043 | |
| 1044 | case UPDATE_CONFIGURATION_TRANSACTION: { |
| 1045 | data.enforceInterface(IActivityManager.descriptor); |
| 1046 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 1047 | updateConfiguration(config); |
| 1048 | reply.writeNoException(); |
| 1049 | return true; |
| 1050 | } |
| 1051 | |
| 1052 | case SET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1053 | data.enforceInterface(IActivityManager.descriptor); |
| 1054 | IBinder token = data.readStrongBinder(); |
| 1055 | int requestedOrientation = data.readInt(); |
| 1056 | setRequestedOrientation(token, requestedOrientation); |
| 1057 | reply.writeNoException(); |
| 1058 | return true; |
| 1059 | } |
| 1060 | |
| 1061 | case GET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1062 | data.enforceInterface(IActivityManager.descriptor); |
| 1063 | IBinder token = data.readStrongBinder(); |
| 1064 | int req = getRequestedOrientation(token); |
| 1065 | reply.writeNoException(); |
| 1066 | reply.writeInt(req); |
| 1067 | return true; |
| 1068 | } |
| 1069 | |
| 1070 | case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: { |
| 1071 | data.enforceInterface(IActivityManager.descriptor); |
| 1072 | IBinder token = data.readStrongBinder(); |
| 1073 | ComponentName cn = getActivityClassForToken(token); |
| 1074 | reply.writeNoException(); |
| 1075 | ComponentName.writeToParcel(cn, reply); |
| 1076 | return true; |
| 1077 | } |
| 1078 | |
| 1079 | case GET_PACKAGE_FOR_TOKEN_TRANSACTION: { |
| 1080 | data.enforceInterface(IActivityManager.descriptor); |
| 1081 | IBinder token = data.readStrongBinder(); |
| 1082 | reply.writeNoException(); |
| 1083 | reply.writeString(getPackageForToken(token)); |
| 1084 | return true; |
| 1085 | } |
| 1086 | |
| 1087 | case GET_INTENT_SENDER_TRANSACTION: { |
| 1088 | data.enforceInterface(IActivityManager.descriptor); |
| 1089 | int type = data.readInt(); |
| 1090 | String packageName = data.readString(); |
| 1091 | IBinder token = data.readStrongBinder(); |
| 1092 | String resultWho = data.readString(); |
| 1093 | int requestCode = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1094 | Intent[] requestIntents; |
| 1095 | String[] requestResolvedTypes; |
| 1096 | if (data.readInt() != 0) { |
| 1097 | requestIntents = data.createTypedArray(Intent.CREATOR); |
| 1098 | requestResolvedTypes = data.createStringArray(); |
| 1099 | } else { |
| 1100 | requestIntents = null; |
| 1101 | requestResolvedTypes = null; |
| 1102 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1103 | int fl = data.readInt(); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 1104 | Bundle options = data.readInt() != 0 |
| 1105 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1106 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1107 | IIntentSender res = getIntentSender(type, packageName, token, |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1108 | resultWho, requestCode, requestIntents, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1109 | requestResolvedTypes, fl, options, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1110 | reply.writeNoException(); |
| 1111 | reply.writeStrongBinder(res != null ? res.asBinder() : null); |
| 1112 | return true; |
| 1113 | } |
| 1114 | |
| 1115 | case CANCEL_INTENT_SENDER_TRANSACTION: { |
| 1116 | data.enforceInterface(IActivityManager.descriptor); |
| 1117 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1118 | data.readStrongBinder()); |
| 1119 | cancelIntentSender(r); |
| 1120 | reply.writeNoException(); |
| 1121 | return true; |
| 1122 | } |
| 1123 | |
| 1124 | case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: { |
| 1125 | data.enforceInterface(IActivityManager.descriptor); |
| 1126 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1127 | data.readStrongBinder()); |
| 1128 | String res = getPackageForIntentSender(r); |
| 1129 | reply.writeNoException(); |
| 1130 | reply.writeString(res); |
| 1131 | return true; |
| 1132 | } |
| 1133 | |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 1134 | case GET_UID_FOR_INTENT_SENDER_TRANSACTION: { |
| 1135 | data.enforceInterface(IActivityManager.descriptor); |
| 1136 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1137 | data.readStrongBinder()); |
| 1138 | int res = getUidForIntentSender(r); |
| 1139 | reply.writeNoException(); |
| 1140 | reply.writeInt(res); |
| 1141 | return true; |
| 1142 | } |
| 1143 | |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1144 | case HANDLE_INCOMING_USER_TRANSACTION: { |
| 1145 | data.enforceInterface(IActivityManager.descriptor); |
| 1146 | int callingPid = data.readInt(); |
| 1147 | int callingUid = data.readInt(); |
| 1148 | int userId = data.readInt(); |
| 1149 | boolean allowAll = data.readInt() != 0 ; |
| 1150 | boolean requireFull = data.readInt() != 0; |
| 1151 | String name = data.readString(); |
| 1152 | String callerPackage = data.readString(); |
| 1153 | int res = handleIncomingUser(callingPid, callingUid, userId, allowAll, |
| 1154 | requireFull, name, callerPackage); |
| 1155 | reply.writeNoException(); |
| 1156 | reply.writeInt(res); |
| 1157 | return true; |
| 1158 | } |
| 1159 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1160 | case SET_PROCESS_LIMIT_TRANSACTION: { |
| 1161 | data.enforceInterface(IActivityManager.descriptor); |
| 1162 | int max = data.readInt(); |
| 1163 | setProcessLimit(max); |
| 1164 | reply.writeNoException(); |
| 1165 | return true; |
| 1166 | } |
| 1167 | |
| 1168 | case GET_PROCESS_LIMIT_TRANSACTION: { |
| 1169 | data.enforceInterface(IActivityManager.descriptor); |
| 1170 | int limit = getProcessLimit(); |
| 1171 | reply.writeNoException(); |
| 1172 | reply.writeInt(limit); |
| 1173 | return true; |
| 1174 | } |
| 1175 | |
| 1176 | case SET_PROCESS_FOREGROUND_TRANSACTION: { |
| 1177 | data.enforceInterface(IActivityManager.descriptor); |
| 1178 | IBinder token = data.readStrongBinder(); |
| 1179 | int pid = data.readInt(); |
| 1180 | boolean isForeground = data.readInt() != 0; |
| 1181 | setProcessForeground(token, pid, isForeground); |
| 1182 | reply.writeNoException(); |
| 1183 | return true; |
| 1184 | } |
| 1185 | |
| 1186 | case CHECK_PERMISSION_TRANSACTION: { |
| 1187 | data.enforceInterface(IActivityManager.descriptor); |
| 1188 | String perm = data.readString(); |
| 1189 | int pid = data.readInt(); |
| 1190 | int uid = data.readInt(); |
| 1191 | int res = checkPermission(perm, pid, uid); |
| 1192 | reply.writeNoException(); |
| 1193 | reply.writeInt(res); |
| 1194 | return true; |
| 1195 | } |
| 1196 | |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1197 | case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: { |
| 1198 | data.enforceInterface(IActivityManager.descriptor); |
| 1199 | String perm = data.readString(); |
| 1200 | int pid = data.readInt(); |
| 1201 | int uid = data.readInt(); |
| 1202 | IBinder token = data.readStrongBinder(); |
| 1203 | int res = checkPermissionWithToken(perm, pid, uid, token); |
| 1204 | reply.writeNoException(); |
| 1205 | reply.writeInt(res); |
| 1206 | return true; |
| 1207 | } |
| 1208 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1209 | case CHECK_URI_PERMISSION_TRANSACTION: { |
| 1210 | data.enforceInterface(IActivityManager.descriptor); |
| 1211 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1212 | int pid = data.readInt(); |
| 1213 | int uid = data.readInt(); |
| 1214 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1215 | int userId = data.readInt(); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1216 | IBinder callerToken = data.readStrongBinder(); |
| 1217 | int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1218 | reply.writeNoException(); |
| 1219 | reply.writeInt(res); |
| 1220 | return true; |
| 1221 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1222 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1223 | case CLEAR_APP_DATA_TRANSACTION: { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1224 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1225 | String packageName = data.readString(); |
| 1226 | IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface( |
| 1227 | data.readStrongBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 1228 | int userId = data.readInt(); |
| 1229 | boolean res = clearApplicationUserData(packageName, observer, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1230 | reply.writeNoException(); |
| 1231 | reply.writeInt(res ? 1 : 0); |
| 1232 | return true; |
| 1233 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1234 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1235 | case GRANT_URI_PERMISSION_TRANSACTION: { |
| 1236 | data.enforceInterface(IActivityManager.descriptor); |
| 1237 | IBinder b = data.readStrongBinder(); |
| 1238 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1239 | String targetPkg = data.readString(); |
| 1240 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1241 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1242 | int userId = data.readInt(); |
| 1243 | grantUriPermission(app, targetPkg, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1244 | reply.writeNoException(); |
| 1245 | return true; |
| 1246 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1247 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1248 | case REVOKE_URI_PERMISSION_TRANSACTION: { |
| 1249 | data.enforceInterface(IActivityManager.descriptor); |
| 1250 | IBinder b = data.readStrongBinder(); |
| 1251 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1252 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1253 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1254 | int userId = data.readInt(); |
| 1255 | revokeUriPermission(app, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1256 | reply.writeNoException(); |
| 1257 | return true; |
| 1258 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1259 | |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1260 | case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1261 | data.enforceInterface(IActivityManager.descriptor); |
| 1262 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1263 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1264 | int userId = data.readInt(); |
| 1265 | takePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1266 | reply.writeNoException(); |
| 1267 | return true; |
| 1268 | } |
| 1269 | |
| 1270 | case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1271 | data.enforceInterface(IActivityManager.descriptor); |
| 1272 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1273 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1274 | int userId = data.readInt(); |
| 1275 | releasePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1276 | reply.writeNoException(); |
| 1277 | return true; |
| 1278 | } |
| 1279 | |
| 1280 | case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: { |
| 1281 | data.enforceInterface(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 1282 | final String packageName = data.readString(); |
| 1283 | final boolean incoming = data.readInt() != 0; |
| 1284 | final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions( |
| 1285 | packageName, incoming); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1286 | reply.writeNoException(); |
| 1287 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1288 | return true; |
| 1289 | } |
| 1290 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1291 | case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: { |
| 1292 | data.enforceInterface(IActivityManager.descriptor); |
| 1293 | IBinder b = data.readStrongBinder(); |
| 1294 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1295 | boolean waiting = data.readInt() != 0; |
| 1296 | showWaitingForDebugger(app, waiting); |
| 1297 | reply.writeNoException(); |
| 1298 | return true; |
| 1299 | } |
| 1300 | |
| 1301 | case GET_MEMORY_INFO_TRANSACTION: { |
| 1302 | data.enforceInterface(IActivityManager.descriptor); |
| 1303 | ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); |
| 1304 | getMemoryInfo(mi); |
| 1305 | reply.writeNoException(); |
| 1306 | mi.writeToParcel(reply, 0); |
| 1307 | return true; |
| 1308 | } |
| 1309 | |
| 1310 | case UNHANDLED_BACK_TRANSACTION: { |
| 1311 | data.enforceInterface(IActivityManager.descriptor); |
| 1312 | unhandledBack(); |
| 1313 | reply.writeNoException(); |
| 1314 | return true; |
| 1315 | } |
| 1316 | |
| 1317 | case OPEN_CONTENT_URI_TRANSACTION: { |
| 1318 | data.enforceInterface(IActivityManager.descriptor); |
| 1319 | Uri uri = Uri.parse(data.readString()); |
| 1320 | ParcelFileDescriptor pfd = openContentUri(uri); |
| 1321 | reply.writeNoException(); |
| 1322 | if (pfd != null) { |
| 1323 | reply.writeInt(1); |
| 1324 | pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1325 | } else { |
| 1326 | reply.writeInt(0); |
| 1327 | } |
| 1328 | return true; |
| 1329 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1330 | |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1331 | case SET_LOCK_SCREEN_SHOWN_TRANSACTION: { |
| 1332 | data.enforceInterface(IActivityManager.descriptor); |
| 1333 | setLockScreenShown(data.readInt() != 0); |
| 1334 | reply.writeNoException(); |
| 1335 | return true; |
| 1336 | } |
| 1337 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1338 | case SET_DEBUG_APP_TRANSACTION: { |
| 1339 | data.enforceInterface(IActivityManager.descriptor); |
| 1340 | String pn = data.readString(); |
| 1341 | boolean wfd = data.readInt() != 0; |
| 1342 | boolean per = data.readInt() != 0; |
| 1343 | setDebugApp(pn, wfd, per); |
| 1344 | reply.writeNoException(); |
| 1345 | return true; |
| 1346 | } |
| 1347 | |
| 1348 | case SET_ALWAYS_FINISH_TRANSACTION: { |
| 1349 | data.enforceInterface(IActivityManager.descriptor); |
| 1350 | boolean enabled = data.readInt() != 0; |
| 1351 | setAlwaysFinish(enabled); |
| 1352 | reply.writeNoException(); |
| 1353 | return true; |
| 1354 | } |
| 1355 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1356 | case SET_ACTIVITY_CONTROLLER_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1357 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1358 | IActivityController watcher = IActivityController.Stub.asInterface( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1359 | data.readStrongBinder()); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1360 | setActivityController(watcher); |
Sungmin Choi | cdb86bb | 2012-12-20 14:08:59 +0900 | [diff] [blame] | 1361 | reply.writeNoException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1362 | return true; |
| 1363 | } |
| 1364 | |
| 1365 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1366 | data.enforceInterface(IActivityManager.descriptor); |
| 1367 | enterSafeMode(); |
| 1368 | reply.writeNoException(); |
| 1369 | return true; |
| 1370 | } |
| 1371 | |
| 1372 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1373 | data.enforceInterface(IActivityManager.descriptor); |
| 1374 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1375 | data.readStrongBinder()); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 1376 | int sourceUid = data.readInt(); |
| 1377 | String sourcePkg = data.readString(); |
| 1378 | noteWakeupAlarm(is, sourceUid, sourcePkg); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1379 | reply.writeNoException(); |
| 1380 | return true; |
| 1381 | } |
| 1382 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1383 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1384 | data.enforceInterface(IActivityManager.descriptor); |
| 1385 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1386 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1387 | boolean secure = data.readInt() != 0; |
| 1388 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1389 | reply.writeNoException(); |
| 1390 | reply.writeInt(res ? 1 : 0); |
| 1391 | return true; |
| 1392 | } |
| 1393 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1394 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1395 | data.enforceInterface(IActivityManager.descriptor); |
| 1396 | String reason = data.readString(); |
| 1397 | boolean res = killProcessesBelowForeground(reason); |
| 1398 | reply.writeNoException(); |
| 1399 | reply.writeInt(res ? 1 : 0); |
| 1400 | return true; |
| 1401 | } |
| 1402 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1403 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1404 | data.enforceInterface(IActivityManager.descriptor); |
| 1405 | IBinder app = data.readStrongBinder(); |
| 1406 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1407 | handleApplicationCrash(app, ci); |
| 1408 | reply.writeNoException(); |
| 1409 | return true; |
| 1410 | } |
| 1411 | |
| 1412 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1413 | data.enforceInterface(IActivityManager.descriptor); |
| 1414 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1415 | String tag = data.readString(); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1416 | boolean system = data.readInt() != 0; |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1417 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1418 | boolean res = handleApplicationWtf(app, tag, system, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1419 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1420 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1421 | return true; |
| 1422 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1423 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1424 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1425 | data.enforceInterface(IActivityManager.descriptor); |
| 1426 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1427 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1428 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1429 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1430 | reply.writeNoException(); |
| 1431 | return true; |
| 1432 | } |
| 1433 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1434 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1435 | data.enforceInterface(IActivityManager.descriptor); |
| 1436 | int sig = data.readInt(); |
| 1437 | signalPersistentProcesses(sig); |
| 1438 | reply.writeNoException(); |
| 1439 | return true; |
| 1440 | } |
| 1441 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1442 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1443 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1444 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1445 | int userId = data.readInt(); |
| 1446 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1447 | reply.writeNoException(); |
| 1448 | return true; |
| 1449 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1450 | |
| 1451 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1452 | data.enforceInterface(IActivityManager.descriptor); |
| 1453 | killAllBackgroundProcesses(); |
| 1454 | reply.writeNoException(); |
| 1455 | return true; |
| 1456 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1457 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1458 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1459 | data.enforceInterface(IActivityManager.descriptor); |
| 1460 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1461 | int userId = data.readInt(); |
| 1462 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1463 | reply.writeNoException(); |
| 1464 | return true; |
| 1465 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1466 | |
| 1467 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1468 | data.enforceInterface(IActivityManager.descriptor); |
| 1469 | ActivityManager.RunningAppProcessInfo info = |
| 1470 | new ActivityManager.RunningAppProcessInfo(); |
| 1471 | getMyMemoryState(info); |
| 1472 | reply.writeNoException(); |
| 1473 | info.writeToParcel(reply, 0); |
| 1474 | return true; |
| 1475 | } |
| 1476 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1477 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1478 | data.enforceInterface(IActivityManager.descriptor); |
| 1479 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1480 | reply.writeNoException(); |
| 1481 | config.writeToParcel(reply, 0); |
| 1482 | return true; |
| 1483 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1484 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1485 | case PROFILE_CONTROL_TRANSACTION: { |
| 1486 | data.enforceInterface(IActivityManager.descriptor); |
| 1487 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1488 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1489 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1490 | int profileType = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1491 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 1492 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
| 1493 | boolean res = profileControl(process, userId, start, profilerInfo, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1494 | reply.writeNoException(); |
| 1495 | reply.writeInt(res ? 1 : 0); |
| 1496 | return true; |
| 1497 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1498 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1499 | case SHUTDOWN_TRANSACTION: { |
| 1500 | data.enforceInterface(IActivityManager.descriptor); |
| 1501 | boolean res = shutdown(data.readInt()); |
| 1502 | reply.writeNoException(); |
| 1503 | reply.writeInt(res ? 1 : 0); |
| 1504 | return true; |
| 1505 | } |
| 1506 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1507 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1508 | data.enforceInterface(IActivityManager.descriptor); |
| 1509 | stopAppSwitches(); |
| 1510 | reply.writeNoException(); |
| 1511 | return true; |
| 1512 | } |
| 1513 | |
| 1514 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1515 | data.enforceInterface(IActivityManager.descriptor); |
| 1516 | resumeAppSwitches(); |
| 1517 | reply.writeNoException(); |
| 1518 | return true; |
| 1519 | } |
| 1520 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1521 | case PEEK_SERVICE_TRANSACTION: { |
| 1522 | data.enforceInterface(IActivityManager.descriptor); |
| 1523 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1524 | String resolvedType = data.readString(); |
| 1525 | IBinder binder = peekService(service, resolvedType); |
| 1526 | reply.writeNoException(); |
| 1527 | reply.writeStrongBinder(binder); |
| 1528 | return true; |
| 1529 | } |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1530 | |
| 1531 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1532 | data.enforceInterface(IActivityManager.descriptor); |
| 1533 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1534 | int backupRestoreMode = data.readInt(); |
| 1535 | boolean success = bindBackupAgent(info, backupRestoreMode); |
| 1536 | reply.writeNoException(); |
| 1537 | reply.writeInt(success ? 1 : 0); |
| 1538 | return true; |
| 1539 | } |
| 1540 | |
| 1541 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1542 | data.enforceInterface(IActivityManager.descriptor); |
| 1543 | String packageName = data.readString(); |
| 1544 | IBinder agent = data.readStrongBinder(); |
| 1545 | backupAgentCreated(packageName, agent); |
| 1546 | reply.writeNoException(); |
| 1547 | return true; |
| 1548 | } |
| 1549 | |
| 1550 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1551 | data.enforceInterface(IActivityManager.descriptor); |
| 1552 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1553 | unbindBackupAgent(info); |
| 1554 | reply.writeNoException(); |
| 1555 | return true; |
| 1556 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1557 | |
| 1558 | case ADD_PACKAGE_DEPENDENCY_TRANSACTION: { |
| 1559 | data.enforceInterface(IActivityManager.descriptor); |
| 1560 | String packageName = data.readString(); |
| 1561 | addPackageDependency(packageName); |
| 1562 | reply.writeNoException(); |
| 1563 | return true; |
| 1564 | } |
| 1565 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1566 | case KILL_APPLICATION_WITH_APPID_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1567 | data.enforceInterface(IActivityManager.descriptor); |
| 1568 | String pkg = data.readString(); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1569 | int appid = data.readInt(); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 1570 | String reason = data.readString(); |
| 1571 | killApplicationWithAppId(pkg, appid, reason); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1572 | reply.writeNoException(); |
| 1573 | return true; |
| 1574 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1575 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1576 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1577 | data.enforceInterface(IActivityManager.descriptor); |
| 1578 | String reason = data.readString(); |
| 1579 | closeSystemDialogs(reason); |
| 1580 | reply.writeNoException(); |
| 1581 | return true; |
| 1582 | } |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1583 | |
| 1584 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1585 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1586 | int[] pids = data.createIntArray(); |
| 1587 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1588 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1589 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1590 | return true; |
| 1591 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1592 | |
| 1593 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1594 | data.enforceInterface(IActivityManager.descriptor); |
| 1595 | String processName = data.readString(); |
| 1596 | int uid = data.readInt(); |
| 1597 | killApplicationProcess(processName, uid); |
| 1598 | reply.writeNoException(); |
| 1599 | return true; |
| 1600 | } |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1601 | |
| 1602 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1603 | data.enforceInterface(IActivityManager.descriptor); |
| 1604 | IBinder token = data.readStrongBinder(); |
| 1605 | String packageName = data.readString(); |
| 1606 | int enterAnim = data.readInt(); |
| 1607 | int exitAnim = data.readInt(); |
| 1608 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1609 | reply.writeNoException(); |
| 1610 | return true; |
| 1611 | } |
| 1612 | |
| 1613 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1614 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1615 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1616 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1617 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1618 | return true; |
| 1619 | } |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1620 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1621 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1622 | data.enforceInterface(IActivityManager.descriptor); |
| 1623 | final boolean monkey = (data.readInt() == 1); |
| 1624 | setUserIsMonkey(monkey); |
| 1625 | reply.writeNoException(); |
| 1626 | return true; |
| 1627 | } |
| 1628 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1629 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1630 | data.enforceInterface(IActivityManager.descriptor); |
| 1631 | finishHeavyWeightApp(); |
| 1632 | reply.writeNoException(); |
| 1633 | return true; |
| 1634 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1635 | |
| 1636 | case IS_IMMERSIVE_TRANSACTION: { |
| 1637 | data.enforceInterface(IActivityManager.descriptor); |
| 1638 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1639 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1640 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1641 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1642 | return true; |
| 1643 | } |
| 1644 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 1645 | case IS_TOP_OF_TASK_TRANSACTION: { |
| 1646 | data.enforceInterface(IActivityManager.descriptor); |
| 1647 | IBinder token = data.readStrongBinder(); |
| 1648 | final boolean isTopOfTask = isTopOfTask(token); |
| 1649 | reply.writeNoException(); |
| 1650 | reply.writeInt(isTopOfTask ? 1 : 0); |
| 1651 | return true; |
| 1652 | } |
| 1653 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1654 | case CONVERT_FROM_TRANSLUCENT_TRANSACTION: { |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1655 | data.enforceInterface(IActivityManager.descriptor); |
| 1656 | IBinder token = data.readStrongBinder(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1657 | boolean converted = convertFromTranslucent(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1658 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1659 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1660 | return true; |
| 1661 | } |
| 1662 | |
| 1663 | case CONVERT_TO_TRANSLUCENT_TRANSACTION: { |
| 1664 | data.enforceInterface(IActivityManager.descriptor); |
| 1665 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1666 | final Bundle bundle; |
| 1667 | if (data.readInt() == 0) { |
| 1668 | bundle = null; |
| 1669 | } else { |
| 1670 | bundle = data.readBundle(); |
| 1671 | } |
| 1672 | final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle); |
| 1673 | boolean converted = convertToTranslucent(token, options); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1674 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1675 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1676 | return true; |
| 1677 | } |
| 1678 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1679 | case GET_ACTIVITY_OPTIONS_TRANSACTION: { |
| 1680 | data.enforceInterface(IActivityManager.descriptor); |
| 1681 | IBinder token = data.readStrongBinder(); |
| 1682 | final ActivityOptions options = getActivityOptions(token); |
| 1683 | reply.writeNoException(); |
| 1684 | reply.writeBundle(options == null ? null : options.toBundle()); |
| 1685 | return true; |
| 1686 | } |
| 1687 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1688 | case SET_IMMERSIVE_TRANSACTION: { |
| 1689 | data.enforceInterface(IActivityManager.descriptor); |
| 1690 | IBinder token = data.readStrongBinder(); |
| 1691 | boolean imm = data.readInt() == 1; |
| 1692 | setImmersive(token, imm); |
| 1693 | reply.writeNoException(); |
| 1694 | return true; |
| 1695 | } |
| 1696 | |
| 1697 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1698 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1699 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1700 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1701 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1702 | return true; |
| 1703 | } |
| 1704 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1705 | case CRASH_APPLICATION_TRANSACTION: { |
| 1706 | data.enforceInterface(IActivityManager.descriptor); |
| 1707 | int uid = data.readInt(); |
| 1708 | int initialPid = data.readInt(); |
| 1709 | String packageName = data.readString(); |
| 1710 | String message = data.readString(); |
| 1711 | crashApplication(uid, initialPid, packageName, message); |
| 1712 | reply.writeNoException(); |
| 1713 | return true; |
| 1714 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1715 | |
| 1716 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1717 | data.enforceInterface(IActivityManager.descriptor); |
| 1718 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1719 | int userId = data.readInt(); |
| 1720 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1721 | reply.writeNoException(); |
| 1722 | reply.writeString(type); |
| 1723 | return true; |
| 1724 | } |
| 1725 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1726 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1727 | data.enforceInterface(IActivityManager.descriptor); |
| 1728 | String name = data.readString(); |
| 1729 | IBinder perm = newUriPermissionOwner(name); |
| 1730 | reply.writeNoException(); |
| 1731 | reply.writeStrongBinder(perm); |
| 1732 | return true; |
| 1733 | } |
| 1734 | |
| 1735 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1736 | data.enforceInterface(IActivityManager.descriptor); |
| 1737 | IBinder owner = data.readStrongBinder(); |
| 1738 | int fromUid = data.readInt(); |
| 1739 | String targetPkg = data.readString(); |
| 1740 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1741 | int mode = data.readInt(); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 1742 | int sourceUserId = data.readInt(); |
| 1743 | int targetUserId = data.readInt(); |
| 1744 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId, |
| 1745 | targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1746 | reply.writeNoException(); |
| 1747 | return true; |
| 1748 | } |
| 1749 | |
| 1750 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1751 | data.enforceInterface(IActivityManager.descriptor); |
| 1752 | IBinder owner = data.readStrongBinder(); |
| 1753 | Uri uri = null; |
| 1754 | if (data.readInt() != 0) { |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1755 | uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1756 | } |
| 1757 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1758 | int userId = data.readInt(); |
| 1759 | revokeUriPermissionFromOwner(owner, uri, mode, userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1760 | reply.writeNoException(); |
| 1761 | return true; |
| 1762 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1763 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1764 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 1765 | data.enforceInterface(IActivityManager.descriptor); |
| 1766 | int callingUid = data.readInt(); |
| 1767 | String targetPkg = data.readString(); |
| 1768 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1769 | int modeFlags = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1770 | int userId = data.readInt(); |
| 1771 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1772 | reply.writeNoException(); |
| 1773 | reply.writeInt(res); |
| 1774 | return true; |
| 1775 | } |
| 1776 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1777 | case DUMP_HEAP_TRANSACTION: { |
| 1778 | data.enforceInterface(IActivityManager.descriptor); |
| 1779 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 1780 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1781 | boolean managed = data.readInt() != 0; |
| 1782 | String path = data.readString(); |
| 1783 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 1784 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1785 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1786 | reply.writeNoException(); |
| 1787 | reply.writeInt(res ? 1 : 0); |
| 1788 | return true; |
| 1789 | } |
| 1790 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1791 | case START_ACTIVITIES_TRANSACTION: |
| 1792 | { |
| 1793 | data.enforceInterface(IActivityManager.descriptor); |
| 1794 | IBinder b = data.readStrongBinder(); |
| 1795 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1796 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1797 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 1798 | String[] resolvedTypes = data.createStringArray(); |
| 1799 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 1800 | Bundle options = data.readInt() != 0 |
| 1801 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 1802 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1803 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 1804 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1805 | reply.writeNoException(); |
| 1806 | reply.writeInt(result); |
| 1807 | return true; |
| 1808 | } |
| 1809 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 1810 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1811 | { |
| 1812 | data.enforceInterface(IActivityManager.descriptor); |
| 1813 | int mode = getFrontActivityScreenCompatMode(); |
| 1814 | reply.writeNoException(); |
| 1815 | reply.writeInt(mode); |
| 1816 | return true; |
| 1817 | } |
| 1818 | |
| 1819 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1820 | { |
| 1821 | data.enforceInterface(IActivityManager.descriptor); |
| 1822 | int mode = data.readInt(); |
| 1823 | setFrontActivityScreenCompatMode(mode); |
| 1824 | reply.writeNoException(); |
| 1825 | reply.writeInt(mode); |
| 1826 | return true; |
| 1827 | } |
| 1828 | |
| 1829 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1830 | { |
| 1831 | data.enforceInterface(IActivityManager.descriptor); |
| 1832 | String pkg = data.readString(); |
| 1833 | int mode = getPackageScreenCompatMode(pkg); |
| 1834 | reply.writeNoException(); |
| 1835 | reply.writeInt(mode); |
| 1836 | return true; |
| 1837 | } |
| 1838 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1839 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1840 | { |
| 1841 | data.enforceInterface(IActivityManager.descriptor); |
| 1842 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 1843 | int mode = data.readInt(); |
| 1844 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1845 | reply.writeNoException(); |
| 1846 | return true; |
| 1847 | } |
Dianne Hackborn | aa9d84c | 2011-05-09 19:00:59 -0700 | [diff] [blame] | 1848 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1849 | case SWITCH_USER_TRANSACTION: { |
| 1850 | data.enforceInterface(IActivityManager.descriptor); |
| 1851 | int userid = data.readInt(); |
| 1852 | boolean result = switchUser(userid); |
| 1853 | reply.writeNoException(); |
| 1854 | reply.writeInt(result ? 1 : 0); |
| 1855 | return true; |
| 1856 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 1857 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 1858 | case START_USER_IN_BACKGROUND_TRANSACTION: { |
| 1859 | data.enforceInterface(IActivityManager.descriptor); |
| 1860 | int userid = data.readInt(); |
| 1861 | boolean result = startUserInBackground(userid); |
| 1862 | reply.writeNoException(); |
| 1863 | reply.writeInt(result ? 1 : 0); |
| 1864 | return true; |
| 1865 | } |
| 1866 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 1867 | case STOP_USER_TRANSACTION: { |
| 1868 | data.enforceInterface(IActivityManager.descriptor); |
| 1869 | int userid = data.readInt(); |
| 1870 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 1871 | data.readStrongBinder()); |
| 1872 | int result = stopUser(userid, callback); |
| 1873 | reply.writeNoException(); |
| 1874 | reply.writeInt(result); |
| 1875 | return true; |
| 1876 | } |
| 1877 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 1878 | case GET_CURRENT_USER_TRANSACTION: { |
| 1879 | data.enforceInterface(IActivityManager.descriptor); |
| 1880 | UserInfo userInfo = getCurrentUser(); |
| 1881 | reply.writeNoException(); |
| 1882 | userInfo.writeToParcel(reply, 0); |
| 1883 | return true; |
| 1884 | } |
| 1885 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1886 | case IS_USER_RUNNING_TRANSACTION: { |
| 1887 | data.enforceInterface(IActivityManager.descriptor); |
| 1888 | int userid = data.readInt(); |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 1889 | boolean orStopping = data.readInt() != 0; |
| 1890 | boolean result = isUserRunning(userid, orStopping); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1891 | reply.writeNoException(); |
| 1892 | reply.writeInt(result ? 1 : 0); |
| 1893 | return true; |
| 1894 | } |
| 1895 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 1896 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 1897 | data.enforceInterface(IActivityManager.descriptor); |
| 1898 | int[] result = getRunningUserIds(); |
| 1899 | reply.writeNoException(); |
| 1900 | reply.writeIntArray(result); |
| 1901 | return true; |
| 1902 | } |
| 1903 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 1904 | case REMOVE_TASK_TRANSACTION: |
| 1905 | { |
| 1906 | data.enforceInterface(IActivityManager.descriptor); |
| 1907 | int taskId = data.readInt(); |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 1908 | boolean result = removeTask(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 1909 | reply.writeNoException(); |
| 1910 | reply.writeInt(result ? 1 : 0); |
| 1911 | return true; |
| 1912 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1913 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 1914 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 1915 | data.enforceInterface(IActivityManager.descriptor); |
| 1916 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 1917 | data.readStrongBinder()); |
| 1918 | registerProcessObserver(observer); |
| 1919 | return true; |
| 1920 | } |
| 1921 | |
| 1922 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 1923 | data.enforceInterface(IActivityManager.descriptor); |
| 1924 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 1925 | data.readStrongBinder()); |
| 1926 | unregisterProcessObserver(observer); |
| 1927 | return true; |
| 1928 | } |
| 1929 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 1930 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 1931 | { |
| 1932 | data.enforceInterface(IActivityManager.descriptor); |
| 1933 | String pkg = data.readString(); |
| 1934 | boolean ask = getPackageAskScreenCompat(pkg); |
| 1935 | reply.writeNoException(); |
| 1936 | reply.writeInt(ask ? 1 : 0); |
| 1937 | return true; |
| 1938 | } |
| 1939 | |
| 1940 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 1941 | { |
| 1942 | data.enforceInterface(IActivityManager.descriptor); |
| 1943 | String pkg = data.readString(); |
| 1944 | boolean ask = data.readInt() != 0; |
| 1945 | setPackageAskScreenCompat(pkg, ask); |
| 1946 | reply.writeNoException(); |
| 1947 | return true; |
| 1948 | } |
| 1949 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 1950 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 1951 | data.enforceInterface(IActivityManager.descriptor); |
| 1952 | IIntentSender r = IIntentSender.Stub.asInterface( |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 1953 | data.readStrongBinder()); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 1954 | boolean res = isIntentSenderTargetedToPackage(r); |
| 1955 | reply.writeNoException(); |
| 1956 | reply.writeInt(res ? 1 : 0); |
| 1957 | return true; |
| 1958 | } |
| 1959 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 1960 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 1961 | data.enforceInterface(IActivityManager.descriptor); |
| 1962 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1963 | data.readStrongBinder()); |
| 1964 | boolean res = isIntentSenderAnActivity(r); |
| 1965 | reply.writeNoException(); |
| 1966 | reply.writeInt(res ? 1 : 0); |
| 1967 | return true; |
| 1968 | } |
| 1969 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 1970 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 1971 | data.enforceInterface(IActivityManager.descriptor); |
| 1972 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1973 | data.readStrongBinder()); |
| 1974 | Intent intent = getIntentForIntentSender(r); |
| 1975 | reply.writeNoException(); |
| 1976 | if (intent != null) { |
| 1977 | reply.writeInt(1); |
| 1978 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1979 | } else { |
| 1980 | reply.writeInt(0); |
| 1981 | } |
| 1982 | return true; |
| 1983 | } |
| 1984 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 1985 | case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { |
| 1986 | data.enforceInterface(IActivityManager.descriptor); |
| 1987 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1988 | data.readStrongBinder()); |
| 1989 | String prefix = data.readString(); |
| 1990 | String tag = getTagForIntentSender(r, prefix); |
| 1991 | reply.writeNoException(); |
| 1992 | reply.writeString(tag); |
| 1993 | return true; |
| 1994 | } |
| 1995 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 1996 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 1997 | data.enforceInterface(IActivityManager.descriptor); |
| 1998 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 1999 | updatePersistentConfiguration(config); |
| 2000 | reply.writeNoException(); |
| 2001 | return true; |
| 2002 | } |
| 2003 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 2004 | case GET_PROCESS_PSS_TRANSACTION: { |
| 2005 | data.enforceInterface(IActivityManager.descriptor); |
| 2006 | int[] pids = data.createIntArray(); |
| 2007 | long[] pss = getProcessPss(pids); |
| 2008 | reply.writeNoException(); |
| 2009 | reply.writeLongArray(pss); |
| 2010 | return true; |
| 2011 | } |
| 2012 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 2013 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 2014 | data.enforceInterface(IActivityManager.descriptor); |
| 2015 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 2016 | boolean always = data.readInt() != 0; |
| 2017 | showBootMessage(msg, always); |
| 2018 | reply.writeNoException(); |
| 2019 | return true; |
| 2020 | } |
| 2021 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2022 | case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2023 | data.enforceInterface(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2024 | keyguardWaitingForActivityDrawn(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2025 | reply.writeNoException(); |
| 2026 | return true; |
| 2027 | } |
| 2028 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2029 | case SHOULD_UP_RECREATE_TASK_TRANSACTION: { |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2030 | data.enforceInterface(IActivityManager.descriptor); |
| 2031 | IBinder token = data.readStrongBinder(); |
| 2032 | String destAffinity = data.readString(); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2033 | boolean res = shouldUpRecreateTask(token, destAffinity); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2034 | reply.writeNoException(); |
| 2035 | reply.writeInt(res ? 1 : 0); |
| 2036 | return true; |
| 2037 | } |
| 2038 | |
| 2039 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 2040 | data.enforceInterface(IActivityManager.descriptor); |
| 2041 | IBinder token = data.readStrongBinder(); |
| 2042 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 2043 | int resultCode = data.readInt(); |
| 2044 | Intent resultData = null; |
| 2045 | if (data.readInt() != 0) { |
| 2046 | resultData = Intent.CREATOR.createFromParcel(data); |
| 2047 | } |
| 2048 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 2049 | reply.writeNoException(); |
| 2050 | reply.writeInt(res ? 1 : 0); |
| 2051 | return true; |
| 2052 | } |
| 2053 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 2054 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 2055 | data.enforceInterface(IActivityManager.descriptor); |
| 2056 | IBinder token = data.readStrongBinder(); |
| 2057 | int res = getLaunchedFromUid(token); |
| 2058 | reply.writeNoException(); |
| 2059 | reply.writeInt(res); |
| 2060 | return true; |
| 2061 | } |
| 2062 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2063 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 2064 | data.enforceInterface(IActivityManager.descriptor); |
| 2065 | IBinder token = data.readStrongBinder(); |
| 2066 | String res = getLaunchedFromPackage(token); |
| 2067 | reply.writeNoException(); |
| 2068 | reply.writeString(res); |
| 2069 | return true; |
| 2070 | } |
| 2071 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2072 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2073 | data.enforceInterface(IActivityManager.descriptor); |
| 2074 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2075 | data.readStrongBinder()); |
| 2076 | registerUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2077 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2078 | return true; |
| 2079 | } |
| 2080 | |
| 2081 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2082 | data.enforceInterface(IActivityManager.descriptor); |
| 2083 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2084 | data.readStrongBinder()); |
| 2085 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2086 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2087 | return true; |
| 2088 | } |
| 2089 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2090 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 2091 | data.enforceInterface(IActivityManager.descriptor); |
| 2092 | requestBugReport(); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2093 | reply.writeNoException(); |
| 2094 | return true; |
| 2095 | } |
| 2096 | |
| 2097 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 2098 | data.enforceInterface(IActivityManager.descriptor); |
| 2099 | int pid = data.readInt(); |
| 2100 | boolean aboveSystem = data.readInt() != 0; |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 2101 | String reason = data.readString(); |
| 2102 | long res = inputDispatchingTimedOut(pid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2103 | reply.writeNoException(); |
| 2104 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2105 | return true; |
| 2106 | } |
| 2107 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2108 | case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2109 | data.enforceInterface(IActivityManager.descriptor); |
| 2110 | int requestType = data.readInt(); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2111 | Bundle res = getAssistContextExtras(requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2112 | reply.writeNoException(); |
| 2113 | reply.writeBundle(res); |
| 2114 | return true; |
| 2115 | } |
| 2116 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2117 | case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2118 | data.enforceInterface(IActivityManager.descriptor); |
| 2119 | IBinder token = data.readStrongBinder(); |
| 2120 | Bundle extras = data.readBundle(); |
Adam Skory | 7140a25 | 2013-09-11 12:04:58 +0100 | [diff] [blame] | 2121 | reportAssistContextExtras(token, extras); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2122 | reply.writeNoException(); |
| 2123 | return true; |
| 2124 | } |
| 2125 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2126 | case LAUNCH_ASSIST_INTENT_TRANSACTION: { |
| 2127 | data.enforceInterface(IActivityManager.descriptor); |
| 2128 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2129 | int requestType = data.readInt(); |
| 2130 | String hint = data.readString(); |
| 2131 | int userHandle = data.readInt(); |
| 2132 | boolean res = launchAssistIntent(intent, requestType, hint, userHandle); |
| 2133 | reply.writeNoException(); |
| 2134 | reply.writeInt(res ? 1 : 0); |
| 2135 | return true; |
| 2136 | } |
| 2137 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2138 | case KILL_UID_TRANSACTION: { |
| 2139 | data.enforceInterface(IActivityManager.descriptor); |
| 2140 | int uid = data.readInt(); |
| 2141 | String reason = data.readString(); |
| 2142 | killUid(uid, reason); |
| 2143 | reply.writeNoException(); |
| 2144 | return true; |
| 2145 | } |
| 2146 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2147 | case HANG_TRANSACTION: { |
| 2148 | data.enforceInterface(IActivityManager.descriptor); |
| 2149 | IBinder who = data.readStrongBinder(); |
| 2150 | boolean allowRestart = data.readInt() != 0; |
| 2151 | hang(who, allowRestart); |
| 2152 | reply.writeNoException(); |
| 2153 | return true; |
| 2154 | } |
| 2155 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2156 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2157 | data.enforceInterface(IActivityManager.descriptor); |
| 2158 | IBinder token = data.readStrongBinder(); |
| 2159 | reportActivityFullyDrawn(token); |
| 2160 | reply.writeNoException(); |
| 2161 | return true; |
| 2162 | } |
| 2163 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2164 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2165 | data.enforceInterface(IActivityManager.descriptor); |
| 2166 | IBinder token = data.readStrongBinder(); |
| 2167 | notifyActivityDrawn(token); |
| 2168 | reply.writeNoException(); |
| 2169 | return true; |
| 2170 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2171 | |
| 2172 | case RESTART_TRANSACTION: { |
| 2173 | data.enforceInterface(IActivityManager.descriptor); |
| 2174 | restart(); |
| 2175 | reply.writeNoException(); |
| 2176 | return true; |
| 2177 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2178 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2179 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2180 | data.enforceInterface(IActivityManager.descriptor); |
| 2181 | performIdleMaintenance(); |
| 2182 | reply.writeNoException(); |
| 2183 | return true; |
| 2184 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2185 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2186 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2187 | data.enforceInterface(IActivityManager.descriptor); |
| 2188 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2189 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2190 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2191 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2192 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2193 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2194 | if (activityContainer != null) { |
| 2195 | reply.writeInt(1); |
| 2196 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2197 | } else { |
| 2198 | reply.writeInt(0); |
| 2199 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2200 | return true; |
| 2201 | } |
| 2202 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2203 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2204 | data.enforceInterface(IActivityManager.descriptor); |
| 2205 | IActivityContainer activityContainer = |
| 2206 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2207 | deleteActivityContainer(activityContainer); |
| 2208 | reply.writeNoException(); |
| 2209 | return true; |
| 2210 | } |
| 2211 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2212 | case CREATE_STACK_ON_DISPLAY: { |
| 2213 | data.enforceInterface(IActivityManager.descriptor); |
| 2214 | int displayId = data.readInt(); |
| 2215 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2216 | reply.writeNoException(); |
| 2217 | if (activityContainer != null) { |
| 2218 | reply.writeInt(1); |
| 2219 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2220 | } else { |
| 2221 | reply.writeInt(0); |
| 2222 | } |
| 2223 | return true; |
| 2224 | } |
| 2225 | |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2226 | case GET_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2227 | data.enforceInterface(IActivityManager.descriptor); |
| 2228 | IBinder activityToken = data.readStrongBinder(); |
| 2229 | IActivityContainer activityContainer = getEnclosingActivityContainer(activityToken); |
| 2230 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2231 | if (activityContainer != null) { |
| 2232 | reply.writeInt(1); |
| 2233 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2234 | } else { |
| 2235 | reply.writeInt(0); |
| 2236 | } |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2237 | return true; |
| 2238 | } |
| 2239 | |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2240 | case GET_HOME_ACTIVITY_TOKEN_TRANSACTION: { |
| 2241 | data.enforceInterface(IActivityManager.descriptor); |
| 2242 | IBinder homeActivityToken = getHomeActivityToken(); |
| 2243 | reply.writeNoException(); |
| 2244 | reply.writeStrongBinder(homeActivityToken); |
| 2245 | return true; |
| 2246 | } |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2247 | |
| 2248 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2249 | data.enforceInterface(IActivityManager.descriptor); |
| 2250 | final int taskId = data.readInt(); |
| 2251 | startLockTaskMode(taskId); |
| 2252 | reply.writeNoException(); |
| 2253 | return true; |
| 2254 | } |
| 2255 | |
| 2256 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2257 | data.enforceInterface(IActivityManager.descriptor); |
| 2258 | IBinder token = data.readStrongBinder(); |
| 2259 | startLockTaskMode(token); |
| 2260 | reply.writeNoException(); |
| 2261 | return true; |
| 2262 | } |
| 2263 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2264 | case START_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2265 | data.enforceInterface(IActivityManager.descriptor); |
| 2266 | startLockTaskModeOnCurrent(); |
| 2267 | reply.writeNoException(); |
| 2268 | return true; |
| 2269 | } |
| 2270 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2271 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2272 | data.enforceInterface(IActivityManager.descriptor); |
| 2273 | stopLockTaskMode(); |
| 2274 | reply.writeNoException(); |
| 2275 | return true; |
| 2276 | } |
| 2277 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2278 | case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2279 | data.enforceInterface(IActivityManager.descriptor); |
| 2280 | stopLockTaskModeOnCurrent(); |
| 2281 | reply.writeNoException(); |
| 2282 | return true; |
| 2283 | } |
| 2284 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2285 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2286 | data.enforceInterface(IActivityManager.descriptor); |
| 2287 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2288 | reply.writeNoException(); |
| 2289 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2290 | return true; |
| 2291 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2292 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2293 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2294 | data.enforceInterface(IActivityManager.descriptor); |
| 2295 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2296 | ActivityManager.TaskDescription values = |
| 2297 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2298 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2299 | reply.writeNoException(); |
| 2300 | return true; |
| 2301 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2302 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame^] | 2303 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2304 | data.enforceInterface(IActivityManager.descriptor); |
| 2305 | int taskId = data.readInt(); |
| 2306 | boolean resizeable = (data.readInt() == 1) ? true : false; |
| 2307 | setTaskResizeable(taskId, resizeable); |
| 2308 | reply.writeNoException(); |
| 2309 | return true; |
| 2310 | } |
| 2311 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2312 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2313 | data.enforceInterface(IActivityManager.descriptor); |
| 2314 | String filename = data.readString(); |
| 2315 | Bitmap icon = getTaskDescriptionIcon(filename); |
| 2316 | reply.writeNoException(); |
| 2317 | if (icon == null) { |
| 2318 | reply.writeInt(0); |
| 2319 | } else { |
| 2320 | reply.writeInt(1); |
| 2321 | icon.writeToParcel(reply, 0); |
| 2322 | } |
| 2323 | return true; |
| 2324 | } |
| 2325 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2326 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2327 | data.enforceInterface(IActivityManager.descriptor); |
| 2328 | final Bundle bundle; |
| 2329 | if (data.readInt() == 0) { |
| 2330 | bundle = null; |
| 2331 | } else { |
| 2332 | bundle = data.readBundle(); |
| 2333 | } |
| 2334 | final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle); |
| 2335 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2336 | reply.writeNoException(); |
| 2337 | return true; |
| 2338 | } |
| 2339 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2340 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2341 | data.enforceInterface(IActivityManager.descriptor); |
| 2342 | IBinder token = data.readStrongBinder(); |
| 2343 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2344 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2345 | reply.writeNoException(); |
| 2346 | reply.writeInt(success ? 1 : 0); |
| 2347 | return true; |
| 2348 | } |
| 2349 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2350 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2351 | data.enforceInterface(IActivityManager.descriptor); |
| 2352 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2353 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2354 | reply.writeNoException(); |
| 2355 | reply.writeInt(enabled ? 1 : 0); |
| 2356 | return true; |
| 2357 | } |
| 2358 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2359 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2360 | data.enforceInterface(IActivityManager.descriptor); |
| 2361 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2362 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2363 | reply.writeNoException(); |
| 2364 | return true; |
| 2365 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2366 | |
| 2367 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2368 | data.enforceInterface(IActivityManager.descriptor); |
| 2369 | IBinder token = data.readStrongBinder(); |
| 2370 | notifyLaunchTaskBehindComplete(token); |
| 2371 | reply.writeNoException(); |
| 2372 | return true; |
| 2373 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2374 | |
| 2375 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2376 | data.enforceInterface(IActivityManager.descriptor); |
| 2377 | IBinder token = data.readStrongBinder(); |
| 2378 | notifyEnterAnimationComplete(token); |
| 2379 | reply.writeNoException(); |
| 2380 | return true; |
| 2381 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2382 | |
| 2383 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2384 | data.enforceInterface(IActivityManager.descriptor); |
| 2385 | bootAnimationComplete(); |
| 2386 | reply.writeNoException(); |
| 2387 | return true; |
| 2388 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2389 | |
| 2390 | case SYSTEM_BACKUP_RESTORED: { |
| 2391 | data.enforceInterface(IActivityManager.descriptor); |
| 2392 | systemBackupRestored(); |
| 2393 | reply.writeNoException(); |
| 2394 | return true; |
| 2395 | } |
Jeff Sharkey | c2ae6fb | 2015-01-15 21:27:13 -0800 | [diff] [blame] | 2396 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2397 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2398 | data.enforceInterface(IActivityManager.descriptor); |
| 2399 | final int uid = data.readInt(); |
| 2400 | final byte[] firstPacket = data.createByteArray(); |
| 2401 | notifyCleartextNetwork(uid, firstPacket); |
| 2402 | reply.writeNoException(); |
| 2403 | return true; |
| 2404 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2405 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2406 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2407 | return super.onTransact(code, data, reply, flags); |
| 2408 | } |
| 2409 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2410 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2411 | return this; |
| 2412 | } |
| 2413 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2414 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2415 | protected IActivityManager create() { |
| 2416 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2417 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2418 | Log.v("ActivityManager", "default service binder = " + b); |
| 2419 | } |
| 2420 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2421 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2422 | Log.v("ActivityManager", "default service = " + am); |
| 2423 | } |
| 2424 | return am; |
| 2425 | } |
| 2426 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2427 | } |
| 2428 | |
| 2429 | class ActivityManagerProxy implements IActivityManager |
| 2430 | { |
| 2431 | public ActivityManagerProxy(IBinder remote) |
| 2432 | { |
| 2433 | mRemote = remote; |
| 2434 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2435 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2436 | public IBinder asBinder() |
| 2437 | { |
| 2438 | return mRemote; |
| 2439 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2440 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2441 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2442 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2443 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2444 | Parcel data = Parcel.obtain(); |
| 2445 | Parcel reply = Parcel.obtain(); |
| 2446 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2447 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2448 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2449 | intent.writeToParcel(data, 0); |
| 2450 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2451 | data.writeStrongBinder(resultTo); |
| 2452 | data.writeString(resultWho); |
| 2453 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2454 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2455 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2456 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2457 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2458 | } else { |
| 2459 | data.writeInt(0); |
| 2460 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2461 | if (options != null) { |
| 2462 | data.writeInt(1); |
| 2463 | options.writeToParcel(data, 0); |
| 2464 | } else { |
| 2465 | data.writeInt(0); |
| 2466 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2467 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2468 | reply.readException(); |
| 2469 | int result = reply.readInt(); |
| 2470 | reply.recycle(); |
| 2471 | data.recycle(); |
| 2472 | return result; |
| 2473 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2474 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2475 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2476 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2477 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2478 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2479 | Parcel data = Parcel.obtain(); |
| 2480 | Parcel reply = Parcel.obtain(); |
| 2481 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2482 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2483 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2484 | intent.writeToParcel(data, 0); |
| 2485 | data.writeString(resolvedType); |
| 2486 | data.writeStrongBinder(resultTo); |
| 2487 | data.writeString(resultWho); |
| 2488 | data.writeInt(requestCode); |
| 2489 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2490 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2491 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2492 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2493 | } else { |
| 2494 | data.writeInt(0); |
| 2495 | } |
| 2496 | if (options != null) { |
| 2497 | data.writeInt(1); |
| 2498 | options.writeToParcel(data, 0); |
| 2499 | } else { |
| 2500 | data.writeInt(0); |
| 2501 | } |
| 2502 | data.writeInt(userId); |
| 2503 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 2504 | reply.readException(); |
| 2505 | int result = reply.readInt(); |
| 2506 | reply.recycle(); |
| 2507 | data.recycle(); |
| 2508 | return result; |
| 2509 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2510 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 2511 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 2512 | int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2513 | Parcel data = Parcel.obtain(); |
| 2514 | Parcel reply = Parcel.obtain(); |
| 2515 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2516 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2517 | data.writeString(callingPackage); |
| 2518 | intent.writeToParcel(data, 0); |
| 2519 | data.writeString(resolvedType); |
| 2520 | data.writeStrongBinder(resultTo); |
| 2521 | data.writeString(resultWho); |
| 2522 | data.writeInt(requestCode); |
| 2523 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2524 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2525 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2526 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2527 | } else { |
| 2528 | data.writeInt(0); |
| 2529 | } |
| 2530 | if (options != null) { |
| 2531 | data.writeInt(1); |
| 2532 | options.writeToParcel(data, 0); |
| 2533 | } else { |
| 2534 | data.writeInt(0); |
| 2535 | } |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 2536 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2537 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 2538 | reply.readException(); |
| 2539 | int result = reply.readInt(); |
| 2540 | reply.recycle(); |
| 2541 | data.recycle(); |
| 2542 | return result; |
| 2543 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2544 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 2545 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2546 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2547 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2548 | Parcel data = Parcel.obtain(); |
| 2549 | Parcel reply = Parcel.obtain(); |
| 2550 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2551 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2552 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2553 | intent.writeToParcel(data, 0); |
| 2554 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2555 | data.writeStrongBinder(resultTo); |
| 2556 | data.writeString(resultWho); |
| 2557 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2558 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2559 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2560 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2561 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2562 | } else { |
| 2563 | data.writeInt(0); |
| 2564 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2565 | if (options != null) { |
| 2566 | data.writeInt(1); |
| 2567 | options.writeToParcel(data, 0); |
| 2568 | } else { |
| 2569 | data.writeInt(0); |
| 2570 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2571 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2572 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 2573 | reply.readException(); |
| 2574 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 2575 | reply.recycle(); |
| 2576 | data.recycle(); |
| 2577 | return result; |
| 2578 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2579 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 2580 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2581 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2582 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2583 | Parcel data = Parcel.obtain(); |
| 2584 | Parcel reply = Parcel.obtain(); |
| 2585 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2586 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2587 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2588 | intent.writeToParcel(data, 0); |
| 2589 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2590 | data.writeStrongBinder(resultTo); |
| 2591 | data.writeString(resultWho); |
| 2592 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2593 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2594 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2595 | if (options != null) { |
| 2596 | data.writeInt(1); |
| 2597 | options.writeToParcel(data, 0); |
| 2598 | } else { |
| 2599 | data.writeInt(0); |
| 2600 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2601 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2602 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2603 | reply.readException(); |
| 2604 | int result = reply.readInt(); |
| 2605 | reply.recycle(); |
| 2606 | data.recycle(); |
| 2607 | return result; |
| 2608 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2609 | public int startActivityIntentSender(IApplicationThread caller, |
| 2610 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2611 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2612 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2613 | Parcel data = Parcel.obtain(); |
| 2614 | Parcel reply = Parcel.obtain(); |
| 2615 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2616 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2617 | intent.writeToParcel(data, 0); |
| 2618 | if (fillInIntent != null) { |
| 2619 | data.writeInt(1); |
| 2620 | fillInIntent.writeToParcel(data, 0); |
| 2621 | } else { |
| 2622 | data.writeInt(0); |
| 2623 | } |
| 2624 | data.writeString(resolvedType); |
| 2625 | data.writeStrongBinder(resultTo); |
| 2626 | data.writeString(resultWho); |
| 2627 | data.writeInt(requestCode); |
| 2628 | data.writeInt(flagsMask); |
| 2629 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2630 | if (options != null) { |
| 2631 | data.writeInt(1); |
| 2632 | options.writeToParcel(data, 0); |
| 2633 | } else { |
| 2634 | data.writeInt(0); |
| 2635 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2636 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2637 | reply.readException(); |
| 2638 | int result = reply.readInt(); |
| 2639 | reply.recycle(); |
| 2640 | data.recycle(); |
| 2641 | return result; |
| 2642 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2643 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 2644 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2645 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 2646 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2647 | Parcel data = Parcel.obtain(); |
| 2648 | Parcel reply = Parcel.obtain(); |
| 2649 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2650 | data.writeString(callingPackage); |
| 2651 | data.writeInt(callingPid); |
| 2652 | data.writeInt(callingUid); |
| 2653 | intent.writeToParcel(data, 0); |
| 2654 | data.writeString(resolvedType); |
| 2655 | data.writeStrongBinder(session.asBinder()); |
| 2656 | data.writeStrongBinder(interactor.asBinder()); |
| 2657 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2658 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2659 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2660 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2661 | } else { |
| 2662 | data.writeInt(0); |
| 2663 | } |
| 2664 | if (options != null) { |
| 2665 | data.writeInt(1); |
| 2666 | options.writeToParcel(data, 0); |
| 2667 | } else { |
| 2668 | data.writeInt(0); |
| 2669 | } |
| 2670 | data.writeInt(userId); |
| 2671 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2672 | reply.readException(); |
| 2673 | int result = reply.readInt(); |
| 2674 | reply.recycle(); |
| 2675 | data.recycle(); |
| 2676 | return result; |
| 2677 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2678 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2679 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2680 | Parcel data = Parcel.obtain(); |
| 2681 | Parcel reply = Parcel.obtain(); |
| 2682 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2683 | data.writeStrongBinder(callingActivity); |
| 2684 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2685 | if (options != null) { |
| 2686 | data.writeInt(1); |
| 2687 | options.writeToParcel(data, 0); |
| 2688 | } else { |
| 2689 | data.writeInt(0); |
| 2690 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2691 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2692 | reply.readException(); |
| 2693 | int result = reply.readInt(); |
| 2694 | reply.recycle(); |
| 2695 | data.recycle(); |
| 2696 | return result != 0; |
| 2697 | } |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 2698 | public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException { |
| 2699 | Parcel data = Parcel.obtain(); |
| 2700 | Parcel reply = Parcel.obtain(); |
| 2701 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2702 | data.writeInt(taskId); |
| 2703 | if (options == null) { |
| 2704 | data.writeInt(0); |
| 2705 | } else { |
| 2706 | data.writeInt(1); |
| 2707 | options.writeToParcel(data, 0); |
| 2708 | } |
| 2709 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 2710 | reply.readException(); |
| 2711 | int result = reply.readInt(); |
| 2712 | reply.recycle(); |
| 2713 | data.recycle(); |
| 2714 | return result; |
| 2715 | } |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 2716 | public boolean finishActivity(IBinder token, int resultCode, Intent resultData, boolean finishTask) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2717 | throws RemoteException { |
| 2718 | Parcel data = Parcel.obtain(); |
| 2719 | Parcel reply = Parcel.obtain(); |
| 2720 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2721 | data.writeStrongBinder(token); |
| 2722 | data.writeInt(resultCode); |
| 2723 | if (resultData != null) { |
| 2724 | data.writeInt(1); |
| 2725 | resultData.writeToParcel(data, 0); |
| 2726 | } else { |
| 2727 | data.writeInt(0); |
| 2728 | } |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 2729 | data.writeInt(finishTask ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2730 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2731 | reply.readException(); |
| 2732 | boolean res = reply.readInt() != 0; |
| 2733 | data.recycle(); |
| 2734 | reply.recycle(); |
| 2735 | return res; |
| 2736 | } |
| 2737 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 2738 | { |
| 2739 | Parcel data = Parcel.obtain(); |
| 2740 | Parcel reply = Parcel.obtain(); |
| 2741 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2742 | data.writeStrongBinder(token); |
| 2743 | data.writeString(resultWho); |
| 2744 | data.writeInt(requestCode); |
| 2745 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2746 | reply.readException(); |
| 2747 | data.recycle(); |
| 2748 | reply.recycle(); |
| 2749 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 2750 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 2751 | Parcel data = Parcel.obtain(); |
| 2752 | Parcel reply = Parcel.obtain(); |
| 2753 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2754 | data.writeStrongBinder(token); |
| 2755 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 2756 | reply.readException(); |
| 2757 | boolean res = reply.readInt() != 0; |
| 2758 | data.recycle(); |
| 2759 | reply.recycle(); |
| 2760 | return res; |
| 2761 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 2762 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 2763 | Parcel data = Parcel.obtain(); |
| 2764 | Parcel reply = Parcel.obtain(); |
| 2765 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2766 | data.writeStrongBinder(session.asBinder()); |
| 2767 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 2768 | reply.readException(); |
| 2769 | data.recycle(); |
| 2770 | reply.recycle(); |
| 2771 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 2772 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 2773 | Parcel data = Parcel.obtain(); |
| 2774 | Parcel reply = Parcel.obtain(); |
| 2775 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2776 | data.writeStrongBinder(token); |
| 2777 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 2778 | reply.readException(); |
| 2779 | boolean res = reply.readInt() != 0; |
| 2780 | data.recycle(); |
| 2781 | reply.recycle(); |
| 2782 | return res; |
| 2783 | } |
| 2784 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 2785 | Parcel data = Parcel.obtain(); |
| 2786 | Parcel reply = Parcel.obtain(); |
| 2787 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2788 | data.writeStrongBinder(app.asBinder()); |
| 2789 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 2790 | reply.readException(); |
| 2791 | data.recycle(); |
| 2792 | reply.recycle(); |
| 2793 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 2794 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 2795 | Parcel data = Parcel.obtain(); |
| 2796 | Parcel reply = Parcel.obtain(); |
| 2797 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2798 | data.writeStrongBinder(token); |
| 2799 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 2800 | reply.readException(); |
| 2801 | boolean res = reply.readInt() != 0; |
| 2802 | data.recycle(); |
| 2803 | reply.recycle(); |
| 2804 | return res; |
| 2805 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2806 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2807 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 2808 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2809 | { |
| 2810 | Parcel data = Parcel.obtain(); |
| 2811 | Parcel reply = Parcel.obtain(); |
| 2812 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2813 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2814 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2815 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 2816 | filter.writeToParcel(data, 0); |
| 2817 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 2818 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2819 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 2820 | reply.readException(); |
| 2821 | Intent intent = null; |
| 2822 | int haveIntent = reply.readInt(); |
| 2823 | if (haveIntent != 0) { |
| 2824 | intent = Intent.CREATOR.createFromParcel(reply); |
| 2825 | } |
| 2826 | reply.recycle(); |
| 2827 | data.recycle(); |
| 2828 | return intent; |
| 2829 | } |
| 2830 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 2831 | { |
| 2832 | Parcel data = Parcel.obtain(); |
| 2833 | Parcel reply = Parcel.obtain(); |
| 2834 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2835 | data.writeStrongBinder(receiver.asBinder()); |
| 2836 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 2837 | reply.readException(); |
| 2838 | data.recycle(); |
| 2839 | reply.recycle(); |
| 2840 | } |
| 2841 | public int broadcastIntent(IApplicationThread caller, |
| 2842 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
| 2843 | int resultCode, String resultData, Bundle map, |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 2844 | String requiredPermission, int appOp, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2845 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2846 | { |
| 2847 | Parcel data = Parcel.obtain(); |
| 2848 | Parcel reply = Parcel.obtain(); |
| 2849 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2850 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2851 | intent.writeToParcel(data, 0); |
| 2852 | data.writeString(resolvedType); |
| 2853 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 2854 | data.writeInt(resultCode); |
| 2855 | data.writeString(resultData); |
| 2856 | data.writeBundle(map); |
| 2857 | data.writeString(requiredPermission); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 2858 | data.writeInt(appOp); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2859 | data.writeInt(serialized ? 1 : 0); |
| 2860 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2861 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2862 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 2863 | reply.readException(); |
| 2864 | int res = reply.readInt(); |
| 2865 | reply.recycle(); |
| 2866 | data.recycle(); |
| 2867 | return res; |
| 2868 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2869 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 2870 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2871 | { |
| 2872 | Parcel data = Parcel.obtain(); |
| 2873 | Parcel reply = Parcel.obtain(); |
| 2874 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2875 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2876 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2877 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2878 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 2879 | reply.readException(); |
| 2880 | data.recycle(); |
| 2881 | reply.recycle(); |
| 2882 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 2883 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 2884 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2885 | { |
| 2886 | Parcel data = Parcel.obtain(); |
| 2887 | Parcel reply = Parcel.obtain(); |
| 2888 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2889 | data.writeStrongBinder(who); |
| 2890 | data.writeInt(resultCode); |
| 2891 | data.writeString(resultData); |
| 2892 | data.writeBundle(map); |
| 2893 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 2894 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2895 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2896 | reply.readException(); |
| 2897 | data.recycle(); |
| 2898 | reply.recycle(); |
| 2899 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2900 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 2901 | { |
| 2902 | Parcel data = Parcel.obtain(); |
| 2903 | Parcel reply = Parcel.obtain(); |
| 2904 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2905 | data.writeStrongBinder(app.asBinder()); |
| 2906 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 2907 | reply.readException(); |
| 2908 | data.recycle(); |
| 2909 | reply.recycle(); |
| 2910 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2911 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 2912 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2913 | { |
| 2914 | Parcel data = Parcel.obtain(); |
| 2915 | Parcel reply = Parcel.obtain(); |
| 2916 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2917 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 2918 | if (config != null) { |
| 2919 | data.writeInt(1); |
| 2920 | config.writeToParcel(data, 0); |
| 2921 | } else { |
| 2922 | data.writeInt(0); |
| 2923 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2924 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2925 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2926 | reply.readException(); |
| 2927 | data.recycle(); |
| 2928 | reply.recycle(); |
| 2929 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 2930 | public void activityResumed(IBinder token) throws RemoteException |
| 2931 | { |
| 2932 | Parcel data = Parcel.obtain(); |
| 2933 | Parcel reply = Parcel.obtain(); |
| 2934 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2935 | data.writeStrongBinder(token); |
| 2936 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 2937 | reply.readException(); |
| 2938 | data.recycle(); |
| 2939 | reply.recycle(); |
| 2940 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 2941 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 2942 | { |
| 2943 | Parcel data = Parcel.obtain(); |
| 2944 | Parcel reply = Parcel.obtain(); |
| 2945 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2946 | data.writeStrongBinder(token); |
| 2947 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 2948 | reply.readException(); |
| 2949 | data.recycle(); |
| 2950 | reply.recycle(); |
| 2951 | } |
| 2952 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 2953 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2954 | { |
| 2955 | Parcel data = Parcel.obtain(); |
| 2956 | Parcel reply = Parcel.obtain(); |
| 2957 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2958 | data.writeStrongBinder(token); |
| 2959 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 2960 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2961 | TextUtils.writeToParcel(description, data, 0); |
| 2962 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2963 | reply.readException(); |
| 2964 | data.recycle(); |
| 2965 | reply.recycle(); |
| 2966 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 2967 | public void activitySlept(IBinder token) throws RemoteException |
| 2968 | { |
| 2969 | Parcel data = Parcel.obtain(); |
| 2970 | Parcel reply = Parcel.obtain(); |
| 2971 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2972 | data.writeStrongBinder(token); |
| 2973 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2974 | reply.readException(); |
| 2975 | data.recycle(); |
| 2976 | reply.recycle(); |
| 2977 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2978 | public void activityDestroyed(IBinder token) throws RemoteException |
| 2979 | { |
| 2980 | Parcel data = Parcel.obtain(); |
| 2981 | Parcel reply = Parcel.obtain(); |
| 2982 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2983 | data.writeStrongBinder(token); |
| 2984 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2985 | reply.readException(); |
| 2986 | data.recycle(); |
| 2987 | reply.recycle(); |
| 2988 | } |
| 2989 | public String getCallingPackage(IBinder token) throws RemoteException |
| 2990 | { |
| 2991 | Parcel data = Parcel.obtain(); |
| 2992 | Parcel reply = Parcel.obtain(); |
| 2993 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2994 | data.writeStrongBinder(token); |
| 2995 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 2996 | reply.readException(); |
| 2997 | String res = reply.readString(); |
| 2998 | data.recycle(); |
| 2999 | reply.recycle(); |
| 3000 | return res; |
| 3001 | } |
| 3002 | public ComponentName getCallingActivity(IBinder token) |
| 3003 | throws RemoteException { |
| 3004 | Parcel data = Parcel.obtain(); |
| 3005 | Parcel reply = Parcel.obtain(); |
| 3006 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3007 | data.writeStrongBinder(token); |
| 3008 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3009 | reply.readException(); |
| 3010 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3011 | data.recycle(); |
| 3012 | reply.recycle(); |
| 3013 | return res; |
| 3014 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3015 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3016 | Parcel data = Parcel.obtain(); |
| 3017 | Parcel reply = Parcel.obtain(); |
| 3018 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3019 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3020 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3021 | reply.readException(); |
| 3022 | ArrayList<IAppTask> list = null; |
| 3023 | int N = reply.readInt(); |
| 3024 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3025 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3026 | while (N > 0) { |
| 3027 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3028 | list.add(task); |
| 3029 | N--; |
| 3030 | } |
| 3031 | } |
| 3032 | data.recycle(); |
| 3033 | reply.recycle(); |
| 3034 | return list; |
| 3035 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3036 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3037 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3038 | Parcel data = Parcel.obtain(); |
| 3039 | Parcel reply = Parcel.obtain(); |
| 3040 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3041 | data.writeStrongBinder(activityToken); |
| 3042 | intent.writeToParcel(data, 0); |
| 3043 | description.writeToParcel(data, 0); |
| 3044 | thumbnail.writeToParcel(data, 0); |
| 3045 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3046 | reply.readException(); |
| 3047 | int res = reply.readInt(); |
| 3048 | data.recycle(); |
| 3049 | reply.recycle(); |
| 3050 | return res; |
| 3051 | } |
| 3052 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3053 | Parcel data = Parcel.obtain(); |
| 3054 | Parcel reply = Parcel.obtain(); |
| 3055 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3056 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3057 | reply.readException(); |
| 3058 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3059 | data.recycle(); |
| 3060 | reply.recycle(); |
| 3061 | return size; |
| 3062 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3063 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3064 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3065 | Parcel data = Parcel.obtain(); |
| 3066 | Parcel reply = Parcel.obtain(); |
| 3067 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3068 | data.writeInt(maxNum); |
| 3069 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3070 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3071 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3072 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3073 | int N = reply.readInt(); |
| 3074 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3075 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3076 | while (N > 0) { |
| 3077 | ActivityManager.RunningTaskInfo info = |
| 3078 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3079 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3080 | list.add(info); |
| 3081 | N--; |
| 3082 | } |
| 3083 | } |
| 3084 | data.recycle(); |
| 3085 | reply.recycle(); |
| 3086 | return list; |
| 3087 | } |
| 3088 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3089 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3090 | Parcel data = Parcel.obtain(); |
| 3091 | Parcel reply = Parcel.obtain(); |
| 3092 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3093 | data.writeInt(maxNum); |
| 3094 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3095 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3096 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3097 | reply.readException(); |
| 3098 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3099 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3100 | data.recycle(); |
| 3101 | reply.recycle(); |
| 3102 | return list; |
| 3103 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3104 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3105 | Parcel data = Parcel.obtain(); |
| 3106 | Parcel reply = Parcel.obtain(); |
| 3107 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3108 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3109 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3110 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3111 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3112 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3113 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3114 | } |
| 3115 | data.recycle(); |
| 3116 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3117 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3118 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3119 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3120 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3121 | Parcel data = Parcel.obtain(); |
| 3122 | Parcel reply = Parcel.obtain(); |
| 3123 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3124 | data.writeInt(maxNum); |
| 3125 | data.writeInt(flags); |
| 3126 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3127 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3128 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3129 | int N = reply.readInt(); |
| 3130 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3131 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3132 | while (N > 0) { |
| 3133 | ActivityManager.RunningServiceInfo info = |
| 3134 | ActivityManager.RunningServiceInfo.CREATOR |
| 3135 | .createFromParcel(reply); |
| 3136 | list.add(info); |
| 3137 | N--; |
| 3138 | } |
| 3139 | } |
| 3140 | data.recycle(); |
| 3141 | reply.recycle(); |
| 3142 | return list; |
| 3143 | } |
| 3144 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3145 | throws RemoteException { |
| 3146 | Parcel data = Parcel.obtain(); |
| 3147 | Parcel reply = Parcel.obtain(); |
| 3148 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3149 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3150 | reply.readException(); |
| 3151 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3152 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3153 | data.recycle(); |
| 3154 | reply.recycle(); |
| 3155 | return list; |
| 3156 | } |
| 3157 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3158 | throws RemoteException { |
| 3159 | Parcel data = Parcel.obtain(); |
| 3160 | Parcel reply = Parcel.obtain(); |
| 3161 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3162 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3163 | reply.readException(); |
| 3164 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3165 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3166 | data.recycle(); |
| 3167 | reply.recycle(); |
| 3168 | return list; |
| 3169 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3170 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3171 | throws RemoteException { |
| 3172 | Parcel data = Parcel.obtain(); |
| 3173 | Parcel reply = Parcel.obtain(); |
| 3174 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3175 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3176 | reply.readException(); |
| 3177 | ArrayList<ApplicationInfo> list |
| 3178 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3179 | data.recycle(); |
| 3180 | reply.recycle(); |
| 3181 | return list; |
| 3182 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3183 | public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3184 | { |
| 3185 | Parcel data = Parcel.obtain(); |
| 3186 | Parcel reply = Parcel.obtain(); |
| 3187 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3188 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3189 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3190 | if (options != null) { |
| 3191 | data.writeInt(1); |
| 3192 | options.writeToParcel(data, 0); |
| 3193 | } else { |
| 3194 | data.writeInt(0); |
| 3195 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3196 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3197 | reply.readException(); |
| 3198 | data.recycle(); |
| 3199 | reply.recycle(); |
| 3200 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3201 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3202 | throws RemoteException { |
| 3203 | Parcel data = Parcel.obtain(); |
| 3204 | Parcel reply = Parcel.obtain(); |
| 3205 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3206 | data.writeStrongBinder(token); |
| 3207 | data.writeInt(nonRoot ? 1 : 0); |
| 3208 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3209 | reply.readException(); |
| 3210 | boolean res = reply.readInt() != 0; |
| 3211 | data.recycle(); |
| 3212 | reply.recycle(); |
| 3213 | return res; |
| 3214 | } |
| 3215 | public void moveTaskBackwards(int task) throws RemoteException |
| 3216 | { |
| 3217 | Parcel data = Parcel.obtain(); |
| 3218 | Parcel reply = Parcel.obtain(); |
| 3219 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3220 | data.writeInt(task); |
| 3221 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3222 | reply.readException(); |
| 3223 | data.recycle(); |
| 3224 | reply.recycle(); |
| 3225 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3226 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3227 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3228 | { |
| 3229 | Parcel data = Parcel.obtain(); |
| 3230 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3231 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3232 | data.writeInt(taskId); |
| 3233 | data.writeInt(stackId); |
| 3234 | data.writeInt(toTop ? 1 : 0); |
| 3235 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3236 | reply.readException(); |
| 3237 | data.recycle(); |
| 3238 | reply.recycle(); |
| 3239 | } |
| 3240 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3241 | public void resizeStack(int stackBoxId, Rect r) throws RemoteException |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3242 | { |
| 3243 | Parcel data = Parcel.obtain(); |
| 3244 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3245 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | 5a44915 | 2013-05-24 15:49:29 -0700 | [diff] [blame] | 3246 | data.writeInt(stackBoxId); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3247 | r.writeToParcel(data, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3248 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3249 | reply.readException(); |
| 3250 | data.recycle(); |
| 3251 | reply.recycle(); |
| 3252 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3253 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3254 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3255 | { |
| 3256 | Parcel data = Parcel.obtain(); |
| 3257 | Parcel reply = Parcel.obtain(); |
| 3258 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3259 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3260 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3261 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3262 | data.recycle(); |
| 3263 | reply.recycle(); |
| 3264 | return list; |
| 3265 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3266 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3267 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3268 | { |
| 3269 | Parcel data = Parcel.obtain(); |
| 3270 | Parcel reply = Parcel.obtain(); |
| 3271 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3272 | data.writeInt(stackId); |
| 3273 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3274 | reply.readException(); |
| 3275 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3276 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3277 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3278 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3279 | } |
| 3280 | data.recycle(); |
| 3281 | reply.recycle(); |
| 3282 | return info; |
| 3283 | } |
| 3284 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 3285 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 3286 | Parcel data = Parcel.obtain(); |
| 3287 | Parcel reply = Parcel.obtain(); |
| 3288 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3289 | data.writeInt(taskId); |
| 3290 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 3291 | reply.readException(); |
| 3292 | boolean isInHomeStack = reply.readInt() > 0; |
| 3293 | data.recycle(); |
| 3294 | reply.recycle(); |
| 3295 | return isInHomeStack; |
| 3296 | } |
| 3297 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3298 | public void setFocusedStack(int stackId) throws RemoteException |
| 3299 | { |
| 3300 | Parcel data = Parcel.obtain(); |
| 3301 | Parcel reply = Parcel.obtain(); |
| 3302 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3303 | data.writeInt(stackId); |
| 3304 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3305 | reply.readException(); |
| 3306 | data.recycle(); |
| 3307 | reply.recycle(); |
| 3308 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3309 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 3310 | public int getFocusedStackId() throws RemoteException { |
| 3311 | Parcel data = Parcel.obtain(); |
| 3312 | Parcel reply = Parcel.obtain(); |
| 3313 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3314 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 3315 | reply.readException(); |
| 3316 | int focusedStackId = reply.readInt(); |
| 3317 | data.recycle(); |
| 3318 | reply.recycle(); |
| 3319 | return focusedStackId; |
| 3320 | } |
| 3321 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3322 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 3323 | { |
| 3324 | Parcel data = Parcel.obtain(); |
| 3325 | Parcel reply = Parcel.obtain(); |
| 3326 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3327 | data.writeStrongBinder(listener.asBinder()); |
| 3328 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3329 | reply.readException(); |
| 3330 | data.recycle(); |
| 3331 | reply.recycle(); |
| 3332 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3333 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 3334 | { |
| 3335 | Parcel data = Parcel.obtain(); |
| 3336 | Parcel reply = Parcel.obtain(); |
| 3337 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3338 | data.writeStrongBinder(token); |
| 3339 | data.writeInt(onlyRoot ? 1 : 0); |
| 3340 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3341 | reply.readException(); |
| 3342 | int res = reply.readInt(); |
| 3343 | data.recycle(); |
| 3344 | reply.recycle(); |
| 3345 | return res; |
| 3346 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3347 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3348 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3349 | Parcel data = Parcel.obtain(); |
| 3350 | Parcel reply = Parcel.obtain(); |
| 3351 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3352 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3353 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3354 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3355 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3356 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3357 | reply.readException(); |
| 3358 | int res = reply.readInt(); |
| 3359 | ContentProviderHolder cph = null; |
| 3360 | if (res != 0) { |
| 3361 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 3362 | } |
| 3363 | data.recycle(); |
| 3364 | reply.recycle(); |
| 3365 | return cph; |
| 3366 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3367 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 3368 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3369 | Parcel data = Parcel.obtain(); |
| 3370 | Parcel reply = Parcel.obtain(); |
| 3371 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3372 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3373 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3374 | data.writeStrongBinder(token); |
| 3375 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3376 | reply.readException(); |
| 3377 | int res = reply.readInt(); |
| 3378 | ContentProviderHolder cph = null; |
| 3379 | if (res != 0) { |
| 3380 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 3381 | } |
| 3382 | data.recycle(); |
| 3383 | reply.recycle(); |
| 3384 | return cph; |
| 3385 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3386 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3387 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3388 | { |
| 3389 | Parcel data = Parcel.obtain(); |
| 3390 | Parcel reply = Parcel.obtain(); |
| 3391 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3392 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3393 | data.writeTypedList(providers); |
| 3394 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 3395 | reply.readException(); |
| 3396 | data.recycle(); |
| 3397 | reply.recycle(); |
| 3398 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3399 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 3400 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3401 | Parcel data = Parcel.obtain(); |
| 3402 | Parcel reply = Parcel.obtain(); |
| 3403 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3404 | data.writeStrongBinder(connection); |
| 3405 | data.writeInt(stable); |
| 3406 | data.writeInt(unstable); |
| 3407 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3408 | reply.readException(); |
| 3409 | boolean res = reply.readInt() != 0; |
| 3410 | data.recycle(); |
| 3411 | reply.recycle(); |
| 3412 | return res; |
| 3413 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3414 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3415 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 3416 | Parcel data = Parcel.obtain(); |
| 3417 | Parcel reply = Parcel.obtain(); |
| 3418 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3419 | data.writeStrongBinder(connection); |
| 3420 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 3421 | reply.readException(); |
| 3422 | data.recycle(); |
| 3423 | reply.recycle(); |
| 3424 | } |
| 3425 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3426 | @Override |
| 3427 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 3428 | Parcel data = Parcel.obtain(); |
| 3429 | Parcel reply = Parcel.obtain(); |
| 3430 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3431 | data.writeStrongBinder(connection); |
| 3432 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 3433 | reply.readException(); |
| 3434 | data.recycle(); |
| 3435 | reply.recycle(); |
| 3436 | } |
| 3437 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3438 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 3439 | Parcel data = Parcel.obtain(); |
| 3440 | Parcel reply = Parcel.obtain(); |
| 3441 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3442 | data.writeStrongBinder(connection); |
| 3443 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3444 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3445 | reply.readException(); |
| 3446 | data.recycle(); |
| 3447 | reply.recycle(); |
| 3448 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3449 | |
| 3450 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 3451 | Parcel data = Parcel.obtain(); |
| 3452 | Parcel reply = Parcel.obtain(); |
| 3453 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3454 | data.writeString(name); |
| 3455 | data.writeStrongBinder(token); |
| 3456 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3457 | reply.readException(); |
| 3458 | data.recycle(); |
| 3459 | reply.recycle(); |
| 3460 | } |
| 3461 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 3462 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 3463 | throws RemoteException |
| 3464 | { |
| 3465 | Parcel data = Parcel.obtain(); |
| 3466 | Parcel reply = Parcel.obtain(); |
| 3467 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3468 | service.writeToParcel(data, 0); |
| 3469 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 3470 | reply.readException(); |
| 3471 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 3472 | data.recycle(); |
| 3473 | reply.recycle(); |
| 3474 | return res; |
| 3475 | } |
| 3476 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3477 | public ComponentName startService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3478 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3479 | { |
| 3480 | Parcel data = Parcel.obtain(); |
| 3481 | Parcel reply = Parcel.obtain(); |
| 3482 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3483 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3484 | service.writeToParcel(data, 0); |
| 3485 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3486 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3487 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 3488 | reply.readException(); |
| 3489 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3490 | data.recycle(); |
| 3491 | reply.recycle(); |
| 3492 | return res; |
| 3493 | } |
| 3494 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3495 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3496 | { |
| 3497 | Parcel data = Parcel.obtain(); |
| 3498 | Parcel reply = Parcel.obtain(); |
| 3499 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3500 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3501 | service.writeToParcel(data, 0); |
| 3502 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3503 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3504 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 3505 | reply.readException(); |
| 3506 | int res = reply.readInt(); |
| 3507 | reply.recycle(); |
| 3508 | data.recycle(); |
| 3509 | return res; |
| 3510 | } |
| 3511 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 3512 | int startId) throws RemoteException { |
| 3513 | Parcel data = Parcel.obtain(); |
| 3514 | Parcel reply = Parcel.obtain(); |
| 3515 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3516 | ComponentName.writeToParcel(className, data); |
| 3517 | data.writeStrongBinder(token); |
| 3518 | data.writeInt(startId); |
| 3519 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 3520 | reply.readException(); |
| 3521 | boolean res = reply.readInt() != 0; |
| 3522 | data.recycle(); |
| 3523 | reply.recycle(); |
| 3524 | return res; |
| 3525 | } |
| 3526 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3527 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3528 | Parcel data = Parcel.obtain(); |
| 3529 | Parcel reply = Parcel.obtain(); |
| 3530 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3531 | ComponentName.writeToParcel(className, data); |
| 3532 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3533 | data.writeInt(id); |
| 3534 | if (notification != null) { |
| 3535 | data.writeInt(1); |
| 3536 | notification.writeToParcel(data, 0); |
| 3537 | } else { |
| 3538 | data.writeInt(0); |
| 3539 | } |
| 3540 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3541 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3542 | reply.readException(); |
| 3543 | data.recycle(); |
| 3544 | reply.recycle(); |
| 3545 | } |
| 3546 | public int bindService(IApplicationThread caller, IBinder token, |
| 3547 | Intent service, String resolvedType, IServiceConnection connection, |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 3548 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3549 | Parcel data = Parcel.obtain(); |
| 3550 | Parcel reply = Parcel.obtain(); |
| 3551 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3552 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3553 | data.writeStrongBinder(token); |
| 3554 | service.writeToParcel(data, 0); |
| 3555 | data.writeString(resolvedType); |
| 3556 | data.writeStrongBinder(connection.asBinder()); |
| 3557 | data.writeInt(flags); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 3558 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3559 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 3560 | reply.readException(); |
| 3561 | int res = reply.readInt(); |
| 3562 | data.recycle(); |
| 3563 | reply.recycle(); |
| 3564 | return res; |
| 3565 | } |
| 3566 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 3567 | { |
| 3568 | Parcel data = Parcel.obtain(); |
| 3569 | Parcel reply = Parcel.obtain(); |
| 3570 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3571 | data.writeStrongBinder(connection.asBinder()); |
| 3572 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 3573 | reply.readException(); |
| 3574 | boolean res = reply.readInt() != 0; |
| 3575 | data.recycle(); |
| 3576 | reply.recycle(); |
| 3577 | return res; |
| 3578 | } |
| 3579 | |
| 3580 | public void publishService(IBinder token, |
| 3581 | Intent intent, IBinder service) throws RemoteException { |
| 3582 | Parcel data = Parcel.obtain(); |
| 3583 | Parcel reply = Parcel.obtain(); |
| 3584 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3585 | data.writeStrongBinder(token); |
| 3586 | intent.writeToParcel(data, 0); |
| 3587 | data.writeStrongBinder(service); |
| 3588 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 3589 | reply.readException(); |
| 3590 | data.recycle(); |
| 3591 | reply.recycle(); |
| 3592 | } |
| 3593 | |
| 3594 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 3595 | throws RemoteException { |
| 3596 | Parcel data = Parcel.obtain(); |
| 3597 | Parcel reply = Parcel.obtain(); |
| 3598 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3599 | data.writeStrongBinder(token); |
| 3600 | intent.writeToParcel(data, 0); |
| 3601 | data.writeInt(doRebind ? 1 : 0); |
| 3602 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 3603 | reply.readException(); |
| 3604 | data.recycle(); |
| 3605 | reply.recycle(); |
| 3606 | } |
| 3607 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 3608 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 3609 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3610 | Parcel data = Parcel.obtain(); |
| 3611 | Parcel reply = Parcel.obtain(); |
| 3612 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3613 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 3614 | data.writeInt(type); |
| 3615 | data.writeInt(startId); |
| 3616 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3617 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3618 | reply.readException(); |
| 3619 | data.recycle(); |
| 3620 | reply.recycle(); |
| 3621 | } |
| 3622 | |
| 3623 | public IBinder peekService(Intent service, String resolvedType) throws RemoteException { |
| 3624 | Parcel data = Parcel.obtain(); |
| 3625 | Parcel reply = Parcel.obtain(); |
| 3626 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3627 | service.writeToParcel(data, 0); |
| 3628 | data.writeString(resolvedType); |
| 3629 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 3630 | reply.readException(); |
| 3631 | IBinder binder = reply.readStrongBinder(); |
| 3632 | reply.recycle(); |
| 3633 | data.recycle(); |
| 3634 | return binder; |
| 3635 | } |
| 3636 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 3637 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 3638 | throws RemoteException { |
| 3639 | Parcel data = Parcel.obtain(); |
| 3640 | Parcel reply = Parcel.obtain(); |
| 3641 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3642 | app.writeToParcel(data, 0); |
| 3643 | data.writeInt(backupRestoreMode); |
| 3644 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 3645 | reply.readException(); |
| 3646 | boolean success = reply.readInt() != 0; |
| 3647 | reply.recycle(); |
| 3648 | data.recycle(); |
| 3649 | return success; |
| 3650 | } |
| 3651 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 3652 | public void clearPendingBackup() throws RemoteException { |
| 3653 | Parcel data = Parcel.obtain(); |
| 3654 | Parcel reply = Parcel.obtain(); |
| 3655 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3656 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 3657 | reply.recycle(); |
| 3658 | data.recycle(); |
| 3659 | } |
| 3660 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 3661 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 3662 | Parcel data = Parcel.obtain(); |
| 3663 | Parcel reply = Parcel.obtain(); |
| 3664 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3665 | data.writeString(packageName); |
| 3666 | data.writeStrongBinder(agent); |
| 3667 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 3668 | reply.recycle(); |
| 3669 | data.recycle(); |
| 3670 | } |
| 3671 | |
| 3672 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 3673 | Parcel data = Parcel.obtain(); |
| 3674 | Parcel reply = Parcel.obtain(); |
| 3675 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3676 | app.writeToParcel(data, 0); |
| 3677 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 3678 | reply.readException(); |
| 3679 | reply.recycle(); |
| 3680 | data.recycle(); |
| 3681 | } |
| 3682 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3683 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 3684 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 3685 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 3686 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3687 | Parcel data = Parcel.obtain(); |
| 3688 | Parcel reply = Parcel.obtain(); |
| 3689 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3690 | ComponentName.writeToParcel(className, data); |
| 3691 | data.writeString(profileFile); |
| 3692 | data.writeInt(flags); |
| 3693 | data.writeBundle(arguments); |
| 3694 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 3695 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3696 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 3697 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3698 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 3699 | reply.readException(); |
| 3700 | boolean res = reply.readInt() != 0; |
| 3701 | reply.recycle(); |
| 3702 | data.recycle(); |
| 3703 | return res; |
| 3704 | } |
| 3705 | |
| 3706 | public void finishInstrumentation(IApplicationThread target, |
| 3707 | int resultCode, Bundle results) throws RemoteException { |
| 3708 | Parcel data = Parcel.obtain(); |
| 3709 | Parcel reply = Parcel.obtain(); |
| 3710 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3711 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 3712 | data.writeInt(resultCode); |
| 3713 | data.writeBundle(results); |
| 3714 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 3715 | reply.readException(); |
| 3716 | data.recycle(); |
| 3717 | reply.recycle(); |
| 3718 | } |
| 3719 | public Configuration getConfiguration() throws RemoteException |
| 3720 | { |
| 3721 | Parcel data = Parcel.obtain(); |
| 3722 | Parcel reply = Parcel.obtain(); |
| 3723 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3724 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 3725 | reply.readException(); |
| 3726 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 3727 | reply.recycle(); |
| 3728 | data.recycle(); |
| 3729 | return res; |
| 3730 | } |
| 3731 | public void updateConfiguration(Configuration values) throws RemoteException |
| 3732 | { |
| 3733 | Parcel data = Parcel.obtain(); |
| 3734 | Parcel reply = Parcel.obtain(); |
| 3735 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3736 | values.writeToParcel(data, 0); |
| 3737 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 3738 | reply.readException(); |
| 3739 | data.recycle(); |
| 3740 | reply.recycle(); |
| 3741 | } |
| 3742 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 3743 | throws RemoteException { |
| 3744 | Parcel data = Parcel.obtain(); |
| 3745 | Parcel reply = Parcel.obtain(); |
| 3746 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3747 | data.writeStrongBinder(token); |
| 3748 | data.writeInt(requestedOrientation); |
| 3749 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 3750 | reply.readException(); |
| 3751 | data.recycle(); |
| 3752 | reply.recycle(); |
| 3753 | } |
| 3754 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 3755 | Parcel data = Parcel.obtain(); |
| 3756 | Parcel reply = Parcel.obtain(); |
| 3757 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3758 | data.writeStrongBinder(token); |
| 3759 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 3760 | reply.readException(); |
| 3761 | int res = reply.readInt(); |
| 3762 | data.recycle(); |
| 3763 | reply.recycle(); |
| 3764 | return res; |
| 3765 | } |
| 3766 | public ComponentName getActivityClassForToken(IBinder token) |
| 3767 | throws RemoteException { |
| 3768 | Parcel data = Parcel.obtain(); |
| 3769 | Parcel reply = Parcel.obtain(); |
| 3770 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3771 | data.writeStrongBinder(token); |
| 3772 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 3773 | reply.readException(); |
| 3774 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3775 | data.recycle(); |
| 3776 | reply.recycle(); |
| 3777 | return res; |
| 3778 | } |
| 3779 | public String getPackageForToken(IBinder token) throws RemoteException |
| 3780 | { |
| 3781 | Parcel data = Parcel.obtain(); |
| 3782 | Parcel reply = Parcel.obtain(); |
| 3783 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3784 | data.writeStrongBinder(token); |
| 3785 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 3786 | reply.readException(); |
| 3787 | String res = reply.readString(); |
| 3788 | data.recycle(); |
| 3789 | reply.recycle(); |
| 3790 | return res; |
| 3791 | } |
| 3792 | public IIntentSender getIntentSender(int type, |
| 3793 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 3794 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3795 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3796 | Parcel data = Parcel.obtain(); |
| 3797 | Parcel reply = Parcel.obtain(); |
| 3798 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3799 | data.writeInt(type); |
| 3800 | data.writeString(packageName); |
| 3801 | data.writeStrongBinder(token); |
| 3802 | data.writeString(resultWho); |
| 3803 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3804 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3805 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3806 | data.writeTypedArray(intents, 0); |
| 3807 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3808 | } else { |
| 3809 | data.writeInt(0); |
| 3810 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3811 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 3812 | if (options != null) { |
| 3813 | data.writeInt(1); |
| 3814 | options.writeToParcel(data, 0); |
| 3815 | } else { |
| 3816 | data.writeInt(0); |
| 3817 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3818 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3819 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3820 | reply.readException(); |
| 3821 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 3822 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3823 | data.recycle(); |
| 3824 | reply.recycle(); |
| 3825 | return res; |
| 3826 | } |
| 3827 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 3828 | Parcel data = Parcel.obtain(); |
| 3829 | Parcel reply = Parcel.obtain(); |
| 3830 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3831 | data.writeStrongBinder(sender.asBinder()); |
| 3832 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3833 | reply.readException(); |
| 3834 | data.recycle(); |
| 3835 | reply.recycle(); |
| 3836 | } |
| 3837 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 3838 | Parcel data = Parcel.obtain(); |
| 3839 | Parcel reply = Parcel.obtain(); |
| 3840 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3841 | data.writeStrongBinder(sender.asBinder()); |
| 3842 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3843 | reply.readException(); |
| 3844 | String res = reply.readString(); |
| 3845 | data.recycle(); |
| 3846 | reply.recycle(); |
| 3847 | return res; |
| 3848 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 3849 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 3850 | Parcel data = Parcel.obtain(); |
| 3851 | Parcel reply = Parcel.obtain(); |
| 3852 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3853 | data.writeStrongBinder(sender.asBinder()); |
| 3854 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3855 | reply.readException(); |
| 3856 | int res = reply.readInt(); |
| 3857 | data.recycle(); |
| 3858 | reply.recycle(); |
| 3859 | return res; |
| 3860 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3861 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 3862 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 3863 | Parcel data = Parcel.obtain(); |
| 3864 | Parcel reply = Parcel.obtain(); |
| 3865 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3866 | data.writeInt(callingPid); |
| 3867 | data.writeInt(callingUid); |
| 3868 | data.writeInt(userId); |
| 3869 | data.writeInt(allowAll ? 1 : 0); |
| 3870 | data.writeInt(requireFull ? 1 : 0); |
| 3871 | data.writeString(name); |
| 3872 | data.writeString(callerPackage); |
| 3873 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 3874 | reply.readException(); |
| 3875 | int res = reply.readInt(); |
| 3876 | data.recycle(); |
| 3877 | reply.recycle(); |
| 3878 | return res; |
| 3879 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3880 | public void setProcessLimit(int max) throws RemoteException |
| 3881 | { |
| 3882 | Parcel data = Parcel.obtain(); |
| 3883 | Parcel reply = Parcel.obtain(); |
| 3884 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3885 | data.writeInt(max); |
| 3886 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 3887 | reply.readException(); |
| 3888 | data.recycle(); |
| 3889 | reply.recycle(); |
| 3890 | } |
| 3891 | public int getProcessLimit() throws RemoteException |
| 3892 | { |
| 3893 | Parcel data = Parcel.obtain(); |
| 3894 | Parcel reply = Parcel.obtain(); |
| 3895 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3896 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 3897 | reply.readException(); |
| 3898 | int res = reply.readInt(); |
| 3899 | data.recycle(); |
| 3900 | reply.recycle(); |
| 3901 | return res; |
| 3902 | } |
| 3903 | public void setProcessForeground(IBinder token, int pid, |
| 3904 | boolean isForeground) throws RemoteException { |
| 3905 | Parcel data = Parcel.obtain(); |
| 3906 | Parcel reply = Parcel.obtain(); |
| 3907 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3908 | data.writeStrongBinder(token); |
| 3909 | data.writeInt(pid); |
| 3910 | data.writeInt(isForeground ? 1 : 0); |
| 3911 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3912 | reply.readException(); |
| 3913 | data.recycle(); |
| 3914 | reply.recycle(); |
| 3915 | } |
| 3916 | public int checkPermission(String permission, int pid, int uid) |
| 3917 | throws RemoteException { |
| 3918 | Parcel data = Parcel.obtain(); |
| 3919 | Parcel reply = Parcel.obtain(); |
| 3920 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3921 | data.writeString(permission); |
| 3922 | data.writeInt(pid); |
| 3923 | data.writeInt(uid); |
| 3924 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 3925 | reply.readException(); |
| 3926 | int res = reply.readInt(); |
| 3927 | data.recycle(); |
| 3928 | reply.recycle(); |
| 3929 | return res; |
| 3930 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 3931 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 3932 | throws RemoteException { |
| 3933 | Parcel data = Parcel.obtain(); |
| 3934 | Parcel reply = Parcel.obtain(); |
| 3935 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3936 | data.writeString(permission); |
| 3937 | data.writeInt(pid); |
| 3938 | data.writeInt(uid); |
| 3939 | data.writeStrongBinder(callerToken); |
| 3940 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 3941 | reply.readException(); |
| 3942 | int res = reply.readInt(); |
| 3943 | data.recycle(); |
| 3944 | reply.recycle(); |
| 3945 | return res; |
| 3946 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3947 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3948 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3949 | Parcel data = Parcel.obtain(); |
| 3950 | Parcel reply = Parcel.obtain(); |
| 3951 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3952 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 3953 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3954 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3955 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 3956 | reply.readException(); |
| 3957 | boolean res = reply.readInt() != 0; |
| 3958 | data.recycle(); |
| 3959 | reply.recycle(); |
| 3960 | return res; |
| 3961 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 3962 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 3963 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3964 | Parcel data = Parcel.obtain(); |
| 3965 | Parcel reply = Parcel.obtain(); |
| 3966 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3967 | uri.writeToParcel(data, 0); |
| 3968 | data.writeInt(pid); |
| 3969 | data.writeInt(uid); |
| 3970 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 3971 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 3972 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3973 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3974 | reply.readException(); |
| 3975 | int res = reply.readInt(); |
| 3976 | data.recycle(); |
| 3977 | reply.recycle(); |
| 3978 | return res; |
| 3979 | } |
| 3980 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 3981 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3982 | Parcel data = Parcel.obtain(); |
| 3983 | Parcel reply = Parcel.obtain(); |
| 3984 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3985 | data.writeStrongBinder(caller.asBinder()); |
| 3986 | data.writeString(targetPkg); |
| 3987 | uri.writeToParcel(data, 0); |
| 3988 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 3989 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3990 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3991 | reply.readException(); |
| 3992 | data.recycle(); |
| 3993 | reply.recycle(); |
| 3994 | } |
| 3995 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 3996 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3997 | Parcel data = Parcel.obtain(); |
| 3998 | Parcel reply = Parcel.obtain(); |
| 3999 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4000 | data.writeStrongBinder(caller.asBinder()); |
| 4001 | uri.writeToParcel(data, 0); |
| 4002 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4003 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4004 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4005 | reply.readException(); |
| 4006 | data.recycle(); |
| 4007 | reply.recycle(); |
| 4008 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4009 | |
| 4010 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4011 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4012 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4013 | Parcel data = Parcel.obtain(); |
| 4014 | Parcel reply = Parcel.obtain(); |
| 4015 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4016 | uri.writeToParcel(data, 0); |
| 4017 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4018 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4019 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4020 | reply.readException(); |
| 4021 | data.recycle(); |
| 4022 | reply.recycle(); |
| 4023 | } |
| 4024 | |
| 4025 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4026 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4027 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4028 | Parcel data = Parcel.obtain(); |
| 4029 | Parcel reply = Parcel.obtain(); |
| 4030 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4031 | uri.writeToParcel(data, 0); |
| 4032 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4033 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4034 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4035 | reply.readException(); |
| 4036 | data.recycle(); |
| 4037 | reply.recycle(); |
| 4038 | } |
| 4039 | |
| 4040 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4041 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4042 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4043 | Parcel data = Parcel.obtain(); |
| 4044 | Parcel reply = Parcel.obtain(); |
| 4045 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4046 | data.writeString(packageName); |
| 4047 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4048 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4049 | reply.readException(); |
| 4050 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4051 | reply); |
| 4052 | data.recycle(); |
| 4053 | reply.recycle(); |
| 4054 | return perms; |
| 4055 | } |
| 4056 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4057 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4058 | throws RemoteException { |
| 4059 | Parcel data = Parcel.obtain(); |
| 4060 | Parcel reply = Parcel.obtain(); |
| 4061 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4062 | data.writeStrongBinder(who.asBinder()); |
| 4063 | data.writeInt(waiting ? 1 : 0); |
| 4064 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4065 | reply.readException(); |
| 4066 | data.recycle(); |
| 4067 | reply.recycle(); |
| 4068 | } |
| 4069 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4070 | Parcel data = Parcel.obtain(); |
| 4071 | Parcel reply = Parcel.obtain(); |
| 4072 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4073 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4074 | reply.readException(); |
| 4075 | outInfo.readFromParcel(reply); |
| 4076 | data.recycle(); |
| 4077 | reply.recycle(); |
| 4078 | } |
| 4079 | public void unhandledBack() throws RemoteException |
| 4080 | { |
| 4081 | Parcel data = Parcel.obtain(); |
| 4082 | Parcel reply = Parcel.obtain(); |
| 4083 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4084 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4085 | reply.readException(); |
| 4086 | data.recycle(); |
| 4087 | reply.recycle(); |
| 4088 | } |
| 4089 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4090 | { |
| 4091 | Parcel data = Parcel.obtain(); |
| 4092 | Parcel reply = Parcel.obtain(); |
| 4093 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4094 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4095 | reply.readException(); |
| 4096 | ParcelFileDescriptor pfd = null; |
| 4097 | if (reply.readInt() != 0) { |
| 4098 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4099 | } |
| 4100 | data.recycle(); |
| 4101 | reply.recycle(); |
| 4102 | return pfd; |
| 4103 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4104 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4105 | { |
| 4106 | Parcel data = Parcel.obtain(); |
| 4107 | Parcel reply = Parcel.obtain(); |
| 4108 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4109 | data.writeInt(shown ? 1 : 0); |
| 4110 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4111 | reply.readException(); |
| 4112 | data.recycle(); |
| 4113 | reply.recycle(); |
| 4114 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4115 | public void setDebugApp( |
| 4116 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4117 | throws RemoteException |
| 4118 | { |
| 4119 | Parcel data = Parcel.obtain(); |
| 4120 | Parcel reply = Parcel.obtain(); |
| 4121 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4122 | data.writeString(packageName); |
| 4123 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4124 | data.writeInt(persistent ? 1 : 0); |
| 4125 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4126 | reply.readException(); |
| 4127 | data.recycle(); |
| 4128 | reply.recycle(); |
| 4129 | } |
| 4130 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4131 | { |
| 4132 | Parcel data = Parcel.obtain(); |
| 4133 | Parcel reply = Parcel.obtain(); |
| 4134 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4135 | data.writeInt(enabled ? 1 : 0); |
| 4136 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4137 | reply.readException(); |
| 4138 | data.recycle(); |
| 4139 | reply.recycle(); |
| 4140 | } |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4141 | public void setActivityController(IActivityController watcher) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4142 | { |
| 4143 | Parcel data = Parcel.obtain(); |
| 4144 | Parcel reply = Parcel.obtain(); |
| 4145 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4146 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4147 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4148 | reply.readException(); |
| 4149 | data.recycle(); |
| 4150 | reply.recycle(); |
| 4151 | } |
| 4152 | public void enterSafeMode() throws RemoteException { |
| 4153 | Parcel data = Parcel.obtain(); |
| 4154 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4155 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4156 | data.recycle(); |
| 4157 | } |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4158 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg) |
| 4159 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4160 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4161 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4162 | data.writeStrongBinder(sender.asBinder()); |
| 4163 | data.writeInt(sourceUid); |
| 4164 | data.writeString(sourcePkg); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4165 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4166 | data.recycle(); |
| 4167 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4168 | public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4169 | Parcel data = Parcel.obtain(); |
| 4170 | Parcel reply = Parcel.obtain(); |
| 4171 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4172 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4173 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4174 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4175 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 4176 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4177 | boolean res = reply.readInt() != 0; |
| 4178 | data.recycle(); |
| 4179 | reply.recycle(); |
| 4180 | return res; |
| 4181 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 4182 | @Override |
| 4183 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 4184 | Parcel data = Parcel.obtain(); |
| 4185 | Parcel reply = Parcel.obtain(); |
| 4186 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4187 | data.writeString(reason); |
| 4188 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4189 | boolean res = reply.readInt() != 0; |
| 4190 | data.recycle(); |
| 4191 | reply.recycle(); |
| 4192 | return res; |
| 4193 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4194 | public boolean testIsSystemReady() |
| 4195 | { |
| 4196 | /* this base class version is never called */ |
| 4197 | return true; |
| 4198 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4199 | public void handleApplicationCrash(IBinder app, |
| 4200 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 4201 | { |
| 4202 | Parcel data = Parcel.obtain(); |
| 4203 | Parcel reply = Parcel.obtain(); |
| 4204 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4205 | data.writeStrongBinder(app); |
| 4206 | crashInfo.writeToParcel(data, 0); |
| 4207 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 4208 | reply.readException(); |
| 4209 | reply.recycle(); |
| 4210 | data.recycle(); |
| 4211 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4212 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4213 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4214 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4215 | { |
| 4216 | Parcel data = Parcel.obtain(); |
| 4217 | Parcel reply = Parcel.obtain(); |
| 4218 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4219 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4220 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4221 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4222 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4223 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4224 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4225 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4226 | reply.recycle(); |
| 4227 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4228 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4229 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4230 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4231 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4232 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4233 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4234 | { |
| 4235 | Parcel data = Parcel.obtain(); |
| 4236 | Parcel reply = Parcel.obtain(); |
| 4237 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4238 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4239 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4240 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4241 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 4242 | reply.readException(); |
| 4243 | reply.recycle(); |
| 4244 | data.recycle(); |
| 4245 | } |
| 4246 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4247 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 4248 | Parcel data = Parcel.obtain(); |
| 4249 | Parcel reply = Parcel.obtain(); |
| 4250 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4251 | data.writeInt(sig); |
| 4252 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 4253 | reply.readException(); |
| 4254 | data.recycle(); |
| 4255 | reply.recycle(); |
| 4256 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4257 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4258 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4259 | Parcel data = Parcel.obtain(); |
| 4260 | Parcel reply = Parcel.obtain(); |
| 4261 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4262 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4263 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4264 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4265 | reply.readException(); |
| 4266 | data.recycle(); |
| 4267 | reply.recycle(); |
| 4268 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4269 | |
| 4270 | public void killAllBackgroundProcesses() throws RemoteException { |
| 4271 | Parcel data = Parcel.obtain(); |
| 4272 | Parcel reply = Parcel.obtain(); |
| 4273 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4274 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4275 | reply.readException(); |
| 4276 | data.recycle(); |
| 4277 | reply.recycle(); |
| 4278 | } |
| 4279 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4280 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4281 | Parcel data = Parcel.obtain(); |
| 4282 | Parcel reply = Parcel.obtain(); |
| 4283 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4284 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4285 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4286 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4287 | reply.readException(); |
| 4288 | data.recycle(); |
| 4289 | reply.recycle(); |
| 4290 | } |
| 4291 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 4292 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 4293 | throws RemoteException |
| 4294 | { |
| 4295 | Parcel data = Parcel.obtain(); |
| 4296 | Parcel reply = Parcel.obtain(); |
| 4297 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4298 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 4299 | reply.readException(); |
| 4300 | outInfo.readFromParcel(reply); |
| 4301 | reply.recycle(); |
| 4302 | data.recycle(); |
| 4303 | } |
| 4304 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4305 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 4306 | { |
| 4307 | Parcel data = Parcel.obtain(); |
| 4308 | Parcel reply = Parcel.obtain(); |
| 4309 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4310 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4311 | reply.readException(); |
| 4312 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 4313 | reply.recycle(); |
| 4314 | data.recycle(); |
| 4315 | return res; |
| 4316 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4317 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4318 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4319 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4320 | { |
| 4321 | Parcel data = Parcel.obtain(); |
| 4322 | Parcel reply = Parcel.obtain(); |
| 4323 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4324 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4325 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4326 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 4327 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4328 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 4329 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4330 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 4331 | } else { |
| 4332 | data.writeInt(0); |
| 4333 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4334 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 4335 | reply.readException(); |
| 4336 | boolean res = reply.readInt() != 0; |
| 4337 | reply.recycle(); |
| 4338 | data.recycle(); |
| 4339 | return res; |
| 4340 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4341 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 4342 | public boolean shutdown(int timeout) throws RemoteException |
| 4343 | { |
| 4344 | Parcel data = Parcel.obtain(); |
| 4345 | Parcel reply = Parcel.obtain(); |
| 4346 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4347 | data.writeInt(timeout); |
| 4348 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 4349 | reply.readException(); |
| 4350 | boolean res = reply.readInt() != 0; |
| 4351 | reply.recycle(); |
| 4352 | data.recycle(); |
| 4353 | return res; |
| 4354 | } |
| 4355 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 4356 | public void stopAppSwitches() throws RemoteException { |
| 4357 | Parcel data = Parcel.obtain(); |
| 4358 | Parcel reply = Parcel.obtain(); |
| 4359 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4360 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 4361 | reply.readException(); |
| 4362 | reply.recycle(); |
| 4363 | data.recycle(); |
| 4364 | } |
| 4365 | |
| 4366 | public void resumeAppSwitches() throws RemoteException { |
| 4367 | Parcel data = Parcel.obtain(); |
| 4368 | Parcel reply = Parcel.obtain(); |
| 4369 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4370 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 4371 | reply.readException(); |
| 4372 | reply.recycle(); |
| 4373 | data.recycle(); |
| 4374 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 4375 | |
| 4376 | public void addPackageDependency(String packageName) throws RemoteException { |
| 4377 | Parcel data = Parcel.obtain(); |
| 4378 | Parcel reply = Parcel.obtain(); |
| 4379 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4380 | data.writeString(packageName); |
| 4381 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 4382 | reply.readException(); |
| 4383 | data.recycle(); |
| 4384 | reply.recycle(); |
| 4385 | } |
| 4386 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 4387 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 4388 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 4389 | Parcel data = Parcel.obtain(); |
| 4390 | Parcel reply = Parcel.obtain(); |
| 4391 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4392 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4393 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 4394 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4395 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 4396 | reply.readException(); |
| 4397 | data.recycle(); |
| 4398 | reply.recycle(); |
| 4399 | } |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 4400 | |
| 4401 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 4402 | Parcel data = Parcel.obtain(); |
| 4403 | Parcel reply = Parcel.obtain(); |
| 4404 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4405 | data.writeString(reason); |
| 4406 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 4407 | reply.readException(); |
| 4408 | data.recycle(); |
| 4409 | reply.recycle(); |
| 4410 | } |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4411 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4412 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4413 | throws RemoteException { |
| 4414 | Parcel data = Parcel.obtain(); |
| 4415 | Parcel reply = Parcel.obtain(); |
| 4416 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4417 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4418 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4419 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4420 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4421 | data.recycle(); |
| 4422 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4423 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4424 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 4425 | |
| 4426 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 4427 | Parcel data = Parcel.obtain(); |
| 4428 | Parcel reply = Parcel.obtain(); |
| 4429 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4430 | data.writeString(processName); |
| 4431 | data.writeInt(uid); |
| 4432 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 4433 | reply.readException(); |
| 4434 | data.recycle(); |
| 4435 | reply.recycle(); |
| 4436 | } |
| 4437 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 4438 | public void overridePendingTransition(IBinder token, String packageName, |
| 4439 | int enterAnim, int exitAnim) throws RemoteException { |
| 4440 | Parcel data = Parcel.obtain(); |
| 4441 | Parcel reply = Parcel.obtain(); |
| 4442 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4443 | data.writeStrongBinder(token); |
| 4444 | data.writeString(packageName); |
| 4445 | data.writeInt(enterAnim); |
| 4446 | data.writeInt(exitAnim); |
| 4447 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 4448 | reply.readException(); |
| 4449 | data.recycle(); |
| 4450 | reply.recycle(); |
| 4451 | } |
| 4452 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 4453 | public boolean isUserAMonkey() throws RemoteException { |
| 4454 | Parcel data = Parcel.obtain(); |
| 4455 | Parcel reply = Parcel.obtain(); |
| 4456 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4457 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 4458 | reply.readException(); |
| 4459 | boolean res = reply.readInt() != 0; |
| 4460 | data.recycle(); |
| 4461 | reply.recycle(); |
| 4462 | return res; |
| 4463 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 4464 | |
| 4465 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 4466 | Parcel data = Parcel.obtain(); |
| 4467 | Parcel reply = Parcel.obtain(); |
| 4468 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4469 | data.writeInt(monkey ? 1 : 0); |
| 4470 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 4471 | reply.readException(); |
| 4472 | data.recycle(); |
| 4473 | reply.recycle(); |
| 4474 | } |
| 4475 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 4476 | public void finishHeavyWeightApp() throws RemoteException { |
| 4477 | Parcel data = Parcel.obtain(); |
| 4478 | Parcel reply = Parcel.obtain(); |
| 4479 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4480 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 4481 | reply.readException(); |
| 4482 | data.recycle(); |
| 4483 | reply.recycle(); |
| 4484 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4485 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4486 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4487 | throws RemoteException { |
| 4488 | Parcel data = Parcel.obtain(); |
| 4489 | Parcel reply = Parcel.obtain(); |
| 4490 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4491 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4492 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 4493 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4494 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4495 | data.recycle(); |
| 4496 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4497 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4498 | } |
| 4499 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4500 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4501 | throws RemoteException { |
| 4502 | Parcel data = Parcel.obtain(); |
| 4503 | Parcel reply = Parcel.obtain(); |
| 4504 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4505 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4506 | if (options == null) { |
| 4507 | data.writeInt(0); |
| 4508 | } else { |
| 4509 | data.writeInt(1); |
| 4510 | data.writeBundle(options.toBundle()); |
| 4511 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4512 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4513 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4514 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4515 | data.recycle(); |
| 4516 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4517 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4518 | } |
| 4519 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4520 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 4521 | Parcel data = Parcel.obtain(); |
| 4522 | Parcel reply = Parcel.obtain(); |
| 4523 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4524 | data.writeStrongBinder(token); |
| 4525 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 4526 | reply.readException(); |
| 4527 | Bundle bundle = reply.readBundle(); |
| 4528 | ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle); |
| 4529 | data.recycle(); |
| 4530 | reply.recycle(); |
| 4531 | return options; |
| 4532 | } |
| 4533 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4534 | public void setImmersive(IBinder token, boolean immersive) |
| 4535 | throws RemoteException { |
| 4536 | Parcel data = Parcel.obtain(); |
| 4537 | Parcel reply = Parcel.obtain(); |
| 4538 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4539 | data.writeStrongBinder(token); |
| 4540 | data.writeInt(immersive ? 1 : 0); |
| 4541 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 4542 | reply.readException(); |
| 4543 | data.recycle(); |
| 4544 | reply.recycle(); |
| 4545 | } |
| 4546 | |
| 4547 | public boolean isImmersive(IBinder token) |
| 4548 | throws RemoteException { |
| 4549 | Parcel data = Parcel.obtain(); |
| 4550 | Parcel reply = Parcel.obtain(); |
| 4551 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4552 | data.writeStrongBinder(token); |
| 4553 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4554 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4555 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4556 | data.recycle(); |
| 4557 | reply.recycle(); |
| 4558 | return res; |
| 4559 | } |
| 4560 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 4561 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 4562 | Parcel data = Parcel.obtain(); |
| 4563 | Parcel reply = Parcel.obtain(); |
| 4564 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4565 | data.writeStrongBinder(token); |
| 4566 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 4567 | reply.readException(); |
| 4568 | boolean res = reply.readInt() == 1; |
| 4569 | data.recycle(); |
| 4570 | reply.recycle(); |
| 4571 | return res; |
| 4572 | } |
| 4573 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4574 | public boolean isTopActivityImmersive() |
| 4575 | throws RemoteException { |
| 4576 | Parcel data = Parcel.obtain(); |
| 4577 | Parcel reply = Parcel.obtain(); |
| 4578 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4579 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4580 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4581 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4582 | data.recycle(); |
| 4583 | reply.recycle(); |
| 4584 | return res; |
| 4585 | } |
| 4586 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 4587 | public void crashApplication(int uid, int initialPid, String packageName, |
| 4588 | String message) throws RemoteException { |
| 4589 | Parcel data = Parcel.obtain(); |
| 4590 | Parcel reply = Parcel.obtain(); |
| 4591 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4592 | data.writeInt(uid); |
| 4593 | data.writeInt(initialPid); |
| 4594 | data.writeString(packageName); |
| 4595 | data.writeString(message); |
| 4596 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 4597 | reply.readException(); |
| 4598 | data.recycle(); |
| 4599 | reply.recycle(); |
| 4600 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4601 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4602 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 4603 | Parcel data = Parcel.obtain(); |
| 4604 | Parcel reply = Parcel.obtain(); |
| 4605 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4606 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4607 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 4608 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 4609 | reply.readException(); |
| 4610 | String res = reply.readString(); |
| 4611 | data.recycle(); |
| 4612 | reply.recycle(); |
| 4613 | return res; |
| 4614 | } |
| 4615 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4616 | public IBinder newUriPermissionOwner(String name) |
| 4617 | throws RemoteException { |
| 4618 | Parcel data = Parcel.obtain(); |
| 4619 | Parcel reply = Parcel.obtain(); |
| 4620 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4621 | data.writeString(name); |
| 4622 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 4623 | reply.readException(); |
| 4624 | IBinder res = reply.readStrongBinder(); |
| 4625 | data.recycle(); |
| 4626 | reply.recycle(); |
| 4627 | return res; |
| 4628 | } |
| 4629 | |
| 4630 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 4631 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4632 | Parcel data = Parcel.obtain(); |
| 4633 | Parcel reply = Parcel.obtain(); |
| 4634 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4635 | data.writeStrongBinder(owner); |
| 4636 | data.writeInt(fromUid); |
| 4637 | data.writeString(targetPkg); |
| 4638 | uri.writeToParcel(data, 0); |
| 4639 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 4640 | data.writeInt(sourceUserId); |
| 4641 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4642 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4643 | reply.readException(); |
| 4644 | data.recycle(); |
| 4645 | reply.recycle(); |
| 4646 | } |
| 4647 | |
| 4648 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4649 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4650 | Parcel data = Parcel.obtain(); |
| 4651 | Parcel reply = Parcel.obtain(); |
| 4652 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4653 | data.writeStrongBinder(owner); |
| 4654 | if (uri != null) { |
| 4655 | data.writeInt(1); |
| 4656 | uri.writeToParcel(data, 0); |
| 4657 | } else { |
| 4658 | data.writeInt(0); |
| 4659 | } |
| 4660 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4661 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4662 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4663 | reply.readException(); |
| 4664 | data.recycle(); |
| 4665 | reply.recycle(); |
| 4666 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 4667 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 4668 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4669 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 4670 | Parcel data = Parcel.obtain(); |
| 4671 | Parcel reply = Parcel.obtain(); |
| 4672 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4673 | data.writeInt(callingUid); |
| 4674 | data.writeString(targetPkg); |
| 4675 | uri.writeToParcel(data, 0); |
| 4676 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4677 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 4678 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4679 | reply.readException(); |
| 4680 | int res = reply.readInt(); |
| 4681 | data.recycle(); |
| 4682 | reply.recycle(); |
| 4683 | return res; |
| 4684 | } |
| 4685 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4686 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4687 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 4688 | Parcel data = Parcel.obtain(); |
| 4689 | Parcel reply = Parcel.obtain(); |
| 4690 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4691 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4692 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4693 | data.writeInt(managed ? 1 : 0); |
| 4694 | data.writeString(path); |
| 4695 | if (fd != null) { |
| 4696 | data.writeInt(1); |
| 4697 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 4698 | } else { |
| 4699 | data.writeInt(0); |
| 4700 | } |
| 4701 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 4702 | reply.readException(); |
| 4703 | boolean res = reply.readInt() != 0; |
| 4704 | reply.recycle(); |
| 4705 | data.recycle(); |
| 4706 | return res; |
| 4707 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 4708 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 4709 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 4710 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 4711 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4712 | Parcel data = Parcel.obtain(); |
| 4713 | Parcel reply = Parcel.obtain(); |
| 4714 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4715 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 4716 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4717 | data.writeTypedArray(intents, 0); |
| 4718 | data.writeStringArray(resolvedTypes); |
| 4719 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 4720 | if (options != null) { |
| 4721 | data.writeInt(1); |
| 4722 | options.writeToParcel(data, 0); |
| 4723 | } else { |
| 4724 | data.writeInt(0); |
| 4725 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 4726 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4727 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 4728 | reply.readException(); |
| 4729 | int result = reply.readInt(); |
| 4730 | reply.recycle(); |
| 4731 | data.recycle(); |
| 4732 | return result; |
| 4733 | } |
| 4734 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4735 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 4736 | Parcel data = Parcel.obtain(); |
| 4737 | Parcel reply = Parcel.obtain(); |
| 4738 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4739 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4740 | reply.readException(); |
| 4741 | int mode = reply.readInt(); |
| 4742 | reply.recycle(); |
| 4743 | data.recycle(); |
| 4744 | return mode; |
| 4745 | } |
| 4746 | |
| 4747 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 4748 | Parcel data = Parcel.obtain(); |
| 4749 | Parcel reply = Parcel.obtain(); |
| 4750 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4751 | data.writeInt(mode); |
| 4752 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4753 | reply.readException(); |
| 4754 | reply.recycle(); |
| 4755 | data.recycle(); |
| 4756 | } |
| 4757 | |
| 4758 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 4759 | Parcel data = Parcel.obtain(); |
| 4760 | Parcel reply = Parcel.obtain(); |
| 4761 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 4762 | data.writeString(packageName); |
| 4763 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4764 | reply.readException(); |
| 4765 | int mode = reply.readInt(); |
| 4766 | reply.recycle(); |
| 4767 | data.recycle(); |
| 4768 | return mode; |
| 4769 | } |
| 4770 | |
| 4771 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 4772 | throws RemoteException { |
| 4773 | Parcel data = Parcel.obtain(); |
| 4774 | Parcel reply = Parcel.obtain(); |
| 4775 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4776 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4777 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 4778 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4779 | reply.readException(); |
| 4780 | reply.recycle(); |
| 4781 | data.recycle(); |
| 4782 | } |
| 4783 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 4784 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 4785 | Parcel data = Parcel.obtain(); |
| 4786 | Parcel reply = Parcel.obtain(); |
| 4787 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4788 | data.writeString(packageName); |
| 4789 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 4790 | reply.readException(); |
| 4791 | boolean ask = reply.readInt() != 0; |
| 4792 | reply.recycle(); |
| 4793 | data.recycle(); |
| 4794 | return ask; |
| 4795 | } |
| 4796 | |
| 4797 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 4798 | throws RemoteException { |
| 4799 | Parcel data = Parcel.obtain(); |
| 4800 | Parcel reply = Parcel.obtain(); |
| 4801 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4802 | data.writeString(packageName); |
| 4803 | data.writeInt(ask ? 1 : 0); |
| 4804 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 4805 | reply.readException(); |
| 4806 | reply.recycle(); |
| 4807 | data.recycle(); |
| 4808 | } |
| 4809 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4810 | public boolean switchUser(int userid) throws RemoteException { |
| 4811 | Parcel data = Parcel.obtain(); |
| 4812 | Parcel reply = Parcel.obtain(); |
| 4813 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4814 | data.writeInt(userid); |
| 4815 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 4816 | reply.readException(); |
| 4817 | boolean result = reply.readInt() != 0; |
| 4818 | reply.recycle(); |
| 4819 | data.recycle(); |
| 4820 | return result; |
| 4821 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 4822 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 4823 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 4824 | Parcel data = Parcel.obtain(); |
| 4825 | Parcel reply = Parcel.obtain(); |
| 4826 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4827 | data.writeInt(userid); |
| 4828 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 4829 | reply.readException(); |
| 4830 | boolean result = reply.readInt() != 0; |
| 4831 | reply.recycle(); |
| 4832 | data.recycle(); |
| 4833 | return result; |
| 4834 | } |
| 4835 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 4836 | public int stopUser(int userid, IStopUserCallback callback) throws RemoteException { |
| 4837 | Parcel data = Parcel.obtain(); |
| 4838 | Parcel reply = Parcel.obtain(); |
| 4839 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4840 | data.writeInt(userid); |
| 4841 | data.writeStrongInterface(callback); |
| 4842 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 4843 | reply.readException(); |
| 4844 | int result = reply.readInt(); |
| 4845 | reply.recycle(); |
| 4846 | data.recycle(); |
| 4847 | return result; |
| 4848 | } |
| 4849 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 4850 | public UserInfo getCurrentUser() throws RemoteException { |
| 4851 | Parcel data = Parcel.obtain(); |
| 4852 | Parcel reply = Parcel.obtain(); |
| 4853 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 4854 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 4855 | reply.readException(); |
| 4856 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 4857 | reply.recycle(); |
| 4858 | data.recycle(); |
| 4859 | return userInfo; |
| 4860 | } |
| 4861 | |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 4862 | public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4863 | Parcel data = Parcel.obtain(); |
| 4864 | Parcel reply = Parcel.obtain(); |
| 4865 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4866 | data.writeInt(userid); |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 4867 | data.writeInt(orStopping ? 1 : 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4868 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 4869 | reply.readException(); |
| 4870 | boolean result = reply.readInt() != 0; |
| 4871 | reply.recycle(); |
| 4872 | data.recycle(); |
| 4873 | return result; |
| 4874 | } |
| 4875 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 4876 | public int[] getRunningUserIds() throws RemoteException { |
| 4877 | Parcel data = Parcel.obtain(); |
| 4878 | Parcel reply = Parcel.obtain(); |
| 4879 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4880 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 4881 | reply.readException(); |
| 4882 | int[] result = reply.createIntArray(); |
| 4883 | reply.recycle(); |
| 4884 | data.recycle(); |
| 4885 | return result; |
| 4886 | } |
| 4887 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 4888 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 4889 | Parcel data = Parcel.obtain(); |
| 4890 | Parcel reply = Parcel.obtain(); |
| 4891 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4892 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 4893 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 4894 | reply.readException(); |
| 4895 | boolean result = reply.readInt() != 0; |
| 4896 | reply.recycle(); |
| 4897 | data.recycle(); |
| 4898 | return result; |
| 4899 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4900 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 4901 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 4902 | Parcel data = Parcel.obtain(); |
| 4903 | Parcel reply = Parcel.obtain(); |
| 4904 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4905 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 4906 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 4907 | reply.readException(); |
| 4908 | data.recycle(); |
| 4909 | reply.recycle(); |
| 4910 | } |
| 4911 | |
| 4912 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 4913 | Parcel data = Parcel.obtain(); |
| 4914 | Parcel reply = Parcel.obtain(); |
| 4915 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4916 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 4917 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 4918 | reply.readException(); |
| 4919 | data.recycle(); |
| 4920 | reply.recycle(); |
| 4921 | } |
| 4922 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 4923 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 4924 | Parcel data = Parcel.obtain(); |
| 4925 | Parcel reply = Parcel.obtain(); |
| 4926 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4927 | data.writeStrongBinder(sender.asBinder()); |
| 4928 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 4929 | reply.readException(); |
| 4930 | boolean res = reply.readInt() != 0; |
| 4931 | data.recycle(); |
| 4932 | reply.recycle(); |
| 4933 | return res; |
| 4934 | } |
| 4935 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 4936 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 4937 | Parcel data = Parcel.obtain(); |
| 4938 | Parcel reply = Parcel.obtain(); |
| 4939 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4940 | data.writeStrongBinder(sender.asBinder()); |
| 4941 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4942 | reply.readException(); |
| 4943 | boolean res = reply.readInt() != 0; |
| 4944 | data.recycle(); |
| 4945 | reply.recycle(); |
| 4946 | return res; |
| 4947 | } |
| 4948 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 4949 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 4950 | Parcel data = Parcel.obtain(); |
| 4951 | Parcel reply = Parcel.obtain(); |
| 4952 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4953 | data.writeStrongBinder(sender.asBinder()); |
| 4954 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4955 | reply.readException(); |
| 4956 | Intent res = reply.readInt() != 0 |
| 4957 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 4958 | data.recycle(); |
| 4959 | reply.recycle(); |
| 4960 | return res; |
| 4961 | } |
| 4962 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 4963 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 4964 | throws RemoteException { |
| 4965 | Parcel data = Parcel.obtain(); |
| 4966 | Parcel reply = Parcel.obtain(); |
| 4967 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4968 | data.writeStrongBinder(sender.asBinder()); |
| 4969 | data.writeString(prefix); |
| 4970 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4971 | reply.readException(); |
| 4972 | String res = reply.readString(); |
| 4973 | data.recycle(); |
| 4974 | reply.recycle(); |
| 4975 | return res; |
| 4976 | } |
| 4977 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 4978 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 4979 | { |
| 4980 | Parcel data = Parcel.obtain(); |
| 4981 | Parcel reply = Parcel.obtain(); |
| 4982 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4983 | values.writeToParcel(data, 0); |
| 4984 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4985 | reply.readException(); |
| 4986 | data.recycle(); |
| 4987 | reply.recycle(); |
| 4988 | } |
| 4989 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 4990 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 4991 | Parcel data = Parcel.obtain(); |
| 4992 | Parcel reply = Parcel.obtain(); |
| 4993 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4994 | data.writeIntArray(pids); |
| 4995 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 4996 | reply.readException(); |
| 4997 | long[] res = reply.createLongArray(); |
| 4998 | data.recycle(); |
| 4999 | reply.recycle(); |
| 5000 | return res; |
| 5001 | } |
| 5002 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5003 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5004 | Parcel data = Parcel.obtain(); |
| 5005 | Parcel reply = Parcel.obtain(); |
| 5006 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5007 | TextUtils.writeToParcel(msg, data, 0); |
| 5008 | data.writeInt(always ? 1 : 0); |
| 5009 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5010 | reply.readException(); |
| 5011 | data.recycle(); |
| 5012 | reply.recycle(); |
| 5013 | } |
| 5014 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5015 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5016 | Parcel data = Parcel.obtain(); |
| 5017 | Parcel reply = Parcel.obtain(); |
| 5018 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5019 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5020 | reply.readException(); |
| 5021 | data.recycle(); |
| 5022 | reply.recycle(); |
| 5023 | } |
| 5024 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5025 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5026 | throws RemoteException { |
| 5027 | Parcel data = Parcel.obtain(); |
| 5028 | Parcel reply = Parcel.obtain(); |
| 5029 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5030 | data.writeStrongBinder(token); |
| 5031 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5032 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5033 | reply.readException(); |
| 5034 | boolean result = reply.readInt() != 0; |
| 5035 | data.recycle(); |
| 5036 | reply.recycle(); |
| 5037 | return result; |
| 5038 | } |
| 5039 | |
| 5040 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5041 | throws RemoteException { |
| 5042 | Parcel data = Parcel.obtain(); |
| 5043 | Parcel reply = Parcel.obtain(); |
| 5044 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5045 | data.writeStrongBinder(token); |
| 5046 | target.writeToParcel(data, 0); |
| 5047 | data.writeInt(resultCode); |
| 5048 | if (resultData != null) { |
| 5049 | data.writeInt(1); |
| 5050 | resultData.writeToParcel(data, 0); |
| 5051 | } else { |
| 5052 | data.writeInt(0); |
| 5053 | } |
| 5054 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5055 | reply.readException(); |
| 5056 | boolean result = reply.readInt() != 0; |
| 5057 | data.recycle(); |
| 5058 | reply.recycle(); |
| 5059 | return result; |
| 5060 | } |
| 5061 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5062 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5063 | Parcel data = Parcel.obtain(); |
| 5064 | Parcel reply = Parcel.obtain(); |
| 5065 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5066 | data.writeStrongBinder(activityToken); |
| 5067 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5068 | reply.readException(); |
| 5069 | int result = reply.readInt(); |
| 5070 | data.recycle(); |
| 5071 | reply.recycle(); |
| 5072 | return result; |
| 5073 | } |
| 5074 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5075 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 5076 | Parcel data = Parcel.obtain(); |
| 5077 | Parcel reply = Parcel.obtain(); |
| 5078 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5079 | data.writeStrongBinder(activityToken); |
| 5080 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 5081 | reply.readException(); |
| 5082 | String result = reply.readString(); |
| 5083 | data.recycle(); |
| 5084 | reply.recycle(); |
| 5085 | return result; |
| 5086 | } |
| 5087 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 5088 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5089 | Parcel data = Parcel.obtain(); |
| 5090 | Parcel reply = Parcel.obtain(); |
| 5091 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5092 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5093 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5094 | reply.readException(); |
| 5095 | data.recycle(); |
| 5096 | reply.recycle(); |
| 5097 | } |
| 5098 | |
| 5099 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5100 | Parcel data = Parcel.obtain(); |
| 5101 | Parcel reply = Parcel.obtain(); |
| 5102 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5103 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5104 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5105 | reply.readException(); |
| 5106 | data.recycle(); |
| 5107 | reply.recycle(); |
| 5108 | } |
| 5109 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5110 | public void requestBugReport() throws RemoteException { |
| 5111 | Parcel data = Parcel.obtain(); |
| 5112 | Parcel reply = Parcel.obtain(); |
| 5113 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5114 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 5115 | reply.readException(); |
| 5116 | data.recycle(); |
| 5117 | reply.recycle(); |
| 5118 | } |
| 5119 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5120 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 5121 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5122 | Parcel data = Parcel.obtain(); |
| 5123 | Parcel reply = Parcel.obtain(); |
| 5124 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5125 | data.writeInt(pid); |
| 5126 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5127 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5128 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 5129 | reply.readException(); |
| 5130 | long res = reply.readInt(); |
| 5131 | data.recycle(); |
| 5132 | reply.recycle(); |
| 5133 | return res; |
| 5134 | } |
| 5135 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5136 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5137 | Parcel data = Parcel.obtain(); |
| 5138 | Parcel reply = Parcel.obtain(); |
| 5139 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5140 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5141 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5142 | reply.readException(); |
| 5143 | Bundle res = reply.readBundle(); |
| 5144 | data.recycle(); |
| 5145 | reply.recycle(); |
| 5146 | return res; |
| 5147 | } |
| 5148 | |
Adam Skory | 7140a25 | 2013-09-11 12:04:58 +0100 | [diff] [blame] | 5149 | public void reportAssistContextExtras(IBinder token, Bundle extras) |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5150 | throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5151 | Parcel data = Parcel.obtain(); |
| 5152 | Parcel reply = Parcel.obtain(); |
| 5153 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5154 | data.writeStrongBinder(token); |
| 5155 | data.writeBundle(extras); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5156 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5157 | reply.readException(); |
| 5158 | data.recycle(); |
| 5159 | reply.recycle(); |
| 5160 | } |
| 5161 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 5162 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle) |
| 5163 | throws RemoteException { |
| 5164 | Parcel data = Parcel.obtain(); |
| 5165 | Parcel reply = Parcel.obtain(); |
| 5166 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5167 | intent.writeToParcel(data, 0); |
| 5168 | data.writeInt(requestType); |
| 5169 | data.writeString(hint); |
| 5170 | data.writeInt(userHandle); |
| 5171 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 5172 | reply.readException(); |
| 5173 | boolean res = reply.readInt() != 0; |
| 5174 | data.recycle(); |
| 5175 | reply.recycle(); |
| 5176 | return res; |
| 5177 | } |
| 5178 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5179 | public void killUid(int uid, String reason) throws RemoteException { |
| 5180 | Parcel data = Parcel.obtain(); |
| 5181 | Parcel reply = Parcel.obtain(); |
| 5182 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5183 | data.writeInt(uid); |
| 5184 | data.writeString(reason); |
| 5185 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 5186 | reply.readException(); |
| 5187 | data.recycle(); |
| 5188 | reply.recycle(); |
| 5189 | } |
| 5190 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 5191 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 5192 | Parcel data = Parcel.obtain(); |
| 5193 | Parcel reply = Parcel.obtain(); |
| 5194 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5195 | data.writeStrongBinder(who); |
| 5196 | data.writeInt(allowRestart ? 1 : 0); |
| 5197 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 5198 | reply.readException(); |
| 5199 | data.recycle(); |
| 5200 | reply.recycle(); |
| 5201 | } |
| 5202 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 5203 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 5204 | Parcel data = Parcel.obtain(); |
| 5205 | Parcel reply = Parcel.obtain(); |
| 5206 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5207 | data.writeStrongBinder(token); |
| 5208 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 5209 | reply.readException(); |
| 5210 | data.recycle(); |
| 5211 | reply.recycle(); |
| 5212 | } |
| 5213 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5214 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 5215 | Parcel data = Parcel.obtain(); |
| 5216 | Parcel reply = Parcel.obtain(); |
| 5217 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5218 | data.writeStrongBinder(token); |
| 5219 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 5220 | reply.readException(); |
| 5221 | data.recycle(); |
| 5222 | reply.recycle(); |
| 5223 | } |
| 5224 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 5225 | public void restart() throws RemoteException { |
| 5226 | Parcel data = Parcel.obtain(); |
| 5227 | Parcel reply = Parcel.obtain(); |
| 5228 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5229 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 5230 | reply.readException(); |
| 5231 | data.recycle(); |
| 5232 | reply.recycle(); |
| 5233 | } |
| 5234 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 5235 | public void performIdleMaintenance() throws RemoteException { |
| 5236 | Parcel data = Parcel.obtain(); |
| 5237 | Parcel reply = Parcel.obtain(); |
| 5238 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5239 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 5240 | reply.readException(); |
| 5241 | data.recycle(); |
| 5242 | reply.recycle(); |
| 5243 | } |
| 5244 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 5245 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5246 | IActivityContainerCallback callback) throws RemoteException { |
| 5247 | Parcel data = Parcel.obtain(); |
| 5248 | Parcel reply = Parcel.obtain(); |
| 5249 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5250 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 5251 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 5252 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5253 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 5254 | final int result = reply.readInt(); |
| 5255 | final IActivityContainer res; |
| 5256 | if (result == 1) { |
| 5257 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5258 | } else { |
| 5259 | res = null; |
| 5260 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5261 | data.recycle(); |
| 5262 | reply.recycle(); |
| 5263 | return res; |
| 5264 | } |
| 5265 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 5266 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 5267 | throws RemoteException { |
| 5268 | Parcel data = Parcel.obtain(); |
| 5269 | Parcel reply = Parcel.obtain(); |
| 5270 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5271 | data.writeStrongBinder(activityContainer.asBinder()); |
| 5272 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 5273 | reply.readException(); |
| 5274 | data.recycle(); |
| 5275 | reply.recycle(); |
| 5276 | } |
| 5277 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 5278 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 5279 | Parcel data = Parcel.obtain(); |
| 5280 | Parcel reply = Parcel.obtain(); |
| 5281 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5282 | data.writeInt(displayId); |
| 5283 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 5284 | reply.readException(); |
| 5285 | final int result = reply.readInt(); |
| 5286 | final IActivityContainer res; |
| 5287 | if (result == 1) { |
| 5288 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5289 | } else { |
| 5290 | res = null; |
| 5291 | } |
| 5292 | data.recycle(); |
| 5293 | reply.recycle(); |
| 5294 | return res; |
| 5295 | } |
| 5296 | |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5297 | public IActivityContainer getEnclosingActivityContainer(IBinder activityToken) |
| 5298 | throws RemoteException { |
| 5299 | Parcel data = Parcel.obtain(); |
| 5300 | Parcel reply = Parcel.obtain(); |
| 5301 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5302 | data.writeStrongBinder(activityToken); |
| 5303 | mRemote.transact(GET_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 5304 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 5305 | final int result = reply.readInt(); |
| 5306 | final IActivityContainer res; |
| 5307 | if (result == 1) { |
| 5308 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5309 | } else { |
| 5310 | res = null; |
| 5311 | } |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5312 | data.recycle(); |
| 5313 | reply.recycle(); |
| 5314 | return res; |
| 5315 | } |
| 5316 | |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5317 | public IBinder getHomeActivityToken() throws RemoteException { |
| 5318 | Parcel data = Parcel.obtain(); |
| 5319 | Parcel reply = Parcel.obtain(); |
| 5320 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5321 | mRemote.transact(GET_HOME_ACTIVITY_TOKEN_TRANSACTION, data, reply, 0); |
| 5322 | reply.readException(); |
| 5323 | IBinder res = reply.readStrongBinder(); |
| 5324 | data.recycle(); |
| 5325 | reply.recycle(); |
| 5326 | return res; |
| 5327 | } |
| 5328 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5329 | @Override |
| 5330 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 5331 | Parcel data = Parcel.obtain(); |
| 5332 | Parcel reply = Parcel.obtain(); |
| 5333 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5334 | data.writeInt(taskId); |
| 5335 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 5336 | reply.readException(); |
| 5337 | data.recycle(); |
| 5338 | reply.recycle(); |
| 5339 | } |
| 5340 | |
| 5341 | @Override |
| 5342 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 5343 | Parcel data = Parcel.obtain(); |
| 5344 | Parcel reply = Parcel.obtain(); |
| 5345 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5346 | data.writeStrongBinder(token); |
| 5347 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 5348 | reply.readException(); |
| 5349 | data.recycle(); |
| 5350 | reply.recycle(); |
| 5351 | } |
| 5352 | |
| 5353 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5354 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 5355 | Parcel data = Parcel.obtain(); |
| 5356 | Parcel reply = Parcel.obtain(); |
| 5357 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5358 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5359 | reply.readException(); |
| 5360 | data.recycle(); |
| 5361 | reply.recycle(); |
| 5362 | } |
| 5363 | |
| 5364 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5365 | public void stopLockTaskMode() throws RemoteException { |
| 5366 | Parcel data = Parcel.obtain(); |
| 5367 | Parcel reply = Parcel.obtain(); |
| 5368 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5369 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 5370 | reply.readException(); |
| 5371 | data.recycle(); |
| 5372 | reply.recycle(); |
| 5373 | } |
| 5374 | |
| 5375 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5376 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 5377 | Parcel data = Parcel.obtain(); |
| 5378 | Parcel reply = Parcel.obtain(); |
| 5379 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5380 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5381 | reply.readException(); |
| 5382 | data.recycle(); |
| 5383 | reply.recycle(); |
| 5384 | } |
| 5385 | |
| 5386 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5387 | public boolean isInLockTaskMode() throws RemoteException { |
| 5388 | Parcel data = Parcel.obtain(); |
| 5389 | Parcel reply = Parcel.obtain(); |
| 5390 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5391 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 5392 | reply.readException(); |
| 5393 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 5394 | data.recycle(); |
| 5395 | reply.recycle(); |
| 5396 | return isInLockTaskMode; |
| 5397 | } |
| 5398 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 5399 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 5400 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 5401 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 5402 | Parcel data = Parcel.obtain(); |
| 5403 | Parcel reply = Parcel.obtain(); |
| 5404 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5405 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 5406 | values.writeToParcel(data, 0); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 5407 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 5408 | reply.readException(); |
| 5409 | data.recycle(); |
| 5410 | reply.recycle(); |
| 5411 | } |
| 5412 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5413 | @Override |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame^] | 5414 | public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException { |
| 5415 | Parcel data = Parcel.obtain(); |
| 5416 | Parcel reply = Parcel.obtain(); |
| 5417 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5418 | data.writeInt(taskId); |
| 5419 | data.writeInt(resizeable ? 1 : 0); |
| 5420 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 5421 | reply.readException(); |
| 5422 | data.recycle(); |
| 5423 | reply.recycle(); |
| 5424 | } |
| 5425 | |
| 5426 | @Override |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 5427 | public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException { |
| 5428 | Parcel data = Parcel.obtain(); |
| 5429 | Parcel reply = Parcel.obtain(); |
| 5430 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5431 | data.writeString(filename); |
| 5432 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 5433 | reply.readException(); |
| 5434 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 5435 | data.recycle(); |
| 5436 | reply.recycle(); |
| 5437 | return icon; |
| 5438 | } |
| 5439 | |
| 5440 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 5441 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 5442 | throws RemoteException { |
| 5443 | Parcel data = Parcel.obtain(); |
| 5444 | Parcel reply = Parcel.obtain(); |
| 5445 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5446 | if (options == null) { |
| 5447 | data.writeInt(0); |
| 5448 | } else { |
| 5449 | data.writeInt(1); |
| 5450 | data.writeBundle(options.toBundle()); |
| 5451 | } |
| 5452 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 5453 | reply.readException(); |
| 5454 | data.recycle(); |
| 5455 | reply.recycle(); |
| 5456 | } |
| 5457 | |
| 5458 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5459 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5460 | Parcel data = Parcel.obtain(); |
| 5461 | Parcel reply = Parcel.obtain(); |
| 5462 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5463 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5464 | data.writeInt(visible ? 1 : 0); |
| 5465 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5466 | reply.readException(); |
| 5467 | boolean success = reply.readInt() > 0; |
| 5468 | data.recycle(); |
| 5469 | reply.recycle(); |
| 5470 | return success; |
| 5471 | } |
| 5472 | |
| 5473 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5474 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5475 | Parcel data = Parcel.obtain(); |
| 5476 | Parcel reply = Parcel.obtain(); |
| 5477 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5478 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5479 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5480 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5481 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5482 | data.recycle(); |
| 5483 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5484 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5485 | } |
| 5486 | |
| 5487 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5488 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5489 | Parcel data = Parcel.obtain(); |
| 5490 | Parcel reply = Parcel.obtain(); |
| 5491 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5492 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5493 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, |
| 5494 | IBinder.FLAG_ONEWAY); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 5495 | reply.readException(); |
| 5496 | data.recycle(); |
| 5497 | reply.recycle(); |
| 5498 | } |
| 5499 | |
| 5500 | @Override |
| 5501 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 5502 | Parcel data = Parcel.obtain(); |
| 5503 | Parcel reply = Parcel.obtain(); |
| 5504 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5505 | data.writeStrongBinder(token); |
| 5506 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, |
| 5507 | IBinder.FLAG_ONEWAY); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5508 | reply.readException(); |
| 5509 | data.recycle(); |
| 5510 | reply.recycle(); |
| 5511 | } |
| 5512 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 5513 | @Override |
| 5514 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 5515 | Parcel data = Parcel.obtain(); |
| 5516 | Parcel reply = Parcel.obtain(); |
| 5517 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5518 | data.writeStrongBinder(token); |
| 5519 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, |
| 5520 | IBinder.FLAG_ONEWAY); |
| 5521 | reply.readException(); |
| 5522 | data.recycle(); |
| 5523 | reply.recycle(); |
| 5524 | } |
| 5525 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 5526 | @Override |
| 5527 | public void bootAnimationComplete() throws RemoteException { |
| 5528 | Parcel data = Parcel.obtain(); |
| 5529 | Parcel reply = Parcel.obtain(); |
| 5530 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5531 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 5532 | reply.readException(); |
| 5533 | data.recycle(); |
| 5534 | reply.recycle(); |
| 5535 | } |
| 5536 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 5537 | @Override |
| 5538 | public void systemBackupRestored() throws RemoteException { |
| 5539 | Parcel data = Parcel.obtain(); |
| 5540 | Parcel reply = Parcel.obtain(); |
| 5541 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5542 | mRemote.transact(SYSTEM_BACKUP_RESTORED, data, reply, 0); |
| 5543 | reply.readException(); |
| 5544 | data.recycle(); |
| 5545 | reply.recycle(); |
| 5546 | } |
| 5547 | |
Jeff Sharkey | c2ae6fb | 2015-01-15 21:27:13 -0800 | [diff] [blame] | 5548 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 5549 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 5550 | Parcel data = Parcel.obtain(); |
| 5551 | Parcel reply = Parcel.obtain(); |
| 5552 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5553 | data.writeInt(uid); |
| 5554 | data.writeByteArray(firstPacket); |
| 5555 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 5556 | reply.readException(); |
| 5557 | data.recycle(); |
| 5558 | reply.recycle(); |
| 5559 | } |
| 5560 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5561 | private IBinder mRemote; |
| 5562 | } |