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