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