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); |
| 2248 | int uid = data.readInt(); |
| 2249 | String reason = data.readString(); |
| 2250 | killUid(uid, reason); |
| 2251 | reply.writeNoException(); |
| 2252 | return true; |
| 2253 | } |
| 2254 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2255 | case HANG_TRANSACTION: { |
| 2256 | data.enforceInterface(IActivityManager.descriptor); |
| 2257 | IBinder who = data.readStrongBinder(); |
| 2258 | boolean allowRestart = data.readInt() != 0; |
| 2259 | hang(who, allowRestart); |
| 2260 | reply.writeNoException(); |
| 2261 | return true; |
| 2262 | } |
| 2263 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2264 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2265 | data.enforceInterface(IActivityManager.descriptor); |
| 2266 | IBinder token = data.readStrongBinder(); |
| 2267 | reportActivityFullyDrawn(token); |
| 2268 | reply.writeNoException(); |
| 2269 | return true; |
| 2270 | } |
| 2271 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2272 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2273 | data.enforceInterface(IActivityManager.descriptor); |
| 2274 | IBinder token = data.readStrongBinder(); |
| 2275 | notifyActivityDrawn(token); |
| 2276 | reply.writeNoException(); |
| 2277 | return true; |
| 2278 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2279 | |
| 2280 | case RESTART_TRANSACTION: { |
| 2281 | data.enforceInterface(IActivityManager.descriptor); |
| 2282 | restart(); |
| 2283 | reply.writeNoException(); |
| 2284 | return true; |
| 2285 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2286 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2287 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2288 | data.enforceInterface(IActivityManager.descriptor); |
| 2289 | performIdleMaintenance(); |
| 2290 | reply.writeNoException(); |
| 2291 | return true; |
| 2292 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2293 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2294 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2295 | data.enforceInterface(IActivityManager.descriptor); |
| 2296 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2297 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2298 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2299 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2300 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2301 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2302 | if (activityContainer != null) { |
| 2303 | reply.writeInt(1); |
| 2304 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2305 | } else { |
| 2306 | reply.writeInt(0); |
| 2307 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2308 | return true; |
| 2309 | } |
| 2310 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2311 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2312 | data.enforceInterface(IActivityManager.descriptor); |
| 2313 | IActivityContainer activityContainer = |
| 2314 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2315 | deleteActivityContainer(activityContainer); |
| 2316 | reply.writeNoException(); |
| 2317 | return true; |
| 2318 | } |
| 2319 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2320 | case CREATE_STACK_ON_DISPLAY: { |
| 2321 | data.enforceInterface(IActivityManager.descriptor); |
| 2322 | int displayId = data.readInt(); |
| 2323 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2324 | reply.writeNoException(); |
| 2325 | if (activityContainer != null) { |
| 2326 | reply.writeInt(1); |
| 2327 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2328 | } else { |
| 2329 | reply.writeInt(0); |
| 2330 | } |
| 2331 | return true; |
| 2332 | } |
| 2333 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2334 | case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: { |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2335 | data.enforceInterface(IActivityManager.descriptor); |
| 2336 | IBinder activityToken = data.readStrongBinder(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2337 | int displayId = getActivityDisplayId(activityToken); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2338 | reply.writeNoException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2339 | reply.writeInt(displayId); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2340 | return true; |
| 2341 | } |
| 2342 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2343 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2344 | data.enforceInterface(IActivityManager.descriptor); |
| 2345 | final int taskId = data.readInt(); |
| 2346 | startLockTaskMode(taskId); |
| 2347 | reply.writeNoException(); |
| 2348 | return true; |
| 2349 | } |
| 2350 | |
| 2351 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2352 | data.enforceInterface(IActivityManager.descriptor); |
| 2353 | IBinder token = data.readStrongBinder(); |
| 2354 | startLockTaskMode(token); |
| 2355 | reply.writeNoException(); |
| 2356 | return true; |
| 2357 | } |
| 2358 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2359 | case START_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2360 | data.enforceInterface(IActivityManager.descriptor); |
| 2361 | startLockTaskModeOnCurrent(); |
| 2362 | reply.writeNoException(); |
| 2363 | return true; |
| 2364 | } |
| 2365 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2366 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2367 | data.enforceInterface(IActivityManager.descriptor); |
| 2368 | stopLockTaskMode(); |
| 2369 | reply.writeNoException(); |
| 2370 | return true; |
| 2371 | } |
| 2372 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2373 | case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2374 | data.enforceInterface(IActivityManager.descriptor); |
| 2375 | stopLockTaskModeOnCurrent(); |
| 2376 | reply.writeNoException(); |
| 2377 | return true; |
| 2378 | } |
| 2379 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2380 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2381 | data.enforceInterface(IActivityManager.descriptor); |
| 2382 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2383 | reply.writeNoException(); |
| 2384 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2385 | return true; |
| 2386 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2387 | |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 2388 | case GET_LOCK_TASK_MODE_STATE_TRANSACTION: { |
| 2389 | data.enforceInterface(IActivityManager.descriptor); |
| 2390 | final int lockTaskModeState = getLockTaskModeState(); |
| 2391 | reply.writeNoException(); |
| 2392 | reply.writeInt(lockTaskModeState); |
| 2393 | return true; |
| 2394 | } |
| 2395 | |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 2396 | case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: { |
| 2397 | data.enforceInterface(IActivityManager.descriptor); |
| 2398 | final IBinder token = data.readStrongBinder(); |
| 2399 | showLockTaskEscapeMessage(token); |
| 2400 | reply.writeNoException(); |
| 2401 | return true; |
| 2402 | } |
| 2403 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2404 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2405 | data.enforceInterface(IActivityManager.descriptor); |
| 2406 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2407 | ActivityManager.TaskDescription values = |
| 2408 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2409 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2410 | reply.writeNoException(); |
| 2411 | return true; |
| 2412 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2413 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2414 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2415 | data.enforceInterface(IActivityManager.descriptor); |
| 2416 | int taskId = data.readInt(); |
| 2417 | boolean resizeable = (data.readInt() == 1) ? true : false; |
| 2418 | setTaskResizeable(taskId, resizeable); |
| 2419 | reply.writeNoException(); |
| 2420 | return true; |
| 2421 | } |
| 2422 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2423 | case RESIZE_TASK_TRANSACTION: { |
| 2424 | data.enforceInterface(IActivityManager.descriptor); |
| 2425 | int taskId = data.readInt(); |
| 2426 | Rect r = Rect.CREATOR.createFromParcel(data); |
| 2427 | resizeTask(taskId, r); |
| 2428 | reply.writeNoException(); |
| 2429 | return true; |
| 2430 | } |
| 2431 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2432 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2433 | data.enforceInterface(IActivityManager.descriptor); |
| 2434 | String filename = data.readString(); |
| 2435 | Bitmap icon = getTaskDescriptionIcon(filename); |
| 2436 | reply.writeNoException(); |
| 2437 | if (icon == null) { |
| 2438 | reply.writeInt(0); |
| 2439 | } else { |
| 2440 | reply.writeInt(1); |
| 2441 | icon.writeToParcel(reply, 0); |
| 2442 | } |
| 2443 | return true; |
| 2444 | } |
| 2445 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2446 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2447 | data.enforceInterface(IActivityManager.descriptor); |
| 2448 | final Bundle bundle; |
| 2449 | if (data.readInt() == 0) { |
| 2450 | bundle = null; |
| 2451 | } else { |
| 2452 | bundle = data.readBundle(); |
| 2453 | } |
| 2454 | final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle); |
| 2455 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2456 | reply.writeNoException(); |
| 2457 | return true; |
| 2458 | } |
| 2459 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2460 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2461 | data.enforceInterface(IActivityManager.descriptor); |
| 2462 | IBinder token = data.readStrongBinder(); |
| 2463 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2464 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2465 | reply.writeNoException(); |
| 2466 | reply.writeInt(success ? 1 : 0); |
| 2467 | return true; |
| 2468 | } |
| 2469 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2470 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2471 | data.enforceInterface(IActivityManager.descriptor); |
| 2472 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2473 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2474 | reply.writeNoException(); |
| 2475 | reply.writeInt(enabled ? 1 : 0); |
| 2476 | return true; |
| 2477 | } |
| 2478 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2479 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2480 | data.enforceInterface(IActivityManager.descriptor); |
| 2481 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2482 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2483 | reply.writeNoException(); |
| 2484 | return true; |
| 2485 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2486 | |
| 2487 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2488 | data.enforceInterface(IActivityManager.descriptor); |
| 2489 | IBinder token = data.readStrongBinder(); |
| 2490 | notifyLaunchTaskBehindComplete(token); |
| 2491 | reply.writeNoException(); |
| 2492 | return true; |
| 2493 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2494 | |
| 2495 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2496 | data.enforceInterface(IActivityManager.descriptor); |
| 2497 | IBinder token = data.readStrongBinder(); |
| 2498 | notifyEnterAnimationComplete(token); |
| 2499 | reply.writeNoException(); |
| 2500 | return true; |
| 2501 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2502 | |
| 2503 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2504 | data.enforceInterface(IActivityManager.descriptor); |
| 2505 | bootAnimationComplete(); |
| 2506 | reply.writeNoException(); |
| 2507 | return true; |
| 2508 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2509 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2510 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2511 | data.enforceInterface(IActivityManager.descriptor); |
| 2512 | final int uid = data.readInt(); |
| 2513 | final byte[] firstPacket = data.createByteArray(); |
| 2514 | notifyCleartextNetwork(uid, firstPacket); |
| 2515 | reply.writeNoException(); |
| 2516 | return true; |
| 2517 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2518 | |
| 2519 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2520 | data.enforceInterface(IActivityManager.descriptor); |
| 2521 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2522 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2523 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2524 | String reportPackage = data.readString(); |
| 2525 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2526 | reply.writeNoException(); |
| 2527 | return true; |
| 2528 | } |
| 2529 | |
| 2530 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2531 | data.enforceInterface(IActivityManager.descriptor); |
| 2532 | String path = data.readString(); |
| 2533 | dumpHeapFinished(path); |
| 2534 | reply.writeNoException(); |
| 2535 | return true; |
| 2536 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2537 | |
| 2538 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2539 | data.enforceInterface(IActivityManager.descriptor); |
| 2540 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2541 | data.readStrongBinder()); |
| 2542 | boolean keepAwake = data.readInt() != 0; |
| 2543 | setVoiceKeepAwake(session, keepAwake); |
| 2544 | reply.writeNoException(); |
| 2545 | return true; |
| 2546 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2547 | |
| 2548 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2549 | data.enforceInterface(IActivityManager.descriptor); |
| 2550 | int userId = data.readInt(); |
| 2551 | String[] packages = data.readStringArray(); |
| 2552 | updateLockTaskPackages(userId, packages); |
| 2553 | reply.writeNoException(); |
| 2554 | return true; |
| 2555 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2556 | |
Craig Mautner | 015c5e5 | 2015-04-23 10:39:39 -0700 | [diff] [blame] | 2557 | case UPDATE_DEVICE_OWNER_TRANSACTION: { |
| 2558 | data.enforceInterface(IActivityManager.descriptor); |
| 2559 | String packageName = data.readString(); |
| 2560 | updateDeviceOwner(packageName); |
| 2561 | reply.writeNoException(); |
| 2562 | return true; |
| 2563 | } |
| 2564 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2565 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2566 | data.enforceInterface(IActivityManager.descriptor); |
| 2567 | String pkg = data.readString(); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 2568 | String callingPackage = data.readString(); |
| 2569 | int res = getPackageProcessState(pkg, callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2570 | reply.writeNoException(); |
| 2571 | reply.writeInt(res); |
| 2572 | return true; |
| 2573 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2574 | |
| 2575 | case SET_PROCESS_MEMORY_TRIM_TRANSACTION: { |
| 2576 | data.enforceInterface(IActivityManager.descriptor); |
| 2577 | String process = data.readString(); |
| 2578 | int userId = data.readInt(); |
| 2579 | int level = data.readInt(); |
| 2580 | boolean res = setProcessMemoryTrimLevel(process, userId, level); |
| 2581 | reply.writeNoException(); |
| 2582 | reply.writeInt(res ? 1 : 0); |
| 2583 | return true; |
| 2584 | } |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame^] | 2585 | |
| 2586 | case IS_ROOT_VOICE_INTERACTION_TRANSACTION: { |
| 2587 | data.enforceInterface(IActivityManager.descriptor); |
| 2588 | IBinder token = data.readStrongBinder(); |
| 2589 | boolean res = isRootVoiceInteraction(token); |
| 2590 | reply.writeNoException(); |
| 2591 | reply.writeInt(res ? 1 : 0); |
| 2592 | return true; |
| 2593 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2594 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2595 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2596 | return super.onTransact(code, data, reply, flags); |
| 2597 | } |
| 2598 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2599 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2600 | return this; |
| 2601 | } |
| 2602 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2603 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2604 | protected IActivityManager create() { |
| 2605 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2606 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2607 | Log.v("ActivityManager", "default service binder = " + b); |
| 2608 | } |
| 2609 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2610 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2611 | Log.v("ActivityManager", "default service = " + am); |
| 2612 | } |
| 2613 | return am; |
| 2614 | } |
| 2615 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2616 | } |
| 2617 | |
| 2618 | class ActivityManagerProxy implements IActivityManager |
| 2619 | { |
| 2620 | public ActivityManagerProxy(IBinder remote) |
| 2621 | { |
| 2622 | mRemote = remote; |
| 2623 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2624 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2625 | public IBinder asBinder() |
| 2626 | { |
| 2627 | return mRemote; |
| 2628 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2629 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2630 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2631 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2632 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2633 | Parcel data = Parcel.obtain(); |
| 2634 | Parcel reply = Parcel.obtain(); |
| 2635 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2636 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2637 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2638 | intent.writeToParcel(data, 0); |
| 2639 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2640 | data.writeStrongBinder(resultTo); |
| 2641 | data.writeString(resultWho); |
| 2642 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2643 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2644 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2645 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2646 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2647 | } else { |
| 2648 | data.writeInt(0); |
| 2649 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2650 | if (options != null) { |
| 2651 | data.writeInt(1); |
| 2652 | options.writeToParcel(data, 0); |
| 2653 | } else { |
| 2654 | data.writeInt(0); |
| 2655 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2656 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2657 | reply.readException(); |
| 2658 | int result = reply.readInt(); |
| 2659 | reply.recycle(); |
| 2660 | data.recycle(); |
| 2661 | return result; |
| 2662 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2663 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2664 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2665 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2666 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2667 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2668 | Parcel data = Parcel.obtain(); |
| 2669 | Parcel reply = Parcel.obtain(); |
| 2670 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2671 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2672 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2673 | intent.writeToParcel(data, 0); |
| 2674 | data.writeString(resolvedType); |
| 2675 | data.writeStrongBinder(resultTo); |
| 2676 | data.writeString(resultWho); |
| 2677 | data.writeInt(requestCode); |
| 2678 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2679 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2680 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2681 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2682 | } else { |
| 2683 | data.writeInt(0); |
| 2684 | } |
| 2685 | if (options != null) { |
| 2686 | data.writeInt(1); |
| 2687 | options.writeToParcel(data, 0); |
| 2688 | } else { |
| 2689 | data.writeInt(0); |
| 2690 | } |
| 2691 | data.writeInt(userId); |
| 2692 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 2693 | reply.readException(); |
| 2694 | int result = reply.readInt(); |
| 2695 | reply.recycle(); |
| 2696 | data.recycle(); |
| 2697 | return result; |
| 2698 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2699 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 2700 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 2701 | int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, |
| 2702 | int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2703 | Parcel data = Parcel.obtain(); |
| 2704 | Parcel reply = Parcel.obtain(); |
| 2705 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2706 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2707 | data.writeString(callingPackage); |
| 2708 | intent.writeToParcel(data, 0); |
| 2709 | data.writeString(resolvedType); |
| 2710 | data.writeStrongBinder(resultTo); |
| 2711 | data.writeString(resultWho); |
| 2712 | data.writeInt(requestCode); |
| 2713 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2714 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2715 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2716 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2717 | } else { |
| 2718 | data.writeInt(0); |
| 2719 | } |
| 2720 | if (options != null) { |
| 2721 | data.writeInt(1); |
| 2722 | options.writeToParcel(data, 0); |
| 2723 | } else { |
| 2724 | data.writeInt(0); |
| 2725 | } |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 2726 | data.writeInt(ignoreTargetSecurity ? 1 : 0); |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 2727 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2728 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 2729 | reply.readException(); |
| 2730 | int result = reply.readInt(); |
| 2731 | reply.recycle(); |
| 2732 | data.recycle(); |
| 2733 | return result; |
| 2734 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2735 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 2736 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2737 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2738 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2739 | Parcel data = Parcel.obtain(); |
| 2740 | Parcel reply = Parcel.obtain(); |
| 2741 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2742 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2743 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2744 | intent.writeToParcel(data, 0); |
| 2745 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2746 | data.writeStrongBinder(resultTo); |
| 2747 | data.writeString(resultWho); |
| 2748 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2749 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2750 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2751 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2752 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2753 | } else { |
| 2754 | data.writeInt(0); |
| 2755 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2756 | if (options != null) { |
| 2757 | data.writeInt(1); |
| 2758 | options.writeToParcel(data, 0); |
| 2759 | } else { |
| 2760 | data.writeInt(0); |
| 2761 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2762 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2763 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 2764 | reply.readException(); |
| 2765 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 2766 | reply.recycle(); |
| 2767 | data.recycle(); |
| 2768 | return result; |
| 2769 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2770 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 2771 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2772 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2773 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2774 | Parcel data = Parcel.obtain(); |
| 2775 | Parcel reply = Parcel.obtain(); |
| 2776 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2777 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2778 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2779 | intent.writeToParcel(data, 0); |
| 2780 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2781 | data.writeStrongBinder(resultTo); |
| 2782 | data.writeString(resultWho); |
| 2783 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2784 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2785 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2786 | if (options != null) { |
| 2787 | data.writeInt(1); |
| 2788 | options.writeToParcel(data, 0); |
| 2789 | } else { |
| 2790 | data.writeInt(0); |
| 2791 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2792 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2793 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2794 | reply.readException(); |
| 2795 | int result = reply.readInt(); |
| 2796 | reply.recycle(); |
| 2797 | data.recycle(); |
| 2798 | return result; |
| 2799 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2800 | public int startActivityIntentSender(IApplicationThread caller, |
| 2801 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2802 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2803 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2804 | Parcel data = Parcel.obtain(); |
| 2805 | Parcel reply = Parcel.obtain(); |
| 2806 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2807 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2808 | intent.writeToParcel(data, 0); |
| 2809 | if (fillInIntent != null) { |
| 2810 | data.writeInt(1); |
| 2811 | fillInIntent.writeToParcel(data, 0); |
| 2812 | } else { |
| 2813 | data.writeInt(0); |
| 2814 | } |
| 2815 | data.writeString(resolvedType); |
| 2816 | data.writeStrongBinder(resultTo); |
| 2817 | data.writeString(resultWho); |
| 2818 | data.writeInt(requestCode); |
| 2819 | data.writeInt(flagsMask); |
| 2820 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2821 | if (options != null) { |
| 2822 | data.writeInt(1); |
| 2823 | options.writeToParcel(data, 0); |
| 2824 | } else { |
| 2825 | data.writeInt(0); |
| 2826 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2827 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2828 | reply.readException(); |
| 2829 | int result = reply.readInt(); |
| 2830 | reply.recycle(); |
| 2831 | data.recycle(); |
| 2832 | return result; |
| 2833 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2834 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 2835 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2836 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 2837 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2838 | Parcel data = Parcel.obtain(); |
| 2839 | Parcel reply = Parcel.obtain(); |
| 2840 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2841 | data.writeString(callingPackage); |
| 2842 | data.writeInt(callingPid); |
| 2843 | data.writeInt(callingUid); |
| 2844 | intent.writeToParcel(data, 0); |
| 2845 | data.writeString(resolvedType); |
| 2846 | data.writeStrongBinder(session.asBinder()); |
| 2847 | data.writeStrongBinder(interactor.asBinder()); |
| 2848 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2849 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2850 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2851 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2852 | } else { |
| 2853 | data.writeInt(0); |
| 2854 | } |
| 2855 | if (options != null) { |
| 2856 | data.writeInt(1); |
| 2857 | options.writeToParcel(data, 0); |
| 2858 | } else { |
| 2859 | data.writeInt(0); |
| 2860 | } |
| 2861 | data.writeInt(userId); |
| 2862 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2863 | reply.readException(); |
| 2864 | int result = reply.readInt(); |
| 2865 | reply.recycle(); |
| 2866 | data.recycle(); |
| 2867 | return result; |
| 2868 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2869 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2870 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2871 | Parcel data = Parcel.obtain(); |
| 2872 | Parcel reply = Parcel.obtain(); |
| 2873 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2874 | data.writeStrongBinder(callingActivity); |
| 2875 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2876 | if (options != null) { |
| 2877 | data.writeInt(1); |
| 2878 | options.writeToParcel(data, 0); |
| 2879 | } else { |
| 2880 | data.writeInt(0); |
| 2881 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2882 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2883 | reply.readException(); |
| 2884 | int result = reply.readInt(); |
| 2885 | reply.recycle(); |
| 2886 | data.recycle(); |
| 2887 | return result != 0; |
| 2888 | } |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 2889 | public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException { |
| 2890 | Parcel data = Parcel.obtain(); |
| 2891 | Parcel reply = Parcel.obtain(); |
| 2892 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2893 | data.writeInt(taskId); |
| 2894 | if (options == null) { |
| 2895 | data.writeInt(0); |
| 2896 | } else { |
| 2897 | data.writeInt(1); |
| 2898 | options.writeToParcel(data, 0); |
| 2899 | } |
| 2900 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 2901 | reply.readException(); |
| 2902 | int result = reply.readInt(); |
| 2903 | reply.recycle(); |
| 2904 | data.recycle(); |
| 2905 | return result; |
| 2906 | } |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 2907 | 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] | 2908 | throws RemoteException { |
| 2909 | Parcel data = Parcel.obtain(); |
| 2910 | Parcel reply = Parcel.obtain(); |
| 2911 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2912 | data.writeStrongBinder(token); |
| 2913 | data.writeInt(resultCode); |
| 2914 | if (resultData != null) { |
| 2915 | data.writeInt(1); |
| 2916 | resultData.writeToParcel(data, 0); |
| 2917 | } else { |
| 2918 | data.writeInt(0); |
| 2919 | } |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 2920 | data.writeInt(finishTask ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2921 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2922 | reply.readException(); |
| 2923 | boolean res = reply.readInt() != 0; |
| 2924 | data.recycle(); |
| 2925 | reply.recycle(); |
| 2926 | return res; |
| 2927 | } |
| 2928 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 2929 | { |
| 2930 | Parcel data = Parcel.obtain(); |
| 2931 | Parcel reply = Parcel.obtain(); |
| 2932 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2933 | data.writeStrongBinder(token); |
| 2934 | data.writeString(resultWho); |
| 2935 | data.writeInt(requestCode); |
| 2936 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2937 | reply.readException(); |
| 2938 | data.recycle(); |
| 2939 | reply.recycle(); |
| 2940 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 2941 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 2942 | Parcel data = Parcel.obtain(); |
| 2943 | Parcel reply = Parcel.obtain(); |
| 2944 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2945 | data.writeStrongBinder(token); |
| 2946 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 2947 | reply.readException(); |
| 2948 | boolean res = reply.readInt() != 0; |
| 2949 | data.recycle(); |
| 2950 | reply.recycle(); |
| 2951 | return res; |
| 2952 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 2953 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 2954 | Parcel data = Parcel.obtain(); |
| 2955 | Parcel reply = Parcel.obtain(); |
| 2956 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2957 | data.writeStrongBinder(session.asBinder()); |
| 2958 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 2959 | reply.readException(); |
| 2960 | data.recycle(); |
| 2961 | reply.recycle(); |
| 2962 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 2963 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 2964 | Parcel data = Parcel.obtain(); |
| 2965 | Parcel reply = Parcel.obtain(); |
| 2966 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2967 | data.writeStrongBinder(token); |
| 2968 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 2969 | reply.readException(); |
| 2970 | boolean res = reply.readInt() != 0; |
| 2971 | data.recycle(); |
| 2972 | reply.recycle(); |
| 2973 | return res; |
| 2974 | } |
| 2975 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 2976 | Parcel data = Parcel.obtain(); |
| 2977 | Parcel reply = Parcel.obtain(); |
| 2978 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2979 | data.writeStrongBinder(app.asBinder()); |
| 2980 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 2981 | reply.readException(); |
| 2982 | data.recycle(); |
| 2983 | reply.recycle(); |
| 2984 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 2985 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 2986 | Parcel data = Parcel.obtain(); |
| 2987 | Parcel reply = Parcel.obtain(); |
| 2988 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2989 | data.writeStrongBinder(token); |
| 2990 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 2991 | reply.readException(); |
| 2992 | boolean res = reply.readInt() != 0; |
| 2993 | data.recycle(); |
| 2994 | reply.recycle(); |
| 2995 | return res; |
| 2996 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2997 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2998 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 2999 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3000 | { |
| 3001 | Parcel data = Parcel.obtain(); |
| 3002 | Parcel reply = Parcel.obtain(); |
| 3003 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3004 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3005 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3006 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 3007 | filter.writeToParcel(data, 0); |
| 3008 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3009 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3010 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3011 | reply.readException(); |
| 3012 | Intent intent = null; |
| 3013 | int haveIntent = reply.readInt(); |
| 3014 | if (haveIntent != 0) { |
| 3015 | intent = Intent.CREATOR.createFromParcel(reply); |
| 3016 | } |
| 3017 | reply.recycle(); |
| 3018 | data.recycle(); |
| 3019 | return intent; |
| 3020 | } |
| 3021 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 3022 | { |
| 3023 | Parcel data = Parcel.obtain(); |
| 3024 | Parcel reply = Parcel.obtain(); |
| 3025 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3026 | data.writeStrongBinder(receiver.asBinder()); |
| 3027 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3028 | reply.readException(); |
| 3029 | data.recycle(); |
| 3030 | reply.recycle(); |
| 3031 | } |
| 3032 | public int broadcastIntent(IApplicationThread caller, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3033 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3034 | int resultCode, String resultData, Bundle map, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3035 | String[] requiredPermissions, int appOp, Bundle options, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3036 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3037 | { |
| 3038 | Parcel data = Parcel.obtain(); |
| 3039 | Parcel reply = Parcel.obtain(); |
| 3040 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3041 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3042 | intent.writeToParcel(data, 0); |
| 3043 | data.writeString(resolvedType); |
| 3044 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 3045 | data.writeInt(resultCode); |
| 3046 | data.writeString(resultData); |
| 3047 | data.writeBundle(map); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3048 | data.writeStringArray(requiredPermissions); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 3049 | data.writeInt(appOp); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3050 | data.writeBundle(options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3051 | data.writeInt(serialized ? 1 : 0); |
| 3052 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3053 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3054 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3055 | reply.readException(); |
| 3056 | int res = reply.readInt(); |
| 3057 | reply.recycle(); |
| 3058 | data.recycle(); |
| 3059 | return res; |
| 3060 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3061 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 3062 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3063 | { |
| 3064 | Parcel data = Parcel.obtain(); |
| 3065 | Parcel reply = Parcel.obtain(); |
| 3066 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3067 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3068 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3069 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3070 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3071 | reply.readException(); |
| 3072 | data.recycle(); |
| 3073 | reply.recycle(); |
| 3074 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3075 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 3076 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3077 | { |
| 3078 | Parcel data = Parcel.obtain(); |
| 3079 | Parcel reply = Parcel.obtain(); |
| 3080 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3081 | data.writeStrongBinder(who); |
| 3082 | data.writeInt(resultCode); |
| 3083 | data.writeString(resultData); |
| 3084 | data.writeBundle(map); |
| 3085 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3086 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3087 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3088 | reply.readException(); |
| 3089 | data.recycle(); |
| 3090 | reply.recycle(); |
| 3091 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3092 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3093 | { |
| 3094 | Parcel data = Parcel.obtain(); |
| 3095 | Parcel reply = Parcel.obtain(); |
| 3096 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3097 | data.writeStrongBinder(app.asBinder()); |
| 3098 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3099 | reply.readException(); |
| 3100 | data.recycle(); |
| 3101 | reply.recycle(); |
| 3102 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3103 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3104 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3105 | { |
| 3106 | Parcel data = Parcel.obtain(); |
| 3107 | Parcel reply = Parcel.obtain(); |
| 3108 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3109 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3110 | if (config != null) { |
| 3111 | data.writeInt(1); |
| 3112 | config.writeToParcel(data, 0); |
| 3113 | } else { |
| 3114 | data.writeInt(0); |
| 3115 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3116 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3117 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3118 | reply.readException(); |
| 3119 | data.recycle(); |
| 3120 | reply.recycle(); |
| 3121 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3122 | public void activityResumed(IBinder token) throws RemoteException |
| 3123 | { |
| 3124 | Parcel data = Parcel.obtain(); |
| 3125 | Parcel reply = Parcel.obtain(); |
| 3126 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3127 | data.writeStrongBinder(token); |
| 3128 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3129 | reply.readException(); |
| 3130 | data.recycle(); |
| 3131 | reply.recycle(); |
| 3132 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3133 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3134 | { |
| 3135 | Parcel data = Parcel.obtain(); |
| 3136 | Parcel reply = Parcel.obtain(); |
| 3137 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3138 | data.writeStrongBinder(token); |
| 3139 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3140 | reply.readException(); |
| 3141 | data.recycle(); |
| 3142 | reply.recycle(); |
| 3143 | } |
| 3144 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3145 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3146 | { |
| 3147 | Parcel data = Parcel.obtain(); |
| 3148 | Parcel reply = Parcel.obtain(); |
| 3149 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3150 | data.writeStrongBinder(token); |
| 3151 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3152 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3153 | TextUtils.writeToParcel(description, data, 0); |
| 3154 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3155 | reply.readException(); |
| 3156 | data.recycle(); |
| 3157 | reply.recycle(); |
| 3158 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3159 | public void activitySlept(IBinder token) throws RemoteException |
| 3160 | { |
| 3161 | Parcel data = Parcel.obtain(); |
| 3162 | Parcel reply = Parcel.obtain(); |
| 3163 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3164 | data.writeStrongBinder(token); |
| 3165 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3166 | reply.readException(); |
| 3167 | data.recycle(); |
| 3168 | reply.recycle(); |
| 3169 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3170 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3171 | { |
| 3172 | Parcel data = Parcel.obtain(); |
| 3173 | Parcel reply = Parcel.obtain(); |
| 3174 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3175 | data.writeStrongBinder(token); |
| 3176 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3177 | reply.readException(); |
| 3178 | data.recycle(); |
| 3179 | reply.recycle(); |
| 3180 | } |
| 3181 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3182 | { |
| 3183 | Parcel data = Parcel.obtain(); |
| 3184 | Parcel reply = Parcel.obtain(); |
| 3185 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3186 | data.writeStrongBinder(token); |
| 3187 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3188 | reply.readException(); |
| 3189 | String res = reply.readString(); |
| 3190 | data.recycle(); |
| 3191 | reply.recycle(); |
| 3192 | return res; |
| 3193 | } |
| 3194 | public ComponentName getCallingActivity(IBinder token) |
| 3195 | throws RemoteException { |
| 3196 | Parcel data = Parcel.obtain(); |
| 3197 | Parcel reply = Parcel.obtain(); |
| 3198 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3199 | data.writeStrongBinder(token); |
| 3200 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3201 | reply.readException(); |
| 3202 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3203 | data.recycle(); |
| 3204 | reply.recycle(); |
| 3205 | return res; |
| 3206 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3207 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3208 | Parcel data = Parcel.obtain(); |
| 3209 | Parcel reply = Parcel.obtain(); |
| 3210 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3211 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3212 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3213 | reply.readException(); |
| 3214 | ArrayList<IAppTask> list = null; |
| 3215 | int N = reply.readInt(); |
| 3216 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3217 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3218 | while (N > 0) { |
| 3219 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3220 | list.add(task); |
| 3221 | N--; |
| 3222 | } |
| 3223 | } |
| 3224 | data.recycle(); |
| 3225 | reply.recycle(); |
| 3226 | return list; |
| 3227 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3228 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3229 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3230 | Parcel data = Parcel.obtain(); |
| 3231 | Parcel reply = Parcel.obtain(); |
| 3232 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3233 | data.writeStrongBinder(activityToken); |
| 3234 | intent.writeToParcel(data, 0); |
| 3235 | description.writeToParcel(data, 0); |
| 3236 | thumbnail.writeToParcel(data, 0); |
| 3237 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3238 | reply.readException(); |
| 3239 | int res = reply.readInt(); |
| 3240 | data.recycle(); |
| 3241 | reply.recycle(); |
| 3242 | return res; |
| 3243 | } |
| 3244 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3245 | Parcel data = Parcel.obtain(); |
| 3246 | Parcel reply = Parcel.obtain(); |
| 3247 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3248 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3249 | reply.readException(); |
| 3250 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3251 | data.recycle(); |
| 3252 | reply.recycle(); |
| 3253 | return size; |
| 3254 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3255 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3256 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3257 | Parcel data = Parcel.obtain(); |
| 3258 | Parcel reply = Parcel.obtain(); |
| 3259 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3260 | data.writeInt(maxNum); |
| 3261 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3262 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3263 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3264 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3265 | int N = reply.readInt(); |
| 3266 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3267 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3268 | while (N > 0) { |
| 3269 | ActivityManager.RunningTaskInfo info = |
| 3270 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3271 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3272 | list.add(info); |
| 3273 | N--; |
| 3274 | } |
| 3275 | } |
| 3276 | data.recycle(); |
| 3277 | reply.recycle(); |
| 3278 | return list; |
| 3279 | } |
| 3280 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3281 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3282 | Parcel data = Parcel.obtain(); |
| 3283 | Parcel reply = Parcel.obtain(); |
| 3284 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3285 | data.writeInt(maxNum); |
| 3286 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3287 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3288 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3289 | reply.readException(); |
| 3290 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3291 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3292 | data.recycle(); |
| 3293 | reply.recycle(); |
| 3294 | return list; |
| 3295 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3296 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3297 | Parcel data = Parcel.obtain(); |
| 3298 | Parcel reply = Parcel.obtain(); |
| 3299 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3300 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3301 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3302 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3303 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3304 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3305 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3306 | } |
| 3307 | data.recycle(); |
| 3308 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3309 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3310 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3311 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3312 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3313 | Parcel data = Parcel.obtain(); |
| 3314 | Parcel reply = Parcel.obtain(); |
| 3315 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3316 | data.writeInt(maxNum); |
| 3317 | data.writeInt(flags); |
| 3318 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3319 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3320 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3321 | int N = reply.readInt(); |
| 3322 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3323 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3324 | while (N > 0) { |
| 3325 | ActivityManager.RunningServiceInfo info = |
| 3326 | ActivityManager.RunningServiceInfo.CREATOR |
| 3327 | .createFromParcel(reply); |
| 3328 | list.add(info); |
| 3329 | N--; |
| 3330 | } |
| 3331 | } |
| 3332 | data.recycle(); |
| 3333 | reply.recycle(); |
| 3334 | return list; |
| 3335 | } |
| 3336 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3337 | throws RemoteException { |
| 3338 | Parcel data = Parcel.obtain(); |
| 3339 | Parcel reply = Parcel.obtain(); |
| 3340 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3341 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3342 | reply.readException(); |
| 3343 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3344 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3345 | data.recycle(); |
| 3346 | reply.recycle(); |
| 3347 | return list; |
| 3348 | } |
| 3349 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3350 | throws RemoteException { |
| 3351 | Parcel data = Parcel.obtain(); |
| 3352 | Parcel reply = Parcel.obtain(); |
| 3353 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3354 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3355 | reply.readException(); |
| 3356 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3357 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3358 | data.recycle(); |
| 3359 | reply.recycle(); |
| 3360 | return list; |
| 3361 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3362 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3363 | throws RemoteException { |
| 3364 | Parcel data = Parcel.obtain(); |
| 3365 | Parcel reply = Parcel.obtain(); |
| 3366 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3367 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3368 | reply.readException(); |
| 3369 | ArrayList<ApplicationInfo> list |
| 3370 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3371 | data.recycle(); |
| 3372 | reply.recycle(); |
| 3373 | return list; |
| 3374 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3375 | 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] | 3376 | { |
| 3377 | Parcel data = Parcel.obtain(); |
| 3378 | Parcel reply = Parcel.obtain(); |
| 3379 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3380 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3381 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3382 | if (options != null) { |
| 3383 | data.writeInt(1); |
| 3384 | options.writeToParcel(data, 0); |
| 3385 | } else { |
| 3386 | data.writeInt(0); |
| 3387 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3388 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3389 | reply.readException(); |
| 3390 | data.recycle(); |
| 3391 | reply.recycle(); |
| 3392 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3393 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3394 | throws RemoteException { |
| 3395 | Parcel data = Parcel.obtain(); |
| 3396 | Parcel reply = Parcel.obtain(); |
| 3397 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3398 | data.writeStrongBinder(token); |
| 3399 | data.writeInt(nonRoot ? 1 : 0); |
| 3400 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3401 | reply.readException(); |
| 3402 | boolean res = reply.readInt() != 0; |
| 3403 | data.recycle(); |
| 3404 | reply.recycle(); |
| 3405 | return res; |
| 3406 | } |
| 3407 | public void moveTaskBackwards(int task) throws RemoteException |
| 3408 | { |
| 3409 | Parcel data = Parcel.obtain(); |
| 3410 | Parcel reply = Parcel.obtain(); |
| 3411 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3412 | data.writeInt(task); |
| 3413 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3414 | reply.readException(); |
| 3415 | data.recycle(); |
| 3416 | reply.recycle(); |
| 3417 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3418 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3419 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3420 | { |
| 3421 | Parcel data = Parcel.obtain(); |
| 3422 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3423 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3424 | data.writeInt(taskId); |
| 3425 | data.writeInt(stackId); |
| 3426 | data.writeInt(toTop ? 1 : 0); |
| 3427 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3428 | reply.readException(); |
| 3429 | data.recycle(); |
| 3430 | reply.recycle(); |
| 3431 | } |
| 3432 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3433 | public void resizeStack(int stackBoxId, Rect r) throws RemoteException |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3434 | { |
| 3435 | Parcel data = Parcel.obtain(); |
| 3436 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3437 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | 5a44915 | 2013-05-24 15:49:29 -0700 | [diff] [blame] | 3438 | data.writeInt(stackBoxId); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3439 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3440 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3441 | reply.readException(); |
| 3442 | data.recycle(); |
| 3443 | reply.recycle(); |
| 3444 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3445 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3446 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3447 | { |
| 3448 | Parcel data = Parcel.obtain(); |
| 3449 | Parcel reply = Parcel.obtain(); |
| 3450 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3451 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3452 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3453 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3454 | data.recycle(); |
| 3455 | reply.recycle(); |
| 3456 | return list; |
| 3457 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3458 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3459 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3460 | { |
| 3461 | Parcel data = Parcel.obtain(); |
| 3462 | Parcel reply = Parcel.obtain(); |
| 3463 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3464 | data.writeInt(stackId); |
| 3465 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3466 | reply.readException(); |
| 3467 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3468 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3469 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3470 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3471 | } |
| 3472 | data.recycle(); |
| 3473 | reply.recycle(); |
| 3474 | return info; |
| 3475 | } |
| 3476 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 3477 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 3478 | Parcel data = Parcel.obtain(); |
| 3479 | Parcel reply = Parcel.obtain(); |
| 3480 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3481 | data.writeInt(taskId); |
| 3482 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 3483 | reply.readException(); |
| 3484 | boolean isInHomeStack = reply.readInt() > 0; |
| 3485 | data.recycle(); |
| 3486 | reply.recycle(); |
| 3487 | return isInHomeStack; |
| 3488 | } |
| 3489 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3490 | public void setFocusedStack(int stackId) throws RemoteException |
| 3491 | { |
| 3492 | Parcel data = Parcel.obtain(); |
| 3493 | Parcel reply = Parcel.obtain(); |
| 3494 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3495 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3496 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3497 | reply.readException(); |
| 3498 | data.recycle(); |
| 3499 | reply.recycle(); |
| 3500 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3501 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 3502 | public int getFocusedStackId() throws RemoteException { |
| 3503 | Parcel data = Parcel.obtain(); |
| 3504 | Parcel reply = Parcel.obtain(); |
| 3505 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3506 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 3507 | reply.readException(); |
| 3508 | int focusedStackId = reply.readInt(); |
| 3509 | data.recycle(); |
| 3510 | reply.recycle(); |
| 3511 | return focusedStackId; |
| 3512 | } |
| 3513 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3514 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 3515 | { |
| 3516 | Parcel data = Parcel.obtain(); |
| 3517 | Parcel reply = Parcel.obtain(); |
| 3518 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3519 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3520 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3521 | reply.readException(); |
| 3522 | data.recycle(); |
| 3523 | reply.recycle(); |
| 3524 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3525 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 3526 | { |
| 3527 | Parcel data = Parcel.obtain(); |
| 3528 | Parcel reply = Parcel.obtain(); |
| 3529 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3530 | data.writeStrongBinder(token); |
| 3531 | data.writeInt(onlyRoot ? 1 : 0); |
| 3532 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3533 | reply.readException(); |
| 3534 | int res = reply.readInt(); |
| 3535 | data.recycle(); |
| 3536 | reply.recycle(); |
| 3537 | return res; |
| 3538 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3539 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3540 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3541 | Parcel data = Parcel.obtain(); |
| 3542 | Parcel reply = Parcel.obtain(); |
| 3543 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3544 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3545 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3546 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3547 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3548 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3549 | reply.readException(); |
| 3550 | int res = reply.readInt(); |
| 3551 | ContentProviderHolder cph = null; |
| 3552 | if (res != 0) { |
| 3553 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 3554 | } |
| 3555 | data.recycle(); |
| 3556 | reply.recycle(); |
| 3557 | return cph; |
| 3558 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3559 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 3560 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3561 | Parcel data = Parcel.obtain(); |
| 3562 | Parcel reply = Parcel.obtain(); |
| 3563 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3564 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3565 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3566 | data.writeStrongBinder(token); |
| 3567 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3568 | reply.readException(); |
| 3569 | int res = reply.readInt(); |
| 3570 | ContentProviderHolder cph = null; |
| 3571 | if (res != 0) { |
| 3572 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 3573 | } |
| 3574 | data.recycle(); |
| 3575 | reply.recycle(); |
| 3576 | return cph; |
| 3577 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3578 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3579 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3580 | { |
| 3581 | Parcel data = Parcel.obtain(); |
| 3582 | Parcel reply = Parcel.obtain(); |
| 3583 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3584 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3585 | data.writeTypedList(providers); |
| 3586 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 3587 | reply.readException(); |
| 3588 | data.recycle(); |
| 3589 | reply.recycle(); |
| 3590 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3591 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 3592 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3593 | Parcel data = Parcel.obtain(); |
| 3594 | Parcel reply = Parcel.obtain(); |
| 3595 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3596 | data.writeStrongBinder(connection); |
| 3597 | data.writeInt(stable); |
| 3598 | data.writeInt(unstable); |
| 3599 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3600 | reply.readException(); |
| 3601 | boolean res = reply.readInt() != 0; |
| 3602 | data.recycle(); |
| 3603 | reply.recycle(); |
| 3604 | return res; |
| 3605 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3606 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3607 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 3608 | Parcel data = Parcel.obtain(); |
| 3609 | Parcel reply = Parcel.obtain(); |
| 3610 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3611 | data.writeStrongBinder(connection); |
| 3612 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 3613 | reply.readException(); |
| 3614 | data.recycle(); |
| 3615 | reply.recycle(); |
| 3616 | } |
| 3617 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3618 | @Override |
| 3619 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 3620 | Parcel data = Parcel.obtain(); |
| 3621 | Parcel reply = Parcel.obtain(); |
| 3622 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3623 | data.writeStrongBinder(connection); |
| 3624 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 3625 | reply.readException(); |
| 3626 | data.recycle(); |
| 3627 | reply.recycle(); |
| 3628 | } |
| 3629 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3630 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 3631 | Parcel data = Parcel.obtain(); |
| 3632 | Parcel reply = Parcel.obtain(); |
| 3633 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3634 | data.writeStrongBinder(connection); |
| 3635 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3636 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3637 | reply.readException(); |
| 3638 | data.recycle(); |
| 3639 | reply.recycle(); |
| 3640 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3641 | |
| 3642 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 3643 | Parcel data = Parcel.obtain(); |
| 3644 | Parcel reply = Parcel.obtain(); |
| 3645 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3646 | data.writeString(name); |
| 3647 | data.writeStrongBinder(token); |
| 3648 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3649 | reply.readException(); |
| 3650 | data.recycle(); |
| 3651 | reply.recycle(); |
| 3652 | } |
| 3653 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 3654 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 3655 | throws RemoteException |
| 3656 | { |
| 3657 | Parcel data = Parcel.obtain(); |
| 3658 | Parcel reply = Parcel.obtain(); |
| 3659 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3660 | service.writeToParcel(data, 0); |
| 3661 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 3662 | reply.readException(); |
| 3663 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 3664 | data.recycle(); |
| 3665 | reply.recycle(); |
| 3666 | return res; |
| 3667 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 3668 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3669 | public ComponentName startService(IApplicationThread caller, Intent service, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3670 | String resolvedType, String callingPackage, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3671 | { |
| 3672 | Parcel data = Parcel.obtain(); |
| 3673 | Parcel reply = Parcel.obtain(); |
| 3674 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3675 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3676 | service.writeToParcel(data, 0); |
| 3677 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3678 | data.writeString(callingPackage); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3679 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3680 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 3681 | reply.readException(); |
| 3682 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3683 | data.recycle(); |
| 3684 | reply.recycle(); |
| 3685 | return res; |
| 3686 | } |
| 3687 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3688 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3689 | { |
| 3690 | Parcel data = Parcel.obtain(); |
| 3691 | Parcel reply = Parcel.obtain(); |
| 3692 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3693 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3694 | service.writeToParcel(data, 0); |
| 3695 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3696 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3697 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 3698 | reply.readException(); |
| 3699 | int res = reply.readInt(); |
| 3700 | reply.recycle(); |
| 3701 | data.recycle(); |
| 3702 | return res; |
| 3703 | } |
| 3704 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 3705 | int startId) throws RemoteException { |
| 3706 | Parcel data = Parcel.obtain(); |
| 3707 | Parcel reply = Parcel.obtain(); |
| 3708 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3709 | ComponentName.writeToParcel(className, data); |
| 3710 | data.writeStrongBinder(token); |
| 3711 | data.writeInt(startId); |
| 3712 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 3713 | reply.readException(); |
| 3714 | boolean res = reply.readInt() != 0; |
| 3715 | data.recycle(); |
| 3716 | reply.recycle(); |
| 3717 | return res; |
| 3718 | } |
| 3719 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3720 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3721 | Parcel data = Parcel.obtain(); |
| 3722 | Parcel reply = Parcel.obtain(); |
| 3723 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3724 | ComponentName.writeToParcel(className, data); |
| 3725 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3726 | data.writeInt(id); |
| 3727 | if (notification != null) { |
| 3728 | data.writeInt(1); |
| 3729 | notification.writeToParcel(data, 0); |
| 3730 | } else { |
| 3731 | data.writeInt(0); |
| 3732 | } |
| 3733 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3734 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3735 | reply.readException(); |
| 3736 | data.recycle(); |
| 3737 | reply.recycle(); |
| 3738 | } |
| 3739 | public int bindService(IApplicationThread caller, IBinder token, |
| 3740 | Intent service, String resolvedType, IServiceConnection connection, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3741 | int flags, String callingPackage, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3742 | Parcel data = Parcel.obtain(); |
| 3743 | Parcel reply = Parcel.obtain(); |
| 3744 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3745 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3746 | data.writeStrongBinder(token); |
| 3747 | service.writeToParcel(data, 0); |
| 3748 | data.writeString(resolvedType); |
| 3749 | data.writeStrongBinder(connection.asBinder()); |
| 3750 | data.writeInt(flags); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3751 | data.writeString(callingPackage); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 3752 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3753 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 3754 | reply.readException(); |
| 3755 | int res = reply.readInt(); |
| 3756 | data.recycle(); |
| 3757 | reply.recycle(); |
| 3758 | return res; |
| 3759 | } |
| 3760 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 3761 | { |
| 3762 | Parcel data = Parcel.obtain(); |
| 3763 | Parcel reply = Parcel.obtain(); |
| 3764 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3765 | data.writeStrongBinder(connection.asBinder()); |
| 3766 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 3767 | reply.readException(); |
| 3768 | boolean res = reply.readInt() != 0; |
| 3769 | data.recycle(); |
| 3770 | reply.recycle(); |
| 3771 | return res; |
| 3772 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 3773 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3774 | public void publishService(IBinder token, |
| 3775 | Intent intent, IBinder service) throws RemoteException { |
| 3776 | Parcel data = Parcel.obtain(); |
| 3777 | Parcel reply = Parcel.obtain(); |
| 3778 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3779 | data.writeStrongBinder(token); |
| 3780 | intent.writeToParcel(data, 0); |
| 3781 | data.writeStrongBinder(service); |
| 3782 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 3783 | reply.readException(); |
| 3784 | data.recycle(); |
| 3785 | reply.recycle(); |
| 3786 | } |
| 3787 | |
| 3788 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 3789 | throws RemoteException { |
| 3790 | Parcel data = Parcel.obtain(); |
| 3791 | Parcel reply = Parcel.obtain(); |
| 3792 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3793 | data.writeStrongBinder(token); |
| 3794 | intent.writeToParcel(data, 0); |
| 3795 | data.writeInt(doRebind ? 1 : 0); |
| 3796 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 3797 | reply.readException(); |
| 3798 | data.recycle(); |
| 3799 | reply.recycle(); |
| 3800 | } |
| 3801 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 3802 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 3803 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3804 | Parcel data = Parcel.obtain(); |
| 3805 | Parcel reply = Parcel.obtain(); |
| 3806 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3807 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 3808 | data.writeInt(type); |
| 3809 | data.writeInt(startId); |
| 3810 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3811 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3812 | reply.readException(); |
| 3813 | data.recycle(); |
| 3814 | reply.recycle(); |
| 3815 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 3816 | |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3817 | public IBinder peekService(Intent service, String resolvedType, String callingPackage) |
| 3818 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3819 | Parcel data = Parcel.obtain(); |
| 3820 | Parcel reply = Parcel.obtain(); |
| 3821 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3822 | service.writeToParcel(data, 0); |
| 3823 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3824 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3825 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 3826 | reply.readException(); |
| 3827 | IBinder binder = reply.readStrongBinder(); |
| 3828 | reply.recycle(); |
| 3829 | data.recycle(); |
| 3830 | return binder; |
| 3831 | } |
| 3832 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 3833 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 3834 | throws RemoteException { |
| 3835 | Parcel data = Parcel.obtain(); |
| 3836 | Parcel reply = Parcel.obtain(); |
| 3837 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3838 | app.writeToParcel(data, 0); |
| 3839 | data.writeInt(backupRestoreMode); |
| 3840 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 3841 | reply.readException(); |
| 3842 | boolean success = reply.readInt() != 0; |
| 3843 | reply.recycle(); |
| 3844 | data.recycle(); |
| 3845 | return success; |
| 3846 | } |
| 3847 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 3848 | public void clearPendingBackup() throws RemoteException { |
| 3849 | Parcel data = Parcel.obtain(); |
| 3850 | Parcel reply = Parcel.obtain(); |
| 3851 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3852 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 3853 | reply.recycle(); |
| 3854 | data.recycle(); |
| 3855 | } |
| 3856 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 3857 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 3858 | Parcel data = Parcel.obtain(); |
| 3859 | Parcel reply = Parcel.obtain(); |
| 3860 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3861 | data.writeString(packageName); |
| 3862 | data.writeStrongBinder(agent); |
| 3863 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 3864 | reply.recycle(); |
| 3865 | data.recycle(); |
| 3866 | } |
| 3867 | |
| 3868 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 3869 | Parcel data = Parcel.obtain(); |
| 3870 | Parcel reply = Parcel.obtain(); |
| 3871 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3872 | app.writeToParcel(data, 0); |
| 3873 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 3874 | reply.readException(); |
| 3875 | reply.recycle(); |
| 3876 | data.recycle(); |
| 3877 | } |
| 3878 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3879 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 3880 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 3881 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 3882 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3883 | Parcel data = Parcel.obtain(); |
| 3884 | Parcel reply = Parcel.obtain(); |
| 3885 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3886 | ComponentName.writeToParcel(className, data); |
| 3887 | data.writeString(profileFile); |
| 3888 | data.writeInt(flags); |
| 3889 | data.writeBundle(arguments); |
| 3890 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 3891 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3892 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 3893 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3894 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 3895 | reply.readException(); |
| 3896 | boolean res = reply.readInt() != 0; |
| 3897 | reply.recycle(); |
| 3898 | data.recycle(); |
| 3899 | return res; |
| 3900 | } |
| 3901 | |
| 3902 | public void finishInstrumentation(IApplicationThread target, |
| 3903 | int resultCode, Bundle results) throws RemoteException { |
| 3904 | Parcel data = Parcel.obtain(); |
| 3905 | Parcel reply = Parcel.obtain(); |
| 3906 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3907 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 3908 | data.writeInt(resultCode); |
| 3909 | data.writeBundle(results); |
| 3910 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 3911 | reply.readException(); |
| 3912 | data.recycle(); |
| 3913 | reply.recycle(); |
| 3914 | } |
| 3915 | public Configuration getConfiguration() throws RemoteException |
| 3916 | { |
| 3917 | Parcel data = Parcel.obtain(); |
| 3918 | Parcel reply = Parcel.obtain(); |
| 3919 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3920 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 3921 | reply.readException(); |
| 3922 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 3923 | reply.recycle(); |
| 3924 | data.recycle(); |
| 3925 | return res; |
| 3926 | } |
| 3927 | public void updateConfiguration(Configuration values) throws RemoteException |
| 3928 | { |
| 3929 | Parcel data = Parcel.obtain(); |
| 3930 | Parcel reply = Parcel.obtain(); |
| 3931 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3932 | values.writeToParcel(data, 0); |
| 3933 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 3934 | reply.readException(); |
| 3935 | data.recycle(); |
| 3936 | reply.recycle(); |
| 3937 | } |
| 3938 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 3939 | throws RemoteException { |
| 3940 | Parcel data = Parcel.obtain(); |
| 3941 | Parcel reply = Parcel.obtain(); |
| 3942 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3943 | data.writeStrongBinder(token); |
| 3944 | data.writeInt(requestedOrientation); |
| 3945 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 3946 | reply.readException(); |
| 3947 | data.recycle(); |
| 3948 | reply.recycle(); |
| 3949 | } |
| 3950 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 3951 | Parcel data = Parcel.obtain(); |
| 3952 | Parcel reply = Parcel.obtain(); |
| 3953 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3954 | data.writeStrongBinder(token); |
| 3955 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 3956 | reply.readException(); |
| 3957 | int res = reply.readInt(); |
| 3958 | data.recycle(); |
| 3959 | reply.recycle(); |
| 3960 | return res; |
| 3961 | } |
| 3962 | public ComponentName getActivityClassForToken(IBinder token) |
| 3963 | throws RemoteException { |
| 3964 | Parcel data = Parcel.obtain(); |
| 3965 | Parcel reply = Parcel.obtain(); |
| 3966 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3967 | data.writeStrongBinder(token); |
| 3968 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 3969 | reply.readException(); |
| 3970 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3971 | data.recycle(); |
| 3972 | reply.recycle(); |
| 3973 | return res; |
| 3974 | } |
| 3975 | public String getPackageForToken(IBinder token) throws RemoteException |
| 3976 | { |
| 3977 | Parcel data = Parcel.obtain(); |
| 3978 | Parcel reply = Parcel.obtain(); |
| 3979 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3980 | data.writeStrongBinder(token); |
| 3981 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 3982 | reply.readException(); |
| 3983 | String res = reply.readString(); |
| 3984 | data.recycle(); |
| 3985 | reply.recycle(); |
| 3986 | return res; |
| 3987 | } |
| 3988 | public IIntentSender getIntentSender(int type, |
| 3989 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 3990 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3991 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3992 | Parcel data = Parcel.obtain(); |
| 3993 | Parcel reply = Parcel.obtain(); |
| 3994 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3995 | data.writeInt(type); |
| 3996 | data.writeString(packageName); |
| 3997 | data.writeStrongBinder(token); |
| 3998 | data.writeString(resultWho); |
| 3999 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4000 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4001 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4002 | data.writeTypedArray(intents, 0); |
| 4003 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4004 | } else { |
| 4005 | data.writeInt(0); |
| 4006 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4007 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4008 | if (options != null) { |
| 4009 | data.writeInt(1); |
| 4010 | options.writeToParcel(data, 0); |
| 4011 | } else { |
| 4012 | data.writeInt(0); |
| 4013 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4014 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4015 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4016 | reply.readException(); |
| 4017 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4018 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4019 | data.recycle(); |
| 4020 | reply.recycle(); |
| 4021 | return res; |
| 4022 | } |
| 4023 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 4024 | Parcel data = Parcel.obtain(); |
| 4025 | Parcel reply = Parcel.obtain(); |
| 4026 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4027 | data.writeStrongBinder(sender.asBinder()); |
| 4028 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4029 | reply.readException(); |
| 4030 | data.recycle(); |
| 4031 | reply.recycle(); |
| 4032 | } |
| 4033 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 4034 | Parcel data = Parcel.obtain(); |
| 4035 | Parcel reply = Parcel.obtain(); |
| 4036 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4037 | data.writeStrongBinder(sender.asBinder()); |
| 4038 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4039 | reply.readException(); |
| 4040 | String res = reply.readString(); |
| 4041 | data.recycle(); |
| 4042 | reply.recycle(); |
| 4043 | return res; |
| 4044 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 4045 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 4046 | Parcel data = Parcel.obtain(); |
| 4047 | Parcel reply = Parcel.obtain(); |
| 4048 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4049 | data.writeStrongBinder(sender.asBinder()); |
| 4050 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4051 | reply.readException(); |
| 4052 | int res = reply.readInt(); |
| 4053 | data.recycle(); |
| 4054 | reply.recycle(); |
| 4055 | return res; |
| 4056 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4057 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 4058 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 4059 | Parcel data = Parcel.obtain(); |
| 4060 | Parcel reply = Parcel.obtain(); |
| 4061 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4062 | data.writeInt(callingPid); |
| 4063 | data.writeInt(callingUid); |
| 4064 | data.writeInt(userId); |
| 4065 | data.writeInt(allowAll ? 1 : 0); |
| 4066 | data.writeInt(requireFull ? 1 : 0); |
| 4067 | data.writeString(name); |
| 4068 | data.writeString(callerPackage); |
| 4069 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 4070 | reply.readException(); |
| 4071 | int res = reply.readInt(); |
| 4072 | data.recycle(); |
| 4073 | reply.recycle(); |
| 4074 | return res; |
| 4075 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4076 | public void setProcessLimit(int max) throws RemoteException |
| 4077 | { |
| 4078 | Parcel data = Parcel.obtain(); |
| 4079 | Parcel reply = Parcel.obtain(); |
| 4080 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4081 | data.writeInt(max); |
| 4082 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4083 | reply.readException(); |
| 4084 | data.recycle(); |
| 4085 | reply.recycle(); |
| 4086 | } |
| 4087 | public int getProcessLimit() throws RemoteException |
| 4088 | { |
| 4089 | Parcel data = Parcel.obtain(); |
| 4090 | Parcel reply = Parcel.obtain(); |
| 4091 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4092 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4093 | reply.readException(); |
| 4094 | int res = reply.readInt(); |
| 4095 | data.recycle(); |
| 4096 | reply.recycle(); |
| 4097 | return res; |
| 4098 | } |
| 4099 | public void setProcessForeground(IBinder token, int pid, |
| 4100 | boolean isForeground) throws RemoteException { |
| 4101 | Parcel data = Parcel.obtain(); |
| 4102 | Parcel reply = Parcel.obtain(); |
| 4103 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4104 | data.writeStrongBinder(token); |
| 4105 | data.writeInt(pid); |
| 4106 | data.writeInt(isForeground ? 1 : 0); |
| 4107 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4108 | reply.readException(); |
| 4109 | data.recycle(); |
| 4110 | reply.recycle(); |
| 4111 | } |
| 4112 | public int checkPermission(String permission, int pid, int uid) |
| 4113 | throws RemoteException { |
| 4114 | Parcel data = Parcel.obtain(); |
| 4115 | Parcel reply = Parcel.obtain(); |
| 4116 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4117 | data.writeString(permission); |
| 4118 | data.writeInt(pid); |
| 4119 | data.writeInt(uid); |
| 4120 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4121 | reply.readException(); |
| 4122 | int res = reply.readInt(); |
| 4123 | data.recycle(); |
| 4124 | reply.recycle(); |
| 4125 | return res; |
| 4126 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4127 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4128 | throws RemoteException { |
| 4129 | Parcel data = Parcel.obtain(); |
| 4130 | Parcel reply = Parcel.obtain(); |
| 4131 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4132 | data.writeString(permission); |
| 4133 | data.writeInt(pid); |
| 4134 | data.writeInt(uid); |
| 4135 | data.writeStrongBinder(callerToken); |
| 4136 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4137 | reply.readException(); |
| 4138 | int res = reply.readInt(); |
| 4139 | data.recycle(); |
| 4140 | reply.recycle(); |
| 4141 | return res; |
| 4142 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4143 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4144 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4145 | Parcel data = Parcel.obtain(); |
| 4146 | Parcel reply = Parcel.obtain(); |
| 4147 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4148 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4149 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4150 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4151 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4152 | reply.readException(); |
| 4153 | boolean res = reply.readInt() != 0; |
| 4154 | data.recycle(); |
| 4155 | reply.recycle(); |
| 4156 | return res; |
| 4157 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4158 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4159 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4160 | Parcel data = Parcel.obtain(); |
| 4161 | Parcel reply = Parcel.obtain(); |
| 4162 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4163 | uri.writeToParcel(data, 0); |
| 4164 | data.writeInt(pid); |
| 4165 | data.writeInt(uid); |
| 4166 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4167 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4168 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4169 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4170 | reply.readException(); |
| 4171 | int res = reply.readInt(); |
| 4172 | data.recycle(); |
| 4173 | reply.recycle(); |
| 4174 | return res; |
| 4175 | } |
| 4176 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4177 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4178 | Parcel data = Parcel.obtain(); |
| 4179 | Parcel reply = Parcel.obtain(); |
| 4180 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4181 | data.writeStrongBinder(caller.asBinder()); |
| 4182 | data.writeString(targetPkg); |
| 4183 | uri.writeToParcel(data, 0); |
| 4184 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4185 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4186 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4187 | reply.readException(); |
| 4188 | data.recycle(); |
| 4189 | reply.recycle(); |
| 4190 | } |
| 4191 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4192 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4193 | Parcel data = Parcel.obtain(); |
| 4194 | Parcel reply = Parcel.obtain(); |
| 4195 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4196 | data.writeStrongBinder(caller.asBinder()); |
| 4197 | uri.writeToParcel(data, 0); |
| 4198 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4199 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4200 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4201 | reply.readException(); |
| 4202 | data.recycle(); |
| 4203 | reply.recycle(); |
| 4204 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4205 | |
| 4206 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4207 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4208 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4209 | Parcel data = Parcel.obtain(); |
| 4210 | Parcel reply = Parcel.obtain(); |
| 4211 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4212 | uri.writeToParcel(data, 0); |
| 4213 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4214 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4215 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4216 | reply.readException(); |
| 4217 | data.recycle(); |
| 4218 | reply.recycle(); |
| 4219 | } |
| 4220 | |
| 4221 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4222 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4223 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4224 | Parcel data = Parcel.obtain(); |
| 4225 | Parcel reply = Parcel.obtain(); |
| 4226 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4227 | uri.writeToParcel(data, 0); |
| 4228 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4229 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4230 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4231 | reply.readException(); |
| 4232 | data.recycle(); |
| 4233 | reply.recycle(); |
| 4234 | } |
| 4235 | |
| 4236 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4237 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4238 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4239 | Parcel data = Parcel.obtain(); |
| 4240 | Parcel reply = Parcel.obtain(); |
| 4241 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4242 | data.writeString(packageName); |
| 4243 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4244 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4245 | reply.readException(); |
| 4246 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4247 | reply); |
| 4248 | data.recycle(); |
| 4249 | reply.recycle(); |
| 4250 | return perms; |
| 4251 | } |
| 4252 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4253 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4254 | throws RemoteException { |
| 4255 | Parcel data = Parcel.obtain(); |
| 4256 | Parcel reply = Parcel.obtain(); |
| 4257 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4258 | data.writeStrongBinder(who.asBinder()); |
| 4259 | data.writeInt(waiting ? 1 : 0); |
| 4260 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4261 | reply.readException(); |
| 4262 | data.recycle(); |
| 4263 | reply.recycle(); |
| 4264 | } |
| 4265 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4266 | Parcel data = Parcel.obtain(); |
| 4267 | Parcel reply = Parcel.obtain(); |
| 4268 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4269 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4270 | reply.readException(); |
| 4271 | outInfo.readFromParcel(reply); |
| 4272 | data.recycle(); |
| 4273 | reply.recycle(); |
| 4274 | } |
| 4275 | public void unhandledBack() throws RemoteException |
| 4276 | { |
| 4277 | Parcel data = Parcel.obtain(); |
| 4278 | Parcel reply = Parcel.obtain(); |
| 4279 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4280 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4281 | reply.readException(); |
| 4282 | data.recycle(); |
| 4283 | reply.recycle(); |
| 4284 | } |
| 4285 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4286 | { |
| 4287 | Parcel data = Parcel.obtain(); |
| 4288 | Parcel reply = Parcel.obtain(); |
| 4289 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4290 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4291 | reply.readException(); |
| 4292 | ParcelFileDescriptor pfd = null; |
| 4293 | if (reply.readInt() != 0) { |
| 4294 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4295 | } |
| 4296 | data.recycle(); |
| 4297 | reply.recycle(); |
| 4298 | return pfd; |
| 4299 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4300 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4301 | { |
| 4302 | Parcel data = Parcel.obtain(); |
| 4303 | Parcel reply = Parcel.obtain(); |
| 4304 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4305 | data.writeInt(shown ? 1 : 0); |
| 4306 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4307 | reply.readException(); |
| 4308 | data.recycle(); |
| 4309 | reply.recycle(); |
| 4310 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4311 | public void setDebugApp( |
| 4312 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4313 | throws RemoteException |
| 4314 | { |
| 4315 | Parcel data = Parcel.obtain(); |
| 4316 | Parcel reply = Parcel.obtain(); |
| 4317 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4318 | data.writeString(packageName); |
| 4319 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4320 | data.writeInt(persistent ? 1 : 0); |
| 4321 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4322 | reply.readException(); |
| 4323 | data.recycle(); |
| 4324 | reply.recycle(); |
| 4325 | } |
| 4326 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4327 | { |
| 4328 | Parcel data = Parcel.obtain(); |
| 4329 | Parcel reply = Parcel.obtain(); |
| 4330 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4331 | data.writeInt(enabled ? 1 : 0); |
| 4332 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4333 | reply.readException(); |
| 4334 | data.recycle(); |
| 4335 | reply.recycle(); |
| 4336 | } |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4337 | public void setActivityController(IActivityController watcher) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4338 | { |
| 4339 | Parcel data = Parcel.obtain(); |
| 4340 | Parcel reply = Parcel.obtain(); |
| 4341 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4342 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4343 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4344 | reply.readException(); |
| 4345 | data.recycle(); |
| 4346 | reply.recycle(); |
| 4347 | } |
| 4348 | public void enterSafeMode() throws RemoteException { |
| 4349 | Parcel data = Parcel.obtain(); |
| 4350 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4351 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4352 | data.recycle(); |
| 4353 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4354 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4355 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4356 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4357 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4358 | data.writeStrongBinder(sender.asBinder()); |
| 4359 | data.writeInt(sourceUid); |
| 4360 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4361 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4362 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4363 | data.recycle(); |
| 4364 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4365 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 4366 | throws RemoteException { |
| 4367 | Parcel data = Parcel.obtain(); |
| 4368 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4369 | data.writeStrongBinder(sender.asBinder()); |
| 4370 | data.writeInt(sourceUid); |
| 4371 | data.writeString(tag); |
| 4372 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 4373 | data.recycle(); |
| 4374 | } |
| 4375 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 4376 | throws RemoteException { |
| 4377 | Parcel data = Parcel.obtain(); |
| 4378 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4379 | data.writeStrongBinder(sender.asBinder()); |
| 4380 | data.writeInt(sourceUid); |
| 4381 | data.writeString(tag); |
| 4382 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 4383 | data.recycle(); |
| 4384 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4385 | 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] | 4386 | Parcel data = Parcel.obtain(); |
| 4387 | Parcel reply = Parcel.obtain(); |
| 4388 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4389 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4390 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4391 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4392 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 4393 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4394 | boolean res = reply.readInt() != 0; |
| 4395 | data.recycle(); |
| 4396 | reply.recycle(); |
| 4397 | return res; |
| 4398 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 4399 | @Override |
| 4400 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 4401 | Parcel data = Parcel.obtain(); |
| 4402 | Parcel reply = Parcel.obtain(); |
| 4403 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4404 | data.writeString(reason); |
| 4405 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4406 | boolean res = reply.readInt() != 0; |
| 4407 | data.recycle(); |
| 4408 | reply.recycle(); |
| 4409 | return res; |
| 4410 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4411 | public boolean testIsSystemReady() |
| 4412 | { |
| 4413 | /* this base class version is never called */ |
| 4414 | return true; |
| 4415 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4416 | public void handleApplicationCrash(IBinder app, |
| 4417 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 4418 | { |
| 4419 | Parcel data = Parcel.obtain(); |
| 4420 | Parcel reply = Parcel.obtain(); |
| 4421 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4422 | data.writeStrongBinder(app); |
| 4423 | crashInfo.writeToParcel(data, 0); |
| 4424 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 4425 | reply.readException(); |
| 4426 | reply.recycle(); |
| 4427 | data.recycle(); |
| 4428 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4429 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4430 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4431 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4432 | { |
| 4433 | Parcel data = Parcel.obtain(); |
| 4434 | Parcel reply = Parcel.obtain(); |
| 4435 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4436 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4437 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4438 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4439 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4440 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4441 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4442 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4443 | reply.recycle(); |
| 4444 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4445 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4446 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4447 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4448 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4449 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4450 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4451 | { |
| 4452 | Parcel data = Parcel.obtain(); |
| 4453 | Parcel reply = Parcel.obtain(); |
| 4454 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4455 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4456 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4457 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4458 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 4459 | reply.readException(); |
| 4460 | reply.recycle(); |
| 4461 | data.recycle(); |
| 4462 | } |
| 4463 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4464 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 4465 | Parcel data = Parcel.obtain(); |
| 4466 | Parcel reply = Parcel.obtain(); |
| 4467 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4468 | data.writeInt(sig); |
| 4469 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 4470 | reply.readException(); |
| 4471 | data.recycle(); |
| 4472 | reply.recycle(); |
| 4473 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4474 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4475 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4476 | Parcel data = Parcel.obtain(); |
| 4477 | Parcel reply = Parcel.obtain(); |
| 4478 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4479 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4480 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4481 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4482 | reply.readException(); |
| 4483 | data.recycle(); |
| 4484 | reply.recycle(); |
| 4485 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4486 | |
| 4487 | public void killAllBackgroundProcesses() throws RemoteException { |
| 4488 | Parcel data = Parcel.obtain(); |
| 4489 | Parcel reply = Parcel.obtain(); |
| 4490 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4491 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4492 | reply.readException(); |
| 4493 | data.recycle(); |
| 4494 | reply.recycle(); |
| 4495 | } |
| 4496 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4497 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4498 | Parcel data = Parcel.obtain(); |
| 4499 | Parcel reply = Parcel.obtain(); |
| 4500 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4501 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4502 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4503 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4504 | reply.readException(); |
| 4505 | data.recycle(); |
| 4506 | reply.recycle(); |
| 4507 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4508 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 4509 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 4510 | throws RemoteException |
| 4511 | { |
| 4512 | Parcel data = Parcel.obtain(); |
| 4513 | Parcel reply = Parcel.obtain(); |
| 4514 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4515 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 4516 | reply.readException(); |
| 4517 | outInfo.readFromParcel(reply); |
| 4518 | reply.recycle(); |
| 4519 | data.recycle(); |
| 4520 | } |
| 4521 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4522 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 4523 | { |
| 4524 | Parcel data = Parcel.obtain(); |
| 4525 | Parcel reply = Parcel.obtain(); |
| 4526 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4527 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4528 | reply.readException(); |
| 4529 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 4530 | reply.recycle(); |
| 4531 | data.recycle(); |
| 4532 | return res; |
| 4533 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4534 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4535 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4536 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4537 | { |
| 4538 | Parcel data = Parcel.obtain(); |
| 4539 | Parcel reply = Parcel.obtain(); |
| 4540 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4541 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4542 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4543 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 4544 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4545 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 4546 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4547 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 4548 | } else { |
| 4549 | data.writeInt(0); |
| 4550 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4551 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 4552 | reply.readException(); |
| 4553 | boolean res = reply.readInt() != 0; |
| 4554 | reply.recycle(); |
| 4555 | data.recycle(); |
| 4556 | return res; |
| 4557 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4558 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 4559 | public boolean shutdown(int timeout) throws RemoteException |
| 4560 | { |
| 4561 | Parcel data = Parcel.obtain(); |
| 4562 | Parcel reply = Parcel.obtain(); |
| 4563 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4564 | data.writeInt(timeout); |
| 4565 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 4566 | reply.readException(); |
| 4567 | boolean res = reply.readInt() != 0; |
| 4568 | reply.recycle(); |
| 4569 | data.recycle(); |
| 4570 | return res; |
| 4571 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4572 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 4573 | public void stopAppSwitches() throws RemoteException { |
| 4574 | Parcel data = Parcel.obtain(); |
| 4575 | Parcel reply = Parcel.obtain(); |
| 4576 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4577 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 4578 | reply.readException(); |
| 4579 | reply.recycle(); |
| 4580 | data.recycle(); |
| 4581 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4582 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 4583 | public void resumeAppSwitches() throws RemoteException { |
| 4584 | Parcel data = Parcel.obtain(); |
| 4585 | Parcel reply = Parcel.obtain(); |
| 4586 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4587 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 4588 | reply.readException(); |
| 4589 | reply.recycle(); |
| 4590 | data.recycle(); |
| 4591 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 4592 | |
| 4593 | public void addPackageDependency(String packageName) throws RemoteException { |
| 4594 | Parcel data = Parcel.obtain(); |
| 4595 | Parcel reply = Parcel.obtain(); |
| 4596 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4597 | data.writeString(packageName); |
| 4598 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 4599 | reply.readException(); |
| 4600 | data.recycle(); |
| 4601 | reply.recycle(); |
| 4602 | } |
| 4603 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 4604 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 4605 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 4606 | Parcel data = Parcel.obtain(); |
| 4607 | Parcel reply = Parcel.obtain(); |
| 4608 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4609 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4610 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 4611 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4612 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 4613 | reply.readException(); |
| 4614 | data.recycle(); |
| 4615 | reply.recycle(); |
| 4616 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4617 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 4618 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 4619 | Parcel data = Parcel.obtain(); |
| 4620 | Parcel reply = Parcel.obtain(); |
| 4621 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4622 | data.writeString(reason); |
| 4623 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 4624 | reply.readException(); |
| 4625 | data.recycle(); |
| 4626 | reply.recycle(); |
| 4627 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4628 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4629 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4630 | throws RemoteException { |
| 4631 | Parcel data = Parcel.obtain(); |
| 4632 | Parcel reply = Parcel.obtain(); |
| 4633 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4634 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4635 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4636 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4637 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4638 | data.recycle(); |
| 4639 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4640 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4641 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 4642 | |
| 4643 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 4644 | Parcel data = Parcel.obtain(); |
| 4645 | Parcel reply = Parcel.obtain(); |
| 4646 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4647 | data.writeString(processName); |
| 4648 | data.writeInt(uid); |
| 4649 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 4650 | reply.readException(); |
| 4651 | data.recycle(); |
| 4652 | reply.recycle(); |
| 4653 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4654 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 4655 | public void overridePendingTransition(IBinder token, String packageName, |
| 4656 | int enterAnim, int exitAnim) throws RemoteException { |
| 4657 | Parcel data = Parcel.obtain(); |
| 4658 | Parcel reply = Parcel.obtain(); |
| 4659 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4660 | data.writeStrongBinder(token); |
| 4661 | data.writeString(packageName); |
| 4662 | data.writeInt(enterAnim); |
| 4663 | data.writeInt(exitAnim); |
| 4664 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 4665 | reply.readException(); |
| 4666 | data.recycle(); |
| 4667 | reply.recycle(); |
| 4668 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4669 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 4670 | public boolean isUserAMonkey() throws RemoteException { |
| 4671 | Parcel data = Parcel.obtain(); |
| 4672 | Parcel reply = Parcel.obtain(); |
| 4673 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4674 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 4675 | reply.readException(); |
| 4676 | boolean res = reply.readInt() != 0; |
| 4677 | data.recycle(); |
| 4678 | reply.recycle(); |
| 4679 | return res; |
| 4680 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 4681 | |
| 4682 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 4683 | Parcel data = Parcel.obtain(); |
| 4684 | Parcel reply = Parcel.obtain(); |
| 4685 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4686 | data.writeInt(monkey ? 1 : 0); |
| 4687 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 4688 | reply.readException(); |
| 4689 | data.recycle(); |
| 4690 | reply.recycle(); |
| 4691 | } |
| 4692 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 4693 | public void finishHeavyWeightApp() throws RemoteException { |
| 4694 | Parcel data = Parcel.obtain(); |
| 4695 | Parcel reply = Parcel.obtain(); |
| 4696 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4697 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 4698 | reply.readException(); |
| 4699 | data.recycle(); |
| 4700 | reply.recycle(); |
| 4701 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4702 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4703 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4704 | throws RemoteException { |
| 4705 | Parcel data = Parcel.obtain(); |
| 4706 | Parcel reply = Parcel.obtain(); |
| 4707 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4708 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4709 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 4710 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4711 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4712 | data.recycle(); |
| 4713 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4714 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4715 | } |
| 4716 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4717 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4718 | throws RemoteException { |
| 4719 | Parcel data = Parcel.obtain(); |
| 4720 | Parcel reply = Parcel.obtain(); |
| 4721 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4722 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4723 | if (options == null) { |
| 4724 | data.writeInt(0); |
| 4725 | } else { |
| 4726 | data.writeInt(1); |
| 4727 | data.writeBundle(options.toBundle()); |
| 4728 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4729 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4730 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4731 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4732 | data.recycle(); |
| 4733 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4734 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4735 | } |
| 4736 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4737 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 4738 | Parcel data = Parcel.obtain(); |
| 4739 | Parcel reply = Parcel.obtain(); |
| 4740 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4741 | data.writeStrongBinder(token); |
| 4742 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 4743 | reply.readException(); |
| 4744 | Bundle bundle = reply.readBundle(); |
| 4745 | ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle); |
| 4746 | data.recycle(); |
| 4747 | reply.recycle(); |
| 4748 | return options; |
| 4749 | } |
| 4750 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4751 | public void setImmersive(IBinder token, boolean immersive) |
| 4752 | throws RemoteException { |
| 4753 | Parcel data = Parcel.obtain(); |
| 4754 | Parcel reply = Parcel.obtain(); |
| 4755 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4756 | data.writeStrongBinder(token); |
| 4757 | data.writeInt(immersive ? 1 : 0); |
| 4758 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 4759 | reply.readException(); |
| 4760 | data.recycle(); |
| 4761 | reply.recycle(); |
| 4762 | } |
| 4763 | |
| 4764 | public boolean isImmersive(IBinder token) |
| 4765 | throws RemoteException { |
| 4766 | Parcel data = Parcel.obtain(); |
| 4767 | Parcel reply = Parcel.obtain(); |
| 4768 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4769 | data.writeStrongBinder(token); |
| 4770 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4771 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4772 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4773 | data.recycle(); |
| 4774 | reply.recycle(); |
| 4775 | return res; |
| 4776 | } |
| 4777 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 4778 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 4779 | Parcel data = Parcel.obtain(); |
| 4780 | Parcel reply = Parcel.obtain(); |
| 4781 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4782 | data.writeStrongBinder(token); |
| 4783 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 4784 | reply.readException(); |
| 4785 | boolean res = reply.readInt() == 1; |
| 4786 | data.recycle(); |
| 4787 | reply.recycle(); |
| 4788 | return res; |
| 4789 | } |
| 4790 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4791 | public boolean isTopActivityImmersive() |
| 4792 | throws RemoteException { |
| 4793 | Parcel data = Parcel.obtain(); |
| 4794 | Parcel reply = Parcel.obtain(); |
| 4795 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4796 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4797 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4798 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4799 | data.recycle(); |
| 4800 | reply.recycle(); |
| 4801 | return res; |
| 4802 | } |
| 4803 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 4804 | public void crashApplication(int uid, int initialPid, String packageName, |
| 4805 | String message) throws RemoteException { |
| 4806 | Parcel data = Parcel.obtain(); |
| 4807 | Parcel reply = Parcel.obtain(); |
| 4808 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4809 | data.writeInt(uid); |
| 4810 | data.writeInt(initialPid); |
| 4811 | data.writeString(packageName); |
| 4812 | data.writeString(message); |
| 4813 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 4814 | reply.readException(); |
| 4815 | data.recycle(); |
| 4816 | reply.recycle(); |
| 4817 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4818 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4819 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 4820 | Parcel data = Parcel.obtain(); |
| 4821 | Parcel reply = Parcel.obtain(); |
| 4822 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4823 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4824 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 4825 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 4826 | reply.readException(); |
| 4827 | String res = reply.readString(); |
| 4828 | data.recycle(); |
| 4829 | reply.recycle(); |
| 4830 | return res; |
| 4831 | } |
| 4832 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4833 | public IBinder newUriPermissionOwner(String name) |
| 4834 | throws RemoteException { |
| 4835 | Parcel data = Parcel.obtain(); |
| 4836 | Parcel reply = Parcel.obtain(); |
| 4837 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4838 | data.writeString(name); |
| 4839 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 4840 | reply.readException(); |
| 4841 | IBinder res = reply.readStrongBinder(); |
| 4842 | data.recycle(); |
| 4843 | reply.recycle(); |
| 4844 | return res; |
| 4845 | } |
| 4846 | |
| 4847 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 4848 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4849 | Parcel data = Parcel.obtain(); |
| 4850 | Parcel reply = Parcel.obtain(); |
| 4851 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4852 | data.writeStrongBinder(owner); |
| 4853 | data.writeInt(fromUid); |
| 4854 | data.writeString(targetPkg); |
| 4855 | uri.writeToParcel(data, 0); |
| 4856 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 4857 | data.writeInt(sourceUserId); |
| 4858 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4859 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4860 | reply.readException(); |
| 4861 | data.recycle(); |
| 4862 | reply.recycle(); |
| 4863 | } |
| 4864 | |
| 4865 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4866 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4867 | Parcel data = Parcel.obtain(); |
| 4868 | Parcel reply = Parcel.obtain(); |
| 4869 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4870 | data.writeStrongBinder(owner); |
| 4871 | if (uri != null) { |
| 4872 | data.writeInt(1); |
| 4873 | uri.writeToParcel(data, 0); |
| 4874 | } else { |
| 4875 | data.writeInt(0); |
| 4876 | } |
| 4877 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4878 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4879 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4880 | reply.readException(); |
| 4881 | data.recycle(); |
| 4882 | reply.recycle(); |
| 4883 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 4884 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 4885 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4886 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 4887 | Parcel data = Parcel.obtain(); |
| 4888 | Parcel reply = Parcel.obtain(); |
| 4889 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4890 | data.writeInt(callingUid); |
| 4891 | data.writeString(targetPkg); |
| 4892 | uri.writeToParcel(data, 0); |
| 4893 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4894 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 4895 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4896 | reply.readException(); |
| 4897 | int res = reply.readInt(); |
| 4898 | data.recycle(); |
| 4899 | reply.recycle(); |
| 4900 | return res; |
| 4901 | } |
| 4902 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4903 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4904 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 4905 | Parcel data = Parcel.obtain(); |
| 4906 | Parcel reply = Parcel.obtain(); |
| 4907 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4908 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4909 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4910 | data.writeInt(managed ? 1 : 0); |
| 4911 | data.writeString(path); |
| 4912 | if (fd != null) { |
| 4913 | data.writeInt(1); |
| 4914 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 4915 | } else { |
| 4916 | data.writeInt(0); |
| 4917 | } |
| 4918 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 4919 | reply.readException(); |
| 4920 | boolean res = reply.readInt() != 0; |
| 4921 | reply.recycle(); |
| 4922 | data.recycle(); |
| 4923 | return res; |
| 4924 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4925 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 4926 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 4927 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 4928 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4929 | Parcel data = Parcel.obtain(); |
| 4930 | Parcel reply = Parcel.obtain(); |
| 4931 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4932 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 4933 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4934 | data.writeTypedArray(intents, 0); |
| 4935 | data.writeStringArray(resolvedTypes); |
| 4936 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 4937 | if (options != null) { |
| 4938 | data.writeInt(1); |
| 4939 | options.writeToParcel(data, 0); |
| 4940 | } else { |
| 4941 | data.writeInt(0); |
| 4942 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 4943 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4944 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 4945 | reply.readException(); |
| 4946 | int result = reply.readInt(); |
| 4947 | reply.recycle(); |
| 4948 | data.recycle(); |
| 4949 | return result; |
| 4950 | } |
| 4951 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4952 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 4953 | Parcel data = Parcel.obtain(); |
| 4954 | Parcel reply = Parcel.obtain(); |
| 4955 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4956 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4957 | reply.readException(); |
| 4958 | int mode = reply.readInt(); |
| 4959 | reply.recycle(); |
| 4960 | data.recycle(); |
| 4961 | return mode; |
| 4962 | } |
| 4963 | |
| 4964 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 4965 | Parcel data = Parcel.obtain(); |
| 4966 | Parcel reply = Parcel.obtain(); |
| 4967 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4968 | data.writeInt(mode); |
| 4969 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4970 | reply.readException(); |
| 4971 | reply.recycle(); |
| 4972 | data.recycle(); |
| 4973 | } |
| 4974 | |
| 4975 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 4976 | Parcel data = Parcel.obtain(); |
| 4977 | Parcel reply = Parcel.obtain(); |
| 4978 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 4979 | data.writeString(packageName); |
| 4980 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4981 | reply.readException(); |
| 4982 | int mode = reply.readInt(); |
| 4983 | reply.recycle(); |
| 4984 | data.recycle(); |
| 4985 | return mode; |
| 4986 | } |
| 4987 | |
| 4988 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 4989 | throws RemoteException { |
| 4990 | Parcel data = Parcel.obtain(); |
| 4991 | Parcel reply = Parcel.obtain(); |
| 4992 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4993 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4994 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 4995 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4996 | reply.readException(); |
| 4997 | reply.recycle(); |
| 4998 | data.recycle(); |
| 4999 | } |
| 5000 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5001 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 5002 | Parcel data = Parcel.obtain(); |
| 5003 | Parcel reply = Parcel.obtain(); |
| 5004 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5005 | data.writeString(packageName); |
| 5006 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5007 | reply.readException(); |
| 5008 | boolean ask = reply.readInt() != 0; |
| 5009 | reply.recycle(); |
| 5010 | data.recycle(); |
| 5011 | return ask; |
| 5012 | } |
| 5013 | |
| 5014 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 5015 | throws RemoteException { |
| 5016 | Parcel data = Parcel.obtain(); |
| 5017 | Parcel reply = Parcel.obtain(); |
| 5018 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5019 | data.writeString(packageName); |
| 5020 | data.writeInt(ask ? 1 : 0); |
| 5021 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5022 | reply.readException(); |
| 5023 | reply.recycle(); |
| 5024 | data.recycle(); |
| 5025 | } |
| 5026 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5027 | public boolean switchUser(int userid) throws RemoteException { |
| 5028 | Parcel data = Parcel.obtain(); |
| 5029 | Parcel reply = Parcel.obtain(); |
| 5030 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5031 | data.writeInt(userid); |
| 5032 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 5033 | reply.readException(); |
| 5034 | boolean result = reply.readInt() != 0; |
| 5035 | reply.recycle(); |
| 5036 | data.recycle(); |
| 5037 | return result; |
| 5038 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5039 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 5040 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 5041 | Parcel data = Parcel.obtain(); |
| 5042 | Parcel reply = Parcel.obtain(); |
| 5043 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5044 | data.writeInt(userid); |
| 5045 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 5046 | reply.readException(); |
| 5047 | boolean result = reply.readInt() != 0; |
| 5048 | reply.recycle(); |
| 5049 | data.recycle(); |
| 5050 | return result; |
| 5051 | } |
| 5052 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5053 | public int stopUser(int userid, IStopUserCallback callback) throws RemoteException { |
| 5054 | Parcel data = Parcel.obtain(); |
| 5055 | Parcel reply = Parcel.obtain(); |
| 5056 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5057 | data.writeInt(userid); |
| 5058 | data.writeStrongInterface(callback); |
| 5059 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 5060 | reply.readException(); |
| 5061 | int result = reply.readInt(); |
| 5062 | reply.recycle(); |
| 5063 | data.recycle(); |
| 5064 | return result; |
| 5065 | } |
| 5066 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5067 | public UserInfo getCurrentUser() throws RemoteException { |
| 5068 | Parcel data = Parcel.obtain(); |
| 5069 | Parcel reply = Parcel.obtain(); |
| 5070 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5071 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5072 | reply.readException(); |
| 5073 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 5074 | reply.recycle(); |
| 5075 | data.recycle(); |
| 5076 | return userInfo; |
| 5077 | } |
| 5078 | |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 5079 | public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5080 | Parcel data = Parcel.obtain(); |
| 5081 | Parcel reply = Parcel.obtain(); |
| 5082 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5083 | data.writeInt(userid); |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 5084 | data.writeInt(orStopping ? 1 : 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5085 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5086 | reply.readException(); |
| 5087 | boolean result = reply.readInt() != 0; |
| 5088 | reply.recycle(); |
| 5089 | data.recycle(); |
| 5090 | return result; |
| 5091 | } |
| 5092 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5093 | public int[] getRunningUserIds() throws RemoteException { |
| 5094 | Parcel data = Parcel.obtain(); |
| 5095 | Parcel reply = Parcel.obtain(); |
| 5096 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5097 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5098 | reply.readException(); |
| 5099 | int[] result = reply.createIntArray(); |
| 5100 | reply.recycle(); |
| 5101 | data.recycle(); |
| 5102 | return result; |
| 5103 | } |
| 5104 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5105 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5106 | Parcel data = Parcel.obtain(); |
| 5107 | Parcel reply = Parcel.obtain(); |
| 5108 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5109 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5110 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5111 | reply.readException(); |
| 5112 | boolean result = reply.readInt() != 0; |
| 5113 | reply.recycle(); |
| 5114 | data.recycle(); |
| 5115 | return result; |
| 5116 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5117 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5118 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5119 | Parcel data = Parcel.obtain(); |
| 5120 | Parcel reply = Parcel.obtain(); |
| 5121 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5122 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5123 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5124 | reply.readException(); |
| 5125 | data.recycle(); |
| 5126 | reply.recycle(); |
| 5127 | } |
| 5128 | |
| 5129 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5130 | Parcel data = Parcel.obtain(); |
| 5131 | Parcel reply = Parcel.obtain(); |
| 5132 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5133 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5134 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5135 | reply.readException(); |
| 5136 | data.recycle(); |
| 5137 | reply.recycle(); |
| 5138 | } |
| 5139 | |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5140 | public void registerUidObserver(IUidObserver observer) throws RemoteException { |
| 5141 | Parcel data = Parcel.obtain(); |
| 5142 | Parcel reply = Parcel.obtain(); |
| 5143 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5144 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5145 | mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5146 | reply.readException(); |
| 5147 | data.recycle(); |
| 5148 | reply.recycle(); |
| 5149 | } |
| 5150 | |
| 5151 | public void unregisterUidObserver(IUidObserver observer) throws RemoteException { |
| 5152 | Parcel data = Parcel.obtain(); |
| 5153 | Parcel reply = Parcel.obtain(); |
| 5154 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5155 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5156 | mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5157 | reply.readException(); |
| 5158 | data.recycle(); |
| 5159 | reply.recycle(); |
| 5160 | } |
| 5161 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5162 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5163 | Parcel data = Parcel.obtain(); |
| 5164 | Parcel reply = Parcel.obtain(); |
| 5165 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5166 | data.writeStrongBinder(sender.asBinder()); |
| 5167 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5168 | reply.readException(); |
| 5169 | boolean res = reply.readInt() != 0; |
| 5170 | data.recycle(); |
| 5171 | reply.recycle(); |
| 5172 | return res; |
| 5173 | } |
| 5174 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5175 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5176 | Parcel data = Parcel.obtain(); |
| 5177 | Parcel reply = Parcel.obtain(); |
| 5178 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5179 | data.writeStrongBinder(sender.asBinder()); |
| 5180 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5181 | reply.readException(); |
| 5182 | boolean res = reply.readInt() != 0; |
| 5183 | data.recycle(); |
| 5184 | reply.recycle(); |
| 5185 | return res; |
| 5186 | } |
| 5187 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5188 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5189 | Parcel data = Parcel.obtain(); |
| 5190 | Parcel reply = Parcel.obtain(); |
| 5191 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5192 | data.writeStrongBinder(sender.asBinder()); |
| 5193 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5194 | reply.readException(); |
| 5195 | Intent res = reply.readInt() != 0 |
| 5196 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5197 | data.recycle(); |
| 5198 | reply.recycle(); |
| 5199 | return res; |
| 5200 | } |
| 5201 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5202 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5203 | throws RemoteException { |
| 5204 | Parcel data = Parcel.obtain(); |
| 5205 | Parcel reply = Parcel.obtain(); |
| 5206 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5207 | data.writeStrongBinder(sender.asBinder()); |
| 5208 | data.writeString(prefix); |
| 5209 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5210 | reply.readException(); |
| 5211 | String res = reply.readString(); |
| 5212 | data.recycle(); |
| 5213 | reply.recycle(); |
| 5214 | return res; |
| 5215 | } |
| 5216 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5217 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5218 | { |
| 5219 | Parcel data = Parcel.obtain(); |
| 5220 | Parcel reply = Parcel.obtain(); |
| 5221 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5222 | values.writeToParcel(data, 0); |
| 5223 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5224 | reply.readException(); |
| 5225 | data.recycle(); |
| 5226 | reply.recycle(); |
| 5227 | } |
| 5228 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 5229 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 5230 | Parcel data = Parcel.obtain(); |
| 5231 | Parcel reply = Parcel.obtain(); |
| 5232 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5233 | data.writeIntArray(pids); |
| 5234 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 5235 | reply.readException(); |
| 5236 | long[] res = reply.createLongArray(); |
| 5237 | data.recycle(); |
| 5238 | reply.recycle(); |
| 5239 | return res; |
| 5240 | } |
| 5241 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5242 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5243 | Parcel data = Parcel.obtain(); |
| 5244 | Parcel reply = Parcel.obtain(); |
| 5245 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5246 | TextUtils.writeToParcel(msg, data, 0); |
| 5247 | data.writeInt(always ? 1 : 0); |
| 5248 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5249 | reply.readException(); |
| 5250 | data.recycle(); |
| 5251 | reply.recycle(); |
| 5252 | } |
| 5253 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5254 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5255 | Parcel data = Parcel.obtain(); |
| 5256 | Parcel reply = Parcel.obtain(); |
| 5257 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5258 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5259 | reply.readException(); |
| 5260 | data.recycle(); |
| 5261 | reply.recycle(); |
| 5262 | } |
| 5263 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5264 | public void keyguardGoingAway(boolean disableWindowAnimations, |
| 5265 | boolean keyguardGoingToNotificationShade) throws RemoteException { |
| 5266 | Parcel data = Parcel.obtain(); |
| 5267 | Parcel reply = Parcel.obtain(); |
| 5268 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5269 | data.writeInt(disableWindowAnimations ? 1 : 0); |
| 5270 | data.writeInt(keyguardGoingToNotificationShade ? 1 : 0); |
| 5271 | mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0); |
| 5272 | reply.readException(); |
| 5273 | data.recycle(); |
| 5274 | reply.recycle(); |
| 5275 | } |
| 5276 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5277 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5278 | throws RemoteException { |
| 5279 | Parcel data = Parcel.obtain(); |
| 5280 | Parcel reply = Parcel.obtain(); |
| 5281 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5282 | data.writeStrongBinder(token); |
| 5283 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5284 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5285 | reply.readException(); |
| 5286 | boolean result = reply.readInt() != 0; |
| 5287 | data.recycle(); |
| 5288 | reply.recycle(); |
| 5289 | return result; |
| 5290 | } |
| 5291 | |
| 5292 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5293 | throws RemoteException { |
| 5294 | Parcel data = Parcel.obtain(); |
| 5295 | Parcel reply = Parcel.obtain(); |
| 5296 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5297 | data.writeStrongBinder(token); |
| 5298 | target.writeToParcel(data, 0); |
| 5299 | data.writeInt(resultCode); |
| 5300 | if (resultData != null) { |
| 5301 | data.writeInt(1); |
| 5302 | resultData.writeToParcel(data, 0); |
| 5303 | } else { |
| 5304 | data.writeInt(0); |
| 5305 | } |
| 5306 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5307 | reply.readException(); |
| 5308 | boolean result = reply.readInt() != 0; |
| 5309 | data.recycle(); |
| 5310 | reply.recycle(); |
| 5311 | return result; |
| 5312 | } |
| 5313 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5314 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5315 | Parcel data = Parcel.obtain(); |
| 5316 | Parcel reply = Parcel.obtain(); |
| 5317 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5318 | data.writeStrongBinder(activityToken); |
| 5319 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5320 | reply.readException(); |
| 5321 | int result = reply.readInt(); |
| 5322 | data.recycle(); |
| 5323 | reply.recycle(); |
| 5324 | return result; |
| 5325 | } |
| 5326 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5327 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 5328 | Parcel data = Parcel.obtain(); |
| 5329 | Parcel reply = Parcel.obtain(); |
| 5330 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5331 | data.writeStrongBinder(activityToken); |
| 5332 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 5333 | reply.readException(); |
| 5334 | String result = reply.readString(); |
| 5335 | data.recycle(); |
| 5336 | reply.recycle(); |
| 5337 | return result; |
| 5338 | } |
| 5339 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 5340 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5341 | Parcel data = Parcel.obtain(); |
| 5342 | Parcel reply = Parcel.obtain(); |
| 5343 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5344 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5345 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5346 | reply.readException(); |
| 5347 | data.recycle(); |
| 5348 | reply.recycle(); |
| 5349 | } |
| 5350 | |
| 5351 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5352 | Parcel data = Parcel.obtain(); |
| 5353 | Parcel reply = Parcel.obtain(); |
| 5354 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5355 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5356 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5357 | reply.readException(); |
| 5358 | data.recycle(); |
| 5359 | reply.recycle(); |
| 5360 | } |
| 5361 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5362 | public void requestBugReport() throws RemoteException { |
| 5363 | Parcel data = Parcel.obtain(); |
| 5364 | Parcel reply = Parcel.obtain(); |
| 5365 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5366 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 5367 | reply.readException(); |
| 5368 | data.recycle(); |
| 5369 | reply.recycle(); |
| 5370 | } |
| 5371 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5372 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 5373 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5374 | Parcel data = Parcel.obtain(); |
| 5375 | Parcel reply = Parcel.obtain(); |
| 5376 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5377 | data.writeInt(pid); |
| 5378 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5379 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5380 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 5381 | reply.readException(); |
| 5382 | long res = reply.readInt(); |
| 5383 | data.recycle(); |
| 5384 | reply.recycle(); |
| 5385 | return res; |
| 5386 | } |
| 5387 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5388 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5389 | Parcel data = Parcel.obtain(); |
| 5390 | Parcel reply = Parcel.obtain(); |
| 5391 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5392 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5393 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5394 | reply.readException(); |
| 5395 | Bundle res = reply.readBundle(); |
| 5396 | data.recycle(); |
| 5397 | reply.recycle(); |
| 5398 | return res; |
| 5399 | } |
| 5400 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5401 | public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, |
| 5402 | IBinder activityToken) throws RemoteException { |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5403 | Parcel data = Parcel.obtain(); |
| 5404 | Parcel reply = Parcel.obtain(); |
| 5405 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5406 | data.writeInt(requestType); |
| 5407 | data.writeStrongBinder(receiver.asBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5408 | data.writeStrongBinder(activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5409 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 5410 | reply.readException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5411 | boolean res = reply.readInt() != 0; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5412 | data.recycle(); |
| 5413 | reply.recycle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5414 | return res; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5415 | } |
| 5416 | |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 5417 | public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 5418 | AssistContent content, Uri referrer) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5419 | Parcel data = Parcel.obtain(); |
| 5420 | Parcel reply = Parcel.obtain(); |
| 5421 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5422 | data.writeStrongBinder(token); |
| 5423 | data.writeBundle(extras); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 5424 | structure.writeToParcel(data, 0); |
| 5425 | content.writeToParcel(data, 0); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 5426 | if (referrer != null) { |
| 5427 | data.writeInt(1); |
| 5428 | referrer.writeToParcel(data, 0); |
| 5429 | } else { |
| 5430 | data.writeInt(0); |
| 5431 | } |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5432 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5433 | reply.readException(); |
| 5434 | data.recycle(); |
| 5435 | reply.recycle(); |
| 5436 | } |
| 5437 | |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 5438 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, |
| 5439 | Bundle args) throws RemoteException { |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 5440 | Parcel data = Parcel.obtain(); |
| 5441 | Parcel reply = Parcel.obtain(); |
| 5442 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5443 | intent.writeToParcel(data, 0); |
| 5444 | data.writeInt(requestType); |
| 5445 | data.writeString(hint); |
| 5446 | data.writeInt(userHandle); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 5447 | data.writeBundle(args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 5448 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 5449 | reply.readException(); |
| 5450 | boolean res = reply.readInt() != 0; |
| 5451 | data.recycle(); |
| 5452 | reply.recycle(); |
| 5453 | return res; |
| 5454 | } |
| 5455 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5456 | public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException { |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 5457 | Parcel data = Parcel.obtain(); |
| 5458 | Parcel reply = Parcel.obtain(); |
| 5459 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5460 | mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5461 | reply.readException(); |
| 5462 | boolean res = reply.readInt() != 0; |
| 5463 | data.recycle(); |
| 5464 | reply.recycle(); |
| 5465 | return res; |
| 5466 | } |
| 5467 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5468 | public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException { |
| 5469 | Parcel data = Parcel.obtain(); |
| 5470 | Parcel reply = Parcel.obtain(); |
| 5471 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5472 | data.writeStrongBinder(token); |
| 5473 | data.writeBundle(args); |
| 5474 | mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5475 | reply.readException(); |
| 5476 | boolean res = reply.readInt() != 0; |
| 5477 | data.recycle(); |
| 5478 | reply.recycle(); |
| 5479 | return res; |
| 5480 | } |
| 5481 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5482 | public void killUid(int uid, String reason) throws RemoteException { |
| 5483 | Parcel data = Parcel.obtain(); |
| 5484 | Parcel reply = Parcel.obtain(); |
| 5485 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5486 | data.writeInt(uid); |
| 5487 | data.writeString(reason); |
| 5488 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 5489 | reply.readException(); |
| 5490 | data.recycle(); |
| 5491 | reply.recycle(); |
| 5492 | } |
| 5493 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 5494 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 5495 | Parcel data = Parcel.obtain(); |
| 5496 | Parcel reply = Parcel.obtain(); |
| 5497 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5498 | data.writeStrongBinder(who); |
| 5499 | data.writeInt(allowRestart ? 1 : 0); |
| 5500 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 5501 | reply.readException(); |
| 5502 | data.recycle(); |
| 5503 | reply.recycle(); |
| 5504 | } |
| 5505 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 5506 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 5507 | Parcel data = Parcel.obtain(); |
| 5508 | Parcel reply = Parcel.obtain(); |
| 5509 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5510 | data.writeStrongBinder(token); |
| 5511 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 5512 | reply.readException(); |
| 5513 | data.recycle(); |
| 5514 | reply.recycle(); |
| 5515 | } |
| 5516 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5517 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 5518 | Parcel data = Parcel.obtain(); |
| 5519 | Parcel reply = Parcel.obtain(); |
| 5520 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5521 | data.writeStrongBinder(token); |
| 5522 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 5523 | reply.readException(); |
| 5524 | data.recycle(); |
| 5525 | reply.recycle(); |
| 5526 | } |
| 5527 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 5528 | public void restart() throws RemoteException { |
| 5529 | Parcel data = Parcel.obtain(); |
| 5530 | Parcel reply = Parcel.obtain(); |
| 5531 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5532 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 5533 | reply.readException(); |
| 5534 | data.recycle(); |
| 5535 | reply.recycle(); |
| 5536 | } |
| 5537 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 5538 | public void performIdleMaintenance() throws RemoteException { |
| 5539 | Parcel data = Parcel.obtain(); |
| 5540 | Parcel reply = Parcel.obtain(); |
| 5541 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5542 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 5543 | reply.readException(); |
| 5544 | data.recycle(); |
| 5545 | reply.recycle(); |
| 5546 | } |
| 5547 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 5548 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5549 | IActivityContainerCallback callback) throws RemoteException { |
| 5550 | Parcel data = Parcel.obtain(); |
| 5551 | Parcel reply = Parcel.obtain(); |
| 5552 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5553 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 5554 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 5555 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5556 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 5557 | final int result = reply.readInt(); |
| 5558 | final IActivityContainer res; |
| 5559 | if (result == 1) { |
| 5560 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5561 | } else { |
| 5562 | res = null; |
| 5563 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5564 | data.recycle(); |
| 5565 | reply.recycle(); |
| 5566 | return res; |
| 5567 | } |
| 5568 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 5569 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 5570 | throws RemoteException { |
| 5571 | Parcel data = Parcel.obtain(); |
| 5572 | Parcel reply = Parcel.obtain(); |
| 5573 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5574 | data.writeStrongBinder(activityContainer.asBinder()); |
| 5575 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 5576 | reply.readException(); |
| 5577 | data.recycle(); |
| 5578 | reply.recycle(); |
| 5579 | } |
| 5580 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5581 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 5582 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 5583 | Parcel data = Parcel.obtain(); |
| 5584 | Parcel reply = Parcel.obtain(); |
| 5585 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5586 | data.writeInt(displayId); |
| 5587 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 5588 | reply.readException(); |
| 5589 | final int result = reply.readInt(); |
| 5590 | final IActivityContainer res; |
| 5591 | if (result == 1) { |
| 5592 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5593 | } else { |
| 5594 | res = null; |
| 5595 | } |
| 5596 | data.recycle(); |
| 5597 | reply.recycle(); |
| 5598 | return res; |
| 5599 | } |
| 5600 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5601 | @Override |
| 5602 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5603 | throws RemoteException { |
| 5604 | Parcel data = Parcel.obtain(); |
| 5605 | Parcel reply = Parcel.obtain(); |
| 5606 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5607 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5608 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5609 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5610 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5611 | data.recycle(); |
| 5612 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5613 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5614 | } |
| 5615 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5616 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5617 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 5618 | Parcel data = Parcel.obtain(); |
| 5619 | Parcel reply = Parcel.obtain(); |
| 5620 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5621 | data.writeInt(taskId); |
| 5622 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 5623 | reply.readException(); |
| 5624 | data.recycle(); |
| 5625 | reply.recycle(); |
| 5626 | } |
| 5627 | |
| 5628 | @Override |
| 5629 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 5630 | Parcel data = Parcel.obtain(); |
| 5631 | Parcel reply = Parcel.obtain(); |
| 5632 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5633 | data.writeStrongBinder(token); |
| 5634 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 5635 | reply.readException(); |
| 5636 | data.recycle(); |
| 5637 | reply.recycle(); |
| 5638 | } |
| 5639 | |
| 5640 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5641 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 5642 | Parcel data = Parcel.obtain(); |
| 5643 | Parcel reply = Parcel.obtain(); |
| 5644 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5645 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5646 | reply.readException(); |
| 5647 | data.recycle(); |
| 5648 | reply.recycle(); |
| 5649 | } |
| 5650 | |
| 5651 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5652 | public void stopLockTaskMode() throws RemoteException { |
| 5653 | Parcel data = Parcel.obtain(); |
| 5654 | Parcel reply = Parcel.obtain(); |
| 5655 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5656 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 5657 | reply.readException(); |
| 5658 | data.recycle(); |
| 5659 | reply.recycle(); |
| 5660 | } |
| 5661 | |
| 5662 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5663 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 5664 | Parcel data = Parcel.obtain(); |
| 5665 | Parcel reply = Parcel.obtain(); |
| 5666 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5667 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5668 | reply.readException(); |
| 5669 | data.recycle(); |
| 5670 | reply.recycle(); |
| 5671 | } |
| 5672 | |
| 5673 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5674 | public boolean isInLockTaskMode() throws RemoteException { |
| 5675 | Parcel data = Parcel.obtain(); |
| 5676 | Parcel reply = Parcel.obtain(); |
| 5677 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5678 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 5679 | reply.readException(); |
| 5680 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 5681 | data.recycle(); |
| 5682 | reply.recycle(); |
| 5683 | return isInLockTaskMode; |
| 5684 | } |
| 5685 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 5686 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 5687 | public int getLockTaskModeState() throws RemoteException { |
| 5688 | Parcel data = Parcel.obtain(); |
| 5689 | Parcel reply = Parcel.obtain(); |
| 5690 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5691 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 5692 | reply.readException(); |
| 5693 | int lockTaskModeState = reply.readInt(); |
| 5694 | data.recycle(); |
| 5695 | reply.recycle(); |
| 5696 | return lockTaskModeState; |
| 5697 | } |
| 5698 | |
| 5699 | @Override |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 5700 | public void showLockTaskEscapeMessage(IBinder token) throws RemoteException { |
| 5701 | Parcel data = Parcel.obtain(); |
| 5702 | Parcel reply = Parcel.obtain(); |
| 5703 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5704 | data.writeStrongBinder(token); |
| 5705 | mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply, |
| 5706 | IBinder.FLAG_ONEWAY); |
| 5707 | reply.readException(); |
| 5708 | data.recycle(); |
| 5709 | reply.recycle(); |
| 5710 | } |
| 5711 | |
| 5712 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 5713 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 5714 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 5715 | Parcel data = Parcel.obtain(); |
| 5716 | Parcel reply = Parcel.obtain(); |
| 5717 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5718 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 5719 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5720 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 5721 | reply.readException(); |
| 5722 | data.recycle(); |
| 5723 | reply.recycle(); |
| 5724 | } |
| 5725 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5726 | @Override |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 5727 | public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException { |
| 5728 | Parcel data = Parcel.obtain(); |
| 5729 | Parcel reply = Parcel.obtain(); |
| 5730 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5731 | data.writeInt(taskId); |
| 5732 | data.writeInt(resizeable ? 1 : 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5733 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 5734 | reply.readException(); |
| 5735 | data.recycle(); |
| 5736 | reply.recycle(); |
| 5737 | } |
| 5738 | |
| 5739 | @Override |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 5740 | public void resizeTask(int taskId, Rect r) throws RemoteException |
| 5741 | { |
| 5742 | Parcel data = Parcel.obtain(); |
| 5743 | Parcel reply = Parcel.obtain(); |
| 5744 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5745 | data.writeInt(taskId); |
| 5746 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5747 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 5748 | reply.readException(); |
| 5749 | data.recycle(); |
| 5750 | reply.recycle(); |
| 5751 | } |
| 5752 | |
| 5753 | @Override |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 5754 | public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException { |
| 5755 | Parcel data = Parcel.obtain(); |
| 5756 | Parcel reply = Parcel.obtain(); |
| 5757 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5758 | data.writeString(filename); |
| 5759 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 5760 | reply.readException(); |
| 5761 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 5762 | data.recycle(); |
| 5763 | reply.recycle(); |
| 5764 | return icon; |
| 5765 | } |
| 5766 | |
| 5767 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 5768 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 5769 | throws RemoteException { |
| 5770 | Parcel data = Parcel.obtain(); |
| 5771 | Parcel reply = Parcel.obtain(); |
| 5772 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5773 | if (options == null) { |
| 5774 | data.writeInt(0); |
| 5775 | } else { |
| 5776 | data.writeInt(1); |
| 5777 | data.writeBundle(options.toBundle()); |
| 5778 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5779 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 5780 | reply.readException(); |
| 5781 | data.recycle(); |
| 5782 | reply.recycle(); |
| 5783 | } |
| 5784 | |
| 5785 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5786 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5787 | Parcel data = Parcel.obtain(); |
| 5788 | Parcel reply = Parcel.obtain(); |
| 5789 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5790 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5791 | data.writeInt(visible ? 1 : 0); |
| 5792 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5793 | reply.readException(); |
| 5794 | boolean success = reply.readInt() > 0; |
| 5795 | data.recycle(); |
| 5796 | reply.recycle(); |
| 5797 | return success; |
| 5798 | } |
| 5799 | |
| 5800 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5801 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5802 | Parcel data = Parcel.obtain(); |
| 5803 | Parcel reply = Parcel.obtain(); |
| 5804 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5805 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5806 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5807 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5808 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5809 | data.recycle(); |
| 5810 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5811 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5812 | } |
| 5813 | |
| 5814 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5815 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5816 | Parcel data = Parcel.obtain(); |
| 5817 | Parcel reply = Parcel.obtain(); |
| 5818 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5819 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5820 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 5821 | reply.readException(); |
| 5822 | data.recycle(); |
| 5823 | reply.recycle(); |
| 5824 | } |
| 5825 | |
| 5826 | @Override |
| 5827 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 5828 | Parcel data = Parcel.obtain(); |
| 5829 | Parcel reply = Parcel.obtain(); |
| 5830 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5831 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5832 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5833 | reply.readException(); |
| 5834 | data.recycle(); |
| 5835 | reply.recycle(); |
| 5836 | } |
| 5837 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 5838 | @Override |
| 5839 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 5840 | Parcel data = Parcel.obtain(); |
| 5841 | Parcel reply = Parcel.obtain(); |
| 5842 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5843 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5844 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 5845 | reply.readException(); |
| 5846 | data.recycle(); |
| 5847 | reply.recycle(); |
| 5848 | } |
| 5849 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 5850 | @Override |
| 5851 | public void bootAnimationComplete() throws RemoteException { |
| 5852 | Parcel data = Parcel.obtain(); |
| 5853 | Parcel reply = Parcel.obtain(); |
| 5854 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5855 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 5856 | reply.readException(); |
| 5857 | data.recycle(); |
| 5858 | reply.recycle(); |
| 5859 | } |
| 5860 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 5861 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 5862 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 5863 | Parcel data = Parcel.obtain(); |
| 5864 | Parcel reply = Parcel.obtain(); |
| 5865 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5866 | data.writeInt(uid); |
| 5867 | data.writeByteArray(firstPacket); |
| 5868 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 5869 | reply.readException(); |
| 5870 | data.recycle(); |
| 5871 | reply.recycle(); |
| 5872 | } |
| 5873 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 5874 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 5875 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 5876 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 5877 | Parcel data = Parcel.obtain(); |
| 5878 | Parcel reply = Parcel.obtain(); |
| 5879 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5880 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 5881 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 5882 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 5883 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 5884 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 5885 | reply.readException(); |
| 5886 | data.recycle(); |
| 5887 | reply.recycle(); |
| 5888 | } |
| 5889 | |
| 5890 | @Override |
| 5891 | public void dumpHeapFinished(String path) throws RemoteException { |
| 5892 | Parcel data = Parcel.obtain(); |
| 5893 | Parcel reply = Parcel.obtain(); |
| 5894 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5895 | data.writeString(path); |
| 5896 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 5897 | reply.readException(); |
| 5898 | data.recycle(); |
| 5899 | reply.recycle(); |
| 5900 | } |
| 5901 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 5902 | @Override |
| 5903 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 5904 | throws RemoteException { |
| 5905 | Parcel data = Parcel.obtain(); |
| 5906 | Parcel reply = Parcel.obtain(); |
| 5907 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5908 | data.writeStrongBinder(session.asBinder()); |
| 5909 | data.writeInt(keepAwake ? 1 : 0); |
| 5910 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 5911 | reply.readException(); |
| 5912 | data.recycle(); |
| 5913 | reply.recycle(); |
| 5914 | } |
| 5915 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 5916 | @Override |
| 5917 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 5918 | Parcel data = Parcel.obtain(); |
| 5919 | Parcel reply = Parcel.obtain(); |
| 5920 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5921 | data.writeInt(userId); |
| 5922 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5923 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 5924 | reply.readException(); |
| 5925 | data.recycle(); |
| 5926 | reply.recycle(); |
| 5927 | } |
| 5928 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5929 | @Override |
Craig Mautner | 015c5e5 | 2015-04-23 10:39:39 -0700 | [diff] [blame] | 5930 | public void updateDeviceOwner(String packageName) throws RemoteException { |
| 5931 | Parcel data = Parcel.obtain(); |
| 5932 | Parcel reply = Parcel.obtain(); |
| 5933 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5934 | data.writeString(packageName); |
| 5935 | mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0); |
| 5936 | reply.readException(); |
| 5937 | data.recycle(); |
| 5938 | reply.recycle(); |
| 5939 | } |
| 5940 | |
| 5941 | @Override |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 5942 | public int getPackageProcessState(String packageName, String callingPackage) |
| 5943 | throws RemoteException { |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5944 | Parcel data = Parcel.obtain(); |
| 5945 | Parcel reply = Parcel.obtain(); |
| 5946 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5947 | data.writeString(packageName); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 5948 | data.writeString(callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5949 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 5950 | reply.readException(); |
| 5951 | int res = reply.readInt(); |
| 5952 | data.recycle(); |
| 5953 | reply.recycle(); |
| 5954 | return res; |
| 5955 | } |
| 5956 | |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5957 | @Override |
| 5958 | public boolean setProcessMemoryTrimLevel(String process, int userId, int level) |
| 5959 | throws RemoteException { |
| 5960 | Parcel data = Parcel.obtain(); |
| 5961 | Parcel reply = Parcel.obtain(); |
| 5962 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5963 | data.writeString(process); |
| 5964 | data.writeInt(userId); |
| 5965 | data.writeInt(level); |
| 5966 | mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0); |
| 5967 | reply.readException(); |
| 5968 | int res = reply.readInt(); |
| 5969 | data.recycle(); |
| 5970 | reply.recycle(); |
| 5971 | return res != 0; |
| 5972 | } |
| 5973 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame^] | 5974 | @Override |
| 5975 | public boolean isRootVoiceInteraction(IBinder token) throws RemoteException { |
| 5976 | Parcel data = Parcel.obtain(); |
| 5977 | Parcel reply = Parcel.obtain(); |
| 5978 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5979 | data.writeStrongBinder(token); |
| 5980 | mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 5981 | reply.readException(); |
| 5982 | int res = reply.readInt(); |
| 5983 | data.recycle(); |
| 5984 | reply.recycle(); |
| 5985 | return res != 0; |
| 5986 | } |
| 5987 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5988 | private IBinder mRemote; |
| 5989 | } |