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