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