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