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