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