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 | } |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame^] | 2100 | |
| 2101 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2102 | data.enforceInterface(IActivityManager.descriptor); |
| 2103 | final int taskId = data.readInt(); |
| 2104 | startLockTaskMode(taskId); |
| 2105 | reply.writeNoException(); |
| 2106 | return true; |
| 2107 | } |
| 2108 | |
| 2109 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2110 | data.enforceInterface(IActivityManager.descriptor); |
| 2111 | IBinder token = data.readStrongBinder(); |
| 2112 | startLockTaskMode(token); |
| 2113 | reply.writeNoException(); |
| 2114 | return true; |
| 2115 | } |
| 2116 | |
| 2117 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2118 | data.enforceInterface(IActivityManager.descriptor); |
| 2119 | stopLockTaskMode(); |
| 2120 | reply.writeNoException(); |
| 2121 | return true; |
| 2122 | } |
| 2123 | |
| 2124 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2125 | data.enforceInterface(IActivityManager.descriptor); |
| 2126 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2127 | reply.writeNoException(); |
| 2128 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2129 | return true; |
| 2130 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2131 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2132 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2133 | return super.onTransact(code, data, reply, flags); |
| 2134 | } |
| 2135 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2136 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2137 | return this; |
| 2138 | } |
| 2139 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2140 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2141 | protected IActivityManager create() { |
| 2142 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2143 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2144 | Log.v("ActivityManager", "default service binder = " + b); |
| 2145 | } |
| 2146 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2147 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2148 | Log.v("ActivityManager", "default service = " + am); |
| 2149 | } |
| 2150 | return am; |
| 2151 | } |
| 2152 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2153 | } |
| 2154 | |
| 2155 | class ActivityManagerProxy implements IActivityManager |
| 2156 | { |
| 2157 | public ActivityManagerProxy(IBinder remote) |
| 2158 | { |
| 2159 | mRemote = remote; |
| 2160 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2161 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2162 | public IBinder asBinder() |
| 2163 | { |
| 2164 | return mRemote; |
| 2165 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2166 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2167 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2168 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
| 2169 | int startFlags, String profileFile, |
| 2170 | ParcelFileDescriptor profileFd, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2171 | Parcel data = Parcel.obtain(); |
| 2172 | Parcel reply = Parcel.obtain(); |
| 2173 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2174 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2175 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2176 | intent.writeToParcel(data, 0); |
| 2177 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2178 | data.writeStrongBinder(resultTo); |
| 2179 | data.writeString(resultWho); |
| 2180 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2181 | data.writeInt(startFlags); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2182 | data.writeString(profileFile); |
| 2183 | if (profileFd != null) { |
| 2184 | data.writeInt(1); |
| 2185 | profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2186 | } else { |
| 2187 | data.writeInt(0); |
| 2188 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2189 | if (options != null) { |
| 2190 | data.writeInt(1); |
| 2191 | options.writeToParcel(data, 0); |
| 2192 | } else { |
| 2193 | data.writeInt(0); |
| 2194 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2195 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2196 | reply.readException(); |
| 2197 | int result = reply.readInt(); |
| 2198 | reply.recycle(); |
| 2199 | data.recycle(); |
| 2200 | return result; |
| 2201 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2202 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2203 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2204 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
| 2205 | int startFlags, String profileFile, |
| 2206 | ParcelFileDescriptor profileFd, Bundle options, int userId) throws RemoteException { |
| 2207 | Parcel data = Parcel.obtain(); |
| 2208 | Parcel reply = Parcel.obtain(); |
| 2209 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2210 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2211 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2212 | intent.writeToParcel(data, 0); |
| 2213 | data.writeString(resolvedType); |
| 2214 | data.writeStrongBinder(resultTo); |
| 2215 | data.writeString(resultWho); |
| 2216 | data.writeInt(requestCode); |
| 2217 | data.writeInt(startFlags); |
| 2218 | data.writeString(profileFile); |
| 2219 | if (profileFd != null) { |
| 2220 | data.writeInt(1); |
| 2221 | profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2222 | } else { |
| 2223 | data.writeInt(0); |
| 2224 | } |
| 2225 | if (options != null) { |
| 2226 | data.writeInt(1); |
| 2227 | options.writeToParcel(data, 0); |
| 2228 | } else { |
| 2229 | data.writeInt(0); |
| 2230 | } |
| 2231 | data.writeInt(userId); |
| 2232 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 2233 | reply.readException(); |
| 2234 | int result = reply.readInt(); |
| 2235 | reply.recycle(); |
| 2236 | data.recycle(); |
| 2237 | return result; |
| 2238 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2239 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 2240 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2241 | int requestCode, int startFlags, String profileFile, |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2242 | ParcelFileDescriptor profileFd, Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2243 | Parcel data = Parcel.obtain(); |
| 2244 | Parcel reply = Parcel.obtain(); |
| 2245 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2246 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2247 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2248 | intent.writeToParcel(data, 0); |
| 2249 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2250 | data.writeStrongBinder(resultTo); |
| 2251 | data.writeString(resultWho); |
| 2252 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2253 | data.writeInt(startFlags); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2254 | data.writeString(profileFile); |
| 2255 | if (profileFd != null) { |
| 2256 | data.writeInt(1); |
| 2257 | profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2258 | } else { |
| 2259 | data.writeInt(0); |
| 2260 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2261 | if (options != null) { |
| 2262 | data.writeInt(1); |
| 2263 | options.writeToParcel(data, 0); |
| 2264 | } else { |
| 2265 | data.writeInt(0); |
| 2266 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2267 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2268 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 2269 | reply.readException(); |
| 2270 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 2271 | reply.recycle(); |
| 2272 | data.recycle(); |
| 2273 | return result; |
| 2274 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2275 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 2276 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2277 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2278 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2279 | Parcel data = Parcel.obtain(); |
| 2280 | Parcel reply = Parcel.obtain(); |
| 2281 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2282 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2283 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2284 | intent.writeToParcel(data, 0); |
| 2285 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2286 | data.writeStrongBinder(resultTo); |
| 2287 | data.writeString(resultWho); |
| 2288 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2289 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2290 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2291 | if (options != null) { |
| 2292 | data.writeInt(1); |
| 2293 | options.writeToParcel(data, 0); |
| 2294 | } else { |
| 2295 | data.writeInt(0); |
| 2296 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2297 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2298 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2299 | reply.readException(); |
| 2300 | int result = reply.readInt(); |
| 2301 | reply.recycle(); |
| 2302 | data.recycle(); |
| 2303 | return result; |
| 2304 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2305 | public int startActivityIntentSender(IApplicationThread caller, |
| 2306 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2307 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2308 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2309 | Parcel data = Parcel.obtain(); |
| 2310 | Parcel reply = Parcel.obtain(); |
| 2311 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2312 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2313 | intent.writeToParcel(data, 0); |
| 2314 | if (fillInIntent != null) { |
| 2315 | data.writeInt(1); |
| 2316 | fillInIntent.writeToParcel(data, 0); |
| 2317 | } else { |
| 2318 | data.writeInt(0); |
| 2319 | } |
| 2320 | data.writeString(resolvedType); |
| 2321 | data.writeStrongBinder(resultTo); |
| 2322 | data.writeString(resultWho); |
| 2323 | data.writeInt(requestCode); |
| 2324 | data.writeInt(flagsMask); |
| 2325 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2326 | if (options != null) { |
| 2327 | data.writeInt(1); |
| 2328 | options.writeToParcel(data, 0); |
| 2329 | } else { |
| 2330 | data.writeInt(0); |
| 2331 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2332 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2333 | reply.readException(); |
| 2334 | int result = reply.readInt(); |
| 2335 | reply.recycle(); |
| 2336 | data.recycle(); |
| 2337 | return result; |
| 2338 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2339 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2340 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2341 | Parcel data = Parcel.obtain(); |
| 2342 | Parcel reply = Parcel.obtain(); |
| 2343 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2344 | data.writeStrongBinder(callingActivity); |
| 2345 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2346 | if (options != null) { |
| 2347 | data.writeInt(1); |
| 2348 | options.writeToParcel(data, 0); |
| 2349 | } else { |
| 2350 | data.writeInt(0); |
| 2351 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2352 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2353 | reply.readException(); |
| 2354 | int result = reply.readInt(); |
| 2355 | reply.recycle(); |
| 2356 | data.recycle(); |
| 2357 | return result != 0; |
| 2358 | } |
| 2359 | public boolean finishActivity(IBinder token, int resultCode, Intent resultData) |
| 2360 | throws RemoteException { |
| 2361 | Parcel data = Parcel.obtain(); |
| 2362 | Parcel reply = Parcel.obtain(); |
| 2363 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2364 | data.writeStrongBinder(token); |
| 2365 | data.writeInt(resultCode); |
| 2366 | if (resultData != null) { |
| 2367 | data.writeInt(1); |
| 2368 | resultData.writeToParcel(data, 0); |
| 2369 | } else { |
| 2370 | data.writeInt(0); |
| 2371 | } |
| 2372 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2373 | reply.readException(); |
| 2374 | boolean res = reply.readInt() != 0; |
| 2375 | data.recycle(); |
| 2376 | reply.recycle(); |
| 2377 | return res; |
| 2378 | } |
| 2379 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 2380 | { |
| 2381 | Parcel data = Parcel.obtain(); |
| 2382 | Parcel reply = Parcel.obtain(); |
| 2383 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2384 | data.writeStrongBinder(token); |
| 2385 | data.writeString(resultWho); |
| 2386 | data.writeInt(requestCode); |
| 2387 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2388 | reply.readException(); |
| 2389 | data.recycle(); |
| 2390 | reply.recycle(); |
| 2391 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 2392 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 2393 | Parcel data = Parcel.obtain(); |
| 2394 | Parcel reply = Parcel.obtain(); |
| 2395 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2396 | data.writeStrongBinder(token); |
| 2397 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 2398 | reply.readException(); |
| 2399 | boolean res = reply.readInt() != 0; |
| 2400 | data.recycle(); |
| 2401 | reply.recycle(); |
| 2402 | return res; |
| 2403 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 2404 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 2405 | Parcel data = Parcel.obtain(); |
| 2406 | Parcel reply = Parcel.obtain(); |
| 2407 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2408 | data.writeStrongBinder(token); |
| 2409 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 2410 | reply.readException(); |
| 2411 | boolean res = reply.readInt() != 0; |
| 2412 | data.recycle(); |
| 2413 | reply.recycle(); |
| 2414 | return res; |
| 2415 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2416 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2417 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 2418 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2419 | { |
| 2420 | Parcel data = Parcel.obtain(); |
| 2421 | Parcel reply = Parcel.obtain(); |
| 2422 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2423 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2424 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2425 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 2426 | filter.writeToParcel(data, 0); |
| 2427 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 2428 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2429 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 2430 | reply.readException(); |
| 2431 | Intent intent = null; |
| 2432 | int haveIntent = reply.readInt(); |
| 2433 | if (haveIntent != 0) { |
| 2434 | intent = Intent.CREATOR.createFromParcel(reply); |
| 2435 | } |
| 2436 | reply.recycle(); |
| 2437 | data.recycle(); |
| 2438 | return intent; |
| 2439 | } |
| 2440 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 2441 | { |
| 2442 | Parcel data = Parcel.obtain(); |
| 2443 | Parcel reply = Parcel.obtain(); |
| 2444 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2445 | data.writeStrongBinder(receiver.asBinder()); |
| 2446 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 2447 | reply.readException(); |
| 2448 | data.recycle(); |
| 2449 | reply.recycle(); |
| 2450 | } |
| 2451 | public int broadcastIntent(IApplicationThread caller, |
| 2452 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
| 2453 | int resultCode, String resultData, Bundle map, |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 2454 | String requiredPermission, int appOp, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2455 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2456 | { |
| 2457 | Parcel data = Parcel.obtain(); |
| 2458 | Parcel reply = Parcel.obtain(); |
| 2459 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2460 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2461 | intent.writeToParcel(data, 0); |
| 2462 | data.writeString(resolvedType); |
| 2463 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 2464 | data.writeInt(resultCode); |
| 2465 | data.writeString(resultData); |
| 2466 | data.writeBundle(map); |
| 2467 | data.writeString(requiredPermission); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 2468 | data.writeInt(appOp); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2469 | data.writeInt(serialized ? 1 : 0); |
| 2470 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2471 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2472 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 2473 | reply.readException(); |
| 2474 | int res = reply.readInt(); |
| 2475 | reply.recycle(); |
| 2476 | data.recycle(); |
| 2477 | return res; |
| 2478 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2479 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 2480 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2481 | { |
| 2482 | Parcel data = Parcel.obtain(); |
| 2483 | Parcel reply = Parcel.obtain(); |
| 2484 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2485 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2486 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2487 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2488 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 2489 | reply.readException(); |
| 2490 | data.recycle(); |
| 2491 | reply.recycle(); |
| 2492 | } |
| 2493 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException |
| 2494 | { |
| 2495 | Parcel data = Parcel.obtain(); |
| 2496 | Parcel reply = Parcel.obtain(); |
| 2497 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2498 | data.writeStrongBinder(who); |
| 2499 | data.writeInt(resultCode); |
| 2500 | data.writeString(resultData); |
| 2501 | data.writeBundle(map); |
| 2502 | data.writeInt(abortBroadcast ? 1 : 0); |
| 2503 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2504 | reply.readException(); |
| 2505 | data.recycle(); |
| 2506 | reply.recycle(); |
| 2507 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2508 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 2509 | { |
| 2510 | Parcel data = Parcel.obtain(); |
| 2511 | Parcel reply = Parcel.obtain(); |
| 2512 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2513 | data.writeStrongBinder(app.asBinder()); |
| 2514 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 2515 | reply.readException(); |
| 2516 | data.recycle(); |
| 2517 | reply.recycle(); |
| 2518 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2519 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 2520 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2521 | { |
| 2522 | Parcel data = Parcel.obtain(); |
| 2523 | Parcel reply = Parcel.obtain(); |
| 2524 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2525 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 2526 | if (config != null) { |
| 2527 | data.writeInt(1); |
| 2528 | config.writeToParcel(data, 0); |
| 2529 | } else { |
| 2530 | data.writeInt(0); |
| 2531 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2532 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2533 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2534 | reply.readException(); |
| 2535 | data.recycle(); |
| 2536 | reply.recycle(); |
| 2537 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 2538 | public void activityResumed(IBinder token) throws RemoteException |
| 2539 | { |
| 2540 | Parcel data = Parcel.obtain(); |
| 2541 | Parcel reply = Parcel.obtain(); |
| 2542 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2543 | data.writeStrongBinder(token); |
| 2544 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 2545 | reply.readException(); |
| 2546 | data.recycle(); |
| 2547 | reply.recycle(); |
| 2548 | } |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 2549 | public void activityPaused(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_PAUSED_TRANSACTION, data, reply, 0); |
| 2556 | reply.readException(); |
| 2557 | data.recycle(); |
| 2558 | reply.recycle(); |
| 2559 | } |
| 2560 | public void activityStopped(IBinder token, Bundle state, |
| 2561 | Bitmap thumbnail, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2562 | { |
| 2563 | Parcel data = Parcel.obtain(); |
| 2564 | Parcel reply = Parcel.obtain(); |
| 2565 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2566 | data.writeStrongBinder(token); |
| 2567 | data.writeBundle(state); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2568 | if (thumbnail != null) { |
| 2569 | data.writeInt(1); |
| 2570 | thumbnail.writeToParcel(data, 0); |
| 2571 | } else { |
| 2572 | data.writeInt(0); |
| 2573 | } |
| 2574 | TextUtils.writeToParcel(description, data, 0); |
| 2575 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2576 | reply.readException(); |
| 2577 | data.recycle(); |
| 2578 | reply.recycle(); |
| 2579 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 2580 | public void activitySlept(IBinder token) throws RemoteException |
| 2581 | { |
| 2582 | Parcel data = Parcel.obtain(); |
| 2583 | Parcel reply = Parcel.obtain(); |
| 2584 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2585 | data.writeStrongBinder(token); |
| 2586 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2587 | reply.readException(); |
| 2588 | data.recycle(); |
| 2589 | reply.recycle(); |
| 2590 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2591 | public void activityDestroyed(IBinder token) throws RemoteException |
| 2592 | { |
| 2593 | Parcel data = Parcel.obtain(); |
| 2594 | Parcel reply = Parcel.obtain(); |
| 2595 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2596 | data.writeStrongBinder(token); |
| 2597 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2598 | reply.readException(); |
| 2599 | data.recycle(); |
| 2600 | reply.recycle(); |
| 2601 | } |
| 2602 | public String getCallingPackage(IBinder token) throws RemoteException |
| 2603 | { |
| 2604 | Parcel data = Parcel.obtain(); |
| 2605 | Parcel reply = Parcel.obtain(); |
| 2606 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2607 | data.writeStrongBinder(token); |
| 2608 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 2609 | reply.readException(); |
| 2610 | String res = reply.readString(); |
| 2611 | data.recycle(); |
| 2612 | reply.recycle(); |
| 2613 | return res; |
| 2614 | } |
| 2615 | public ComponentName getCallingActivity(IBinder token) |
| 2616 | throws RemoteException { |
| 2617 | Parcel data = Parcel.obtain(); |
| 2618 | Parcel reply = Parcel.obtain(); |
| 2619 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2620 | data.writeStrongBinder(token); |
| 2621 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2622 | reply.readException(); |
| 2623 | ComponentName res = ComponentName.readFromParcel(reply); |
| 2624 | data.recycle(); |
| 2625 | reply.recycle(); |
| 2626 | return res; |
| 2627 | } |
| 2628 | public List getTasks(int maxNum, int flags, |
| 2629 | IThumbnailReceiver receiver) throws RemoteException { |
| 2630 | Parcel data = Parcel.obtain(); |
| 2631 | Parcel reply = Parcel.obtain(); |
| 2632 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2633 | data.writeInt(maxNum); |
| 2634 | data.writeInt(flags); |
| 2635 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 2636 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 2637 | reply.readException(); |
| 2638 | ArrayList list = null; |
| 2639 | int N = reply.readInt(); |
| 2640 | if (N >= 0) { |
| 2641 | list = new ArrayList(); |
| 2642 | while (N > 0) { |
| 2643 | ActivityManager.RunningTaskInfo info = |
| 2644 | ActivityManager.RunningTaskInfo.CREATOR |
| 2645 | .createFromParcel(reply); |
| 2646 | list.add(info); |
| 2647 | N--; |
| 2648 | } |
| 2649 | } |
| 2650 | data.recycle(); |
| 2651 | reply.recycle(); |
| 2652 | return list; |
| 2653 | } |
| 2654 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2655 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2656 | Parcel data = Parcel.obtain(); |
| 2657 | Parcel reply = Parcel.obtain(); |
| 2658 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2659 | data.writeInt(maxNum); |
| 2660 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2661 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2662 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 2663 | reply.readException(); |
| 2664 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 2665 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 2666 | data.recycle(); |
| 2667 | reply.recycle(); |
| 2668 | return list; |
| 2669 | } |
Dianne Hackborn | f26fd99 | 2011-04-08 18:14:09 -0700 | [diff] [blame] | 2670 | public ActivityManager.TaskThumbnails getTaskThumbnails(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 2671 | Parcel data = Parcel.obtain(); |
| 2672 | Parcel reply = Parcel.obtain(); |
| 2673 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2674 | data.writeInt(id); |
Dianne Hackborn | f26fd99 | 2011-04-08 18:14:09 -0700 | [diff] [blame] | 2675 | mRemote.transact(GET_TASK_THUMBNAILS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 2676 | reply.readException(); |
Dianne Hackborn | f26fd99 | 2011-04-08 18:14:09 -0700 | [diff] [blame] | 2677 | ActivityManager.TaskThumbnails bm = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 2678 | if (reply.readInt() != 0) { |
Dianne Hackborn | f26fd99 | 2011-04-08 18:14:09 -0700 | [diff] [blame] | 2679 | bm = ActivityManager.TaskThumbnails.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 2680 | } |
| 2681 | data.recycle(); |
| 2682 | reply.recycle(); |
| 2683 | return bm; |
| 2684 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 2685 | public Bitmap getTaskTopThumbnail(int id) throws RemoteException { |
| 2686 | Parcel data = Parcel.obtain(); |
| 2687 | Parcel reply = Parcel.obtain(); |
| 2688 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2689 | data.writeInt(id); |
| 2690 | mRemote.transact(GET_TASK_TOP_THUMBNAIL_TRANSACTION, data, reply, 0); |
| 2691 | reply.readException(); |
| 2692 | Bitmap bm = null; |
| 2693 | if (reply.readInt() != 0) { |
| 2694 | bm = Bitmap.CREATOR.createFromParcel(reply); |
| 2695 | } |
| 2696 | data.recycle(); |
| 2697 | reply.recycle(); |
| 2698 | return bm; |
| 2699 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2700 | public List getServices(int maxNum, int flags) throws RemoteException { |
| 2701 | Parcel data = Parcel.obtain(); |
| 2702 | Parcel reply = Parcel.obtain(); |
| 2703 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2704 | data.writeInt(maxNum); |
| 2705 | data.writeInt(flags); |
| 2706 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 2707 | reply.readException(); |
| 2708 | ArrayList list = null; |
| 2709 | int N = reply.readInt(); |
| 2710 | if (N >= 0) { |
| 2711 | list = new ArrayList(); |
| 2712 | while (N > 0) { |
| 2713 | ActivityManager.RunningServiceInfo info = |
| 2714 | ActivityManager.RunningServiceInfo.CREATOR |
| 2715 | .createFromParcel(reply); |
| 2716 | list.add(info); |
| 2717 | N--; |
| 2718 | } |
| 2719 | } |
| 2720 | data.recycle(); |
| 2721 | reply.recycle(); |
| 2722 | return list; |
| 2723 | } |
| 2724 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 2725 | throws RemoteException { |
| 2726 | Parcel data = Parcel.obtain(); |
| 2727 | Parcel reply = Parcel.obtain(); |
| 2728 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2729 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 2730 | reply.readException(); |
| 2731 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 2732 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 2733 | data.recycle(); |
| 2734 | reply.recycle(); |
| 2735 | return list; |
| 2736 | } |
| 2737 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 2738 | throws RemoteException { |
| 2739 | Parcel data = Parcel.obtain(); |
| 2740 | Parcel reply = Parcel.obtain(); |
| 2741 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2742 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 2743 | reply.readException(); |
| 2744 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 2745 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 2746 | data.recycle(); |
| 2747 | reply.recycle(); |
| 2748 | return list; |
| 2749 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 2750 | public List<ApplicationInfo> getRunningExternalApplications() |
| 2751 | throws RemoteException { |
| 2752 | Parcel data = Parcel.obtain(); |
| 2753 | Parcel reply = Parcel.obtain(); |
| 2754 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2755 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 2756 | reply.readException(); |
| 2757 | ArrayList<ApplicationInfo> list |
| 2758 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 2759 | data.recycle(); |
| 2760 | reply.recycle(); |
| 2761 | return list; |
| 2762 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 2763 | 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] | 2764 | { |
| 2765 | Parcel data = Parcel.obtain(); |
| 2766 | Parcel reply = Parcel.obtain(); |
| 2767 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2768 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2769 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 2770 | if (options != null) { |
| 2771 | data.writeInt(1); |
| 2772 | options.writeToParcel(data, 0); |
| 2773 | } else { |
| 2774 | data.writeInt(0); |
| 2775 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2776 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 2777 | reply.readException(); |
| 2778 | data.recycle(); |
| 2779 | reply.recycle(); |
| 2780 | } |
| 2781 | public void moveTaskToBack(int task) throws RemoteException |
| 2782 | { |
| 2783 | Parcel data = Parcel.obtain(); |
| 2784 | Parcel reply = Parcel.obtain(); |
| 2785 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2786 | data.writeInt(task); |
| 2787 | mRemote.transact(MOVE_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 2788 | reply.readException(); |
| 2789 | data.recycle(); |
| 2790 | reply.recycle(); |
| 2791 | } |
| 2792 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 2793 | throws RemoteException { |
| 2794 | Parcel data = Parcel.obtain(); |
| 2795 | Parcel reply = Parcel.obtain(); |
| 2796 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2797 | data.writeStrongBinder(token); |
| 2798 | data.writeInt(nonRoot ? 1 : 0); |
| 2799 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 2800 | reply.readException(); |
| 2801 | boolean res = reply.readInt() != 0; |
| 2802 | data.recycle(); |
| 2803 | reply.recycle(); |
| 2804 | return res; |
| 2805 | } |
| 2806 | public void moveTaskBackwards(int task) throws RemoteException |
| 2807 | { |
| 2808 | Parcel data = Parcel.obtain(); |
| 2809 | Parcel reply = Parcel.obtain(); |
| 2810 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2811 | data.writeInt(task); |
| 2812 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 2813 | reply.readException(); |
| 2814 | data.recycle(); |
| 2815 | reply.recycle(); |
| 2816 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 2817 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 2818 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 2819 | { |
| 2820 | Parcel data = Parcel.obtain(); |
| 2821 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 2822 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 2823 | data.writeInt(taskId); |
| 2824 | data.writeInt(stackId); |
| 2825 | data.writeInt(toTop ? 1 : 0); |
| 2826 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 2827 | reply.readException(); |
| 2828 | data.recycle(); |
| 2829 | reply.recycle(); |
| 2830 | } |
| 2831 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 2832 | public void resizeStack(int stackBoxId, Rect r) throws RemoteException |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 2833 | { |
| 2834 | Parcel data = Parcel.obtain(); |
| 2835 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 2836 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | 5a44915 | 2013-05-24 15:49:29 -0700 | [diff] [blame] | 2837 | data.writeInt(stackBoxId); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 2838 | r.writeToParcel(data, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 2839 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 2840 | reply.readException(); |
| 2841 | data.recycle(); |
| 2842 | reply.recycle(); |
| 2843 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 2844 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 2845 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 2846 | { |
| 2847 | Parcel data = Parcel.obtain(); |
| 2848 | Parcel reply = Parcel.obtain(); |
| 2849 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 2850 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 2851 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 2852 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 2853 | data.recycle(); |
| 2854 | reply.recycle(); |
| 2855 | return list; |
| 2856 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 2857 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 2858 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 2859 | { |
| 2860 | Parcel data = Parcel.obtain(); |
| 2861 | Parcel reply = Parcel.obtain(); |
| 2862 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 2863 | data.writeInt(stackId); |
| 2864 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 2865 | reply.readException(); |
| 2866 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 2867 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 2868 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 2869 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 2870 | } |
| 2871 | data.recycle(); |
| 2872 | reply.recycle(); |
| 2873 | return info; |
| 2874 | } |
| 2875 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 2876 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 2877 | Parcel data = Parcel.obtain(); |
| 2878 | Parcel reply = Parcel.obtain(); |
| 2879 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2880 | data.writeInt(taskId); |
| 2881 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 2882 | reply.readException(); |
| 2883 | boolean isInHomeStack = reply.readInt() > 0; |
| 2884 | data.recycle(); |
| 2885 | reply.recycle(); |
| 2886 | return isInHomeStack; |
| 2887 | } |
| 2888 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 2889 | public void setFocusedStack(int stackId) throws RemoteException |
| 2890 | { |
| 2891 | Parcel data = Parcel.obtain(); |
| 2892 | Parcel reply = Parcel.obtain(); |
| 2893 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2894 | data.writeInt(stackId); |
| 2895 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2896 | reply.readException(); |
| 2897 | data.recycle(); |
| 2898 | reply.recycle(); |
| 2899 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2900 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 2901 | { |
| 2902 | Parcel data = Parcel.obtain(); |
| 2903 | Parcel reply = Parcel.obtain(); |
| 2904 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2905 | data.writeStrongBinder(token); |
| 2906 | data.writeInt(onlyRoot ? 1 : 0); |
| 2907 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2908 | reply.readException(); |
| 2909 | int res = reply.readInt(); |
| 2910 | data.recycle(); |
| 2911 | reply.recycle(); |
| 2912 | return res; |
| 2913 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2914 | public void reportThumbnail(IBinder token, |
| 2915 | Bitmap thumbnail, CharSequence description) throws RemoteException |
| 2916 | { |
| 2917 | Parcel data = Parcel.obtain(); |
| 2918 | Parcel reply = Parcel.obtain(); |
| 2919 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2920 | data.writeStrongBinder(token); |
| 2921 | if (thumbnail != null) { |
| 2922 | data.writeInt(1); |
| 2923 | thumbnail.writeToParcel(data, 0); |
| 2924 | } else { |
| 2925 | data.writeInt(0); |
| 2926 | } |
| 2927 | TextUtils.writeToParcel(description, data, 0); |
| 2928 | mRemote.transact(REPORT_THUMBNAIL_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2929 | reply.readException(); |
| 2930 | data.recycle(); |
| 2931 | reply.recycle(); |
| 2932 | } |
| 2933 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 2934 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2935 | Parcel data = Parcel.obtain(); |
| 2936 | Parcel reply = Parcel.obtain(); |
| 2937 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2938 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2939 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 2940 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 2941 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2942 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 2943 | reply.readException(); |
| 2944 | int res = reply.readInt(); |
| 2945 | ContentProviderHolder cph = null; |
| 2946 | if (res != 0) { |
| 2947 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 2948 | } |
| 2949 | data.recycle(); |
| 2950 | reply.recycle(); |
| 2951 | return cph; |
| 2952 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 2953 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 2954 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 2955 | Parcel data = Parcel.obtain(); |
| 2956 | Parcel reply = Parcel.obtain(); |
| 2957 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2958 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 2959 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 2960 | data.writeStrongBinder(token); |
| 2961 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 2962 | reply.readException(); |
| 2963 | int res = reply.readInt(); |
| 2964 | ContentProviderHolder cph = null; |
| 2965 | if (res != 0) { |
| 2966 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 2967 | } |
| 2968 | data.recycle(); |
| 2969 | reply.recycle(); |
| 2970 | return cph; |
| 2971 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2972 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 2973 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2974 | { |
| 2975 | Parcel data = Parcel.obtain(); |
| 2976 | Parcel reply = Parcel.obtain(); |
| 2977 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2978 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2979 | data.writeTypedList(providers); |
| 2980 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 2981 | reply.readException(); |
| 2982 | data.recycle(); |
| 2983 | reply.recycle(); |
| 2984 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 2985 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 2986 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2987 | Parcel data = Parcel.obtain(); |
| 2988 | Parcel reply = Parcel.obtain(); |
| 2989 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 2990 | data.writeStrongBinder(connection); |
| 2991 | data.writeInt(stable); |
| 2992 | data.writeInt(unstable); |
| 2993 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 2994 | reply.readException(); |
| 2995 | boolean res = reply.readInt() != 0; |
| 2996 | data.recycle(); |
| 2997 | reply.recycle(); |
| 2998 | return res; |
| 2999 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3000 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3001 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 3002 | Parcel data = Parcel.obtain(); |
| 3003 | Parcel reply = Parcel.obtain(); |
| 3004 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3005 | data.writeStrongBinder(connection); |
| 3006 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 3007 | reply.readException(); |
| 3008 | data.recycle(); |
| 3009 | reply.recycle(); |
| 3010 | } |
| 3011 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3012 | @Override |
| 3013 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 3014 | Parcel data = Parcel.obtain(); |
| 3015 | Parcel reply = Parcel.obtain(); |
| 3016 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3017 | data.writeStrongBinder(connection); |
| 3018 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 3019 | reply.readException(); |
| 3020 | data.recycle(); |
| 3021 | reply.recycle(); |
| 3022 | } |
| 3023 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3024 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 3025 | Parcel data = Parcel.obtain(); |
| 3026 | Parcel reply = Parcel.obtain(); |
| 3027 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3028 | data.writeStrongBinder(connection); |
| 3029 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3030 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3031 | reply.readException(); |
| 3032 | data.recycle(); |
| 3033 | reply.recycle(); |
| 3034 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3035 | |
| 3036 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 3037 | Parcel data = Parcel.obtain(); |
| 3038 | Parcel reply = Parcel.obtain(); |
| 3039 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3040 | data.writeString(name); |
| 3041 | data.writeStrongBinder(token); |
| 3042 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3043 | reply.readException(); |
| 3044 | data.recycle(); |
| 3045 | reply.recycle(); |
| 3046 | } |
| 3047 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 3048 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 3049 | throws RemoteException |
| 3050 | { |
| 3051 | Parcel data = Parcel.obtain(); |
| 3052 | Parcel reply = Parcel.obtain(); |
| 3053 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3054 | service.writeToParcel(data, 0); |
| 3055 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 3056 | reply.readException(); |
| 3057 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 3058 | data.recycle(); |
| 3059 | reply.recycle(); |
| 3060 | return res; |
| 3061 | } |
| 3062 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3063 | public ComponentName startService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3064 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3065 | { |
| 3066 | Parcel data = Parcel.obtain(); |
| 3067 | Parcel reply = Parcel.obtain(); |
| 3068 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3069 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3070 | service.writeToParcel(data, 0); |
| 3071 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3072 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3073 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 3074 | reply.readException(); |
| 3075 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3076 | data.recycle(); |
| 3077 | reply.recycle(); |
| 3078 | return res; |
| 3079 | } |
| 3080 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3081 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3082 | { |
| 3083 | Parcel data = Parcel.obtain(); |
| 3084 | Parcel reply = Parcel.obtain(); |
| 3085 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3086 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3087 | service.writeToParcel(data, 0); |
| 3088 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3089 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3090 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 3091 | reply.readException(); |
| 3092 | int res = reply.readInt(); |
| 3093 | reply.recycle(); |
| 3094 | data.recycle(); |
| 3095 | return res; |
| 3096 | } |
| 3097 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 3098 | int startId) throws RemoteException { |
| 3099 | Parcel data = Parcel.obtain(); |
| 3100 | Parcel reply = Parcel.obtain(); |
| 3101 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3102 | ComponentName.writeToParcel(className, data); |
| 3103 | data.writeStrongBinder(token); |
| 3104 | data.writeInt(startId); |
| 3105 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 3106 | reply.readException(); |
| 3107 | boolean res = reply.readInt() != 0; |
| 3108 | data.recycle(); |
| 3109 | reply.recycle(); |
| 3110 | return res; |
| 3111 | } |
| 3112 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3113 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3114 | Parcel data = Parcel.obtain(); |
| 3115 | Parcel reply = Parcel.obtain(); |
| 3116 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3117 | ComponentName.writeToParcel(className, data); |
| 3118 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3119 | data.writeInt(id); |
| 3120 | if (notification != null) { |
| 3121 | data.writeInt(1); |
| 3122 | notification.writeToParcel(data, 0); |
| 3123 | } else { |
| 3124 | data.writeInt(0); |
| 3125 | } |
| 3126 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3127 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3128 | reply.readException(); |
| 3129 | data.recycle(); |
| 3130 | reply.recycle(); |
| 3131 | } |
| 3132 | public int bindService(IApplicationThread caller, IBinder token, |
| 3133 | Intent service, String resolvedType, IServiceConnection connection, |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 3134 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3135 | Parcel data = Parcel.obtain(); |
| 3136 | Parcel reply = Parcel.obtain(); |
| 3137 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3138 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3139 | data.writeStrongBinder(token); |
| 3140 | service.writeToParcel(data, 0); |
| 3141 | data.writeString(resolvedType); |
| 3142 | data.writeStrongBinder(connection.asBinder()); |
| 3143 | data.writeInt(flags); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 3144 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3145 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 3146 | reply.readException(); |
| 3147 | int res = reply.readInt(); |
| 3148 | data.recycle(); |
| 3149 | reply.recycle(); |
| 3150 | return res; |
| 3151 | } |
| 3152 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 3153 | { |
| 3154 | Parcel data = Parcel.obtain(); |
| 3155 | Parcel reply = Parcel.obtain(); |
| 3156 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3157 | data.writeStrongBinder(connection.asBinder()); |
| 3158 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 3159 | reply.readException(); |
| 3160 | boolean res = reply.readInt() != 0; |
| 3161 | data.recycle(); |
| 3162 | reply.recycle(); |
| 3163 | return res; |
| 3164 | } |
| 3165 | |
| 3166 | public void publishService(IBinder token, |
| 3167 | Intent intent, IBinder service) throws RemoteException { |
| 3168 | Parcel data = Parcel.obtain(); |
| 3169 | Parcel reply = Parcel.obtain(); |
| 3170 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3171 | data.writeStrongBinder(token); |
| 3172 | intent.writeToParcel(data, 0); |
| 3173 | data.writeStrongBinder(service); |
| 3174 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 3175 | reply.readException(); |
| 3176 | data.recycle(); |
| 3177 | reply.recycle(); |
| 3178 | } |
| 3179 | |
| 3180 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 3181 | throws RemoteException { |
| 3182 | Parcel data = Parcel.obtain(); |
| 3183 | Parcel reply = Parcel.obtain(); |
| 3184 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3185 | data.writeStrongBinder(token); |
| 3186 | intent.writeToParcel(data, 0); |
| 3187 | data.writeInt(doRebind ? 1 : 0); |
| 3188 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 3189 | reply.readException(); |
| 3190 | data.recycle(); |
| 3191 | reply.recycle(); |
| 3192 | } |
| 3193 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 3194 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 3195 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3196 | Parcel data = Parcel.obtain(); |
| 3197 | Parcel reply = Parcel.obtain(); |
| 3198 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3199 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 3200 | data.writeInt(type); |
| 3201 | data.writeInt(startId); |
| 3202 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3203 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3204 | reply.readException(); |
| 3205 | data.recycle(); |
| 3206 | reply.recycle(); |
| 3207 | } |
| 3208 | |
| 3209 | public IBinder peekService(Intent service, String resolvedType) throws RemoteException { |
| 3210 | Parcel data = Parcel.obtain(); |
| 3211 | Parcel reply = Parcel.obtain(); |
| 3212 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3213 | service.writeToParcel(data, 0); |
| 3214 | data.writeString(resolvedType); |
| 3215 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 3216 | reply.readException(); |
| 3217 | IBinder binder = reply.readStrongBinder(); |
| 3218 | reply.recycle(); |
| 3219 | data.recycle(); |
| 3220 | return binder; |
| 3221 | } |
| 3222 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 3223 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 3224 | throws RemoteException { |
| 3225 | Parcel data = Parcel.obtain(); |
| 3226 | Parcel reply = Parcel.obtain(); |
| 3227 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3228 | app.writeToParcel(data, 0); |
| 3229 | data.writeInt(backupRestoreMode); |
| 3230 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 3231 | reply.readException(); |
| 3232 | boolean success = reply.readInt() != 0; |
| 3233 | reply.recycle(); |
| 3234 | data.recycle(); |
| 3235 | return success; |
| 3236 | } |
| 3237 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 3238 | public void clearPendingBackup() throws RemoteException { |
| 3239 | Parcel data = Parcel.obtain(); |
| 3240 | Parcel reply = Parcel.obtain(); |
| 3241 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3242 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 3243 | reply.recycle(); |
| 3244 | data.recycle(); |
| 3245 | } |
| 3246 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 3247 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 3248 | Parcel data = Parcel.obtain(); |
| 3249 | Parcel reply = Parcel.obtain(); |
| 3250 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3251 | data.writeString(packageName); |
| 3252 | data.writeStrongBinder(agent); |
| 3253 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 3254 | reply.recycle(); |
| 3255 | data.recycle(); |
| 3256 | } |
| 3257 | |
| 3258 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 3259 | Parcel data = Parcel.obtain(); |
| 3260 | Parcel reply = Parcel.obtain(); |
| 3261 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3262 | app.writeToParcel(data, 0); |
| 3263 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 3264 | reply.readException(); |
| 3265 | reply.recycle(); |
| 3266 | data.recycle(); |
| 3267 | } |
| 3268 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3269 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 3270 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
| 3271 | IUiAutomationConnection connection, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3272 | Parcel data = Parcel.obtain(); |
| 3273 | Parcel reply = Parcel.obtain(); |
| 3274 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3275 | ComponentName.writeToParcel(className, data); |
| 3276 | data.writeString(profileFile); |
| 3277 | data.writeInt(flags); |
| 3278 | data.writeBundle(arguments); |
| 3279 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 3280 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3281 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3282 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 3283 | reply.readException(); |
| 3284 | boolean res = reply.readInt() != 0; |
| 3285 | reply.recycle(); |
| 3286 | data.recycle(); |
| 3287 | return res; |
| 3288 | } |
| 3289 | |
| 3290 | public void finishInstrumentation(IApplicationThread target, |
| 3291 | int resultCode, Bundle results) throws RemoteException { |
| 3292 | Parcel data = Parcel.obtain(); |
| 3293 | Parcel reply = Parcel.obtain(); |
| 3294 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3295 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 3296 | data.writeInt(resultCode); |
| 3297 | data.writeBundle(results); |
| 3298 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 3299 | reply.readException(); |
| 3300 | data.recycle(); |
| 3301 | reply.recycle(); |
| 3302 | } |
| 3303 | public Configuration getConfiguration() throws RemoteException |
| 3304 | { |
| 3305 | Parcel data = Parcel.obtain(); |
| 3306 | Parcel reply = Parcel.obtain(); |
| 3307 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3308 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 3309 | reply.readException(); |
| 3310 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 3311 | reply.recycle(); |
| 3312 | data.recycle(); |
| 3313 | return res; |
| 3314 | } |
| 3315 | public void updateConfiguration(Configuration values) throws RemoteException |
| 3316 | { |
| 3317 | Parcel data = Parcel.obtain(); |
| 3318 | Parcel reply = Parcel.obtain(); |
| 3319 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3320 | values.writeToParcel(data, 0); |
| 3321 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 3322 | reply.readException(); |
| 3323 | data.recycle(); |
| 3324 | reply.recycle(); |
| 3325 | } |
| 3326 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 3327 | throws RemoteException { |
| 3328 | Parcel data = Parcel.obtain(); |
| 3329 | Parcel reply = Parcel.obtain(); |
| 3330 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3331 | data.writeStrongBinder(token); |
| 3332 | data.writeInt(requestedOrientation); |
| 3333 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 3334 | reply.readException(); |
| 3335 | data.recycle(); |
| 3336 | reply.recycle(); |
| 3337 | } |
| 3338 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 3339 | Parcel data = Parcel.obtain(); |
| 3340 | Parcel reply = Parcel.obtain(); |
| 3341 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3342 | data.writeStrongBinder(token); |
| 3343 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 3344 | reply.readException(); |
| 3345 | int res = reply.readInt(); |
| 3346 | data.recycle(); |
| 3347 | reply.recycle(); |
| 3348 | return res; |
| 3349 | } |
| 3350 | public ComponentName getActivityClassForToken(IBinder token) |
| 3351 | throws RemoteException { |
| 3352 | Parcel data = Parcel.obtain(); |
| 3353 | Parcel reply = Parcel.obtain(); |
| 3354 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3355 | data.writeStrongBinder(token); |
| 3356 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 3357 | reply.readException(); |
| 3358 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3359 | data.recycle(); |
| 3360 | reply.recycle(); |
| 3361 | return res; |
| 3362 | } |
| 3363 | public String getPackageForToken(IBinder token) throws RemoteException |
| 3364 | { |
| 3365 | Parcel data = Parcel.obtain(); |
| 3366 | Parcel reply = Parcel.obtain(); |
| 3367 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3368 | data.writeStrongBinder(token); |
| 3369 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 3370 | reply.readException(); |
| 3371 | String res = reply.readString(); |
| 3372 | data.recycle(); |
| 3373 | reply.recycle(); |
| 3374 | return res; |
| 3375 | } |
| 3376 | public IIntentSender getIntentSender(int type, |
| 3377 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 3378 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3379 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3380 | Parcel data = Parcel.obtain(); |
| 3381 | Parcel reply = Parcel.obtain(); |
| 3382 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3383 | data.writeInt(type); |
| 3384 | data.writeString(packageName); |
| 3385 | data.writeStrongBinder(token); |
| 3386 | data.writeString(resultWho); |
| 3387 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3388 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3389 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3390 | data.writeTypedArray(intents, 0); |
| 3391 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3392 | } else { |
| 3393 | data.writeInt(0); |
| 3394 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3395 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 3396 | if (options != null) { |
| 3397 | data.writeInt(1); |
| 3398 | options.writeToParcel(data, 0); |
| 3399 | } else { |
| 3400 | data.writeInt(0); |
| 3401 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3402 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3403 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3404 | reply.readException(); |
| 3405 | IIntentSender res = IIntentSender.Stub.asInterface( |
| 3406 | reply.readStrongBinder()); |
| 3407 | data.recycle(); |
| 3408 | reply.recycle(); |
| 3409 | return res; |
| 3410 | } |
| 3411 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 3412 | Parcel data = Parcel.obtain(); |
| 3413 | Parcel reply = Parcel.obtain(); |
| 3414 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3415 | data.writeStrongBinder(sender.asBinder()); |
| 3416 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3417 | reply.readException(); |
| 3418 | data.recycle(); |
| 3419 | reply.recycle(); |
| 3420 | } |
| 3421 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 3422 | Parcel data = Parcel.obtain(); |
| 3423 | Parcel reply = Parcel.obtain(); |
| 3424 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3425 | data.writeStrongBinder(sender.asBinder()); |
| 3426 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3427 | reply.readException(); |
| 3428 | String res = reply.readString(); |
| 3429 | data.recycle(); |
| 3430 | reply.recycle(); |
| 3431 | return res; |
| 3432 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 3433 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 3434 | Parcel data = Parcel.obtain(); |
| 3435 | Parcel reply = Parcel.obtain(); |
| 3436 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3437 | data.writeStrongBinder(sender.asBinder()); |
| 3438 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3439 | reply.readException(); |
| 3440 | int res = reply.readInt(); |
| 3441 | data.recycle(); |
| 3442 | reply.recycle(); |
| 3443 | return res; |
| 3444 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3445 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 3446 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 3447 | Parcel data = Parcel.obtain(); |
| 3448 | Parcel reply = Parcel.obtain(); |
| 3449 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3450 | data.writeInt(callingPid); |
| 3451 | data.writeInt(callingUid); |
| 3452 | data.writeInt(userId); |
| 3453 | data.writeInt(allowAll ? 1 : 0); |
| 3454 | data.writeInt(requireFull ? 1 : 0); |
| 3455 | data.writeString(name); |
| 3456 | data.writeString(callerPackage); |
| 3457 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 3458 | reply.readException(); |
| 3459 | int res = reply.readInt(); |
| 3460 | data.recycle(); |
| 3461 | reply.recycle(); |
| 3462 | return res; |
| 3463 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3464 | public void setProcessLimit(int max) throws RemoteException |
| 3465 | { |
| 3466 | Parcel data = Parcel.obtain(); |
| 3467 | Parcel reply = Parcel.obtain(); |
| 3468 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3469 | data.writeInt(max); |
| 3470 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 3471 | reply.readException(); |
| 3472 | data.recycle(); |
| 3473 | reply.recycle(); |
| 3474 | } |
| 3475 | public int getProcessLimit() throws RemoteException |
| 3476 | { |
| 3477 | Parcel data = Parcel.obtain(); |
| 3478 | Parcel reply = Parcel.obtain(); |
| 3479 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3480 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 3481 | reply.readException(); |
| 3482 | int res = reply.readInt(); |
| 3483 | data.recycle(); |
| 3484 | reply.recycle(); |
| 3485 | return res; |
| 3486 | } |
| 3487 | public void setProcessForeground(IBinder token, int pid, |
| 3488 | boolean isForeground) throws RemoteException { |
| 3489 | Parcel data = Parcel.obtain(); |
| 3490 | Parcel reply = Parcel.obtain(); |
| 3491 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3492 | data.writeStrongBinder(token); |
| 3493 | data.writeInt(pid); |
| 3494 | data.writeInt(isForeground ? 1 : 0); |
| 3495 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3496 | reply.readException(); |
| 3497 | data.recycle(); |
| 3498 | reply.recycle(); |
| 3499 | } |
| 3500 | public int checkPermission(String permission, int pid, int uid) |
| 3501 | throws RemoteException { |
| 3502 | Parcel data = Parcel.obtain(); |
| 3503 | Parcel reply = Parcel.obtain(); |
| 3504 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3505 | data.writeString(permission); |
| 3506 | data.writeInt(pid); |
| 3507 | data.writeInt(uid); |
| 3508 | mRemote.transact(CHECK_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 boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3516 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3517 | Parcel data = Parcel.obtain(); |
| 3518 | Parcel reply = Parcel.obtain(); |
| 3519 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3520 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 3521 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3522 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3523 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 3524 | reply.readException(); |
| 3525 | boolean res = reply.readInt() != 0; |
| 3526 | data.recycle(); |
| 3527 | reply.recycle(); |
| 3528 | return res; |
| 3529 | } |
| 3530 | public int checkUriPermission(Uri uri, int pid, int uid, int mode) |
| 3531 | throws RemoteException { |
| 3532 | Parcel data = Parcel.obtain(); |
| 3533 | Parcel reply = Parcel.obtain(); |
| 3534 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3535 | uri.writeToParcel(data, 0); |
| 3536 | data.writeInt(pid); |
| 3537 | data.writeInt(uid); |
| 3538 | data.writeInt(mode); |
| 3539 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3540 | reply.readException(); |
| 3541 | int res = reply.readInt(); |
| 3542 | data.recycle(); |
| 3543 | reply.recycle(); |
| 3544 | return res; |
| 3545 | } |
| 3546 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
| 3547 | Uri uri, int mode) throws RemoteException { |
| 3548 | Parcel data = Parcel.obtain(); |
| 3549 | Parcel reply = Parcel.obtain(); |
| 3550 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3551 | data.writeStrongBinder(caller.asBinder()); |
| 3552 | data.writeString(targetPkg); |
| 3553 | uri.writeToParcel(data, 0); |
| 3554 | data.writeInt(mode); |
| 3555 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3556 | reply.readException(); |
| 3557 | data.recycle(); |
| 3558 | reply.recycle(); |
| 3559 | } |
| 3560 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
| 3561 | int mode) throws RemoteException { |
| 3562 | Parcel data = Parcel.obtain(); |
| 3563 | Parcel reply = Parcel.obtain(); |
| 3564 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3565 | data.writeStrongBinder(caller.asBinder()); |
| 3566 | uri.writeToParcel(data, 0); |
| 3567 | data.writeInt(mode); |
| 3568 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3569 | reply.readException(); |
| 3570 | data.recycle(); |
| 3571 | reply.recycle(); |
| 3572 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 3573 | |
| 3574 | @Override |
| 3575 | public void takePersistableUriPermission(Uri uri, int mode) throws RemoteException { |
| 3576 | Parcel data = Parcel.obtain(); |
| 3577 | Parcel reply = Parcel.obtain(); |
| 3578 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3579 | uri.writeToParcel(data, 0); |
| 3580 | data.writeInt(mode); |
| 3581 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3582 | reply.readException(); |
| 3583 | data.recycle(); |
| 3584 | reply.recycle(); |
| 3585 | } |
| 3586 | |
| 3587 | @Override |
| 3588 | public void releasePersistableUriPermission(Uri uri, int mode) throws RemoteException { |
| 3589 | Parcel data = Parcel.obtain(); |
| 3590 | Parcel reply = Parcel.obtain(); |
| 3591 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3592 | uri.writeToParcel(data, 0); |
| 3593 | data.writeInt(mode); |
| 3594 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3595 | reply.readException(); |
| 3596 | data.recycle(); |
| 3597 | reply.recycle(); |
| 3598 | } |
| 3599 | |
| 3600 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 3601 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 3602 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 3603 | Parcel data = Parcel.obtain(); |
| 3604 | Parcel reply = Parcel.obtain(); |
| 3605 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 3606 | data.writeString(packageName); |
| 3607 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 3608 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 3609 | reply.readException(); |
| 3610 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 3611 | reply); |
| 3612 | data.recycle(); |
| 3613 | reply.recycle(); |
| 3614 | return perms; |
| 3615 | } |
| 3616 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3617 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 3618 | throws RemoteException { |
| 3619 | Parcel data = Parcel.obtain(); |
| 3620 | Parcel reply = Parcel.obtain(); |
| 3621 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3622 | data.writeStrongBinder(who.asBinder()); |
| 3623 | data.writeInt(waiting ? 1 : 0); |
| 3624 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 3625 | reply.readException(); |
| 3626 | data.recycle(); |
| 3627 | reply.recycle(); |
| 3628 | } |
| 3629 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 3630 | Parcel data = Parcel.obtain(); |
| 3631 | Parcel reply = Parcel.obtain(); |
| 3632 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3633 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 3634 | reply.readException(); |
| 3635 | outInfo.readFromParcel(reply); |
| 3636 | data.recycle(); |
| 3637 | reply.recycle(); |
| 3638 | } |
| 3639 | public void unhandledBack() throws RemoteException |
| 3640 | { |
| 3641 | Parcel data = Parcel.obtain(); |
| 3642 | Parcel reply = Parcel.obtain(); |
| 3643 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3644 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 3645 | reply.readException(); |
| 3646 | data.recycle(); |
| 3647 | reply.recycle(); |
| 3648 | } |
| 3649 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 3650 | { |
| 3651 | Parcel data = Parcel.obtain(); |
| 3652 | Parcel reply = Parcel.obtain(); |
| 3653 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3654 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 3655 | reply.readException(); |
| 3656 | ParcelFileDescriptor pfd = null; |
| 3657 | if (reply.readInt() != 0) { |
| 3658 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 3659 | } |
| 3660 | data.recycle(); |
| 3661 | reply.recycle(); |
| 3662 | return pfd; |
| 3663 | } |
| 3664 | public void goingToSleep() throws RemoteException |
| 3665 | { |
| 3666 | Parcel data = Parcel.obtain(); |
| 3667 | Parcel reply = Parcel.obtain(); |
| 3668 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3669 | mRemote.transact(GOING_TO_SLEEP_TRANSACTION, data, reply, 0); |
| 3670 | reply.readException(); |
| 3671 | data.recycle(); |
| 3672 | reply.recycle(); |
| 3673 | } |
| 3674 | public void wakingUp() throws RemoteException |
| 3675 | { |
| 3676 | Parcel data = Parcel.obtain(); |
| 3677 | Parcel reply = Parcel.obtain(); |
| 3678 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3679 | mRemote.transact(WAKING_UP_TRANSACTION, data, reply, 0); |
| 3680 | reply.readException(); |
| 3681 | data.recycle(); |
| 3682 | reply.recycle(); |
| 3683 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 3684 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 3685 | { |
| 3686 | Parcel data = Parcel.obtain(); |
| 3687 | Parcel reply = Parcel.obtain(); |
| 3688 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3689 | data.writeInt(shown ? 1 : 0); |
| 3690 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 3691 | reply.readException(); |
| 3692 | data.recycle(); |
| 3693 | reply.recycle(); |
| 3694 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3695 | public void setDebugApp( |
| 3696 | String packageName, boolean waitForDebugger, boolean persistent) |
| 3697 | throws RemoteException |
| 3698 | { |
| 3699 | Parcel data = Parcel.obtain(); |
| 3700 | Parcel reply = Parcel.obtain(); |
| 3701 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3702 | data.writeString(packageName); |
| 3703 | data.writeInt(waitForDebugger ? 1 : 0); |
| 3704 | data.writeInt(persistent ? 1 : 0); |
| 3705 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 3706 | reply.readException(); |
| 3707 | data.recycle(); |
| 3708 | reply.recycle(); |
| 3709 | } |
| 3710 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 3711 | { |
| 3712 | Parcel data = Parcel.obtain(); |
| 3713 | Parcel reply = Parcel.obtain(); |
| 3714 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3715 | data.writeInt(enabled ? 1 : 0); |
| 3716 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 3717 | reply.readException(); |
| 3718 | data.recycle(); |
| 3719 | reply.recycle(); |
| 3720 | } |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 3721 | public void setActivityController(IActivityController watcher) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3722 | { |
| 3723 | Parcel data = Parcel.obtain(); |
| 3724 | Parcel reply = Parcel.obtain(); |
| 3725 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3726 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 3727 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3728 | reply.readException(); |
| 3729 | data.recycle(); |
| 3730 | reply.recycle(); |
| 3731 | } |
| 3732 | public void enterSafeMode() throws RemoteException { |
| 3733 | Parcel data = Parcel.obtain(); |
| 3734 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3735 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 3736 | data.recycle(); |
| 3737 | } |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 3738 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg) |
| 3739 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3740 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3741 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 3742 | data.writeStrongBinder(sender.asBinder()); |
| 3743 | data.writeInt(sourceUid); |
| 3744 | data.writeString(sourcePkg); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3745 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 3746 | data.recycle(); |
| 3747 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 3748 | 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] | 3749 | Parcel data = Parcel.obtain(); |
| 3750 | Parcel reply = Parcel.obtain(); |
| 3751 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3752 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 3753 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 3754 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 3755 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 3756 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3757 | boolean res = reply.readInt() != 0; |
| 3758 | data.recycle(); |
| 3759 | reply.recycle(); |
| 3760 | return res; |
| 3761 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 3762 | @Override |
| 3763 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 3764 | Parcel data = Parcel.obtain(); |
| 3765 | Parcel reply = Parcel.obtain(); |
| 3766 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3767 | data.writeString(reason); |
| 3768 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3769 | boolean res = reply.readInt() != 0; |
| 3770 | data.recycle(); |
| 3771 | reply.recycle(); |
| 3772 | return res; |
| 3773 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3774 | public void startRunning(String pkg, String cls, String action, |
| 3775 | String indata) throws RemoteException { |
| 3776 | Parcel data = Parcel.obtain(); |
| 3777 | Parcel reply = Parcel.obtain(); |
| 3778 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3779 | data.writeString(pkg); |
| 3780 | data.writeString(cls); |
| 3781 | data.writeString(action); |
| 3782 | data.writeString(indata); |
| 3783 | mRemote.transact(START_RUNNING_TRANSACTION, data, reply, 0); |
| 3784 | reply.readException(); |
| 3785 | data.recycle(); |
| 3786 | reply.recycle(); |
| 3787 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3788 | public boolean testIsSystemReady() |
| 3789 | { |
| 3790 | /* this base class version is never called */ |
| 3791 | return true; |
| 3792 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 3793 | public void handleApplicationCrash(IBinder app, |
| 3794 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 3795 | { |
| 3796 | Parcel data = Parcel.obtain(); |
| 3797 | Parcel reply = Parcel.obtain(); |
| 3798 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3799 | data.writeStrongBinder(app); |
| 3800 | crashInfo.writeToParcel(data, 0); |
| 3801 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 3802 | reply.readException(); |
| 3803 | reply.recycle(); |
| 3804 | data.recycle(); |
| 3805 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 3806 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 3807 | public boolean handleApplicationWtf(IBinder app, String tag, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 3808 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3809 | { |
| 3810 | Parcel data = Parcel.obtain(); |
| 3811 | Parcel reply = Parcel.obtain(); |
| 3812 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3813 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3814 | data.writeString(tag); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 3815 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 3816 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3817 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 3818 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3819 | reply.recycle(); |
| 3820 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 3821 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3822 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 3823 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 3824 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 3825 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 3826 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 3827 | { |
| 3828 | Parcel data = Parcel.obtain(); |
| 3829 | Parcel reply = Parcel.obtain(); |
| 3830 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3831 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 3832 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 3833 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 3834 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 3835 | reply.readException(); |
| 3836 | reply.recycle(); |
| 3837 | data.recycle(); |
| 3838 | } |
| 3839 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3840 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 3841 | Parcel data = Parcel.obtain(); |
| 3842 | Parcel reply = Parcel.obtain(); |
| 3843 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3844 | data.writeInt(sig); |
| 3845 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 3846 | reply.readException(); |
| 3847 | data.recycle(); |
| 3848 | reply.recycle(); |
| 3849 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 3850 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3851 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3852 | Parcel data = Parcel.obtain(); |
| 3853 | Parcel reply = Parcel.obtain(); |
| 3854 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3855 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3856 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 3857 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 3858 | reply.readException(); |
| 3859 | data.recycle(); |
| 3860 | reply.recycle(); |
| 3861 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 3862 | |
| 3863 | public void killAllBackgroundProcesses() throws RemoteException { |
| 3864 | Parcel data = Parcel.obtain(); |
| 3865 | Parcel reply = Parcel.obtain(); |
| 3866 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3867 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 3868 | reply.readException(); |
| 3869 | data.recycle(); |
| 3870 | reply.recycle(); |
| 3871 | } |
| 3872 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3873 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 3874 | Parcel data = Parcel.obtain(); |
| 3875 | Parcel reply = Parcel.obtain(); |
| 3876 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3877 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3878 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 3879 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3880 | reply.readException(); |
| 3881 | data.recycle(); |
| 3882 | reply.recycle(); |
| 3883 | } |
| 3884 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 3885 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 3886 | throws RemoteException |
| 3887 | { |
| 3888 | Parcel data = Parcel.obtain(); |
| 3889 | Parcel reply = Parcel.obtain(); |
| 3890 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3891 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 3892 | reply.readException(); |
| 3893 | outInfo.readFromParcel(reply); |
| 3894 | reply.recycle(); |
| 3895 | data.recycle(); |
| 3896 | } |
| 3897 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3898 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 3899 | { |
| 3900 | Parcel data = Parcel.obtain(); |
| 3901 | Parcel reply = Parcel.obtain(); |
| 3902 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3903 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 3904 | reply.readException(); |
| 3905 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 3906 | reply.recycle(); |
| 3907 | data.recycle(); |
| 3908 | return res; |
| 3909 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 3910 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3911 | public boolean profileControl(String process, int userId, boolean start, |
Romain Guy | 7eabe55 | 2011-07-21 14:56:34 -0700 | [diff] [blame] | 3912 | String path, ParcelFileDescriptor fd, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 3913 | { |
| 3914 | Parcel data = Parcel.obtain(); |
| 3915 | Parcel reply = Parcel.obtain(); |
| 3916 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3917 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3918 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 3919 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 3920 | data.writeInt(profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 3921 | data.writeString(path); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 3922 | if (fd != null) { |
| 3923 | data.writeInt(1); |
| 3924 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 3925 | } else { |
| 3926 | data.writeInt(0); |
| 3927 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 3928 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 3929 | reply.readException(); |
| 3930 | boolean res = reply.readInt() != 0; |
| 3931 | reply.recycle(); |
| 3932 | data.recycle(); |
| 3933 | return res; |
| 3934 | } |
| 3935 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 3936 | public boolean shutdown(int timeout) throws RemoteException |
| 3937 | { |
| 3938 | Parcel data = Parcel.obtain(); |
| 3939 | Parcel reply = Parcel.obtain(); |
| 3940 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3941 | data.writeInt(timeout); |
| 3942 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 3943 | reply.readException(); |
| 3944 | boolean res = reply.readInt() != 0; |
| 3945 | reply.recycle(); |
| 3946 | data.recycle(); |
| 3947 | return res; |
| 3948 | } |
| 3949 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 3950 | public void stopAppSwitches() throws RemoteException { |
| 3951 | Parcel data = Parcel.obtain(); |
| 3952 | Parcel reply = Parcel.obtain(); |
| 3953 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3954 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 3955 | reply.readException(); |
| 3956 | reply.recycle(); |
| 3957 | data.recycle(); |
| 3958 | } |
| 3959 | |
| 3960 | public void resumeAppSwitches() throws RemoteException { |
| 3961 | Parcel data = Parcel.obtain(); |
| 3962 | Parcel reply = Parcel.obtain(); |
| 3963 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3964 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 3965 | reply.readException(); |
| 3966 | reply.recycle(); |
| 3967 | data.recycle(); |
| 3968 | } |
| 3969 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 3970 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 3971 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 3972 | Parcel data = Parcel.obtain(); |
| 3973 | Parcel reply = Parcel.obtain(); |
| 3974 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3975 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3976 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 3977 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3978 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 3979 | reply.readException(); |
| 3980 | data.recycle(); |
| 3981 | reply.recycle(); |
| 3982 | } |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 3983 | |
| 3984 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 3985 | Parcel data = Parcel.obtain(); |
| 3986 | Parcel reply = Parcel.obtain(); |
| 3987 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3988 | data.writeString(reason); |
| 3989 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 3990 | reply.readException(); |
| 3991 | data.recycle(); |
| 3992 | reply.recycle(); |
| 3993 | } |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 3994 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 3995 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 3996 | throws RemoteException { |
| 3997 | Parcel data = Parcel.obtain(); |
| 3998 | Parcel reply = Parcel.obtain(); |
| 3999 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4000 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4001 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4002 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4003 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4004 | data.recycle(); |
| 4005 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4006 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4007 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 4008 | |
| 4009 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 4010 | Parcel data = Parcel.obtain(); |
| 4011 | Parcel reply = Parcel.obtain(); |
| 4012 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4013 | data.writeString(processName); |
| 4014 | data.writeInt(uid); |
| 4015 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 4016 | reply.readException(); |
| 4017 | data.recycle(); |
| 4018 | reply.recycle(); |
| 4019 | } |
| 4020 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 4021 | public void overridePendingTransition(IBinder token, String packageName, |
| 4022 | int enterAnim, int exitAnim) throws RemoteException { |
| 4023 | Parcel data = Parcel.obtain(); |
| 4024 | Parcel reply = Parcel.obtain(); |
| 4025 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4026 | data.writeStrongBinder(token); |
| 4027 | data.writeString(packageName); |
| 4028 | data.writeInt(enterAnim); |
| 4029 | data.writeInt(exitAnim); |
| 4030 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 4031 | reply.readException(); |
| 4032 | data.recycle(); |
| 4033 | reply.recycle(); |
| 4034 | } |
| 4035 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 4036 | public boolean isUserAMonkey() throws RemoteException { |
| 4037 | Parcel data = Parcel.obtain(); |
| 4038 | Parcel reply = Parcel.obtain(); |
| 4039 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4040 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 4041 | reply.readException(); |
| 4042 | boolean res = reply.readInt() != 0; |
| 4043 | data.recycle(); |
| 4044 | reply.recycle(); |
| 4045 | return res; |
| 4046 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 4047 | |
| 4048 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 4049 | Parcel data = Parcel.obtain(); |
| 4050 | Parcel reply = Parcel.obtain(); |
| 4051 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4052 | data.writeInt(monkey ? 1 : 0); |
| 4053 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 4054 | reply.readException(); |
| 4055 | data.recycle(); |
| 4056 | reply.recycle(); |
| 4057 | } |
| 4058 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 4059 | public void finishHeavyWeightApp() throws RemoteException { |
| 4060 | Parcel data = Parcel.obtain(); |
| 4061 | Parcel reply = Parcel.obtain(); |
| 4062 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4063 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 4064 | reply.readException(); |
| 4065 | data.recycle(); |
| 4066 | reply.recycle(); |
| 4067 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4068 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4069 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4070 | throws RemoteException { |
| 4071 | Parcel data = Parcel.obtain(); |
| 4072 | Parcel reply = Parcel.obtain(); |
| 4073 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4074 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4075 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 4076 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4077 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4078 | data.recycle(); |
| 4079 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4080 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4081 | } |
| 4082 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4083 | public boolean convertToTranslucent(IBinder token) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4084 | throws RemoteException { |
| 4085 | Parcel data = Parcel.obtain(); |
| 4086 | Parcel reply = Parcel.obtain(); |
| 4087 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4088 | data.writeStrongBinder(token); |
| 4089 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4090 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4091 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4092 | data.recycle(); |
| 4093 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4094 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4095 | } |
| 4096 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4097 | public void setImmersive(IBinder token, boolean immersive) |
| 4098 | throws RemoteException { |
| 4099 | Parcel data = Parcel.obtain(); |
| 4100 | Parcel reply = Parcel.obtain(); |
| 4101 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4102 | data.writeStrongBinder(token); |
| 4103 | data.writeInt(immersive ? 1 : 0); |
| 4104 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 4105 | reply.readException(); |
| 4106 | data.recycle(); |
| 4107 | reply.recycle(); |
| 4108 | } |
| 4109 | |
| 4110 | public boolean isImmersive(IBinder token) |
| 4111 | throws RemoteException { |
| 4112 | Parcel data = Parcel.obtain(); |
| 4113 | Parcel reply = Parcel.obtain(); |
| 4114 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4115 | data.writeStrongBinder(token); |
| 4116 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4117 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4118 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4119 | data.recycle(); |
| 4120 | reply.recycle(); |
| 4121 | return res; |
| 4122 | } |
| 4123 | |
| 4124 | public boolean isTopActivityImmersive() |
| 4125 | throws RemoteException { |
| 4126 | Parcel data = Parcel.obtain(); |
| 4127 | Parcel reply = Parcel.obtain(); |
| 4128 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4129 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4130 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4131 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4132 | data.recycle(); |
| 4133 | reply.recycle(); |
| 4134 | return res; |
| 4135 | } |
| 4136 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 4137 | public void crashApplication(int uid, int initialPid, String packageName, |
| 4138 | String message) throws RemoteException { |
| 4139 | Parcel data = Parcel.obtain(); |
| 4140 | Parcel reply = Parcel.obtain(); |
| 4141 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4142 | data.writeInt(uid); |
| 4143 | data.writeInt(initialPid); |
| 4144 | data.writeString(packageName); |
| 4145 | data.writeString(message); |
| 4146 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 4147 | reply.readException(); |
| 4148 | data.recycle(); |
| 4149 | reply.recycle(); |
| 4150 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4151 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4152 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 4153 | Parcel data = Parcel.obtain(); |
| 4154 | Parcel reply = Parcel.obtain(); |
| 4155 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4156 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4157 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 4158 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 4159 | reply.readException(); |
| 4160 | String res = reply.readString(); |
| 4161 | data.recycle(); |
| 4162 | reply.recycle(); |
| 4163 | return res; |
| 4164 | } |
| 4165 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4166 | public IBinder newUriPermissionOwner(String name) |
| 4167 | throws RemoteException { |
| 4168 | Parcel data = Parcel.obtain(); |
| 4169 | Parcel reply = Parcel.obtain(); |
| 4170 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4171 | data.writeString(name); |
| 4172 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 4173 | reply.readException(); |
| 4174 | IBinder res = reply.readStrongBinder(); |
| 4175 | data.recycle(); |
| 4176 | reply.recycle(); |
| 4177 | return res; |
| 4178 | } |
| 4179 | |
| 4180 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
| 4181 | Uri uri, int mode) throws RemoteException { |
| 4182 | Parcel data = Parcel.obtain(); |
| 4183 | Parcel reply = Parcel.obtain(); |
| 4184 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4185 | data.writeStrongBinder(owner); |
| 4186 | data.writeInt(fromUid); |
| 4187 | data.writeString(targetPkg); |
| 4188 | uri.writeToParcel(data, 0); |
| 4189 | data.writeInt(mode); |
| 4190 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4191 | reply.readException(); |
| 4192 | data.recycle(); |
| 4193 | reply.recycle(); |
| 4194 | } |
| 4195 | |
| 4196 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
| 4197 | int mode) throws RemoteException { |
| 4198 | Parcel data = Parcel.obtain(); |
| 4199 | Parcel reply = Parcel.obtain(); |
| 4200 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4201 | data.writeStrongBinder(owner); |
| 4202 | if (uri != null) { |
| 4203 | data.writeInt(1); |
| 4204 | uri.writeToParcel(data, 0); |
| 4205 | } else { |
| 4206 | data.writeInt(0); |
| 4207 | } |
| 4208 | data.writeInt(mode); |
| 4209 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4210 | reply.readException(); |
| 4211 | data.recycle(); |
| 4212 | reply.recycle(); |
| 4213 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 4214 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 4215 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
| 4216 | Uri uri, int modeFlags) throws RemoteException { |
| 4217 | Parcel data = Parcel.obtain(); |
| 4218 | Parcel reply = Parcel.obtain(); |
| 4219 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4220 | data.writeInt(callingUid); |
| 4221 | data.writeString(targetPkg); |
| 4222 | uri.writeToParcel(data, 0); |
| 4223 | data.writeInt(modeFlags); |
| 4224 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4225 | reply.readException(); |
| 4226 | int res = reply.readInt(); |
| 4227 | data.recycle(); |
| 4228 | reply.recycle(); |
| 4229 | return res; |
| 4230 | } |
| 4231 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4232 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4233 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 4234 | Parcel data = Parcel.obtain(); |
| 4235 | Parcel reply = Parcel.obtain(); |
| 4236 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4237 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4238 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4239 | data.writeInt(managed ? 1 : 0); |
| 4240 | data.writeString(path); |
| 4241 | if (fd != null) { |
| 4242 | data.writeInt(1); |
| 4243 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 4244 | } else { |
| 4245 | data.writeInt(0); |
| 4246 | } |
| 4247 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 4248 | reply.readException(); |
| 4249 | boolean res = reply.readInt() != 0; |
| 4250 | reply.recycle(); |
| 4251 | data.recycle(); |
| 4252 | return res; |
| 4253 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 4254 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 4255 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 4256 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 4257 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4258 | Parcel data = Parcel.obtain(); |
| 4259 | Parcel reply = Parcel.obtain(); |
| 4260 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4261 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 4262 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4263 | data.writeTypedArray(intents, 0); |
| 4264 | data.writeStringArray(resolvedTypes); |
| 4265 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 4266 | if (options != null) { |
| 4267 | data.writeInt(1); |
| 4268 | options.writeToParcel(data, 0); |
| 4269 | } else { |
| 4270 | data.writeInt(0); |
| 4271 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 4272 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4273 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 4274 | reply.readException(); |
| 4275 | int result = reply.readInt(); |
| 4276 | reply.recycle(); |
| 4277 | data.recycle(); |
| 4278 | return result; |
| 4279 | } |
| 4280 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4281 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 4282 | Parcel data = Parcel.obtain(); |
| 4283 | Parcel reply = Parcel.obtain(); |
| 4284 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4285 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4286 | reply.readException(); |
| 4287 | int mode = reply.readInt(); |
| 4288 | reply.recycle(); |
| 4289 | data.recycle(); |
| 4290 | return mode; |
| 4291 | } |
| 4292 | |
| 4293 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 4294 | Parcel data = Parcel.obtain(); |
| 4295 | Parcel reply = Parcel.obtain(); |
| 4296 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4297 | data.writeInt(mode); |
| 4298 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4299 | reply.readException(); |
| 4300 | reply.recycle(); |
| 4301 | data.recycle(); |
| 4302 | } |
| 4303 | |
| 4304 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 4305 | Parcel data = Parcel.obtain(); |
| 4306 | Parcel reply = Parcel.obtain(); |
| 4307 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 4308 | data.writeString(packageName); |
| 4309 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4310 | reply.readException(); |
| 4311 | int mode = reply.readInt(); |
| 4312 | reply.recycle(); |
| 4313 | data.recycle(); |
| 4314 | return mode; |
| 4315 | } |
| 4316 | |
| 4317 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 4318 | throws RemoteException { |
| 4319 | Parcel data = Parcel.obtain(); |
| 4320 | Parcel reply = Parcel.obtain(); |
| 4321 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4322 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4323 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 4324 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4325 | reply.readException(); |
| 4326 | reply.recycle(); |
| 4327 | data.recycle(); |
| 4328 | } |
| 4329 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 4330 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 4331 | Parcel data = Parcel.obtain(); |
| 4332 | Parcel reply = Parcel.obtain(); |
| 4333 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4334 | data.writeString(packageName); |
| 4335 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 4336 | reply.readException(); |
| 4337 | boolean ask = reply.readInt() != 0; |
| 4338 | reply.recycle(); |
| 4339 | data.recycle(); |
| 4340 | return ask; |
| 4341 | } |
| 4342 | |
| 4343 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 4344 | throws RemoteException { |
| 4345 | Parcel data = Parcel.obtain(); |
| 4346 | Parcel reply = Parcel.obtain(); |
| 4347 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4348 | data.writeString(packageName); |
| 4349 | data.writeInt(ask ? 1 : 0); |
| 4350 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 4351 | reply.readException(); |
| 4352 | reply.recycle(); |
| 4353 | data.recycle(); |
| 4354 | } |
| 4355 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4356 | public boolean switchUser(int userid) throws RemoteException { |
| 4357 | Parcel data = Parcel.obtain(); |
| 4358 | Parcel reply = Parcel.obtain(); |
| 4359 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4360 | data.writeInt(userid); |
| 4361 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 4362 | reply.readException(); |
| 4363 | boolean result = reply.readInt() != 0; |
| 4364 | reply.recycle(); |
| 4365 | data.recycle(); |
| 4366 | return result; |
| 4367 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 4368 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 4369 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 4370 | Parcel data = Parcel.obtain(); |
| 4371 | Parcel reply = Parcel.obtain(); |
| 4372 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4373 | data.writeInt(userid); |
| 4374 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 4375 | reply.readException(); |
| 4376 | boolean result = reply.readInt() != 0; |
| 4377 | reply.recycle(); |
| 4378 | data.recycle(); |
| 4379 | return result; |
| 4380 | } |
| 4381 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 4382 | public int stopUser(int userid, IStopUserCallback callback) throws RemoteException { |
| 4383 | Parcel data = Parcel.obtain(); |
| 4384 | Parcel reply = Parcel.obtain(); |
| 4385 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4386 | data.writeInt(userid); |
| 4387 | data.writeStrongInterface(callback); |
| 4388 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 4389 | reply.readException(); |
| 4390 | int result = reply.readInt(); |
| 4391 | reply.recycle(); |
| 4392 | data.recycle(); |
| 4393 | return result; |
| 4394 | } |
| 4395 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 4396 | public UserInfo getCurrentUser() throws RemoteException { |
| 4397 | Parcel data = Parcel.obtain(); |
| 4398 | Parcel reply = Parcel.obtain(); |
| 4399 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 4400 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 4401 | reply.readException(); |
| 4402 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 4403 | reply.recycle(); |
| 4404 | data.recycle(); |
| 4405 | return userInfo; |
| 4406 | } |
| 4407 | |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 4408 | public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4409 | Parcel data = Parcel.obtain(); |
| 4410 | Parcel reply = Parcel.obtain(); |
| 4411 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4412 | data.writeInt(userid); |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 4413 | data.writeInt(orStopping ? 1 : 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4414 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 4415 | reply.readException(); |
| 4416 | boolean result = reply.readInt() != 0; |
| 4417 | reply.recycle(); |
| 4418 | data.recycle(); |
| 4419 | return result; |
| 4420 | } |
| 4421 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 4422 | public int[] getRunningUserIds() throws RemoteException { |
| 4423 | Parcel data = Parcel.obtain(); |
| 4424 | Parcel reply = Parcel.obtain(); |
| 4425 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4426 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 4427 | reply.readException(); |
| 4428 | int[] result = reply.createIntArray(); |
| 4429 | reply.recycle(); |
| 4430 | data.recycle(); |
| 4431 | return result; |
| 4432 | } |
| 4433 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 4434 | public boolean removeSubTask(int taskId, int subTaskIndex) throws RemoteException { |
| 4435 | Parcel data = Parcel.obtain(); |
| 4436 | Parcel reply = Parcel.obtain(); |
| 4437 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4438 | data.writeInt(taskId); |
| 4439 | data.writeInt(subTaskIndex); |
| 4440 | mRemote.transact(REMOVE_SUB_TASK_TRANSACTION, data, reply, 0); |
| 4441 | reply.readException(); |
| 4442 | boolean result = reply.readInt() != 0; |
| 4443 | reply.recycle(); |
| 4444 | data.recycle(); |
| 4445 | return result; |
| 4446 | } |
| 4447 | |
| 4448 | public boolean removeTask(int taskId, int flags) throws RemoteException { |
| 4449 | Parcel data = Parcel.obtain(); |
| 4450 | Parcel reply = Parcel.obtain(); |
| 4451 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4452 | data.writeInt(taskId); |
| 4453 | data.writeInt(flags); |
| 4454 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 4455 | reply.readException(); |
| 4456 | boolean result = reply.readInt() != 0; |
| 4457 | reply.recycle(); |
| 4458 | data.recycle(); |
| 4459 | return result; |
| 4460 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4461 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 4462 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 4463 | Parcel data = Parcel.obtain(); |
| 4464 | Parcel reply = Parcel.obtain(); |
| 4465 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4466 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 4467 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 4468 | reply.readException(); |
| 4469 | data.recycle(); |
| 4470 | reply.recycle(); |
| 4471 | } |
| 4472 | |
| 4473 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 4474 | Parcel data = Parcel.obtain(); |
| 4475 | Parcel reply = Parcel.obtain(); |
| 4476 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4477 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 4478 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 4479 | reply.readException(); |
| 4480 | data.recycle(); |
| 4481 | reply.recycle(); |
| 4482 | } |
| 4483 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 4484 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 4485 | Parcel data = Parcel.obtain(); |
| 4486 | Parcel reply = Parcel.obtain(); |
| 4487 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4488 | data.writeStrongBinder(sender.asBinder()); |
| 4489 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 4490 | reply.readException(); |
| 4491 | boolean res = reply.readInt() != 0; |
| 4492 | data.recycle(); |
| 4493 | reply.recycle(); |
| 4494 | return res; |
| 4495 | } |
| 4496 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 4497 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 4498 | Parcel data = Parcel.obtain(); |
| 4499 | Parcel reply = Parcel.obtain(); |
| 4500 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4501 | data.writeStrongBinder(sender.asBinder()); |
| 4502 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4503 | reply.readException(); |
| 4504 | boolean res = reply.readInt() != 0; |
| 4505 | data.recycle(); |
| 4506 | reply.recycle(); |
| 4507 | return res; |
| 4508 | } |
| 4509 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 4510 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 4511 | Parcel data = Parcel.obtain(); |
| 4512 | Parcel reply = Parcel.obtain(); |
| 4513 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4514 | data.writeStrongBinder(sender.asBinder()); |
| 4515 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4516 | reply.readException(); |
| 4517 | Intent res = reply.readInt() != 0 |
| 4518 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 4519 | data.recycle(); |
| 4520 | reply.recycle(); |
| 4521 | return res; |
| 4522 | } |
| 4523 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 4524 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 4525 | throws RemoteException { |
| 4526 | Parcel data = Parcel.obtain(); |
| 4527 | Parcel reply = Parcel.obtain(); |
| 4528 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4529 | data.writeStrongBinder(sender.asBinder()); |
| 4530 | data.writeString(prefix); |
| 4531 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4532 | reply.readException(); |
| 4533 | String res = reply.readString(); |
| 4534 | data.recycle(); |
| 4535 | reply.recycle(); |
| 4536 | return res; |
| 4537 | } |
| 4538 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 4539 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 4540 | { |
| 4541 | Parcel data = Parcel.obtain(); |
| 4542 | Parcel reply = Parcel.obtain(); |
| 4543 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4544 | values.writeToParcel(data, 0); |
| 4545 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4546 | reply.readException(); |
| 4547 | data.recycle(); |
| 4548 | reply.recycle(); |
| 4549 | } |
| 4550 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 4551 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 4552 | Parcel data = Parcel.obtain(); |
| 4553 | Parcel reply = Parcel.obtain(); |
| 4554 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4555 | data.writeIntArray(pids); |
| 4556 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 4557 | reply.readException(); |
| 4558 | long[] res = reply.createLongArray(); |
| 4559 | data.recycle(); |
| 4560 | reply.recycle(); |
| 4561 | return res; |
| 4562 | } |
| 4563 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 4564 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 4565 | Parcel data = Parcel.obtain(); |
| 4566 | Parcel reply = Parcel.obtain(); |
| 4567 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4568 | TextUtils.writeToParcel(msg, data, 0); |
| 4569 | data.writeInt(always ? 1 : 0); |
| 4570 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 4571 | reply.readException(); |
| 4572 | data.recycle(); |
| 4573 | reply.recycle(); |
| 4574 | } |
| 4575 | |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 4576 | public void dismissKeyguardOnNextActivity() throws RemoteException { |
| 4577 | Parcel data = Parcel.obtain(); |
| 4578 | Parcel reply = Parcel.obtain(); |
| 4579 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4580 | mRemote.transact(DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4581 | reply.readException(); |
| 4582 | data.recycle(); |
| 4583 | reply.recycle(); |
| 4584 | } |
| 4585 | |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 4586 | public boolean targetTaskAffinityMatchesActivity(IBinder token, String destAffinity) |
| 4587 | throws RemoteException { |
| 4588 | Parcel data = Parcel.obtain(); |
| 4589 | Parcel reply = Parcel.obtain(); |
| 4590 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4591 | data.writeStrongBinder(token); |
| 4592 | data.writeString(destAffinity); |
| 4593 | mRemote.transact(TARGET_TASK_AFFINITY_MATCHES_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4594 | reply.readException(); |
| 4595 | boolean result = reply.readInt() != 0; |
| 4596 | data.recycle(); |
| 4597 | reply.recycle(); |
| 4598 | return result; |
| 4599 | } |
| 4600 | |
| 4601 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 4602 | throws RemoteException { |
| 4603 | Parcel data = Parcel.obtain(); |
| 4604 | Parcel reply = Parcel.obtain(); |
| 4605 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4606 | data.writeStrongBinder(token); |
| 4607 | target.writeToParcel(data, 0); |
| 4608 | data.writeInt(resultCode); |
| 4609 | if (resultData != null) { |
| 4610 | data.writeInt(1); |
| 4611 | resultData.writeToParcel(data, 0); |
| 4612 | } else { |
| 4613 | data.writeInt(0); |
| 4614 | } |
| 4615 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 4616 | reply.readException(); |
| 4617 | boolean result = reply.readInt() != 0; |
| 4618 | data.recycle(); |
| 4619 | reply.recycle(); |
| 4620 | return result; |
| 4621 | } |
| 4622 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 4623 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 4624 | Parcel data = Parcel.obtain(); |
| 4625 | Parcel reply = Parcel.obtain(); |
| 4626 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4627 | data.writeStrongBinder(activityToken); |
| 4628 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 4629 | reply.readException(); |
| 4630 | int result = reply.readInt(); |
| 4631 | data.recycle(); |
| 4632 | reply.recycle(); |
| 4633 | return result; |
| 4634 | } |
| 4635 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 4636 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 4637 | Parcel data = Parcel.obtain(); |
| 4638 | Parcel reply = Parcel.obtain(); |
| 4639 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4640 | data.writeStrongBinder(activityToken); |
| 4641 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 4642 | reply.readException(); |
| 4643 | String result = reply.readString(); |
| 4644 | data.recycle(); |
| 4645 | reply.recycle(); |
| 4646 | return result; |
| 4647 | } |
| 4648 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 4649 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 4650 | Parcel data = Parcel.obtain(); |
| 4651 | Parcel reply = Parcel.obtain(); |
| 4652 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4653 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 4654 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 4655 | reply.readException(); |
| 4656 | data.recycle(); |
| 4657 | reply.recycle(); |
| 4658 | } |
| 4659 | |
| 4660 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 4661 | Parcel data = Parcel.obtain(); |
| 4662 | Parcel reply = Parcel.obtain(); |
| 4663 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4664 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 4665 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 4666 | reply.readException(); |
| 4667 | data.recycle(); |
| 4668 | reply.recycle(); |
| 4669 | } |
| 4670 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 4671 | public void requestBugReport() throws RemoteException { |
| 4672 | Parcel data = Parcel.obtain(); |
| 4673 | Parcel reply = Parcel.obtain(); |
| 4674 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4675 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 4676 | reply.readException(); |
| 4677 | data.recycle(); |
| 4678 | reply.recycle(); |
| 4679 | } |
| 4680 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 4681 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 4682 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 4683 | Parcel data = Parcel.obtain(); |
| 4684 | Parcel reply = Parcel.obtain(); |
| 4685 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4686 | data.writeInt(pid); |
| 4687 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 4688 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 4689 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 4690 | reply.readException(); |
| 4691 | long res = reply.readInt(); |
| 4692 | data.recycle(); |
| 4693 | reply.recycle(); |
| 4694 | return res; |
| 4695 | } |
| 4696 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 4697 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 4698 | Parcel data = Parcel.obtain(); |
| 4699 | Parcel reply = Parcel.obtain(); |
| 4700 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4701 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 4702 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 4703 | reply.readException(); |
| 4704 | Bundle res = reply.readBundle(); |
| 4705 | data.recycle(); |
| 4706 | reply.recycle(); |
| 4707 | return res; |
| 4708 | } |
| 4709 | |
Adam Skory | 7140a25 | 2013-09-11 12:04:58 +0100 | [diff] [blame] | 4710 | public void reportAssistContextExtras(IBinder token, Bundle extras) |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 4711 | throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 4712 | Parcel data = Parcel.obtain(); |
| 4713 | Parcel reply = Parcel.obtain(); |
| 4714 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4715 | data.writeStrongBinder(token); |
| 4716 | data.writeBundle(extras); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 4717 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 4718 | reply.readException(); |
| 4719 | data.recycle(); |
| 4720 | reply.recycle(); |
| 4721 | } |
| 4722 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 4723 | public void killUid(int uid, String reason) throws RemoteException { |
| 4724 | Parcel data = Parcel.obtain(); |
| 4725 | Parcel reply = Parcel.obtain(); |
| 4726 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4727 | data.writeInt(uid); |
| 4728 | data.writeString(reason); |
| 4729 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 4730 | reply.readException(); |
| 4731 | data.recycle(); |
| 4732 | reply.recycle(); |
| 4733 | } |
| 4734 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 4735 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 4736 | Parcel data = Parcel.obtain(); |
| 4737 | Parcel reply = Parcel.obtain(); |
| 4738 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4739 | data.writeStrongBinder(who); |
| 4740 | data.writeInt(allowRestart ? 1 : 0); |
| 4741 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 4742 | reply.readException(); |
| 4743 | data.recycle(); |
| 4744 | reply.recycle(); |
| 4745 | } |
| 4746 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 4747 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 4748 | Parcel data = Parcel.obtain(); |
| 4749 | Parcel reply = Parcel.obtain(); |
| 4750 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4751 | data.writeStrongBinder(token); |
| 4752 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 4753 | reply.readException(); |
| 4754 | data.recycle(); |
| 4755 | reply.recycle(); |
| 4756 | } |
| 4757 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4758 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 4759 | Parcel data = Parcel.obtain(); |
| 4760 | Parcel reply = Parcel.obtain(); |
| 4761 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4762 | data.writeStrongBinder(token); |
| 4763 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 4764 | reply.readException(); |
| 4765 | data.recycle(); |
| 4766 | reply.recycle(); |
| 4767 | } |
| 4768 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 4769 | public void restart() throws RemoteException { |
| 4770 | Parcel data = Parcel.obtain(); |
| 4771 | Parcel reply = Parcel.obtain(); |
| 4772 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4773 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 4774 | reply.readException(); |
| 4775 | data.recycle(); |
| 4776 | reply.recycle(); |
| 4777 | } |
| 4778 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 4779 | public void performIdleMaintenance() throws RemoteException { |
| 4780 | Parcel data = Parcel.obtain(); |
| 4781 | Parcel reply = Parcel.obtain(); |
| 4782 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4783 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 4784 | reply.readException(); |
| 4785 | data.recycle(); |
| 4786 | reply.recycle(); |
| 4787 | } |
| 4788 | |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 4789 | public IActivityContainer createActivityContainer(IBinder parentActivityToken, |
| 4790 | IActivityContainerCallback callback) throws RemoteException { |
| 4791 | Parcel data = Parcel.obtain(); |
| 4792 | Parcel reply = Parcel.obtain(); |
| 4793 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4794 | data.writeStrongBinder(parentActivityToken); |
| 4795 | data.writeStrongBinder((IBinder)callback); |
| 4796 | mRemote.transact(CREATE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 4797 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 4798 | final int result = reply.readInt(); |
| 4799 | final IActivityContainer res; |
| 4800 | if (result == 1) { |
| 4801 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 4802 | } else { |
| 4803 | res = null; |
| 4804 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 4805 | data.recycle(); |
| 4806 | reply.recycle(); |
| 4807 | return res; |
| 4808 | } |
| 4809 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 4810 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 4811 | throws RemoteException { |
| 4812 | Parcel data = Parcel.obtain(); |
| 4813 | Parcel reply = Parcel.obtain(); |
| 4814 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4815 | data.writeStrongBinder(activityContainer.asBinder()); |
| 4816 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 4817 | reply.readException(); |
| 4818 | data.recycle(); |
| 4819 | reply.recycle(); |
| 4820 | } |
| 4821 | |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 4822 | public IActivityContainer getEnclosingActivityContainer(IBinder activityToken) |
| 4823 | throws RemoteException { |
| 4824 | Parcel data = Parcel.obtain(); |
| 4825 | Parcel reply = Parcel.obtain(); |
| 4826 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4827 | data.writeStrongBinder(activityToken); |
| 4828 | mRemote.transact(GET_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 4829 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 4830 | final int result = reply.readInt(); |
| 4831 | final IActivityContainer res; |
| 4832 | if (result == 1) { |
| 4833 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 4834 | } else { |
| 4835 | res = null; |
| 4836 | } |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 4837 | data.recycle(); |
| 4838 | reply.recycle(); |
| 4839 | return res; |
| 4840 | } |
| 4841 | |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 4842 | public IBinder getHomeActivityToken() throws RemoteException { |
| 4843 | Parcel data = Parcel.obtain(); |
| 4844 | Parcel reply = Parcel.obtain(); |
| 4845 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4846 | mRemote.transact(GET_HOME_ACTIVITY_TOKEN_TRANSACTION, data, reply, 0); |
| 4847 | reply.readException(); |
| 4848 | IBinder res = reply.readStrongBinder(); |
| 4849 | data.recycle(); |
| 4850 | reply.recycle(); |
| 4851 | return res; |
| 4852 | } |
| 4853 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame^] | 4854 | @Override |
| 4855 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 4856 | Parcel data = Parcel.obtain(); |
| 4857 | Parcel reply = Parcel.obtain(); |
| 4858 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4859 | data.writeInt(taskId); |
| 4860 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 4861 | reply.readException(); |
| 4862 | data.recycle(); |
| 4863 | reply.recycle(); |
| 4864 | } |
| 4865 | |
| 4866 | @Override |
| 4867 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 4868 | Parcel data = Parcel.obtain(); |
| 4869 | Parcel reply = Parcel.obtain(); |
| 4870 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4871 | data.writeStrongBinder(token); |
| 4872 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 4873 | reply.readException(); |
| 4874 | data.recycle(); |
| 4875 | reply.recycle(); |
| 4876 | } |
| 4877 | |
| 4878 | @Override |
| 4879 | public void stopLockTaskMode() throws RemoteException { |
| 4880 | Parcel data = Parcel.obtain(); |
| 4881 | Parcel reply = Parcel.obtain(); |
| 4882 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4883 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 4884 | reply.readException(); |
| 4885 | data.recycle(); |
| 4886 | reply.recycle(); |
| 4887 | } |
| 4888 | |
| 4889 | @Override |
| 4890 | public boolean isInLockTaskMode() throws RemoteException { |
| 4891 | Parcel data = Parcel.obtain(); |
| 4892 | Parcel reply = Parcel.obtain(); |
| 4893 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4894 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 4895 | reply.readException(); |
| 4896 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 4897 | data.recycle(); |
| 4898 | reply.recycle(); |
| 4899 | return isInLockTaskMode; |
| 4900 | } |
| 4901 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4902 | private IBinder mRemote; |
| 4903 | } |