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