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