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