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