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