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