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