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