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