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