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