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