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