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 | |
Tony Mak | 9c6e8ce | 2016-03-21 12:07:16 +0000 | [diff] [blame] | 19 | import android.annotation.UserIdInt; |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 20 | import android.app.ActivityManager.StackInfo; |
Dianne Hackborn | 69c6adc | 2015-06-02 10:52:59 -0700 | [diff] [blame] | 21 | import android.app.assist.AssistContent; |
| 22 | import android.app.assist.AssistStructure; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 23 | import android.content.ComponentName; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 24 | import android.content.IIntentReceiver; |
| 25 | import android.content.IIntentSender; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | import android.content.Intent; |
| 27 | import android.content.IntentFilter; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 28 | import android.content.IntentSender; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 29 | import android.content.UriPermission; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 30 | import android.content.pm.ApplicationInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | import android.content.pm.ConfigurationInfo; |
| 32 | import android.content.pm.IPackageDataObserver; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 33 | import android.content.pm.ParceledListSlice; |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 34 | import android.content.pm.UserInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 35 | import android.content.res.Configuration; |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 36 | import android.graphics.Bitmap; |
| 37 | import android.graphics.Point; |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 38 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | import android.net.Uri; |
| 40 | import android.os.Binder; |
| 41 | import android.os.Bundle; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 42 | import android.os.Debug; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | import android.os.IBinder; |
Jeff Sharkey | bd91e2f | 2016-03-22 15:32:31 -0600 | [diff] [blame] | 44 | import android.os.IProgressListener; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | import android.os.Parcel; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 46 | import android.os.ParcelFileDescriptor; |
| 47 | import android.os.Parcelable; |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 48 | import android.os.PersistableBundle; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 49 | import android.os.RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | import android.os.ServiceManager; |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 51 | import android.os.StrictMode; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 52 | import android.service.voice.IVoiceInteractionSession; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | import android.text.TextUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 54 | import android.util.Log; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 55 | import android.util.Singleton; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 56 | import com.android.internal.app.IVoiceInteractor; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 57 | import com.android.internal.os.IResultReceiver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 59 | import java.util.ArrayList; |
| 60 | import java.util.List; |
| 61 | |
| 62 | /** {@hide} */ |
| 63 | public abstract class ActivityManagerNative extends Binder implements IActivityManager |
| 64 | { |
| 65 | /** |
| 66 | * Cast a Binder object into an activity manager interface, generating |
| 67 | * a proxy if needed. |
| 68 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 69 | static public IActivityManager asInterface(IBinder obj) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 70 | if (obj == null) { |
| 71 | return null; |
| 72 | } |
| 73 | IActivityManager in = |
| 74 | (IActivityManager)obj.queryLocalInterface(descriptor); |
| 75 | if (in != null) { |
| 76 | return in; |
| 77 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 78 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 79 | return new ActivityManagerProxy(obj); |
| 80 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 81 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 82 | /** |
| 83 | * Retrieve the system's default/global activity manager. |
| 84 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 85 | static public IActivityManager getDefault() { |
| 86 | return gDefault.get(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Convenience for checking whether the system is ready. For internal use only. |
| 91 | */ |
| 92 | static public boolean isSystemReady() { |
| 93 | if (!sSystemReady) { |
| 94 | sSystemReady = getDefault().testIsSystemReady(); |
| 95 | } |
| 96 | return sSystemReady; |
| 97 | } |
Jeff Sharkey | b5e89c6 | 2016-04-01 23:20:31 -0600 | [diff] [blame] | 98 | static volatile boolean sSystemReady = false; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 99 | |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 100 | static public void broadcastStickyIntent(Intent intent, String permission, int userId) { |
| 101 | broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId); |
| 102 | } |
| 103 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 104 | /** |
| 105 | * Convenience for sending a sticky broadcast. For internal use only. |
| 106 | * If you don't care about permission, use null. |
| 107 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 108 | static public void broadcastStickyIntent(Intent intent, String permission, int appOp, |
| 109 | int userId) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 110 | try { |
| 111 | getDefault().broadcastIntent( |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 112 | null, intent, null, null, Activity.RESULT_OK, null, null, |
| 113 | null /*permission*/, appOp, null, false, true, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 114 | } catch (RemoteException ex) { |
| 115 | } |
| 116 | } |
| 117 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 118 | static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg, |
| 119 | String tag) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 120 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 121 | getDefault().noteWakeupAlarm((ps != null) ? ps.getTarget() : null, |
| 122 | sourceUid, sourcePkg, tag); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 123 | } catch (RemoteException ex) { |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) { |
| 128 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 129 | getDefault().noteAlarmStart((ps != null) ? ps.getTarget() : null, sourceUid, tag); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 130 | } catch (RemoteException ex) { |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) { |
| 135 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 136 | getDefault().noteAlarmFinish((ps != null) ? ps.getTarget() : null, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 137 | } catch (RemoteException ex) { |
| 138 | } |
| 139 | } |
| 140 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 141 | public ActivityManagerNative() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 142 | attachInterface(this, descriptor); |
| 143 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 144 | |
| 145 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 146 | public boolean onTransact(int code, Parcel data, Parcel reply, int flags) |
| 147 | throws RemoteException { |
| 148 | switch (code) { |
| 149 | case START_ACTIVITY_TRANSACTION: |
| 150 | { |
| 151 | data.enforceInterface(IActivityManager.descriptor); |
| 152 | IBinder b = data.readStrongBinder(); |
| 153 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 154 | String callingPackage = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 155 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 156 | String resolvedType = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 157 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 158 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 159 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 160 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 161 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 162 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 163 | Bundle options = data.readInt() != 0 |
| 164 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 165 | int result = startActivity(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 166 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 167 | reply.writeNoException(); |
| 168 | reply.writeInt(result); |
| 169 | return true; |
| 170 | } |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 171 | |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 172 | case START_ACTIVITY_AS_USER_TRANSACTION: |
| 173 | { |
| 174 | data.enforceInterface(IActivityManager.descriptor); |
| 175 | IBinder b = data.readStrongBinder(); |
| 176 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 177 | String callingPackage = data.readString(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 178 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 179 | String resolvedType = data.readString(); |
| 180 | IBinder resultTo = data.readStrongBinder(); |
| 181 | String resultWho = data.readString(); |
| 182 | int requestCode = data.readInt(); |
| 183 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 184 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 185 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 186 | Bundle options = data.readInt() != 0 |
| 187 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 188 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 189 | int result = startActivityAsUser(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 190 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 191 | reply.writeNoException(); |
| 192 | reply.writeInt(result); |
| 193 | return true; |
| 194 | } |
| 195 | |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 196 | case START_ACTIVITY_AS_CALLER_TRANSACTION: |
| 197 | { |
| 198 | data.enforceInterface(IActivityManager.descriptor); |
| 199 | IBinder b = data.readStrongBinder(); |
| 200 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 201 | String callingPackage = data.readString(); |
| 202 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 203 | String resolvedType = data.readString(); |
| 204 | IBinder resultTo = data.readStrongBinder(); |
| 205 | String resultWho = data.readString(); |
| 206 | int requestCode = data.readInt(); |
| 207 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 208 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 209 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 210 | Bundle options = data.readInt() != 0 |
| 211 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 212 | boolean ignoreTargetSecurity = data.readInt() != 0; |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 213 | int userId = data.readInt(); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 214 | int result = startActivityAsCaller(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 215 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, |
| 216 | ignoreTargetSecurity, userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 217 | reply.writeNoException(); |
| 218 | reply.writeInt(result); |
| 219 | return true; |
| 220 | } |
| 221 | |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 222 | case START_ACTIVITY_AND_WAIT_TRANSACTION: |
| 223 | { |
| 224 | data.enforceInterface(IActivityManager.descriptor); |
| 225 | IBinder b = data.readStrongBinder(); |
| 226 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 227 | String callingPackage = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 228 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 229 | String resolvedType = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 230 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 231 | String resultWho = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 232 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 233 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 234 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 235 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 236 | Bundle options = data.readInt() != 0 |
| 237 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 238 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 239 | WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 240 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 241 | reply.writeNoException(); |
| 242 | result.writeToParcel(reply, 0); |
| 243 | return true; |
| 244 | } |
| 245 | |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 246 | case START_ACTIVITY_WITH_CONFIG_TRANSACTION: |
| 247 | { |
| 248 | data.enforceInterface(IActivityManager.descriptor); |
| 249 | IBinder b = data.readStrongBinder(); |
| 250 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 251 | String callingPackage = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 252 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 253 | String resolvedType = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 254 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 255 | String resultWho = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 256 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 257 | int startFlags = data.readInt(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 258 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 259 | Bundle options = data.readInt() != 0 |
| 260 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 261 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 262 | int result = startActivityWithConfig(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 263 | resultTo, resultWho, requestCode, startFlags, config, options, userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 264 | reply.writeNoException(); |
| 265 | reply.writeInt(result); |
| 266 | return true; |
| 267 | } |
| 268 | |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 269 | case START_ACTIVITY_INTENT_SENDER_TRANSACTION: |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 270 | { |
| 271 | data.enforceInterface(IActivityManager.descriptor); |
| 272 | IBinder b = data.readStrongBinder(); |
| 273 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 274 | IntentSender intent = IntentSender.CREATOR.createFromParcel(data); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 275 | Intent fillInIntent = null; |
| 276 | if (data.readInt() != 0) { |
| 277 | fillInIntent = Intent.CREATOR.createFromParcel(data); |
| 278 | } |
| 279 | String resolvedType = data.readString(); |
| 280 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 281 | String resultWho = data.readString(); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 282 | int requestCode = data.readInt(); |
| 283 | int flagsMask = data.readInt(); |
| 284 | int flagsValues = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 285 | Bundle options = data.readInt() != 0 |
| 286 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 287 | int result = startActivityIntentSender(app, intent, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 288 | fillInIntent, resolvedType, resultTo, resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 289 | requestCode, flagsMask, flagsValues, options); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 290 | reply.writeNoException(); |
| 291 | reply.writeInt(result); |
| 292 | return true; |
| 293 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 294 | |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 295 | case START_VOICE_ACTIVITY_TRANSACTION: |
| 296 | { |
| 297 | data.enforceInterface(IActivityManager.descriptor); |
| 298 | String callingPackage = data.readString(); |
| 299 | int callingPid = data.readInt(); |
| 300 | int callingUid = data.readInt(); |
| 301 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 302 | String resolvedType = data.readString(); |
| 303 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 304 | data.readStrongBinder()); |
| 305 | IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface( |
| 306 | data.readStrongBinder()); |
| 307 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 308 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 309 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 310 | Bundle options = data.readInt() != 0 |
| 311 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 312 | int userId = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 313 | int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent, |
| 314 | resolvedType, session, interactor, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 315 | reply.writeNoException(); |
| 316 | reply.writeInt(result); |
| 317 | return true; |
| 318 | } |
| 319 | |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 320 | case START_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 321 | { |
| 322 | data.enforceInterface(IActivityManager.descriptor); |
| 323 | IBinder token = data.readStrongBinder(); |
| 324 | Bundle options = data.readBundle(); |
| 325 | startLocalVoiceInteraction(token, options); |
| 326 | reply.writeNoException(); |
| 327 | return true; |
| 328 | } |
| 329 | |
| 330 | case STOP_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 331 | { |
| 332 | data.enforceInterface(IActivityManager.descriptor); |
| 333 | IBinder token = data.readStrongBinder(); |
| 334 | stopLocalVoiceInteraction(token); |
| 335 | reply.writeNoException(); |
| 336 | return true; |
| 337 | } |
| 338 | |
| 339 | case SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 340 | { |
| 341 | data.enforceInterface(IActivityManager.descriptor); |
| 342 | boolean result = supportsLocalVoiceInteraction(); |
| 343 | reply.writeNoException(); |
| 344 | reply.writeInt(result? 1 : 0); |
| 345 | return true; |
| 346 | } |
| 347 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 348 | case START_NEXT_MATCHING_ACTIVITY_TRANSACTION: |
| 349 | { |
| 350 | data.enforceInterface(IActivityManager.descriptor); |
| 351 | IBinder callingActivity = data.readStrongBinder(); |
| 352 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 353 | Bundle options = data.readInt() != 0 |
| 354 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 355 | boolean result = startNextMatchingActivity(callingActivity, intent, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 356 | reply.writeNoException(); |
| 357 | reply.writeInt(result ? 1 : 0); |
| 358 | return true; |
| 359 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 360 | |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 361 | case START_ACTIVITY_FROM_RECENTS_TRANSACTION: |
| 362 | { |
| 363 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 364 | final int taskId = data.readInt(); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 365 | final Bundle options = |
| 366 | data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data); |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 367 | final int result = startActivityFromRecents(taskId, options); |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 368 | reply.writeNoException(); |
| 369 | reply.writeInt(result); |
| 370 | return true; |
| 371 | } |
| 372 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 373 | case FINISH_ACTIVITY_TRANSACTION: { |
| 374 | data.enforceInterface(IActivityManager.descriptor); |
| 375 | IBinder token = data.readStrongBinder(); |
| 376 | Intent resultData = null; |
| 377 | int resultCode = data.readInt(); |
| 378 | if (data.readInt() != 0) { |
| 379 | resultData = Intent.CREATOR.createFromParcel(data); |
| 380 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 381 | int finishTask = data.readInt(); |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 382 | boolean res = finishActivity(token, resultCode, resultData, finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 383 | reply.writeNoException(); |
| 384 | reply.writeInt(res ? 1 : 0); |
| 385 | return true; |
| 386 | } |
| 387 | |
| 388 | case FINISH_SUB_ACTIVITY_TRANSACTION: { |
| 389 | data.enforceInterface(IActivityManager.descriptor); |
| 390 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 391 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 392 | int requestCode = data.readInt(); |
| 393 | finishSubActivity(token, resultWho, requestCode); |
| 394 | reply.writeNoException(); |
| 395 | return true; |
| 396 | } |
| 397 | |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 398 | case FINISH_ACTIVITY_AFFINITY_TRANSACTION: { |
| 399 | data.enforceInterface(IActivityManager.descriptor); |
| 400 | IBinder token = data.readStrongBinder(); |
| 401 | boolean res = finishActivityAffinity(token); |
| 402 | reply.writeNoException(); |
| 403 | reply.writeInt(res ? 1 : 0); |
| 404 | return true; |
| 405 | } |
| 406 | |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 407 | case FINISH_VOICE_TASK_TRANSACTION: { |
| 408 | data.enforceInterface(IActivityManager.descriptor); |
| 409 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 410 | data.readStrongBinder()); |
| 411 | finishVoiceTask(session); |
| 412 | reply.writeNoException(); |
| 413 | return true; |
| 414 | } |
| 415 | |
Chong Zhang | fec694e | 2016-08-09 12:57:38 -0700 | [diff] [blame] | 416 | case REQUEST_ACTIVITY_RELAUNCH: { |
| 417 | data.enforceInterface(IActivityManager.descriptor); |
| 418 | IBinder token = data.readStrongBinder(); |
| 419 | requestActivityRelaunch(token); |
| 420 | reply.writeNoException(); |
| 421 | return true; |
| 422 | } |
| 423 | |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 424 | case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: { |
| 425 | data.enforceInterface(IActivityManager.descriptor); |
| 426 | IBinder token = data.readStrongBinder(); |
| 427 | boolean res = releaseActivityInstance(token); |
| 428 | reply.writeNoException(); |
| 429 | reply.writeInt(res ? 1 : 0); |
| 430 | return true; |
| 431 | } |
| 432 | |
| 433 | case RELEASE_SOME_ACTIVITIES_TRANSACTION: { |
| 434 | data.enforceInterface(IActivityManager.descriptor); |
| 435 | IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder()); |
| 436 | releaseSomeActivities(app); |
| 437 | reply.writeNoException(); |
| 438 | return true; |
| 439 | } |
| 440 | |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 441 | case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: { |
| 442 | data.enforceInterface(IActivityManager.descriptor); |
| 443 | IBinder token = data.readStrongBinder(); |
| 444 | boolean res = willActivityBeVisible(token); |
| 445 | reply.writeNoException(); |
| 446 | reply.writeInt(res ? 1 : 0); |
| 447 | return true; |
| 448 | } |
| 449 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 450 | case REGISTER_RECEIVER_TRANSACTION: |
| 451 | { |
| 452 | data.enforceInterface(IActivityManager.descriptor); |
| 453 | IBinder b = data.readStrongBinder(); |
| 454 | IApplicationThread app = |
| 455 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 456 | String packageName = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 457 | b = data.readStrongBinder(); |
| 458 | IIntentReceiver rec |
| 459 | = b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 460 | IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data); |
| 461 | String perm = data.readString(); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 462 | int userId = data.readInt(); |
| 463 | Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 464 | reply.writeNoException(); |
| 465 | if (intent != null) { |
| 466 | reply.writeInt(1); |
| 467 | intent.writeToParcel(reply, 0); |
| 468 | } else { |
| 469 | reply.writeInt(0); |
| 470 | } |
| 471 | return true; |
| 472 | } |
| 473 | |
| 474 | case UNREGISTER_RECEIVER_TRANSACTION: |
| 475 | { |
| 476 | data.enforceInterface(IActivityManager.descriptor); |
| 477 | IBinder b = data.readStrongBinder(); |
| 478 | if (b == null) { |
| 479 | return true; |
| 480 | } |
| 481 | IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b); |
| 482 | unregisterReceiver(rec); |
| 483 | reply.writeNoException(); |
| 484 | return true; |
| 485 | } |
| 486 | |
| 487 | case BROADCAST_INTENT_TRANSACTION: |
| 488 | { |
| 489 | data.enforceInterface(IActivityManager.descriptor); |
| 490 | IBinder b = data.readStrongBinder(); |
| 491 | IApplicationThread app = |
| 492 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 493 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 494 | String resolvedType = data.readString(); |
| 495 | b = data.readStrongBinder(); |
| 496 | IIntentReceiver resultTo = |
| 497 | b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 498 | int resultCode = data.readInt(); |
| 499 | String resultData = data.readString(); |
| 500 | Bundle resultExtras = data.readBundle(); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 501 | String[] perms = data.readStringArray(); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 502 | int appOp = data.readInt(); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 503 | Bundle options = data.readBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 504 | boolean serialized = data.readInt() != 0; |
| 505 | boolean sticky = data.readInt() != 0; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 506 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 507 | int res = broadcastIntent(app, intent, resolvedType, resultTo, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 508 | resultCode, resultData, resultExtras, perms, appOp, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 509 | options, serialized, sticky, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 510 | reply.writeNoException(); |
| 511 | reply.writeInt(res); |
| 512 | return true; |
| 513 | } |
| 514 | |
| 515 | case UNBROADCAST_INTENT_TRANSACTION: |
| 516 | { |
| 517 | data.enforceInterface(IActivityManager.descriptor); |
| 518 | IBinder b = data.readStrongBinder(); |
| 519 | IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 520 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 521 | int userId = data.readInt(); |
| 522 | unbroadcastIntent(app, intent, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 523 | reply.writeNoException(); |
| 524 | return true; |
| 525 | } |
| 526 | |
| 527 | case FINISH_RECEIVER_TRANSACTION: { |
| 528 | data.enforceInterface(IActivityManager.descriptor); |
| 529 | IBinder who = data.readStrongBinder(); |
| 530 | int resultCode = data.readInt(); |
| 531 | String resultData = data.readString(); |
| 532 | Bundle resultExtras = data.readBundle(); |
| 533 | boolean resultAbort = data.readInt() != 0; |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 534 | int intentFlags = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 535 | if (who != null) { |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 536 | finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 537 | } |
| 538 | reply.writeNoException(); |
| 539 | return true; |
| 540 | } |
| 541 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 542 | case ATTACH_APPLICATION_TRANSACTION: { |
| 543 | data.enforceInterface(IActivityManager.descriptor); |
| 544 | IApplicationThread app = ApplicationThreadNative.asInterface( |
| 545 | data.readStrongBinder()); |
| 546 | if (app != null) { |
| 547 | attachApplication(app); |
| 548 | } |
| 549 | reply.writeNoException(); |
| 550 | return true; |
| 551 | } |
| 552 | |
| 553 | case ACTIVITY_IDLE_TRANSACTION: { |
| 554 | data.enforceInterface(IActivityManager.descriptor); |
| 555 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 556 | Configuration config = null; |
| 557 | if (data.readInt() != 0) { |
| 558 | config = Configuration.CREATOR.createFromParcel(data); |
| 559 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 560 | boolean stopProfiling = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 561 | if (token != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 562 | activityIdle(token, config, stopProfiling); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 563 | } |
| 564 | reply.writeNoException(); |
| 565 | return true; |
| 566 | } |
| 567 | |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 568 | case ACTIVITY_RESUMED_TRANSACTION: { |
| 569 | data.enforceInterface(IActivityManager.descriptor); |
| 570 | IBinder token = data.readStrongBinder(); |
| 571 | activityResumed(token); |
| 572 | reply.writeNoException(); |
| 573 | return true; |
| 574 | } |
| 575 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 576 | case ACTIVITY_PAUSED_TRANSACTION: { |
| 577 | data.enforceInterface(IActivityManager.descriptor); |
| 578 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 579 | activityPaused(token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 580 | reply.writeNoException(); |
| 581 | return true; |
| 582 | } |
| 583 | |
| 584 | case ACTIVITY_STOPPED_TRANSACTION: { |
| 585 | data.enforceInterface(IActivityManager.descriptor); |
| 586 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 587 | Bundle map = data.readBundle(); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 588 | PersistableBundle persistentState = data.readPersistableBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 589 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 590 | activityStopped(token, map, persistentState, description); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 591 | reply.writeNoException(); |
| 592 | return true; |
| 593 | } |
| 594 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 595 | case ACTIVITY_SLEPT_TRANSACTION: { |
| 596 | data.enforceInterface(IActivityManager.descriptor); |
| 597 | IBinder token = data.readStrongBinder(); |
| 598 | activitySlept(token); |
| 599 | reply.writeNoException(); |
| 600 | return true; |
| 601 | } |
| 602 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 603 | case ACTIVITY_DESTROYED_TRANSACTION: { |
| 604 | data.enforceInterface(IActivityManager.descriptor); |
| 605 | IBinder token = data.readStrongBinder(); |
| 606 | activityDestroyed(token); |
| 607 | reply.writeNoException(); |
| 608 | return true; |
| 609 | } |
| 610 | |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 611 | case ACTIVITY_RELAUNCHED_TRANSACTION: { |
| 612 | data.enforceInterface(IActivityManager.descriptor); |
| 613 | IBinder token = data.readStrongBinder(); |
| 614 | activityRelaunched(token); |
| 615 | reply.writeNoException(); |
| 616 | return true; |
| 617 | } |
| 618 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 619 | case GET_CALLING_PACKAGE_TRANSACTION: { |
| 620 | data.enforceInterface(IActivityManager.descriptor); |
| 621 | IBinder token = data.readStrongBinder(); |
| 622 | String res = token != null ? getCallingPackage(token) : null; |
| 623 | reply.writeNoException(); |
| 624 | reply.writeString(res); |
| 625 | return true; |
| 626 | } |
| 627 | |
| 628 | case GET_CALLING_ACTIVITY_TRANSACTION: { |
| 629 | data.enforceInterface(IActivityManager.descriptor); |
| 630 | IBinder token = data.readStrongBinder(); |
| 631 | ComponentName cn = getCallingActivity(token); |
| 632 | reply.writeNoException(); |
| 633 | ComponentName.writeToParcel(cn, reply); |
| 634 | return true; |
| 635 | } |
| 636 | |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 637 | case GET_APP_TASKS_TRANSACTION: { |
| 638 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 639 | String callingPackage = data.readString(); |
| 640 | List<IAppTask> list = getAppTasks(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 641 | reply.writeNoException(); |
| 642 | int N = list != null ? list.size() : -1; |
| 643 | reply.writeInt(N); |
| 644 | int i; |
| 645 | for (i=0; i<N; i++) { |
| 646 | IAppTask task = list.get(i); |
| 647 | reply.writeStrongBinder(task.asBinder()); |
| 648 | } |
| 649 | return true; |
| 650 | } |
| 651 | |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 652 | case ADD_APP_TASK_TRANSACTION: { |
| 653 | data.enforceInterface(IActivityManager.descriptor); |
| 654 | IBinder activityToken = data.readStrongBinder(); |
| 655 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 656 | ActivityManager.TaskDescription descr |
| 657 | = ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 658 | Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data); |
| 659 | int res = addAppTask(activityToken, intent, descr, thumbnail); |
| 660 | reply.writeNoException(); |
| 661 | reply.writeInt(res); |
| 662 | return true; |
| 663 | } |
| 664 | |
| 665 | case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: { |
| 666 | data.enforceInterface(IActivityManager.descriptor); |
| 667 | Point size = getAppTaskThumbnailSize(); |
| 668 | reply.writeNoException(); |
| 669 | size.writeToParcel(reply, 0); |
| 670 | return true; |
| 671 | } |
| 672 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 673 | case GET_TASKS_TRANSACTION: { |
| 674 | data.enforceInterface(IActivityManager.descriptor); |
| 675 | int maxNum = data.readInt(); |
| 676 | int fl = data.readInt(); |
Dianne Hackborn | 0923328 | 2014-04-30 11:33:59 -0700 | [diff] [blame] | 677 | List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 678 | reply.writeNoException(); |
| 679 | int N = list != null ? list.size() : -1; |
| 680 | reply.writeInt(N); |
| 681 | int i; |
| 682 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 683 | ActivityManager.RunningTaskInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 684 | info.writeToParcel(reply, 0); |
| 685 | } |
| 686 | return true; |
| 687 | } |
| 688 | |
| 689 | case GET_RECENT_TASKS_TRANSACTION: { |
| 690 | data.enforceInterface(IActivityManager.descriptor); |
| 691 | int maxNum = data.readInt(); |
| 692 | int fl = data.readInt(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 693 | int userId = data.readInt(); |
Jeff Sharkey | 479212c | 2016-06-29 16:00:55 -0600 | [diff] [blame] | 694 | ParceledListSlice<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 695 | fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 696 | reply.writeNoException(); |
Jeff Sharkey | 479212c | 2016-06-29 16:00:55 -0600 | [diff] [blame] | 697 | list.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 698 | return true; |
| 699 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 700 | |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 701 | case GET_TASK_THUMBNAIL_TRANSACTION: { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 702 | data.enforceInterface(IActivityManager.descriptor); |
| 703 | int id = data.readInt(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 704 | ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 705 | reply.writeNoException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 706 | if (taskThumbnail != null) { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 707 | reply.writeInt(1); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 708 | taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 709 | } else { |
| 710 | reply.writeInt(0); |
| 711 | } |
| 712 | return true; |
| 713 | } |
| 714 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 715 | case GET_SERVICES_TRANSACTION: { |
| 716 | data.enforceInterface(IActivityManager.descriptor); |
| 717 | int maxNum = data.readInt(); |
| 718 | int fl = data.readInt(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 719 | List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 720 | reply.writeNoException(); |
| 721 | int N = list != null ? list.size() : -1; |
| 722 | reply.writeInt(N); |
| 723 | int i; |
| 724 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 725 | ActivityManager.RunningServiceInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 726 | info.writeToParcel(reply, 0); |
| 727 | } |
| 728 | return true; |
| 729 | } |
| 730 | |
| 731 | case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: { |
| 732 | data.enforceInterface(IActivityManager.descriptor); |
| 733 | List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState(); |
| 734 | reply.writeNoException(); |
| 735 | reply.writeTypedList(list); |
| 736 | return true; |
| 737 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 738 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 739 | case GET_RUNNING_APP_PROCESSES_TRANSACTION: { |
| 740 | data.enforceInterface(IActivityManager.descriptor); |
| 741 | List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses(); |
| 742 | reply.writeNoException(); |
| 743 | reply.writeTypedList(list); |
| 744 | return true; |
| 745 | } |
| 746 | |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 747 | case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: { |
| 748 | data.enforceInterface(IActivityManager.descriptor); |
| 749 | List<ApplicationInfo> list = getRunningExternalApplications(); |
| 750 | reply.writeNoException(); |
| 751 | reply.writeTypedList(list); |
| 752 | return true; |
| 753 | } |
| 754 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 755 | case MOVE_TASK_TO_FRONT_TRANSACTION: { |
| 756 | data.enforceInterface(IActivityManager.descriptor); |
| 757 | int task = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 758 | int fl = data.readInt(); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 759 | Bundle options = data.readInt() != 0 |
| 760 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 761 | moveTaskToFront(task, fl, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 762 | reply.writeNoException(); |
| 763 | return true; |
| 764 | } |
| 765 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 766 | case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: { |
| 767 | data.enforceInterface(IActivityManager.descriptor); |
| 768 | IBinder token = data.readStrongBinder(); |
| 769 | boolean nonRoot = data.readInt() != 0; |
| 770 | boolean res = moveActivityTaskToBack(token, nonRoot); |
| 771 | reply.writeNoException(); |
| 772 | reply.writeInt(res ? 1 : 0); |
| 773 | return true; |
| 774 | } |
| 775 | |
| 776 | case MOVE_TASK_BACKWARDS_TRANSACTION: { |
| 777 | data.enforceInterface(IActivityManager.descriptor); |
| 778 | int task = data.readInt(); |
| 779 | moveTaskBackwards(task); |
| 780 | reply.writeNoException(); |
| 781 | return true; |
| 782 | } |
| 783 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 784 | case MOVE_TASK_TO_STACK_TRANSACTION: { |
| 785 | data.enforceInterface(IActivityManager.descriptor); |
| 786 | int taskId = data.readInt(); |
| 787 | int stackId = data.readInt(); |
| 788 | boolean toTop = data.readInt() != 0; |
| 789 | moveTaskToStack(taskId, stackId, toTop); |
| 790 | reply.writeNoException(); |
| 791 | return true; |
| 792 | } |
| 793 | |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 794 | case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: { |
| 795 | data.enforceInterface(IActivityManager.descriptor); |
| 796 | int taskId = data.readInt(); |
| 797 | int createMode = data.readInt(); |
| 798 | boolean toTop = data.readInt() != 0; |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 799 | boolean animate = data.readInt() != 0; |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 800 | Rect bounds = null; |
| 801 | boolean hasBounds = data.readInt() != 0; |
| 802 | if (hasBounds) { |
| 803 | bounds = Rect.CREATOR.createFromParcel(data); |
| 804 | } |
Wale Ogunwale | a4d92a0 | 2016-05-01 16:02:16 -0700 | [diff] [blame] | 805 | final boolean moveHomeStackFront = data.readInt() != 0; |
| 806 | final boolean res = moveTaskToDockedStack( |
| 807 | taskId, createMode, toTop, animate, bounds, moveHomeStackFront); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 808 | reply.writeNoException(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 809 | reply.writeInt(res ? 1 : 0); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 810 | return true; |
| 811 | } |
| 812 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 813 | case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: { |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 814 | data.enforceInterface(IActivityManager.descriptor); |
| 815 | final int stackId = data.readInt(); |
| 816 | final Rect r = Rect.CREATOR.createFromParcel(data); |
| 817 | final boolean res = moveTopActivityToPinnedStack(stackId, r); |
| 818 | reply.writeNoException(); |
| 819 | reply.writeInt(res ? 1 : 0); |
| 820 | return true; |
| 821 | } |
| 822 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 823 | case RESIZE_STACK_TRANSACTION: { |
| 824 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 825 | final int stackId = data.readInt(); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 826 | final boolean hasRect = data.readInt() != 0; |
| 827 | Rect r = null; |
| 828 | if (hasRect) { |
| 829 | r = Rect.CREATOR.createFromParcel(data); |
| 830 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 831 | final boolean allowResizeInDockedMode = data.readInt() == 1; |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 832 | final boolean preserveWindows = data.readInt() == 1; |
| 833 | final boolean animate = data.readInt() == 1; |
Wale Ogunwale | e75a9ad | 2016-03-18 20:43:49 -0700 | [diff] [blame] | 834 | final int animationDuration = data.readInt(); |
| 835 | resizeStack(stackId, |
| 836 | r, allowResizeInDockedMode, preserveWindows, animate, animationDuration); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 837 | reply.writeNoException(); |
| 838 | return true; |
| 839 | } |
Robert Carr | 0d00c2e | 2016-02-29 17:45:02 -0800 | [diff] [blame] | 840 | case RESIZE_PINNED_STACK_TRANSACTION: { |
| 841 | data.enforceInterface(IActivityManager.descriptor); |
| 842 | final boolean hasBounds = data.readInt() != 0; |
| 843 | Rect bounds = null; |
| 844 | if (hasBounds) { |
| 845 | bounds = Rect.CREATOR.createFromParcel(data); |
| 846 | } |
| 847 | final boolean hasTempPinnedTaskBounds = data.readInt() != 0; |
| 848 | Rect tempPinnedTaskBounds = null; |
| 849 | if (hasTempPinnedTaskBounds) { |
| 850 | tempPinnedTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 851 | } |
| 852 | resizePinnedStack(bounds, tempPinnedTaskBounds); |
| 853 | return true; |
| 854 | } |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 855 | case SWAP_DOCKED_AND_FULLSCREEN_STACK: { |
| 856 | data.enforceInterface(IActivityManager.descriptor); |
| 857 | swapDockedAndFullscreenStack(); |
| 858 | reply.writeNoException(); |
| 859 | return true; |
| 860 | } |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 861 | case RESIZE_DOCKED_STACK_TRANSACTION: { |
| 862 | data.enforceInterface(IActivityManager.descriptor); |
| 863 | final boolean hasBounds = data.readInt() != 0; |
| 864 | Rect bounds = null; |
| 865 | if (hasBounds) { |
| 866 | bounds = Rect.CREATOR.createFromParcel(data); |
| 867 | } |
| 868 | final boolean hasTempDockedTaskBounds = data.readInt() != 0; |
| 869 | Rect tempDockedTaskBounds = null; |
| 870 | if (hasTempDockedTaskBounds) { |
| 871 | tempDockedTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 872 | } |
| 873 | final boolean hasTempDockedTaskInsetBounds = data.readInt() != 0; |
| 874 | Rect tempDockedTaskInsetBounds = null; |
| 875 | if (hasTempDockedTaskInsetBounds) { |
| 876 | tempDockedTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 877 | } |
| 878 | final boolean hasTempOtherTaskBounds = data.readInt() != 0; |
| 879 | Rect tempOtherTaskBounds = null; |
| 880 | if (hasTempOtherTaskBounds) { |
| 881 | tempOtherTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 882 | } |
| 883 | final boolean hasTempOtherTaskInsetBounds = data.readInt() != 0; |
| 884 | Rect tempOtherTaskInsetBounds = null; |
| 885 | if (hasTempOtherTaskInsetBounds) { |
| 886 | tempOtherTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 887 | } |
| 888 | resizeDockedStack(bounds, tempDockedTaskBounds, tempDockedTaskInsetBounds, |
| 889 | tempOtherTaskBounds, tempOtherTaskInsetBounds); |
| 890 | reply.writeNoException(); |
| 891 | return true; |
| 892 | } |
| 893 | |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 894 | case POSITION_TASK_IN_STACK_TRANSACTION: { |
| 895 | data.enforceInterface(IActivityManager.descriptor); |
| 896 | int taskId = data.readInt(); |
| 897 | int stackId = data.readInt(); |
| 898 | int position = data.readInt(); |
| 899 | positionTaskInStack(taskId, stackId, position); |
| 900 | reply.writeNoException(); |
| 901 | return true; |
| 902 | } |
| 903 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 904 | case GET_ALL_STACK_INFOS_TRANSACTION: { |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 905 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 906 | List<StackInfo> list = getAllStackInfos(); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 907 | reply.writeNoException(); |
| 908 | reply.writeTypedList(list); |
| 909 | return true; |
| 910 | } |
| 911 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 912 | case GET_STACK_INFO_TRANSACTION: { |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 913 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 914 | int stackId = data.readInt(); |
| 915 | StackInfo info = getStackInfo(stackId); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 916 | reply.writeNoException(); |
| 917 | if (info != null) { |
| 918 | reply.writeInt(1); |
| 919 | info.writeToParcel(reply, 0); |
| 920 | } else { |
| 921 | reply.writeInt(0); |
| 922 | } |
| 923 | return true; |
| 924 | } |
| 925 | |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 926 | case IS_IN_HOME_STACK_TRANSACTION: { |
| 927 | data.enforceInterface(IActivityManager.descriptor); |
| 928 | int taskId = data.readInt(); |
| 929 | boolean isInHomeStack = isInHomeStack(taskId); |
| 930 | reply.writeNoException(); |
| 931 | reply.writeInt(isInHomeStack ? 1 : 0); |
| 932 | return true; |
| 933 | } |
| 934 | |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 935 | case SET_FOCUSED_STACK_TRANSACTION: { |
| 936 | data.enforceInterface(IActivityManager.descriptor); |
| 937 | int stackId = data.readInt(); |
| 938 | setFocusedStack(stackId); |
| 939 | reply.writeNoException(); |
| 940 | return true; |
| 941 | } |
| 942 | |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 943 | case GET_FOCUSED_STACK_ID_TRANSACTION: { |
| 944 | data.enforceInterface(IActivityManager.descriptor); |
| 945 | int focusedStackId = getFocusedStackId(); |
| 946 | reply.writeNoException(); |
| 947 | reply.writeInt(focusedStackId); |
| 948 | return true; |
| 949 | } |
| 950 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 951 | case SET_FOCUSED_TASK_TRANSACTION: { |
| 952 | data.enforceInterface(IActivityManager.descriptor); |
| 953 | int taskId = data.readInt(); |
Skuhne | f36bb0c | 2015-08-26 14:26:17 -0700 | [diff] [blame] | 954 | setFocusedTask(taskId); |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 955 | reply.writeNoException(); |
| 956 | return true; |
| 957 | } |
| 958 | |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 959 | case REGISTER_TASK_STACK_LISTENER_TRANSACTION: { |
| 960 | data.enforceInterface(IActivityManager.descriptor); |
| 961 | IBinder token = data.readStrongBinder(); |
| 962 | registerTaskStackListener(ITaskStackListener.Stub.asInterface(token)); |
| 963 | reply.writeNoException(); |
| 964 | return true; |
| 965 | } |
| 966 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 967 | case GET_TASK_FOR_ACTIVITY_TRANSACTION: { |
| 968 | data.enforceInterface(IActivityManager.descriptor); |
| 969 | IBinder token = data.readStrongBinder(); |
| 970 | boolean onlyRoot = data.readInt() != 0; |
| 971 | int res = token != null |
| 972 | ? getTaskForActivity(token, onlyRoot) : -1; |
| 973 | reply.writeNoException(); |
| 974 | reply.writeInt(res); |
| 975 | return true; |
| 976 | } |
| 977 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 978 | case GET_CONTENT_PROVIDER_TRANSACTION: { |
| 979 | data.enforceInterface(IActivityManager.descriptor); |
| 980 | IBinder b = data.readStrongBinder(); |
| 981 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 982 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 983 | int userId = data.readInt(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 984 | boolean stable = data.readInt() != 0; |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 985 | ContentProviderHolder cph = getContentProvider(app, name, userId, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 986 | reply.writeNoException(); |
| 987 | if (cph != null) { |
| 988 | reply.writeInt(1); |
| 989 | cph.writeToParcel(reply, 0); |
| 990 | } else { |
| 991 | reply.writeInt(0); |
| 992 | } |
| 993 | return true; |
| 994 | } |
| 995 | |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 996 | case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 997 | data.enforceInterface(IActivityManager.descriptor); |
| 998 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 999 | int userId = data.readInt(); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 1000 | IBinder token = data.readStrongBinder(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 1001 | ContentProviderHolder cph = getContentProviderExternal(name, userId, token); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 1002 | reply.writeNoException(); |
| 1003 | if (cph != null) { |
| 1004 | reply.writeInt(1); |
| 1005 | cph.writeToParcel(reply, 0); |
| 1006 | } else { |
| 1007 | reply.writeInt(0); |
| 1008 | } |
| 1009 | return true; |
| 1010 | } |
| 1011 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1012 | case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: { |
| 1013 | data.enforceInterface(IActivityManager.descriptor); |
| 1014 | IBinder b = data.readStrongBinder(); |
| 1015 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1016 | ArrayList<ContentProviderHolder> providers = |
| 1017 | data.createTypedArrayList(ContentProviderHolder.CREATOR); |
| 1018 | publishContentProviders(app, providers); |
| 1019 | reply.writeNoException(); |
| 1020 | return true; |
| 1021 | } |
| 1022 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1023 | case REF_CONTENT_PROVIDER_TRANSACTION: { |
| 1024 | data.enforceInterface(IActivityManager.descriptor); |
| 1025 | IBinder b = data.readStrongBinder(); |
| 1026 | int stable = data.readInt(); |
| 1027 | int unstable = data.readInt(); |
| 1028 | boolean res = refContentProvider(b, stable, unstable); |
| 1029 | reply.writeNoException(); |
| 1030 | reply.writeInt(res ? 1 : 0); |
| 1031 | return true; |
| 1032 | } |
| 1033 | |
| 1034 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: { |
| 1035 | data.enforceInterface(IActivityManager.descriptor); |
| 1036 | IBinder b = data.readStrongBinder(); |
| 1037 | unstableProviderDied(b); |
| 1038 | reply.writeNoException(); |
| 1039 | return true; |
| 1040 | } |
| 1041 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 1042 | case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: { |
| 1043 | data.enforceInterface(IActivityManager.descriptor); |
| 1044 | IBinder b = data.readStrongBinder(); |
| 1045 | appNotRespondingViaProvider(b); |
| 1046 | reply.writeNoException(); |
| 1047 | return true; |
| 1048 | } |
| 1049 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1050 | case REMOVE_CONTENT_PROVIDER_TRANSACTION: { |
| 1051 | data.enforceInterface(IActivityManager.descriptor); |
| 1052 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1053 | boolean stable = data.readInt() != 0; |
| 1054 | removeContentProvider(b, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1055 | reply.writeNoException(); |
| 1056 | return true; |
| 1057 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 1058 | |
| 1059 | case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 1060 | data.enforceInterface(IActivityManager.descriptor); |
| 1061 | String name = data.readString(); |
| 1062 | IBinder token = data.readStrongBinder(); |
| 1063 | removeContentProviderExternal(name, token); |
| 1064 | reply.writeNoException(); |
| 1065 | return true; |
| 1066 | } |
| 1067 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 1068 | case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: { |
| 1069 | data.enforceInterface(IActivityManager.descriptor); |
| 1070 | ComponentName comp = ComponentName.CREATOR.createFromParcel(data); |
| 1071 | PendingIntent pi = getRunningServiceControlPanel(comp); |
| 1072 | reply.writeNoException(); |
| 1073 | PendingIntent.writePendingIntentOrNullToParcel(pi, reply); |
| 1074 | return true; |
| 1075 | } |
| 1076 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1077 | case START_SERVICE_TRANSACTION: { |
| 1078 | data.enforceInterface(IActivityManager.descriptor); |
| 1079 | IBinder b = data.readStrongBinder(); |
| 1080 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1081 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1082 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1083 | String callingPackage = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1084 | int userId = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1085 | ComponentName cn = startService(app, service, resolvedType, callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1086 | reply.writeNoException(); |
| 1087 | ComponentName.writeToParcel(cn, reply); |
| 1088 | return true; |
| 1089 | } |
| 1090 | |
| 1091 | case STOP_SERVICE_TRANSACTION: { |
| 1092 | data.enforceInterface(IActivityManager.descriptor); |
| 1093 | IBinder b = data.readStrongBinder(); |
| 1094 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1095 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1096 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1097 | int userId = data.readInt(); |
| 1098 | int res = stopService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1099 | reply.writeNoException(); |
| 1100 | reply.writeInt(res); |
| 1101 | return true; |
| 1102 | } |
| 1103 | |
| 1104 | case STOP_SERVICE_TOKEN_TRANSACTION: { |
| 1105 | data.enforceInterface(IActivityManager.descriptor); |
| 1106 | ComponentName className = ComponentName.readFromParcel(data); |
| 1107 | IBinder token = data.readStrongBinder(); |
| 1108 | int startId = data.readInt(); |
| 1109 | boolean res = stopServiceToken(className, token, startId); |
| 1110 | reply.writeNoException(); |
| 1111 | reply.writeInt(res ? 1 : 0); |
| 1112 | return true; |
| 1113 | } |
| 1114 | |
| 1115 | case SET_SERVICE_FOREGROUND_TRANSACTION: { |
| 1116 | data.enforceInterface(IActivityManager.descriptor); |
| 1117 | ComponentName className = ComponentName.readFromParcel(data); |
| 1118 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 1119 | int id = data.readInt(); |
| 1120 | Notification notification = null; |
| 1121 | if (data.readInt() != 0) { |
| 1122 | notification = Notification.CREATOR.createFromParcel(data); |
| 1123 | } |
Dianne Hackborn | 67324c9 | 2016-04-18 13:55:25 -0700 | [diff] [blame] | 1124 | int sflags = data.readInt(); |
| 1125 | setServiceForeground(className, token, id, notification, sflags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1126 | reply.writeNoException(); |
| 1127 | return true; |
| 1128 | } |
| 1129 | |
| 1130 | case BIND_SERVICE_TRANSACTION: { |
| 1131 | data.enforceInterface(IActivityManager.descriptor); |
| 1132 | IBinder b = data.readStrongBinder(); |
| 1133 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1134 | IBinder token = data.readStrongBinder(); |
| 1135 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1136 | String resolvedType = data.readString(); |
| 1137 | b = data.readStrongBinder(); |
| 1138 | int fl = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1139 | String callingPackage = data.readString(); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 1140 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1141 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1142 | int res = bindService(app, token, service, resolvedType, conn, fl, |
| 1143 | callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1144 | reply.writeNoException(); |
| 1145 | reply.writeInt(res); |
| 1146 | return true; |
| 1147 | } |
| 1148 | |
| 1149 | case UNBIND_SERVICE_TRANSACTION: { |
| 1150 | data.enforceInterface(IActivityManager.descriptor); |
| 1151 | IBinder b = data.readStrongBinder(); |
| 1152 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
| 1153 | boolean res = unbindService(conn); |
| 1154 | reply.writeNoException(); |
| 1155 | reply.writeInt(res ? 1 : 0); |
| 1156 | return true; |
| 1157 | } |
| 1158 | |
| 1159 | case PUBLISH_SERVICE_TRANSACTION: { |
| 1160 | data.enforceInterface(IActivityManager.descriptor); |
| 1161 | IBinder token = data.readStrongBinder(); |
| 1162 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1163 | IBinder service = data.readStrongBinder(); |
| 1164 | publishService(token, intent, service); |
| 1165 | reply.writeNoException(); |
| 1166 | return true; |
| 1167 | } |
| 1168 | |
| 1169 | case UNBIND_FINISHED_TRANSACTION: { |
| 1170 | data.enforceInterface(IActivityManager.descriptor); |
| 1171 | IBinder token = data.readStrongBinder(); |
| 1172 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1173 | boolean doRebind = data.readInt() != 0; |
| 1174 | unbindFinished(token, intent, doRebind); |
| 1175 | reply.writeNoException(); |
| 1176 | return true; |
| 1177 | } |
| 1178 | |
| 1179 | case SERVICE_DONE_EXECUTING_TRANSACTION: { |
| 1180 | data.enforceInterface(IActivityManager.descriptor); |
| 1181 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 1182 | int type = data.readInt(); |
| 1183 | int startId = data.readInt(); |
| 1184 | int res = data.readInt(); |
| 1185 | serviceDoneExecuting(token, type, startId, res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1186 | reply.writeNoException(); |
| 1187 | return true; |
| 1188 | } |
| 1189 | |
| 1190 | case START_INSTRUMENTATION_TRANSACTION: { |
| 1191 | data.enforceInterface(IActivityManager.descriptor); |
| 1192 | ComponentName className = ComponentName.readFromParcel(data); |
| 1193 | String profileFile = data.readString(); |
| 1194 | int fl = data.readInt(); |
| 1195 | Bundle arguments = data.readBundle(); |
| 1196 | IBinder b = data.readStrongBinder(); |
| 1197 | IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 1198 | b = data.readStrongBinder(); |
| 1199 | IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1200 | int userId = data.readInt(); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 1201 | String abiOverride = data.readString(); |
| 1202 | boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId, |
| 1203 | abiOverride); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1204 | reply.writeNoException(); |
| 1205 | reply.writeInt(res ? 1 : 0); |
| 1206 | return true; |
| 1207 | } |
| 1208 | |
| 1209 | |
| 1210 | case FINISH_INSTRUMENTATION_TRANSACTION: { |
| 1211 | data.enforceInterface(IActivityManager.descriptor); |
| 1212 | IBinder b = data.readStrongBinder(); |
| 1213 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1214 | int resultCode = data.readInt(); |
| 1215 | Bundle results = data.readBundle(); |
| 1216 | finishInstrumentation(app, resultCode, results); |
| 1217 | reply.writeNoException(); |
| 1218 | return true; |
| 1219 | } |
| 1220 | |
| 1221 | case GET_CONFIGURATION_TRANSACTION: { |
| 1222 | data.enforceInterface(IActivityManager.descriptor); |
| 1223 | Configuration config = getConfiguration(); |
| 1224 | reply.writeNoException(); |
| 1225 | config.writeToParcel(reply, 0); |
| 1226 | return true; |
| 1227 | } |
| 1228 | |
| 1229 | case UPDATE_CONFIGURATION_TRANSACTION: { |
| 1230 | data.enforceInterface(IActivityManager.descriptor); |
| 1231 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
Wale Ogunwale | 02896ab | 2016-10-05 09:08:43 -0700 | [diff] [blame] | 1232 | final boolean updated = updateConfiguration(config); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1233 | reply.writeNoException(); |
Wale Ogunwale | 02896ab | 2016-10-05 09:08:43 -0700 | [diff] [blame] | 1234 | reply.writeInt(updated ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1235 | return true; |
| 1236 | } |
| 1237 | |
| 1238 | case SET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1239 | data.enforceInterface(IActivityManager.descriptor); |
| 1240 | IBinder token = data.readStrongBinder(); |
| 1241 | int requestedOrientation = data.readInt(); |
| 1242 | setRequestedOrientation(token, requestedOrientation); |
| 1243 | reply.writeNoException(); |
| 1244 | return true; |
| 1245 | } |
| 1246 | |
| 1247 | case GET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1248 | data.enforceInterface(IActivityManager.descriptor); |
| 1249 | IBinder token = data.readStrongBinder(); |
| 1250 | int req = getRequestedOrientation(token); |
| 1251 | reply.writeNoException(); |
| 1252 | reply.writeInt(req); |
| 1253 | return true; |
| 1254 | } |
| 1255 | |
| 1256 | case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: { |
| 1257 | data.enforceInterface(IActivityManager.descriptor); |
| 1258 | IBinder token = data.readStrongBinder(); |
| 1259 | ComponentName cn = getActivityClassForToken(token); |
| 1260 | reply.writeNoException(); |
| 1261 | ComponentName.writeToParcel(cn, reply); |
| 1262 | return true; |
| 1263 | } |
| 1264 | |
| 1265 | case GET_PACKAGE_FOR_TOKEN_TRANSACTION: { |
| 1266 | data.enforceInterface(IActivityManager.descriptor); |
| 1267 | IBinder token = data.readStrongBinder(); |
| 1268 | reply.writeNoException(); |
| 1269 | reply.writeString(getPackageForToken(token)); |
| 1270 | return true; |
| 1271 | } |
| 1272 | |
| 1273 | case GET_INTENT_SENDER_TRANSACTION: { |
| 1274 | data.enforceInterface(IActivityManager.descriptor); |
| 1275 | int type = data.readInt(); |
| 1276 | String packageName = data.readString(); |
| 1277 | IBinder token = data.readStrongBinder(); |
| 1278 | String resultWho = data.readString(); |
| 1279 | int requestCode = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1280 | Intent[] requestIntents; |
| 1281 | String[] requestResolvedTypes; |
| 1282 | if (data.readInt() != 0) { |
| 1283 | requestIntents = data.createTypedArray(Intent.CREATOR); |
| 1284 | requestResolvedTypes = data.createStringArray(); |
| 1285 | } else { |
| 1286 | requestIntents = null; |
| 1287 | requestResolvedTypes = null; |
| 1288 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1289 | int fl = data.readInt(); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 1290 | Bundle options = data.readInt() != 0 |
| 1291 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1292 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1293 | IIntentSender res = getIntentSender(type, packageName, token, |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1294 | resultWho, requestCode, requestIntents, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1295 | requestResolvedTypes, fl, options, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1296 | reply.writeNoException(); |
| 1297 | reply.writeStrongBinder(res != null ? res.asBinder() : null); |
| 1298 | return true; |
| 1299 | } |
| 1300 | |
| 1301 | case CANCEL_INTENT_SENDER_TRANSACTION: { |
| 1302 | data.enforceInterface(IActivityManager.descriptor); |
| 1303 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1304 | data.readStrongBinder()); |
| 1305 | cancelIntentSender(r); |
| 1306 | reply.writeNoException(); |
| 1307 | return true; |
| 1308 | } |
| 1309 | |
| 1310 | case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: { |
| 1311 | data.enforceInterface(IActivityManager.descriptor); |
| 1312 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1313 | data.readStrongBinder()); |
| 1314 | String res = getPackageForIntentSender(r); |
| 1315 | reply.writeNoException(); |
| 1316 | reply.writeString(res); |
| 1317 | return true; |
| 1318 | } |
| 1319 | |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 1320 | case GET_UID_FOR_INTENT_SENDER_TRANSACTION: { |
| 1321 | data.enforceInterface(IActivityManager.descriptor); |
| 1322 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1323 | data.readStrongBinder()); |
| 1324 | int res = getUidForIntentSender(r); |
| 1325 | reply.writeNoException(); |
| 1326 | reply.writeInt(res); |
| 1327 | return true; |
| 1328 | } |
| 1329 | |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1330 | case HANDLE_INCOMING_USER_TRANSACTION: { |
| 1331 | data.enforceInterface(IActivityManager.descriptor); |
| 1332 | int callingPid = data.readInt(); |
| 1333 | int callingUid = data.readInt(); |
| 1334 | int userId = data.readInt(); |
| 1335 | boolean allowAll = data.readInt() != 0 ; |
| 1336 | boolean requireFull = data.readInt() != 0; |
| 1337 | String name = data.readString(); |
| 1338 | String callerPackage = data.readString(); |
| 1339 | int res = handleIncomingUser(callingPid, callingUid, userId, allowAll, |
| 1340 | requireFull, name, callerPackage); |
| 1341 | reply.writeNoException(); |
| 1342 | reply.writeInt(res); |
| 1343 | return true; |
| 1344 | } |
| 1345 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1346 | case SET_PROCESS_LIMIT_TRANSACTION: { |
| 1347 | data.enforceInterface(IActivityManager.descriptor); |
| 1348 | int max = data.readInt(); |
| 1349 | setProcessLimit(max); |
| 1350 | reply.writeNoException(); |
| 1351 | return true; |
| 1352 | } |
| 1353 | |
| 1354 | case GET_PROCESS_LIMIT_TRANSACTION: { |
| 1355 | data.enforceInterface(IActivityManager.descriptor); |
| 1356 | int limit = getProcessLimit(); |
| 1357 | reply.writeNoException(); |
| 1358 | reply.writeInt(limit); |
| 1359 | return true; |
| 1360 | } |
| 1361 | |
| 1362 | case SET_PROCESS_FOREGROUND_TRANSACTION: { |
| 1363 | data.enforceInterface(IActivityManager.descriptor); |
| 1364 | IBinder token = data.readStrongBinder(); |
| 1365 | int pid = data.readInt(); |
| 1366 | boolean isForeground = data.readInt() != 0; |
| 1367 | setProcessForeground(token, pid, isForeground); |
| 1368 | reply.writeNoException(); |
| 1369 | return true; |
| 1370 | } |
| 1371 | |
| 1372 | case CHECK_PERMISSION_TRANSACTION: { |
| 1373 | data.enforceInterface(IActivityManager.descriptor); |
| 1374 | String perm = data.readString(); |
| 1375 | int pid = data.readInt(); |
| 1376 | int uid = data.readInt(); |
| 1377 | int res = checkPermission(perm, pid, uid); |
| 1378 | reply.writeNoException(); |
| 1379 | reply.writeInt(res); |
| 1380 | return true; |
| 1381 | } |
| 1382 | |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1383 | case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: { |
| 1384 | data.enforceInterface(IActivityManager.descriptor); |
| 1385 | String perm = data.readString(); |
| 1386 | int pid = data.readInt(); |
| 1387 | int uid = data.readInt(); |
| 1388 | IBinder token = data.readStrongBinder(); |
| 1389 | int res = checkPermissionWithToken(perm, pid, uid, token); |
| 1390 | reply.writeNoException(); |
| 1391 | reply.writeInt(res); |
| 1392 | return true; |
| 1393 | } |
| 1394 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1395 | case CHECK_URI_PERMISSION_TRANSACTION: { |
| 1396 | data.enforceInterface(IActivityManager.descriptor); |
| 1397 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1398 | int pid = data.readInt(); |
| 1399 | int uid = data.readInt(); |
| 1400 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1401 | int userId = data.readInt(); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1402 | IBinder callerToken = data.readStrongBinder(); |
| 1403 | int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1404 | reply.writeNoException(); |
| 1405 | reply.writeInt(res); |
| 1406 | return true; |
| 1407 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1408 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1409 | case CLEAR_APP_DATA_TRANSACTION: { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1410 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1411 | String packageName = data.readString(); |
| 1412 | IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface( |
| 1413 | data.readStrongBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 1414 | int userId = data.readInt(); |
| 1415 | boolean res = clearApplicationUserData(packageName, observer, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1416 | reply.writeNoException(); |
| 1417 | reply.writeInt(res ? 1 : 0); |
| 1418 | return true; |
| 1419 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1420 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1421 | case GRANT_URI_PERMISSION_TRANSACTION: { |
| 1422 | data.enforceInterface(IActivityManager.descriptor); |
| 1423 | IBinder b = data.readStrongBinder(); |
| 1424 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1425 | String targetPkg = data.readString(); |
| 1426 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1427 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1428 | int userId = data.readInt(); |
| 1429 | grantUriPermission(app, targetPkg, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1430 | reply.writeNoException(); |
| 1431 | return true; |
| 1432 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1433 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1434 | case REVOKE_URI_PERMISSION_TRANSACTION: { |
| 1435 | data.enforceInterface(IActivityManager.descriptor); |
| 1436 | IBinder b = data.readStrongBinder(); |
| 1437 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1438 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1439 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1440 | int userId = data.readInt(); |
| 1441 | revokeUriPermission(app, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1442 | reply.writeNoException(); |
| 1443 | return true; |
| 1444 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1445 | |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1446 | case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1447 | data.enforceInterface(IActivityManager.descriptor); |
| 1448 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1449 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1450 | int userId = data.readInt(); |
| 1451 | takePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1452 | reply.writeNoException(); |
| 1453 | return true; |
| 1454 | } |
| 1455 | |
| 1456 | case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1457 | data.enforceInterface(IActivityManager.descriptor); |
| 1458 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1459 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1460 | int userId = data.readInt(); |
| 1461 | releasePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1462 | reply.writeNoException(); |
| 1463 | return true; |
| 1464 | } |
| 1465 | |
| 1466 | case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: { |
| 1467 | data.enforceInterface(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 1468 | final String packageName = data.readString(); |
| 1469 | final boolean incoming = data.readInt() != 0; |
| 1470 | final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions( |
| 1471 | packageName, incoming); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1472 | reply.writeNoException(); |
| 1473 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1474 | return true; |
| 1475 | } |
| 1476 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 1477 | case GET_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1478 | data.enforceInterface(IActivityManager.descriptor); |
| 1479 | final String packageName = data.readString(); |
| 1480 | final int userId = data.readInt(); |
| 1481 | final ParceledListSlice<UriPermission> perms = getGrantedUriPermissions(packageName, |
| 1482 | userId); |
| 1483 | reply.writeNoException(); |
| 1484 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1485 | return true; |
| 1486 | } |
| 1487 | |
| 1488 | case CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1489 | data.enforceInterface(IActivityManager.descriptor); |
| 1490 | final String packageName = data.readString(); |
| 1491 | final int userId = data.readInt(); |
| 1492 | clearGrantedUriPermissions(packageName, userId); |
| 1493 | reply.writeNoException(); |
| 1494 | return true; |
| 1495 | } |
| 1496 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1497 | case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: { |
| 1498 | data.enforceInterface(IActivityManager.descriptor); |
| 1499 | IBinder b = data.readStrongBinder(); |
| 1500 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1501 | boolean waiting = data.readInt() != 0; |
| 1502 | showWaitingForDebugger(app, waiting); |
| 1503 | reply.writeNoException(); |
| 1504 | return true; |
| 1505 | } |
| 1506 | |
| 1507 | case GET_MEMORY_INFO_TRANSACTION: { |
| 1508 | data.enforceInterface(IActivityManager.descriptor); |
| 1509 | ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); |
| 1510 | getMemoryInfo(mi); |
| 1511 | reply.writeNoException(); |
| 1512 | mi.writeToParcel(reply, 0); |
| 1513 | return true; |
| 1514 | } |
| 1515 | |
| 1516 | case UNHANDLED_BACK_TRANSACTION: { |
| 1517 | data.enforceInterface(IActivityManager.descriptor); |
| 1518 | unhandledBack(); |
| 1519 | reply.writeNoException(); |
| 1520 | return true; |
| 1521 | } |
| 1522 | |
| 1523 | case OPEN_CONTENT_URI_TRANSACTION: { |
| 1524 | data.enforceInterface(IActivityManager.descriptor); |
| 1525 | Uri uri = Uri.parse(data.readString()); |
| 1526 | ParcelFileDescriptor pfd = openContentUri(uri); |
| 1527 | reply.writeNoException(); |
| 1528 | if (pfd != null) { |
| 1529 | reply.writeInt(1); |
| 1530 | pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1531 | } else { |
| 1532 | reply.writeInt(0); |
| 1533 | } |
| 1534 | return true; |
| 1535 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1536 | |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1537 | case SET_LOCK_SCREEN_SHOWN_TRANSACTION: { |
| 1538 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | 9973294 | 2016-05-06 10:13:14 -0700 | [diff] [blame] | 1539 | final boolean showing = data.readInt() != 0; |
| 1540 | final boolean occluded = data.readInt() != 0; |
| 1541 | setLockScreenShown(showing, occluded); |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1542 | reply.writeNoException(); |
| 1543 | return true; |
| 1544 | } |
| 1545 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1546 | case SET_DEBUG_APP_TRANSACTION: { |
| 1547 | data.enforceInterface(IActivityManager.descriptor); |
| 1548 | String pn = data.readString(); |
| 1549 | boolean wfd = data.readInt() != 0; |
| 1550 | boolean per = data.readInt() != 0; |
| 1551 | setDebugApp(pn, wfd, per); |
| 1552 | reply.writeNoException(); |
| 1553 | return true; |
| 1554 | } |
| 1555 | |
| 1556 | case SET_ALWAYS_FINISH_TRANSACTION: { |
| 1557 | data.enforceInterface(IActivityManager.descriptor); |
| 1558 | boolean enabled = data.readInt() != 0; |
| 1559 | setAlwaysFinish(enabled); |
| 1560 | reply.writeNoException(); |
| 1561 | return true; |
| 1562 | } |
| 1563 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1564 | case SET_ACTIVITY_CONTROLLER_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1565 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1566 | IActivityController watcher = IActivityController.Stub.asInterface( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1567 | data.readStrongBinder()); |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 1568 | boolean imAMonkey = data.readInt() != 0; |
| 1569 | setActivityController(watcher, imAMonkey); |
Sungmin Choi | cdb86bb | 2012-12-20 14:08:59 +0900 | [diff] [blame] | 1570 | reply.writeNoException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1571 | return true; |
| 1572 | } |
| 1573 | |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 1574 | case SET_LENIENT_BACKGROUND_CHECK_TRANSACTION: { |
| 1575 | data.enforceInterface(IActivityManager.descriptor); |
| 1576 | boolean enabled = data.readInt() != 0; |
| 1577 | setLenientBackgroundCheck(enabled); |
| 1578 | reply.writeNoException(); |
| 1579 | return true; |
| 1580 | } |
| 1581 | |
Dianne Hackborn | 970510b | 2016-02-24 16:56:42 -0800 | [diff] [blame] | 1582 | case GET_MEMORY_TRIM_LEVEL_TRANSACTION: { |
| 1583 | data.enforceInterface(IActivityManager.descriptor); |
| 1584 | int level = getMemoryTrimLevel(); |
| 1585 | reply.writeNoException(); |
| 1586 | reply.writeInt(level); |
| 1587 | return true; |
| 1588 | } |
| 1589 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1590 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1591 | data.enforceInterface(IActivityManager.descriptor); |
| 1592 | enterSafeMode(); |
| 1593 | reply.writeNoException(); |
| 1594 | return true; |
| 1595 | } |
| 1596 | |
| 1597 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1598 | data.enforceInterface(IActivityManager.descriptor); |
| 1599 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1600 | data.readStrongBinder()); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 1601 | int sourceUid = data.readInt(); |
| 1602 | String sourcePkg = data.readString(); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 1603 | String tag = data.readString(); |
| 1604 | noteWakeupAlarm(is, sourceUid, sourcePkg, tag); |
| 1605 | reply.writeNoException(); |
| 1606 | return true; |
| 1607 | } |
| 1608 | |
| 1609 | case NOTE_ALARM_START_TRANSACTION: { |
| 1610 | data.enforceInterface(IActivityManager.descriptor); |
| 1611 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1612 | data.readStrongBinder()); |
| 1613 | int sourceUid = data.readInt(); |
| 1614 | String tag = data.readString(); |
| 1615 | noteAlarmStart(is, sourceUid, tag); |
| 1616 | reply.writeNoException(); |
| 1617 | return true; |
| 1618 | } |
| 1619 | |
| 1620 | case NOTE_ALARM_FINISH_TRANSACTION: { |
| 1621 | data.enforceInterface(IActivityManager.descriptor); |
| 1622 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1623 | data.readStrongBinder()); |
| 1624 | int sourceUid = data.readInt(); |
| 1625 | String tag = data.readString(); |
| 1626 | noteAlarmFinish(is, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1627 | reply.writeNoException(); |
| 1628 | return true; |
| 1629 | } |
| 1630 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1631 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1632 | data.enforceInterface(IActivityManager.descriptor); |
| 1633 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1634 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1635 | boolean secure = data.readInt() != 0; |
| 1636 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1637 | reply.writeNoException(); |
| 1638 | reply.writeInt(res ? 1 : 0); |
| 1639 | return true; |
| 1640 | } |
| 1641 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1642 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1643 | data.enforceInterface(IActivityManager.descriptor); |
| 1644 | String reason = data.readString(); |
| 1645 | boolean res = killProcessesBelowForeground(reason); |
| 1646 | reply.writeNoException(); |
| 1647 | reply.writeInt(res ? 1 : 0); |
| 1648 | return true; |
| 1649 | } |
| 1650 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1651 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1652 | data.enforceInterface(IActivityManager.descriptor); |
| 1653 | IBinder app = data.readStrongBinder(); |
| 1654 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1655 | handleApplicationCrash(app, ci); |
| 1656 | reply.writeNoException(); |
| 1657 | return true; |
| 1658 | } |
| 1659 | |
| 1660 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1661 | data.enforceInterface(IActivityManager.descriptor); |
| 1662 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1663 | String tag = data.readString(); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1664 | boolean system = data.readInt() != 0; |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1665 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1666 | boolean res = handleApplicationWtf(app, tag, system, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1667 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1668 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1669 | return true; |
| 1670 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1671 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1672 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1673 | data.enforceInterface(IActivityManager.descriptor); |
| 1674 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1675 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1676 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1677 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1678 | reply.writeNoException(); |
| 1679 | return true; |
| 1680 | } |
| 1681 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1682 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1683 | data.enforceInterface(IActivityManager.descriptor); |
| 1684 | int sig = data.readInt(); |
| 1685 | signalPersistentProcesses(sig); |
| 1686 | reply.writeNoException(); |
| 1687 | return true; |
| 1688 | } |
| 1689 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1690 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1691 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1692 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1693 | int userId = data.readInt(); |
| 1694 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1695 | reply.writeNoException(); |
| 1696 | return true; |
| 1697 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1698 | |
| 1699 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1700 | data.enforceInterface(IActivityManager.descriptor); |
| 1701 | killAllBackgroundProcesses(); |
| 1702 | reply.writeNoException(); |
| 1703 | return true; |
| 1704 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1705 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 1706 | case KILL_PACKAGE_DEPENDENTS_TRANSACTION: { |
| 1707 | data.enforceInterface(IActivityManager.descriptor); |
| 1708 | String packageName = data.readString(); |
| 1709 | int userId = data.readInt(); |
| 1710 | killPackageDependents(packageName, userId); |
| 1711 | reply.writeNoException(); |
| 1712 | return true; |
| 1713 | } |
| 1714 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1715 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1716 | data.enforceInterface(IActivityManager.descriptor); |
| 1717 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1718 | int userId = data.readInt(); |
| 1719 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1720 | reply.writeNoException(); |
| 1721 | return true; |
| 1722 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1723 | |
| 1724 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1725 | data.enforceInterface(IActivityManager.descriptor); |
| 1726 | ActivityManager.RunningAppProcessInfo info = |
| 1727 | new ActivityManager.RunningAppProcessInfo(); |
| 1728 | getMyMemoryState(info); |
| 1729 | reply.writeNoException(); |
| 1730 | info.writeToParcel(reply, 0); |
| 1731 | return true; |
| 1732 | } |
| 1733 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1734 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1735 | data.enforceInterface(IActivityManager.descriptor); |
| 1736 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1737 | reply.writeNoException(); |
| 1738 | config.writeToParcel(reply, 0); |
| 1739 | return true; |
| 1740 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1741 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1742 | case PROFILE_CONTROL_TRANSACTION: { |
| 1743 | data.enforceInterface(IActivityManager.descriptor); |
| 1744 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1745 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1746 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1747 | int profileType = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1748 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 1749 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
| 1750 | boolean res = profileControl(process, userId, start, profilerInfo, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1751 | reply.writeNoException(); |
| 1752 | reply.writeInt(res ? 1 : 0); |
| 1753 | return true; |
| 1754 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1755 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1756 | case SHUTDOWN_TRANSACTION: { |
| 1757 | data.enforceInterface(IActivityManager.descriptor); |
| 1758 | boolean res = shutdown(data.readInt()); |
| 1759 | reply.writeNoException(); |
| 1760 | reply.writeInt(res ? 1 : 0); |
| 1761 | return true; |
| 1762 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1763 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1764 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1765 | data.enforceInterface(IActivityManager.descriptor); |
| 1766 | stopAppSwitches(); |
| 1767 | reply.writeNoException(); |
| 1768 | return true; |
| 1769 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1770 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1771 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1772 | data.enforceInterface(IActivityManager.descriptor); |
| 1773 | resumeAppSwitches(); |
| 1774 | reply.writeNoException(); |
| 1775 | return true; |
| 1776 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1777 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1778 | case PEEK_SERVICE_TRANSACTION: { |
| 1779 | data.enforceInterface(IActivityManager.descriptor); |
| 1780 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1781 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1782 | String callingPackage = data.readString(); |
| 1783 | IBinder binder = peekService(service, resolvedType, callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1784 | reply.writeNoException(); |
| 1785 | reply.writeStrongBinder(binder); |
| 1786 | return true; |
| 1787 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1788 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1789 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1790 | data.enforceInterface(IActivityManager.descriptor); |
Christopher Tate | c58054f | 2016-06-13 15:17:54 -0700 | [diff] [blame] | 1791 | String packageName = data.readString(); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1792 | int backupRestoreMode = data.readInt(); |
Christopher Tate | c58054f | 2016-06-13 15:17:54 -0700 | [diff] [blame] | 1793 | int userId = data.readInt(); |
| 1794 | boolean success = bindBackupAgent(packageName, backupRestoreMode, userId); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1795 | reply.writeNoException(); |
| 1796 | reply.writeInt(success ? 1 : 0); |
| 1797 | return true; |
| 1798 | } |
| 1799 | |
| 1800 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1801 | data.enforceInterface(IActivityManager.descriptor); |
| 1802 | String packageName = data.readString(); |
| 1803 | IBinder agent = data.readStrongBinder(); |
| 1804 | backupAgentCreated(packageName, agent); |
| 1805 | reply.writeNoException(); |
| 1806 | return true; |
| 1807 | } |
| 1808 | |
| 1809 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1810 | data.enforceInterface(IActivityManager.descriptor); |
| 1811 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1812 | unbindBackupAgent(info); |
| 1813 | reply.writeNoException(); |
| 1814 | return true; |
| 1815 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1816 | |
| 1817 | case ADD_PACKAGE_DEPENDENCY_TRANSACTION: { |
| 1818 | data.enforceInterface(IActivityManager.descriptor); |
| 1819 | String packageName = data.readString(); |
| 1820 | addPackageDependency(packageName); |
| 1821 | reply.writeNoException(); |
| 1822 | return true; |
| 1823 | } |
| 1824 | |
Jeff Sharkey | 85f449e | 2016-06-23 09:26:00 -0600 | [diff] [blame] | 1825 | case KILL_APPLICATION_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1826 | data.enforceInterface(IActivityManager.descriptor); |
| 1827 | String pkg = data.readString(); |
Jeff Sharkey | 85f449e | 2016-06-23 09:26:00 -0600 | [diff] [blame] | 1828 | int appId = data.readInt(); |
| 1829 | int userId = data.readInt(); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 1830 | String reason = data.readString(); |
Jeff Sharkey | 85f449e | 2016-06-23 09:26:00 -0600 | [diff] [blame] | 1831 | killApplication(pkg, appId, userId, reason); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1832 | reply.writeNoException(); |
| 1833 | return true; |
| 1834 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1835 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1836 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1837 | data.enforceInterface(IActivityManager.descriptor); |
| 1838 | String reason = data.readString(); |
| 1839 | closeSystemDialogs(reason); |
| 1840 | reply.writeNoException(); |
| 1841 | return true; |
| 1842 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1843 | |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1844 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1845 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1846 | int[] pids = data.createIntArray(); |
| 1847 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1848 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1849 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1850 | return true; |
| 1851 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1852 | |
| 1853 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1854 | data.enforceInterface(IActivityManager.descriptor); |
| 1855 | String processName = data.readString(); |
| 1856 | int uid = data.readInt(); |
| 1857 | killApplicationProcess(processName, uid); |
| 1858 | reply.writeNoException(); |
| 1859 | return true; |
| 1860 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1861 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1862 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1863 | data.enforceInterface(IActivityManager.descriptor); |
| 1864 | IBinder token = data.readStrongBinder(); |
| 1865 | String packageName = data.readString(); |
| 1866 | int enterAnim = data.readInt(); |
| 1867 | int exitAnim = data.readInt(); |
| 1868 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1869 | reply.writeNoException(); |
| 1870 | return true; |
| 1871 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1872 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1873 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1874 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1875 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1876 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1877 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1878 | return true; |
| 1879 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1880 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1881 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1882 | data.enforceInterface(IActivityManager.descriptor); |
| 1883 | final boolean monkey = (data.readInt() == 1); |
| 1884 | setUserIsMonkey(monkey); |
| 1885 | reply.writeNoException(); |
| 1886 | return true; |
| 1887 | } |
| 1888 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1889 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1890 | data.enforceInterface(IActivityManager.descriptor); |
| 1891 | finishHeavyWeightApp(); |
| 1892 | reply.writeNoException(); |
| 1893 | return true; |
| 1894 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1895 | |
| 1896 | case IS_IMMERSIVE_TRANSACTION: { |
| 1897 | data.enforceInterface(IActivityManager.descriptor); |
| 1898 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1899 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1900 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1901 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1902 | return true; |
| 1903 | } |
| 1904 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 1905 | case IS_TOP_OF_TASK_TRANSACTION: { |
| 1906 | data.enforceInterface(IActivityManager.descriptor); |
| 1907 | IBinder token = data.readStrongBinder(); |
| 1908 | final boolean isTopOfTask = isTopOfTask(token); |
| 1909 | reply.writeNoException(); |
| 1910 | reply.writeInt(isTopOfTask ? 1 : 0); |
| 1911 | return true; |
| 1912 | } |
| 1913 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1914 | case CONVERT_FROM_TRANSLUCENT_TRANSACTION: { |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1915 | data.enforceInterface(IActivityManager.descriptor); |
| 1916 | IBinder token = data.readStrongBinder(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1917 | boolean converted = convertFromTranslucent(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1918 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1919 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1920 | return true; |
| 1921 | } |
| 1922 | |
| 1923 | case CONVERT_TO_TRANSLUCENT_TRANSACTION: { |
| 1924 | data.enforceInterface(IActivityManager.descriptor); |
| 1925 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1926 | final Bundle bundle; |
| 1927 | if (data.readInt() == 0) { |
| 1928 | bundle = null; |
| 1929 | } else { |
| 1930 | bundle = data.readBundle(); |
| 1931 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 1932 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1933 | boolean converted = convertToTranslucent(token, options); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1934 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1935 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1936 | return true; |
| 1937 | } |
| 1938 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1939 | case GET_ACTIVITY_OPTIONS_TRANSACTION: { |
| 1940 | data.enforceInterface(IActivityManager.descriptor); |
| 1941 | IBinder token = data.readStrongBinder(); |
| 1942 | final ActivityOptions options = getActivityOptions(token); |
| 1943 | reply.writeNoException(); |
| 1944 | reply.writeBundle(options == null ? null : options.toBundle()); |
| 1945 | return true; |
| 1946 | } |
| 1947 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1948 | case SET_IMMERSIVE_TRANSACTION: { |
| 1949 | data.enforceInterface(IActivityManager.descriptor); |
| 1950 | IBinder token = data.readStrongBinder(); |
| 1951 | boolean imm = data.readInt() == 1; |
| 1952 | setImmersive(token, imm); |
| 1953 | reply.writeNoException(); |
| 1954 | return true; |
| 1955 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1956 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1957 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1958 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1959 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1960 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1961 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1962 | return true; |
| 1963 | } |
| 1964 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1965 | case CRASH_APPLICATION_TRANSACTION: { |
| 1966 | data.enforceInterface(IActivityManager.descriptor); |
| 1967 | int uid = data.readInt(); |
| 1968 | int initialPid = data.readInt(); |
| 1969 | String packageName = data.readString(); |
| 1970 | String message = data.readString(); |
| 1971 | crashApplication(uid, initialPid, packageName, message); |
| 1972 | reply.writeNoException(); |
| 1973 | return true; |
| 1974 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1975 | |
| 1976 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1977 | data.enforceInterface(IActivityManager.descriptor); |
| 1978 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1979 | int userId = data.readInt(); |
| 1980 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1981 | reply.writeNoException(); |
| 1982 | reply.writeString(type); |
| 1983 | return true; |
| 1984 | } |
| 1985 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1986 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1987 | data.enforceInterface(IActivityManager.descriptor); |
| 1988 | String name = data.readString(); |
| 1989 | IBinder perm = newUriPermissionOwner(name); |
| 1990 | reply.writeNoException(); |
| 1991 | reply.writeStrongBinder(perm); |
| 1992 | return true; |
| 1993 | } |
| 1994 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 1995 | case GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION: { |
| 1996 | data.enforceInterface(IActivityManager.descriptor); |
| 1997 | IBinder activityToken = data.readStrongBinder(); |
| 1998 | IBinder perm = getUriPermissionOwnerForActivity(activityToken); |
| 1999 | reply.writeNoException(); |
| 2000 | reply.writeStrongBinder(perm); |
| 2001 | return true; |
| 2002 | } |
| 2003 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2004 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 2005 | data.enforceInterface(IActivityManager.descriptor); |
| 2006 | IBinder owner = data.readStrongBinder(); |
| 2007 | int fromUid = data.readInt(); |
| 2008 | String targetPkg = data.readString(); |
| 2009 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 2010 | int mode = data.readInt(); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 2011 | int sourceUserId = data.readInt(); |
| 2012 | int targetUserId = data.readInt(); |
| 2013 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId, |
| 2014 | targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2015 | reply.writeNoException(); |
| 2016 | return true; |
| 2017 | } |
| 2018 | |
| 2019 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 2020 | data.enforceInterface(IActivityManager.descriptor); |
| 2021 | IBinder owner = data.readStrongBinder(); |
| 2022 | Uri uri = null; |
| 2023 | if (data.readInt() != 0) { |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2024 | uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2025 | } |
| 2026 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2027 | int userId = data.readInt(); |
| 2028 | revokeUriPermissionFromOwner(owner, uri, mode, userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2029 | reply.writeNoException(); |
| 2030 | return true; |
| 2031 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 2032 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 2033 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 2034 | data.enforceInterface(IActivityManager.descriptor); |
| 2035 | int callingUid = data.readInt(); |
| 2036 | String targetPkg = data.readString(); |
| 2037 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 2038 | int modeFlags = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2039 | int userId = data.readInt(); |
| 2040 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 2041 | reply.writeNoException(); |
| 2042 | reply.writeInt(res); |
| 2043 | return true; |
| 2044 | } |
| 2045 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2046 | case DUMP_HEAP_TRANSACTION: { |
| 2047 | data.enforceInterface(IActivityManager.descriptor); |
| 2048 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 2049 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2050 | boolean managed = data.readInt() != 0; |
| 2051 | String path = data.readString(); |
| 2052 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 2053 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 2054 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2055 | reply.writeNoException(); |
| 2056 | reply.writeInt(res ? 1 : 0); |
| 2057 | return true; |
| 2058 | } |
| 2059 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2060 | case START_ACTIVITIES_TRANSACTION: |
| 2061 | { |
| 2062 | data.enforceInterface(IActivityManager.descriptor); |
| 2063 | IBinder b = data.readStrongBinder(); |
| 2064 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2065 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2066 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 2067 | String[] resolvedTypes = data.createStringArray(); |
| 2068 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2069 | Bundle options = data.readInt() != 0 |
| 2070 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2071 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2072 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2073 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2074 | reply.writeNoException(); |
| 2075 | reply.writeInt(result); |
| 2076 | return true; |
| 2077 | } |
| 2078 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2079 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2080 | { |
| 2081 | data.enforceInterface(IActivityManager.descriptor); |
| 2082 | int mode = getFrontActivityScreenCompatMode(); |
| 2083 | reply.writeNoException(); |
| 2084 | reply.writeInt(mode); |
| 2085 | return true; |
| 2086 | } |
| 2087 | |
| 2088 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2089 | { |
| 2090 | data.enforceInterface(IActivityManager.descriptor); |
| 2091 | int mode = data.readInt(); |
| 2092 | setFrontActivityScreenCompatMode(mode); |
| 2093 | reply.writeNoException(); |
| 2094 | reply.writeInt(mode); |
| 2095 | return true; |
| 2096 | } |
| 2097 | |
| 2098 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2099 | { |
| 2100 | data.enforceInterface(IActivityManager.descriptor); |
| 2101 | String pkg = data.readString(); |
| 2102 | int mode = getPackageScreenCompatMode(pkg); |
| 2103 | reply.writeNoException(); |
| 2104 | reply.writeInt(mode); |
| 2105 | return true; |
| 2106 | } |
| 2107 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2108 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2109 | { |
| 2110 | data.enforceInterface(IActivityManager.descriptor); |
| 2111 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2112 | int mode = data.readInt(); |
| 2113 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2114 | reply.writeNoException(); |
| 2115 | return true; |
| 2116 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2117 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2118 | case SWITCH_USER_TRANSACTION: { |
| 2119 | data.enforceInterface(IActivityManager.descriptor); |
| 2120 | int userid = data.readInt(); |
| 2121 | boolean result = switchUser(userid); |
| 2122 | reply.writeNoException(); |
| 2123 | reply.writeInt(result ? 1 : 0); |
| 2124 | return true; |
| 2125 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2126 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 2127 | case START_USER_IN_BACKGROUND_TRANSACTION: { |
| 2128 | data.enforceInterface(IActivityManager.descriptor); |
| 2129 | int userid = data.readInt(); |
| 2130 | boolean result = startUserInBackground(userid); |
| 2131 | reply.writeNoException(); |
| 2132 | reply.writeInt(result ? 1 : 0); |
| 2133 | return true; |
| 2134 | } |
| 2135 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2136 | case UNLOCK_USER_TRANSACTION: { |
| 2137 | data.enforceInterface(IActivityManager.descriptor); |
| 2138 | int userId = data.readInt(); |
| 2139 | byte[] token = data.createByteArray(); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 2140 | byte[] secret = data.createByteArray(); |
Jeff Sharkey | bd91e2f | 2016-03-22 15:32:31 -0600 | [diff] [blame] | 2141 | IProgressListener listener = IProgressListener.Stub |
| 2142 | .asInterface(data.readStrongBinder()); |
| 2143 | boolean result = unlockUser(userId, token, secret, listener); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2144 | reply.writeNoException(); |
| 2145 | reply.writeInt(result ? 1 : 0); |
| 2146 | return true; |
| 2147 | } |
| 2148 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2149 | case STOP_USER_TRANSACTION: { |
| 2150 | data.enforceInterface(IActivityManager.descriptor); |
| 2151 | int userid = data.readInt(); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2152 | boolean force = data.readInt() != 0; |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2153 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 2154 | data.readStrongBinder()); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2155 | int result = stopUser(userid, force, callback); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2156 | reply.writeNoException(); |
| 2157 | reply.writeInt(result); |
| 2158 | return true; |
| 2159 | } |
| 2160 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2161 | case GET_CURRENT_USER_TRANSACTION: { |
| 2162 | data.enforceInterface(IActivityManager.descriptor); |
| 2163 | UserInfo userInfo = getCurrentUser(); |
| 2164 | reply.writeNoException(); |
| 2165 | userInfo.writeToParcel(reply, 0); |
| 2166 | return true; |
| 2167 | } |
| 2168 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2169 | case IS_USER_RUNNING_TRANSACTION: { |
| 2170 | data.enforceInterface(IActivityManager.descriptor); |
| 2171 | int userid = data.readInt(); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 2172 | int _flags = data.readInt(); |
| 2173 | boolean result = isUserRunning(userid, _flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2174 | reply.writeNoException(); |
| 2175 | reply.writeInt(result ? 1 : 0); |
| 2176 | return true; |
| 2177 | } |
| 2178 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 2179 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 2180 | data.enforceInterface(IActivityManager.descriptor); |
| 2181 | int[] result = getRunningUserIds(); |
| 2182 | reply.writeNoException(); |
| 2183 | reply.writeIntArray(result); |
| 2184 | return true; |
| 2185 | } |
| 2186 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2187 | case REMOVE_TASK_TRANSACTION: |
| 2188 | { |
| 2189 | data.enforceInterface(IActivityManager.descriptor); |
| 2190 | int taskId = data.readInt(); |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 2191 | boolean result = removeTask(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2192 | reply.writeNoException(); |
| 2193 | reply.writeInt(result ? 1 : 0); |
| 2194 | return true; |
| 2195 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2196 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 2197 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2198 | data.enforceInterface(IActivityManager.descriptor); |
| 2199 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2200 | data.readStrongBinder()); |
| 2201 | registerProcessObserver(observer); |
| 2202 | return true; |
| 2203 | } |
| 2204 | |
| 2205 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2206 | data.enforceInterface(IActivityManager.descriptor); |
| 2207 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2208 | data.readStrongBinder()); |
| 2209 | unregisterProcessObserver(observer); |
| 2210 | return true; |
| 2211 | } |
| 2212 | |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2213 | case REGISTER_UID_OBSERVER_TRANSACTION: { |
| 2214 | data.enforceInterface(IActivityManager.descriptor); |
| 2215 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2216 | data.readStrongBinder()); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2217 | int which = data.readInt(); |
| 2218 | registerUidObserver(observer, which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2219 | return true; |
| 2220 | } |
| 2221 | |
| 2222 | case UNREGISTER_UID_OBSERVER_TRANSACTION: { |
| 2223 | data.enforceInterface(IActivityManager.descriptor); |
| 2224 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2225 | data.readStrongBinder()); |
| 2226 | unregisterUidObserver(observer); |
| 2227 | return true; |
| 2228 | } |
| 2229 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 2230 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2231 | { |
| 2232 | data.enforceInterface(IActivityManager.descriptor); |
| 2233 | String pkg = data.readString(); |
| 2234 | boolean ask = getPackageAskScreenCompat(pkg); |
| 2235 | reply.writeNoException(); |
| 2236 | reply.writeInt(ask ? 1 : 0); |
| 2237 | return true; |
| 2238 | } |
| 2239 | |
| 2240 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2241 | { |
| 2242 | data.enforceInterface(IActivityManager.descriptor); |
| 2243 | String pkg = data.readString(); |
| 2244 | boolean ask = data.readInt() != 0; |
| 2245 | setPackageAskScreenCompat(pkg, ask); |
| 2246 | reply.writeNoException(); |
| 2247 | return true; |
| 2248 | } |
| 2249 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2250 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 2251 | data.enforceInterface(IActivityManager.descriptor); |
| 2252 | IIntentSender r = IIntentSender.Stub.asInterface( |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2253 | data.readStrongBinder()); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2254 | boolean res = isIntentSenderTargetedToPackage(r); |
| 2255 | reply.writeNoException(); |
| 2256 | reply.writeInt(res ? 1 : 0); |
| 2257 | return true; |
| 2258 | } |
| 2259 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 2260 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 2261 | data.enforceInterface(IActivityManager.descriptor); |
| 2262 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2263 | data.readStrongBinder()); |
| 2264 | boolean res = isIntentSenderAnActivity(r); |
| 2265 | reply.writeNoException(); |
| 2266 | reply.writeInt(res ? 1 : 0); |
| 2267 | return true; |
| 2268 | } |
| 2269 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 2270 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 2271 | data.enforceInterface(IActivityManager.descriptor); |
| 2272 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2273 | data.readStrongBinder()); |
| 2274 | Intent intent = getIntentForIntentSender(r); |
| 2275 | reply.writeNoException(); |
| 2276 | if (intent != null) { |
| 2277 | reply.writeInt(1); |
| 2278 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2279 | } else { |
| 2280 | reply.writeInt(0); |
| 2281 | } |
| 2282 | return true; |
| 2283 | } |
| 2284 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 2285 | case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { |
| 2286 | data.enforceInterface(IActivityManager.descriptor); |
| 2287 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2288 | data.readStrongBinder()); |
| 2289 | String prefix = data.readString(); |
| 2290 | String tag = getTagForIntentSender(r, prefix); |
| 2291 | reply.writeNoException(); |
| 2292 | reply.writeString(tag); |
| 2293 | return true; |
| 2294 | } |
| 2295 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2296 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 2297 | data.enforceInterface(IActivityManager.descriptor); |
| 2298 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 2299 | updatePersistentConfiguration(config); |
| 2300 | reply.writeNoException(); |
| 2301 | return true; |
| 2302 | } |
| 2303 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 2304 | case GET_PROCESS_PSS_TRANSACTION: { |
| 2305 | data.enforceInterface(IActivityManager.descriptor); |
| 2306 | int[] pids = data.createIntArray(); |
| 2307 | long[] pss = getProcessPss(pids); |
| 2308 | reply.writeNoException(); |
| 2309 | reply.writeLongArray(pss); |
| 2310 | return true; |
| 2311 | } |
| 2312 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 2313 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 2314 | data.enforceInterface(IActivityManager.descriptor); |
| 2315 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 2316 | boolean always = data.readInt() != 0; |
| 2317 | showBootMessage(msg, always); |
| 2318 | reply.writeNoException(); |
| 2319 | return true; |
| 2320 | } |
| 2321 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2322 | case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2323 | data.enforceInterface(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2324 | keyguardWaitingForActivityDrawn(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2325 | reply.writeNoException(); |
| 2326 | return true; |
| 2327 | } |
| 2328 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2329 | case KEYGUARD_GOING_AWAY_TRANSACTION: { |
| 2330 | data.enforceInterface(IActivityManager.descriptor); |
Adrian Roos | d5c2db6 | 2016-03-08 16:11:31 -0800 | [diff] [blame] | 2331 | keyguardGoingAway(data.readInt()); |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2332 | reply.writeNoException(); |
| 2333 | return true; |
| 2334 | } |
| 2335 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2336 | case SHOULD_UP_RECREATE_TASK_TRANSACTION: { |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2337 | data.enforceInterface(IActivityManager.descriptor); |
| 2338 | IBinder token = data.readStrongBinder(); |
| 2339 | String destAffinity = data.readString(); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2340 | boolean res = shouldUpRecreateTask(token, destAffinity); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2341 | reply.writeNoException(); |
| 2342 | reply.writeInt(res ? 1 : 0); |
| 2343 | return true; |
| 2344 | } |
| 2345 | |
| 2346 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 2347 | data.enforceInterface(IActivityManager.descriptor); |
| 2348 | IBinder token = data.readStrongBinder(); |
| 2349 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 2350 | int resultCode = data.readInt(); |
| 2351 | Intent resultData = null; |
| 2352 | if (data.readInt() != 0) { |
| 2353 | resultData = Intent.CREATOR.createFromParcel(data); |
| 2354 | } |
| 2355 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 2356 | reply.writeNoException(); |
| 2357 | reply.writeInt(res ? 1 : 0); |
| 2358 | return true; |
| 2359 | } |
| 2360 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 2361 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 2362 | data.enforceInterface(IActivityManager.descriptor); |
| 2363 | IBinder token = data.readStrongBinder(); |
| 2364 | int res = getLaunchedFromUid(token); |
| 2365 | reply.writeNoException(); |
| 2366 | reply.writeInt(res); |
| 2367 | return true; |
| 2368 | } |
| 2369 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2370 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 2371 | data.enforceInterface(IActivityManager.descriptor); |
| 2372 | IBinder token = data.readStrongBinder(); |
| 2373 | String res = getLaunchedFromPackage(token); |
| 2374 | reply.writeNoException(); |
| 2375 | reply.writeString(res); |
| 2376 | return true; |
| 2377 | } |
| 2378 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2379 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2380 | data.enforceInterface(IActivityManager.descriptor); |
| 2381 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2382 | data.readStrongBinder()); |
Fyodor Kupolov | 0b77ef9 | 2016-06-20 17:16:52 -0700 | [diff] [blame] | 2383 | String name = data.readString(); |
| 2384 | registerUserSwitchObserver(observer, name); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2385 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2386 | return true; |
| 2387 | } |
| 2388 | |
| 2389 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2390 | data.enforceInterface(IActivityManager.descriptor); |
| 2391 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2392 | data.readStrongBinder()); |
| 2393 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2394 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2395 | return true; |
| 2396 | } |
| 2397 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2398 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 2399 | data.enforceInterface(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 2400 | int bugreportType = data.readInt(); |
| 2401 | requestBugReport(bugreportType); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2402 | reply.writeNoException(); |
| 2403 | return true; |
| 2404 | } |
| 2405 | |
| 2406 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 2407 | data.enforceInterface(IActivityManager.descriptor); |
| 2408 | int pid = data.readInt(); |
| 2409 | boolean aboveSystem = data.readInt() != 0; |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 2410 | String reason = data.readString(); |
| 2411 | long res = inputDispatchingTimedOut(pid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2412 | reply.writeNoException(); |
| 2413 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2414 | return true; |
| 2415 | } |
| 2416 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2417 | case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2418 | data.enforceInterface(IActivityManager.descriptor); |
| 2419 | int requestType = data.readInt(); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2420 | Bundle res = getAssistContextExtras(requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2421 | reply.writeNoException(); |
| 2422 | reply.writeBundle(res); |
| 2423 | return true; |
| 2424 | } |
| 2425 | |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2426 | case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
| 2427 | data.enforceInterface(IActivityManager.descriptor); |
| 2428 | int requestType = data.readInt(); |
| 2429 | IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder()); |
Amith Yamasani | e8222e5 | 2016-04-08 15:28:47 -0700 | [diff] [blame] | 2430 | Bundle receiverExtras = data.readBundle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2431 | IBinder activityToken = data.readStrongBinder(); |
Amith Yamasani | e8222e5 | 2016-04-08 15:28:47 -0700 | [diff] [blame] | 2432 | boolean focused = data.readInt() == 1; |
Amith Yamasani | 4f128e4 | 2016-05-10 11:44:12 -0700 | [diff] [blame] | 2433 | boolean newSessionId = data.readInt() == 1; |
Amith Yamasani | e8222e5 | 2016-04-08 15:28:47 -0700 | [diff] [blame] | 2434 | boolean res = requestAssistContextExtras(requestType, receiver, receiverExtras, |
Amith Yamasani | 4f128e4 | 2016-05-10 11:44:12 -0700 | [diff] [blame] | 2435 | activityToken, focused, newSessionId); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2436 | reply.writeNoException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2437 | reply.writeInt(res ? 1 : 0); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2438 | return true; |
| 2439 | } |
| 2440 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2441 | case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2442 | data.enforceInterface(IActivityManager.descriptor); |
| 2443 | IBinder token = data.readStrongBinder(); |
| 2444 | Bundle extras = data.readBundle(); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 2445 | AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data); |
| 2446 | AssistContent content = AssistContent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 2447 | Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null; |
| 2448 | reportAssistContextExtras(token, extras, structure, content, referrer); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2449 | reply.writeNoException(); |
| 2450 | return true; |
| 2451 | } |
| 2452 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2453 | case LAUNCH_ASSIST_INTENT_TRANSACTION: { |
| 2454 | data.enforceInterface(IActivityManager.descriptor); |
| 2455 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2456 | int requestType = data.readInt(); |
| 2457 | String hint = data.readString(); |
| 2458 | int userHandle = data.readInt(); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 2459 | Bundle args = data.readBundle(); |
| 2460 | boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2461 | reply.writeNoException(); |
| 2462 | reply.writeInt(res ? 1 : 0); |
| 2463 | return true; |
| 2464 | } |
| 2465 | |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2466 | case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: { |
| 2467 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2468 | boolean res = isAssistDataAllowedOnCurrentActivity(); |
| 2469 | reply.writeNoException(); |
| 2470 | reply.writeInt(res ? 1 : 0); |
| 2471 | return true; |
| 2472 | } |
| 2473 | |
| 2474 | case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: { |
| 2475 | data.enforceInterface(IActivityManager.descriptor); |
| 2476 | IBinder token = data.readStrongBinder(); |
| 2477 | Bundle args = data.readBundle(); |
| 2478 | boolean res = showAssistFromActivity(token, args); |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2479 | reply.writeNoException(); |
| 2480 | reply.writeInt(res ? 1 : 0); |
| 2481 | return true; |
| 2482 | } |
| 2483 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2484 | case KILL_UID_TRANSACTION: { |
| 2485 | data.enforceInterface(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2486 | int appId = data.readInt(); |
| 2487 | int userId = data.readInt(); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2488 | String reason = data.readString(); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2489 | killUid(appId, userId, reason); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2490 | reply.writeNoException(); |
| 2491 | return true; |
| 2492 | } |
| 2493 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2494 | case HANG_TRANSACTION: { |
| 2495 | data.enforceInterface(IActivityManager.descriptor); |
| 2496 | IBinder who = data.readStrongBinder(); |
| 2497 | boolean allowRestart = data.readInt() != 0; |
| 2498 | hang(who, allowRestart); |
| 2499 | reply.writeNoException(); |
| 2500 | return true; |
| 2501 | } |
| 2502 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2503 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2504 | data.enforceInterface(IActivityManager.descriptor); |
| 2505 | IBinder token = data.readStrongBinder(); |
| 2506 | reportActivityFullyDrawn(token); |
| 2507 | reply.writeNoException(); |
| 2508 | return true; |
| 2509 | } |
| 2510 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2511 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2512 | data.enforceInterface(IActivityManager.descriptor); |
| 2513 | IBinder token = data.readStrongBinder(); |
| 2514 | notifyActivityDrawn(token); |
| 2515 | reply.writeNoException(); |
| 2516 | return true; |
| 2517 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2518 | |
| 2519 | case RESTART_TRANSACTION: { |
| 2520 | data.enforceInterface(IActivityManager.descriptor); |
| 2521 | restart(); |
| 2522 | reply.writeNoException(); |
| 2523 | return true; |
| 2524 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2525 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2526 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2527 | data.enforceInterface(IActivityManager.descriptor); |
| 2528 | performIdleMaintenance(); |
| 2529 | reply.writeNoException(); |
| 2530 | return true; |
| 2531 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2532 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2533 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2534 | data.enforceInterface(IActivityManager.descriptor); |
| 2535 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2536 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2537 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2538 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2539 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2540 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2541 | if (activityContainer != null) { |
| 2542 | reply.writeInt(1); |
| 2543 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2544 | } else { |
| 2545 | reply.writeInt(0); |
| 2546 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2547 | return true; |
| 2548 | } |
| 2549 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2550 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2551 | data.enforceInterface(IActivityManager.descriptor); |
| 2552 | IActivityContainer activityContainer = |
| 2553 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2554 | deleteActivityContainer(activityContainer); |
| 2555 | reply.writeNoException(); |
| 2556 | return true; |
| 2557 | } |
| 2558 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2559 | case CREATE_STACK_ON_DISPLAY: { |
| 2560 | data.enforceInterface(IActivityManager.descriptor); |
| 2561 | int displayId = data.readInt(); |
| 2562 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2563 | reply.writeNoException(); |
| 2564 | if (activityContainer != null) { |
| 2565 | reply.writeInt(1); |
| 2566 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2567 | } else { |
| 2568 | reply.writeInt(0); |
| 2569 | } |
| 2570 | return true; |
| 2571 | } |
| 2572 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2573 | case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: { |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2574 | data.enforceInterface(IActivityManager.descriptor); |
| 2575 | IBinder activityToken = data.readStrongBinder(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2576 | int displayId = getActivityDisplayId(activityToken); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2577 | reply.writeNoException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2578 | reply.writeInt(displayId); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2579 | return true; |
| 2580 | } |
| 2581 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2582 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2583 | data.enforceInterface(IActivityManager.descriptor); |
| 2584 | final int taskId = data.readInt(); |
| 2585 | startLockTaskMode(taskId); |
| 2586 | reply.writeNoException(); |
| 2587 | return true; |
| 2588 | } |
| 2589 | |
| 2590 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2591 | data.enforceInterface(IActivityManager.descriptor); |
| 2592 | IBinder token = data.readStrongBinder(); |
| 2593 | startLockTaskMode(token); |
| 2594 | reply.writeNoException(); |
| 2595 | return true; |
| 2596 | } |
| 2597 | |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 2598 | case START_SYSTEM_LOCK_TASK_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2599 | data.enforceInterface(IActivityManager.descriptor); |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 2600 | int taskId = data.readInt(); |
| 2601 | startSystemLockTaskMode(taskId); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2602 | reply.writeNoException(); |
| 2603 | return true; |
| 2604 | } |
| 2605 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2606 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2607 | data.enforceInterface(IActivityManager.descriptor); |
| 2608 | stopLockTaskMode(); |
| 2609 | reply.writeNoException(); |
| 2610 | return true; |
| 2611 | } |
| 2612 | |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 2613 | case STOP_SYSTEM_LOCK_TASK_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2614 | data.enforceInterface(IActivityManager.descriptor); |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 2615 | stopSystemLockTaskMode(); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2616 | reply.writeNoException(); |
| 2617 | return true; |
| 2618 | } |
| 2619 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2620 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2621 | data.enforceInterface(IActivityManager.descriptor); |
| 2622 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2623 | reply.writeNoException(); |
| 2624 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2625 | return true; |
| 2626 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2627 | |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 2628 | case GET_LOCK_TASK_MODE_STATE_TRANSACTION: { |
| 2629 | data.enforceInterface(IActivityManager.descriptor); |
| 2630 | final int lockTaskModeState = getLockTaskModeState(); |
| 2631 | reply.writeNoException(); |
| 2632 | reply.writeInt(lockTaskModeState); |
| 2633 | return true; |
| 2634 | } |
| 2635 | |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 2636 | case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: { |
| 2637 | data.enforceInterface(IActivityManager.descriptor); |
| 2638 | final IBinder token = data.readStrongBinder(); |
| 2639 | showLockTaskEscapeMessage(token); |
| 2640 | reply.writeNoException(); |
| 2641 | return true; |
| 2642 | } |
| 2643 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2644 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2645 | data.enforceInterface(IActivityManager.descriptor); |
| 2646 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2647 | ActivityManager.TaskDescription values = |
| 2648 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2649 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2650 | reply.writeNoException(); |
| 2651 | return true; |
| 2652 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2653 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2654 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2655 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 2656 | final int taskId = data.readInt(); |
| 2657 | final int resizeableMode = data.readInt(); |
| 2658 | setTaskResizeable(taskId, resizeableMode); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2659 | reply.writeNoException(); |
| 2660 | return true; |
| 2661 | } |
| 2662 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2663 | case RESIZE_TASK_TRANSACTION: { |
| 2664 | data.enforceInterface(IActivityManager.descriptor); |
| 2665 | int taskId = data.readInt(); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2666 | int resizeMode = data.readInt(); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2667 | Rect r = Rect.CREATOR.createFromParcel(data); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2668 | resizeTask(taskId, r, resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2669 | reply.writeNoException(); |
| 2670 | return true; |
| 2671 | } |
| 2672 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 2673 | case GET_TASK_BOUNDS_TRANSACTION: { |
| 2674 | data.enforceInterface(IActivityManager.descriptor); |
| 2675 | int taskId = data.readInt(); |
| 2676 | Rect r = getTaskBounds(taskId); |
| 2677 | reply.writeNoException(); |
| 2678 | r.writeToParcel(reply, 0); |
| 2679 | return true; |
| 2680 | } |
| 2681 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2682 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2683 | data.enforceInterface(IActivityManager.descriptor); |
| 2684 | String filename = data.readString(); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 2685 | int userId = data.readInt(); |
| 2686 | Bitmap icon = getTaskDescriptionIcon(filename, userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2687 | reply.writeNoException(); |
| 2688 | if (icon == null) { |
| 2689 | reply.writeInt(0); |
| 2690 | } else { |
| 2691 | reply.writeInt(1); |
| 2692 | icon.writeToParcel(reply, 0); |
| 2693 | } |
| 2694 | return true; |
| 2695 | } |
| 2696 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2697 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2698 | data.enforceInterface(IActivityManager.descriptor); |
| 2699 | final Bundle bundle; |
| 2700 | if (data.readInt() == 0) { |
| 2701 | bundle = null; |
| 2702 | } else { |
| 2703 | bundle = data.readBundle(); |
| 2704 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 2705 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2706 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2707 | reply.writeNoException(); |
| 2708 | return true; |
| 2709 | } |
| 2710 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2711 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2712 | data.enforceInterface(IActivityManager.descriptor); |
| 2713 | IBinder token = data.readStrongBinder(); |
| 2714 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2715 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2716 | reply.writeNoException(); |
| 2717 | reply.writeInt(success ? 1 : 0); |
| 2718 | return true; |
| 2719 | } |
| 2720 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2721 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2722 | data.enforceInterface(IActivityManager.descriptor); |
| 2723 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2724 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2725 | reply.writeNoException(); |
| 2726 | reply.writeInt(enabled ? 1 : 0); |
| 2727 | return true; |
| 2728 | } |
| 2729 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2730 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2731 | data.enforceInterface(IActivityManager.descriptor); |
| 2732 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2733 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2734 | reply.writeNoException(); |
| 2735 | return true; |
| 2736 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2737 | |
| 2738 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2739 | data.enforceInterface(IActivityManager.descriptor); |
| 2740 | IBinder token = data.readStrongBinder(); |
| 2741 | notifyLaunchTaskBehindComplete(token); |
| 2742 | reply.writeNoException(); |
| 2743 | return true; |
| 2744 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2745 | |
| 2746 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2747 | data.enforceInterface(IActivityManager.descriptor); |
| 2748 | IBinder token = data.readStrongBinder(); |
| 2749 | notifyEnterAnimationComplete(token); |
| 2750 | reply.writeNoException(); |
| 2751 | return true; |
| 2752 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2753 | |
| 2754 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2755 | data.enforceInterface(IActivityManager.descriptor); |
| 2756 | bootAnimationComplete(); |
| 2757 | reply.writeNoException(); |
| 2758 | return true; |
| 2759 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2760 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2761 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2762 | data.enforceInterface(IActivityManager.descriptor); |
| 2763 | final int uid = data.readInt(); |
| 2764 | final byte[] firstPacket = data.createByteArray(); |
| 2765 | notifyCleartextNetwork(uid, firstPacket); |
| 2766 | reply.writeNoException(); |
| 2767 | return true; |
| 2768 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2769 | |
| 2770 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2771 | data.enforceInterface(IActivityManager.descriptor); |
| 2772 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2773 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2774 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2775 | String reportPackage = data.readString(); |
| 2776 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2777 | reply.writeNoException(); |
| 2778 | return true; |
| 2779 | } |
| 2780 | |
| 2781 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2782 | data.enforceInterface(IActivityManager.descriptor); |
| 2783 | String path = data.readString(); |
| 2784 | dumpHeapFinished(path); |
| 2785 | reply.writeNoException(); |
| 2786 | return true; |
| 2787 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2788 | |
| 2789 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2790 | data.enforceInterface(IActivityManager.descriptor); |
| 2791 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2792 | data.readStrongBinder()); |
| 2793 | boolean keepAwake = data.readInt() != 0; |
| 2794 | setVoiceKeepAwake(session, keepAwake); |
| 2795 | reply.writeNoException(); |
| 2796 | return true; |
| 2797 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2798 | |
| 2799 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2800 | data.enforceInterface(IActivityManager.descriptor); |
| 2801 | int userId = data.readInt(); |
| 2802 | String[] packages = data.readStringArray(); |
| 2803 | updateLockTaskPackages(userId, packages); |
| 2804 | reply.writeNoException(); |
| 2805 | return true; |
| 2806 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2807 | |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 2808 | case UPDATE_DEVICE_OWNER_TRANSACTION: { |
| 2809 | data.enforceInterface(IActivityManager.descriptor); |
| 2810 | String packageName = data.readString(); |
| 2811 | updateDeviceOwner(packageName); |
| 2812 | reply.writeNoException(); |
| 2813 | return true; |
| 2814 | } |
| 2815 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2816 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2817 | data.enforceInterface(IActivityManager.descriptor); |
| 2818 | String pkg = data.readString(); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 2819 | String callingPackage = data.readString(); |
| 2820 | int res = getPackageProcessState(pkg, callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2821 | reply.writeNoException(); |
| 2822 | reply.writeInt(res); |
| 2823 | return true; |
| 2824 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2825 | |
| 2826 | case SET_PROCESS_MEMORY_TRIM_TRANSACTION: { |
| 2827 | data.enforceInterface(IActivityManager.descriptor); |
| 2828 | String process = data.readString(); |
| 2829 | int userId = data.readInt(); |
| 2830 | int level = data.readInt(); |
| 2831 | boolean res = setProcessMemoryTrimLevel(process, userId, level); |
| 2832 | reply.writeNoException(); |
| 2833 | reply.writeInt(res ? 1 : 0); |
| 2834 | return true; |
| 2835 | } |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2836 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 2837 | case IS_ROOT_VOICE_INTERACTION_TRANSACTION: { |
| 2838 | data.enforceInterface(IActivityManager.descriptor); |
| 2839 | IBinder token = data.readStrongBinder(); |
| 2840 | boolean res = isRootVoiceInteraction(token); |
| 2841 | reply.writeNoException(); |
| 2842 | reply.writeInt(res ? 1 : 0); |
| 2843 | return true; |
| 2844 | } |
Ian Pedowitz | a371084 | 2015-08-03 23:36:15 -0700 | [diff] [blame] | 2845 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2846 | case START_BINDER_TRACKING_TRANSACTION: { |
| 2847 | data.enforceInterface(IActivityManager.descriptor); |
| 2848 | boolean res = startBinderTracking(); |
| 2849 | reply.writeNoException(); |
| 2850 | reply.writeInt(res ? 1 : 0); |
| 2851 | return true; |
| 2852 | } |
| 2853 | |
| 2854 | case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: { |
| 2855 | data.enforceInterface(IActivityManager.descriptor); |
| 2856 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 2857 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
| 2858 | boolean res = stopBinderTrackingAndDump(fd); |
| 2859 | reply.writeNoException(); |
| 2860 | reply.writeInt(res ? 1 : 0); |
| 2861 | return true; |
| 2862 | } |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2863 | case GET_ACTIVITY_STACK_ID_TRANSACTION: { |
| 2864 | data.enforceInterface(IActivityManager.descriptor); |
| 2865 | IBinder token = data.readStrongBinder(); |
| 2866 | int stackId = getActivityStackId(token); |
| 2867 | reply.writeNoException(); |
| 2868 | reply.writeInt(stackId); |
| 2869 | return true; |
| 2870 | } |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2871 | case EXIT_FREEFORM_MODE_TRANSACTION: { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2872 | data.enforceInterface(IActivityManager.descriptor); |
| 2873 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2874 | exitFreeformMode(token); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2875 | reply.writeNoException(); |
| 2876 | return true; |
| 2877 | } |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2878 | case REPORT_SIZE_CONFIGURATIONS: { |
| 2879 | data.enforceInterface(IActivityManager.descriptor); |
| 2880 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2881 | int[] horizontal = readIntArray(data); |
| 2882 | int[] vertical = readIntArray(data); |
| 2883 | int[] smallest = readIntArray(data); |
| 2884 | reportSizeConfigurations(token, horizontal, vertical, smallest); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2885 | return true; |
| 2886 | } |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 2887 | case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: { |
| 2888 | data.enforceInterface(IActivityManager.descriptor); |
| 2889 | final boolean suppress = data.readInt() == 1; |
| 2890 | suppressResizeConfigChanges(suppress); |
| 2891 | reply.writeNoException(); |
| 2892 | return true; |
| 2893 | } |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 2894 | case MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION: { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2895 | data.enforceInterface(IActivityManager.descriptor); |
| 2896 | final int stackId = data.readInt(); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 2897 | final boolean onTop = data.readInt() == 1; |
| 2898 | moveTasksToFullscreenStack(stackId, onTop); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2899 | reply.writeNoException(); |
| 2900 | return true; |
| 2901 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2902 | case GET_APP_START_MODE_TRANSACTION: { |
| 2903 | data.enforceInterface(IActivityManager.descriptor); |
| 2904 | final int uid = data.readInt(); |
| 2905 | final String pkg = data.readString(); |
| 2906 | int res = getAppStartMode(uid, pkg); |
| 2907 | reply.writeNoException(); |
| 2908 | reply.writeInt(res); |
| 2909 | return true; |
| 2910 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2911 | case IN_MULTI_WINDOW_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2912 | data.enforceInterface(IActivityManager.descriptor); |
| 2913 | final IBinder token = data.readStrongBinder(); |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 2914 | final boolean inMultiWindow = isInMultiWindowMode(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2915 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2916 | reply.writeInt(inMultiWindow ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2917 | return true; |
| 2918 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2919 | case IN_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2920 | data.enforceInterface(IActivityManager.descriptor); |
| 2921 | final IBinder token = data.readStrongBinder(); |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 2922 | final boolean inPip = isInPictureInPictureMode(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2923 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2924 | reply.writeInt(inPip ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2925 | return true; |
| 2926 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2927 | case ENTER_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2928 | data.enforceInterface(IActivityManager.descriptor); |
| 2929 | final IBinder token = data.readStrongBinder(); |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 2930 | enterPictureInPictureMode(token); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2931 | reply.writeNoException(); |
| 2932 | return true; |
| 2933 | } |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2934 | case SET_VR_MODE_TRANSACTION: { |
| 2935 | data.enforceInterface(IActivityManager.descriptor); |
| 2936 | final IBinder token = data.readStrongBinder(); |
| 2937 | final boolean enable = data.readInt() == 1; |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 2938 | final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data); |
| 2939 | int res = setVrMode(token, enable, packageName); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2940 | reply.writeNoException(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 2941 | reply.writeInt(res); |
| 2942 | return true; |
| 2943 | } |
| 2944 | case IS_VR_PACKAGE_ENABLED_TRANSACTION: { |
| 2945 | data.enforceInterface(IActivityManager.descriptor); |
| 2946 | final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data); |
| 2947 | boolean res = isVrModePackageEnabled(packageName); |
| 2948 | reply.writeNoException(); |
| 2949 | reply.writeInt(res ? 1 : 0); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2950 | return true; |
| 2951 | } |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 2952 | case IS_APP_FOREGROUND_TRANSACTION: { |
| 2953 | data.enforceInterface(IActivityManager.descriptor); |
| 2954 | final int userHandle = data.readInt(); |
| 2955 | final boolean isForeground = isAppForeground(userHandle); |
| 2956 | reply.writeNoException(); |
| 2957 | reply.writeInt(isForeground ? 1 : 0); |
| 2958 | return true; |
| 2959 | } |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 2960 | case NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION: { |
| 2961 | data.enforceInterface(IActivityManager.descriptor); |
| 2962 | reply.writeNoException(); |
| 2963 | return true; |
| 2964 | } |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 2965 | case REMOVE_STACK: { |
| 2966 | data.enforceInterface(IActivityManager.descriptor); |
| 2967 | final int stackId = data.readInt(); |
| 2968 | removeStack(stackId); |
| 2969 | reply.writeNoException(); |
| 2970 | return true; |
| 2971 | } |
Tony Mak | 9c6e8ce | 2016-03-21 12:07:16 +0000 | [diff] [blame] | 2972 | case NOTIFY_LOCKED_PROFILE: { |
| 2973 | data.enforceInterface(IActivityManager.descriptor); |
| 2974 | final int userId = data.readInt(); |
| 2975 | notifyLockedProfile(userId); |
| 2976 | reply.writeNoException(); |
| 2977 | return true; |
| 2978 | } |
Tony Mak | 646fe99 | 2016-04-21 16:43:08 +0100 | [diff] [blame] | 2979 | case START_CONFIRM_DEVICE_CREDENTIAL_INTENT: { |
| 2980 | data.enforceInterface(IActivityManager.descriptor); |
| 2981 | final Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2982 | startConfirmDeviceCredentialIntent(intent); |
| 2983 | reply.writeNoException(); |
| 2984 | return true; |
| 2985 | } |
Christopher Tate | 27d92e4 | 2016-05-06 11:25:11 -0700 | [diff] [blame] | 2986 | case SEND_IDLE_JOB_TRIGGER_TRANSACTION: { |
| 2987 | data.enforceInterface(IActivityManager.descriptor); |
| 2988 | sendIdleJobTrigger(); |
| 2989 | reply.writeNoException(); |
| 2990 | return true; |
| 2991 | } |
Dianne Hackborn | 0c4e6a8 | 2016-05-13 17:37:08 -0700 | [diff] [blame] | 2992 | case SEND_INTENT_SENDER_TRANSACTION: { |
| 2993 | data.enforceInterface(IActivityManager.descriptor); |
| 2994 | IIntentSender sender = IIntentSender.Stub.asInterface(data.readStrongBinder()); |
| 2995 | int scode = data.readInt(); |
| 2996 | Intent intent = data.readInt() != 0 ? Intent.CREATOR.createFromParcel(data) : null; |
| 2997 | String resolvedType = data.readString(); |
| 2998 | IIntentReceiver finishedReceiver = IIntentReceiver.Stub.asInterface( |
| 2999 | data.readStrongBinder()); |
| 3000 | String requiredPermission = data.readString(); |
| 3001 | Bundle options = data.readInt() != 0 ? Bundle.CREATOR.createFromParcel(data) : null; |
| 3002 | int result = sendIntentSender(sender, scode, intent, resolvedType, finishedReceiver, |
| 3003 | requiredPermission, options); |
| 3004 | reply.writeNoException(); |
| 3005 | reply.writeInt(result); |
| 3006 | return true; |
| 3007 | } |
Srinath Sridharan | e535a58 | 2016-06-27 18:13:47 -0700 | [diff] [blame] | 3008 | case SET_VR_THREAD_TRANSACTION: { |
| 3009 | data.enforceInterface(IActivityManager.descriptor); |
| 3010 | final int tid = data.readInt(); |
| 3011 | setVrThread(tid); |
| 3012 | reply.writeNoException(); |
| 3013 | return true; |
| 3014 | } |
Tim Murray | 33eb07f | 2016-06-10 10:03:20 -0700 | [diff] [blame] | 3015 | case SET_RENDER_THREAD_TRANSACTION: { |
| 3016 | data.enforceInterface(IActivityManager.descriptor); |
| 3017 | final int tid = data.readInt(); |
| 3018 | setRenderThread(tid); |
| 3019 | reply.writeNoException(); |
| 3020 | return true; |
| 3021 | } |
Jorim Jaggi | f6782ee | 2016-07-22 11:40:00 +0200 | [diff] [blame] | 3022 | case SET_HAS_TOP_UI: { |
| 3023 | data.enforceInterface(IActivityManager.descriptor); |
| 3024 | final boolean hasTopUi = data.readInt() != 0; |
| 3025 | setHasTopUi(hasTopUi); |
| 3026 | reply.writeNoException(); |
| 3027 | return true; |
| 3028 | } |
Rubin Xu | 89927b3 | 2016-07-28 14:34:26 +0100 | [diff] [blame] | 3029 | case CAN_BYPASS_WORK_CHALLENGE: { |
| 3030 | data.enforceInterface(IActivityManager.descriptor); |
| 3031 | final PendingIntent intent = PendingIntent.CREATOR.createFromParcel(data); |
| 3032 | final boolean result = canBypassWorkChallenge(intent); |
| 3033 | reply.writeNoException(); |
| 3034 | reply.writeInt(result ? 1 : 0); |
| 3035 | return true; |
| 3036 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3037 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 3038 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3039 | return super.onTransact(code, data, reply, flags); |
| 3040 | } |
| 3041 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 3042 | private int[] readIntArray(Parcel data) { |
| 3043 | int[] smallest = null; |
| 3044 | int smallestSize = data.readInt(); |
| 3045 | if (smallestSize > 0) { |
| 3046 | smallest = new int[smallestSize]; |
| 3047 | data.readIntArray(smallest); |
| 3048 | } |
| 3049 | return smallest; |
| 3050 | } |
| 3051 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 3052 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3053 | return this; |
| 3054 | } |
| 3055 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 3056 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 3057 | protected IActivityManager create() { |
| 3058 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 3059 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 3060 | Log.v("ActivityManager", "default service binder = " + b); |
| 3061 | } |
| 3062 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 3063 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 3064 | Log.v("ActivityManager", "default service = " + am); |
| 3065 | } |
| 3066 | return am; |
| 3067 | } |
| 3068 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3069 | } |
| 3070 | |
| 3071 | class ActivityManagerProxy implements IActivityManager |
| 3072 | { |
| 3073 | public ActivityManagerProxy(IBinder remote) |
| 3074 | { |
| 3075 | mRemote = remote; |
| 3076 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 3077 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3078 | public IBinder asBinder() |
| 3079 | { |
| 3080 | return mRemote; |
| 3081 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 3082 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3083 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3084 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3085 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3086 | Parcel data = Parcel.obtain(); |
| 3087 | Parcel reply = Parcel.obtain(); |
| 3088 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3089 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3090 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3091 | intent.writeToParcel(data, 0); |
| 3092 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3093 | data.writeStrongBinder(resultTo); |
| 3094 | data.writeString(resultWho); |
| 3095 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3096 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3097 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3098 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3099 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3100 | } else { |
| 3101 | data.writeInt(0); |
| 3102 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3103 | if (options != null) { |
| 3104 | data.writeInt(1); |
| 3105 | options.writeToParcel(data, 0); |
| 3106 | } else { |
| 3107 | data.writeInt(0); |
| 3108 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3109 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3110 | reply.readException(); |
| 3111 | int result = reply.readInt(); |
| 3112 | reply.recycle(); |
| 3113 | data.recycle(); |
| 3114 | return result; |
| 3115 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3116 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3117 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3118 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3119 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3120 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3121 | Parcel data = Parcel.obtain(); |
| 3122 | Parcel reply = Parcel.obtain(); |
| 3123 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3124 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3125 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3126 | intent.writeToParcel(data, 0); |
| 3127 | data.writeString(resolvedType); |
| 3128 | data.writeStrongBinder(resultTo); |
| 3129 | data.writeString(resultWho); |
| 3130 | data.writeInt(requestCode); |
| 3131 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3132 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3133 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3134 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3135 | } else { |
| 3136 | data.writeInt(0); |
| 3137 | } |
| 3138 | if (options != null) { |
| 3139 | data.writeInt(1); |
| 3140 | options.writeToParcel(data, 0); |
| 3141 | } else { |
| 3142 | data.writeInt(0); |
| 3143 | } |
| 3144 | data.writeInt(userId); |
| 3145 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 3146 | reply.readException(); |
| 3147 | int result = reply.readInt(); |
| 3148 | reply.recycle(); |
| 3149 | data.recycle(); |
| 3150 | return result; |
| 3151 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3152 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 3153 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3154 | int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, |
| 3155 | int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3156 | Parcel data = Parcel.obtain(); |
| 3157 | Parcel reply = Parcel.obtain(); |
| 3158 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3159 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3160 | data.writeString(callingPackage); |
| 3161 | intent.writeToParcel(data, 0); |
| 3162 | data.writeString(resolvedType); |
| 3163 | data.writeStrongBinder(resultTo); |
| 3164 | data.writeString(resultWho); |
| 3165 | data.writeInt(requestCode); |
| 3166 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3167 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3168 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3169 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3170 | } else { |
| 3171 | data.writeInt(0); |
| 3172 | } |
| 3173 | if (options != null) { |
| 3174 | data.writeInt(1); |
| 3175 | options.writeToParcel(data, 0); |
| 3176 | } else { |
| 3177 | data.writeInt(0); |
| 3178 | } |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3179 | data.writeInt(ignoreTargetSecurity ? 1 : 0); |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 3180 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3181 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 3182 | reply.readException(); |
| 3183 | int result = reply.readInt(); |
| 3184 | reply.recycle(); |
| 3185 | data.recycle(); |
| 3186 | return result; |
| 3187 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3188 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 3189 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3190 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3191 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3192 | Parcel data = Parcel.obtain(); |
| 3193 | Parcel reply = Parcel.obtain(); |
| 3194 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3195 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3196 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3197 | intent.writeToParcel(data, 0); |
| 3198 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3199 | data.writeStrongBinder(resultTo); |
| 3200 | data.writeString(resultWho); |
| 3201 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3202 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3203 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3204 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3205 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3206 | } else { |
| 3207 | data.writeInt(0); |
| 3208 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3209 | if (options != null) { |
| 3210 | data.writeInt(1); |
| 3211 | options.writeToParcel(data, 0); |
| 3212 | } else { |
| 3213 | data.writeInt(0); |
| 3214 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3215 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3216 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 3217 | reply.readException(); |
| 3218 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 3219 | reply.recycle(); |
| 3220 | data.recycle(); |
| 3221 | return result; |
| 3222 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3223 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 3224 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3225 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3226 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3227 | Parcel data = Parcel.obtain(); |
| 3228 | Parcel reply = Parcel.obtain(); |
| 3229 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3230 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3231 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3232 | intent.writeToParcel(data, 0); |
| 3233 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3234 | data.writeStrongBinder(resultTo); |
| 3235 | data.writeString(resultWho); |
| 3236 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3237 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3238 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3239 | if (options != null) { |
| 3240 | data.writeInt(1); |
| 3241 | options.writeToParcel(data, 0); |
| 3242 | } else { |
| 3243 | data.writeInt(0); |
| 3244 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3245 | data.writeInt(userId); |
Nicolas Prevot | 011aaa1 | 2016-09-14 17:01:53 +0100 | [diff] [blame] | 3246 | mRemote.transact(START_ACTIVITY_WITH_CONFIG_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3247 | reply.readException(); |
| 3248 | int result = reply.readInt(); |
| 3249 | reply.recycle(); |
| 3250 | data.recycle(); |
| 3251 | return result; |
| 3252 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3253 | public int startActivityIntentSender(IApplicationThread caller, |
| 3254 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3255 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3256 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3257 | Parcel data = Parcel.obtain(); |
| 3258 | Parcel reply = Parcel.obtain(); |
| 3259 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3260 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3261 | intent.writeToParcel(data, 0); |
| 3262 | if (fillInIntent != null) { |
| 3263 | data.writeInt(1); |
| 3264 | fillInIntent.writeToParcel(data, 0); |
| 3265 | } else { |
| 3266 | data.writeInt(0); |
| 3267 | } |
| 3268 | data.writeString(resolvedType); |
| 3269 | data.writeStrongBinder(resultTo); |
| 3270 | data.writeString(resultWho); |
| 3271 | data.writeInt(requestCode); |
| 3272 | data.writeInt(flagsMask); |
| 3273 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3274 | if (options != null) { |
| 3275 | data.writeInt(1); |
| 3276 | options.writeToParcel(data, 0); |
| 3277 | } else { |
| 3278 | data.writeInt(0); |
| 3279 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3280 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3281 | reply.readException(); |
| 3282 | int result = reply.readInt(); |
| 3283 | reply.recycle(); |
| 3284 | data.recycle(); |
| 3285 | return result; |
| 3286 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3287 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 3288 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3289 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 3290 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3291 | Parcel data = Parcel.obtain(); |
| 3292 | Parcel reply = Parcel.obtain(); |
| 3293 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3294 | data.writeString(callingPackage); |
| 3295 | data.writeInt(callingPid); |
| 3296 | data.writeInt(callingUid); |
| 3297 | intent.writeToParcel(data, 0); |
| 3298 | data.writeString(resolvedType); |
| 3299 | data.writeStrongBinder(session.asBinder()); |
| 3300 | data.writeStrongBinder(interactor.asBinder()); |
| 3301 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3302 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3303 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3304 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3305 | } else { |
| 3306 | data.writeInt(0); |
| 3307 | } |
| 3308 | if (options != null) { |
| 3309 | data.writeInt(1); |
| 3310 | options.writeToParcel(data, 0); |
| 3311 | } else { |
| 3312 | data.writeInt(0); |
| 3313 | } |
| 3314 | data.writeInt(userId); |
| 3315 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3316 | reply.readException(); |
| 3317 | int result = reply.readInt(); |
| 3318 | reply.recycle(); |
| 3319 | data.recycle(); |
| 3320 | return result; |
| 3321 | } |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 3322 | |
| 3323 | public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options) |
| 3324 | throws RemoteException { |
| 3325 | Parcel data = Parcel.obtain(); |
| 3326 | Parcel reply = Parcel.obtain(); |
| 3327 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3328 | data.writeStrongBinder(callingActivity); |
| 3329 | data.writeBundle(options); |
| 3330 | mRemote.transact(START_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3331 | reply.readException(); |
| 3332 | reply.recycle(); |
| 3333 | data.recycle(); |
| 3334 | } |
| 3335 | |
| 3336 | public void stopLocalVoiceInteraction(IBinder callingActivity) throws RemoteException { |
| 3337 | Parcel data = Parcel.obtain(); |
| 3338 | Parcel reply = Parcel.obtain(); |
| 3339 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3340 | data.writeStrongBinder(callingActivity); |
| 3341 | mRemote.transact(STOP_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3342 | reply.readException(); |
| 3343 | reply.recycle(); |
| 3344 | data.recycle(); |
| 3345 | } |
| 3346 | |
| 3347 | public boolean supportsLocalVoiceInteraction() throws RemoteException { |
| 3348 | Parcel data = Parcel.obtain(); |
| 3349 | Parcel reply = Parcel.obtain(); |
| 3350 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3351 | mRemote.transact(SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3352 | reply.readException(); |
| 3353 | int result = reply.readInt(); |
| 3354 | reply.recycle(); |
| 3355 | data.recycle(); |
| 3356 | return result != 0; |
| 3357 | } |
| 3358 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3359 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3360 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3361 | Parcel data = Parcel.obtain(); |
| 3362 | Parcel reply = Parcel.obtain(); |
| 3363 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3364 | data.writeStrongBinder(callingActivity); |
| 3365 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3366 | if (options != null) { |
| 3367 | data.writeInt(1); |
| 3368 | options.writeToParcel(data, 0); |
| 3369 | } else { |
| 3370 | data.writeInt(0); |
| 3371 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3372 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3373 | reply.readException(); |
| 3374 | int result = reply.readInt(); |
| 3375 | reply.recycle(); |
| 3376 | data.recycle(); |
| 3377 | return result != 0; |
| 3378 | } |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 3379 | public int startActivityFromRecents(int taskId, Bundle options) |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3380 | throws RemoteException { |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3381 | Parcel data = Parcel.obtain(); |
| 3382 | Parcel reply = Parcel.obtain(); |
| 3383 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3384 | data.writeInt(taskId); |
| 3385 | if (options == null) { |
| 3386 | data.writeInt(0); |
| 3387 | } else { |
| 3388 | data.writeInt(1); |
| 3389 | options.writeToParcel(data, 0); |
| 3390 | } |
| 3391 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 3392 | reply.readException(); |
| 3393 | int result = reply.readInt(); |
| 3394 | reply.recycle(); |
| 3395 | data.recycle(); |
| 3396 | return result; |
| 3397 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3398 | public boolean finishActivity(IBinder token, int resultCode, Intent resultData, int finishTask) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3399 | throws RemoteException { |
| 3400 | Parcel data = Parcel.obtain(); |
| 3401 | Parcel reply = Parcel.obtain(); |
| 3402 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3403 | data.writeStrongBinder(token); |
| 3404 | data.writeInt(resultCode); |
| 3405 | if (resultData != null) { |
| 3406 | data.writeInt(1); |
| 3407 | resultData.writeToParcel(data, 0); |
| 3408 | } else { |
| 3409 | data.writeInt(0); |
| 3410 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3411 | data.writeInt(finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3412 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3413 | reply.readException(); |
| 3414 | boolean res = reply.readInt() != 0; |
| 3415 | data.recycle(); |
| 3416 | reply.recycle(); |
| 3417 | return res; |
| 3418 | } |
| 3419 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 3420 | { |
| 3421 | Parcel data = Parcel.obtain(); |
| 3422 | Parcel reply = Parcel.obtain(); |
| 3423 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3424 | data.writeStrongBinder(token); |
| 3425 | data.writeString(resultWho); |
| 3426 | data.writeInt(requestCode); |
| 3427 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3428 | reply.readException(); |
| 3429 | data.recycle(); |
| 3430 | reply.recycle(); |
| 3431 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 3432 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 3433 | Parcel data = Parcel.obtain(); |
| 3434 | Parcel reply = Parcel.obtain(); |
| 3435 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3436 | data.writeStrongBinder(token); |
| 3437 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 3438 | reply.readException(); |
| 3439 | boolean res = reply.readInt() != 0; |
| 3440 | data.recycle(); |
| 3441 | reply.recycle(); |
| 3442 | return res; |
| 3443 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 3444 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 3445 | Parcel data = Parcel.obtain(); |
| 3446 | Parcel reply = Parcel.obtain(); |
| 3447 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3448 | data.writeStrongBinder(session.asBinder()); |
| 3449 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 3450 | reply.readException(); |
| 3451 | data.recycle(); |
| 3452 | reply.recycle(); |
| 3453 | } |
Chong Zhang | fec694e | 2016-08-09 12:57:38 -0700 | [diff] [blame] | 3454 | public void requestActivityRelaunch(IBinder token) throws RemoteException { |
| 3455 | Parcel data = Parcel.obtain(); |
| 3456 | Parcel reply = Parcel.obtain(); |
| 3457 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3458 | data.writeStrongBinder(token); |
| 3459 | mRemote.transact(REQUEST_ACTIVITY_RELAUNCH, data, reply, 0); |
| 3460 | reply.readException(); |
| 3461 | data.recycle(); |
| 3462 | reply.recycle(); |
| 3463 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 3464 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 3465 | Parcel data = Parcel.obtain(); |
| 3466 | Parcel reply = Parcel.obtain(); |
| 3467 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3468 | data.writeStrongBinder(token); |
| 3469 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 3470 | reply.readException(); |
| 3471 | boolean res = reply.readInt() != 0; |
| 3472 | data.recycle(); |
| 3473 | reply.recycle(); |
| 3474 | return res; |
| 3475 | } |
| 3476 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 3477 | Parcel data = Parcel.obtain(); |
| 3478 | Parcel reply = Parcel.obtain(); |
| 3479 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3480 | data.writeStrongBinder(app.asBinder()); |
| 3481 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 3482 | reply.readException(); |
| 3483 | data.recycle(); |
| 3484 | reply.recycle(); |
| 3485 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 3486 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 3487 | Parcel data = Parcel.obtain(); |
| 3488 | Parcel reply = Parcel.obtain(); |
| 3489 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3490 | data.writeStrongBinder(token); |
| 3491 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 3492 | reply.readException(); |
| 3493 | boolean res = reply.readInt() != 0; |
| 3494 | data.recycle(); |
| 3495 | reply.recycle(); |
| 3496 | return res; |
| 3497 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3498 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3499 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3500 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3501 | { |
| 3502 | Parcel data = Parcel.obtain(); |
| 3503 | Parcel reply = Parcel.obtain(); |
| 3504 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3505 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3506 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3507 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 3508 | filter.writeToParcel(data, 0); |
| 3509 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3510 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3511 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3512 | reply.readException(); |
| 3513 | Intent intent = null; |
| 3514 | int haveIntent = reply.readInt(); |
| 3515 | if (haveIntent != 0) { |
| 3516 | intent = Intent.CREATOR.createFromParcel(reply); |
| 3517 | } |
| 3518 | reply.recycle(); |
| 3519 | data.recycle(); |
| 3520 | return intent; |
| 3521 | } |
| 3522 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 3523 | { |
| 3524 | Parcel data = Parcel.obtain(); |
| 3525 | Parcel reply = Parcel.obtain(); |
| 3526 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3527 | data.writeStrongBinder(receiver.asBinder()); |
| 3528 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3529 | reply.readException(); |
| 3530 | data.recycle(); |
| 3531 | reply.recycle(); |
| 3532 | } |
| 3533 | public int broadcastIntent(IApplicationThread caller, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3534 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3535 | int resultCode, String resultData, Bundle map, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3536 | String[] requiredPermissions, int appOp, Bundle options, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3537 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3538 | { |
| 3539 | Parcel data = Parcel.obtain(); |
| 3540 | Parcel reply = Parcel.obtain(); |
| 3541 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3542 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3543 | intent.writeToParcel(data, 0); |
| 3544 | data.writeString(resolvedType); |
| 3545 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 3546 | data.writeInt(resultCode); |
| 3547 | data.writeString(resultData); |
| 3548 | data.writeBundle(map); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3549 | data.writeStringArray(requiredPermissions); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 3550 | data.writeInt(appOp); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3551 | data.writeBundle(options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3552 | data.writeInt(serialized ? 1 : 0); |
| 3553 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3554 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3555 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3556 | reply.readException(); |
| 3557 | int res = reply.readInt(); |
| 3558 | reply.recycle(); |
| 3559 | data.recycle(); |
| 3560 | return res; |
| 3561 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3562 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 3563 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3564 | { |
| 3565 | Parcel data = Parcel.obtain(); |
| 3566 | Parcel reply = Parcel.obtain(); |
| 3567 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3568 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3569 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3570 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3571 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3572 | reply.readException(); |
| 3573 | data.recycle(); |
| 3574 | reply.recycle(); |
| 3575 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3576 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 3577 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3578 | { |
| 3579 | Parcel data = Parcel.obtain(); |
| 3580 | Parcel reply = Parcel.obtain(); |
| 3581 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3582 | data.writeStrongBinder(who); |
| 3583 | data.writeInt(resultCode); |
| 3584 | data.writeString(resultData); |
| 3585 | data.writeBundle(map); |
| 3586 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3587 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3588 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3589 | reply.readException(); |
| 3590 | data.recycle(); |
| 3591 | reply.recycle(); |
| 3592 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3593 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3594 | { |
| 3595 | Parcel data = Parcel.obtain(); |
| 3596 | Parcel reply = Parcel.obtain(); |
| 3597 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3598 | data.writeStrongBinder(app.asBinder()); |
| 3599 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3600 | reply.readException(); |
| 3601 | data.recycle(); |
| 3602 | reply.recycle(); |
| 3603 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3604 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3605 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3606 | { |
| 3607 | Parcel data = Parcel.obtain(); |
| 3608 | Parcel reply = Parcel.obtain(); |
| 3609 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3610 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3611 | if (config != null) { |
| 3612 | data.writeInt(1); |
| 3613 | config.writeToParcel(data, 0); |
| 3614 | } else { |
| 3615 | data.writeInt(0); |
| 3616 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3617 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3618 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3619 | reply.readException(); |
| 3620 | data.recycle(); |
| 3621 | reply.recycle(); |
| 3622 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3623 | public void activityResumed(IBinder token) throws RemoteException |
| 3624 | { |
| 3625 | Parcel data = Parcel.obtain(); |
| 3626 | Parcel reply = Parcel.obtain(); |
| 3627 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3628 | data.writeStrongBinder(token); |
| 3629 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3630 | reply.readException(); |
| 3631 | data.recycle(); |
| 3632 | reply.recycle(); |
| 3633 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3634 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3635 | { |
| 3636 | Parcel data = Parcel.obtain(); |
| 3637 | Parcel reply = Parcel.obtain(); |
| 3638 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3639 | data.writeStrongBinder(token); |
| 3640 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3641 | reply.readException(); |
| 3642 | data.recycle(); |
| 3643 | reply.recycle(); |
| 3644 | } |
| 3645 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3646 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3647 | { |
| 3648 | Parcel data = Parcel.obtain(); |
| 3649 | Parcel reply = Parcel.obtain(); |
| 3650 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3651 | data.writeStrongBinder(token); |
| 3652 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3653 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3654 | TextUtils.writeToParcel(description, data, 0); |
| 3655 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3656 | reply.readException(); |
| 3657 | data.recycle(); |
| 3658 | reply.recycle(); |
| 3659 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3660 | public void activitySlept(IBinder token) throws RemoteException |
| 3661 | { |
| 3662 | Parcel data = Parcel.obtain(); |
| 3663 | Parcel reply = Parcel.obtain(); |
| 3664 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3665 | data.writeStrongBinder(token); |
| 3666 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3667 | reply.readException(); |
| 3668 | data.recycle(); |
| 3669 | reply.recycle(); |
| 3670 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3671 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3672 | { |
| 3673 | Parcel data = Parcel.obtain(); |
| 3674 | Parcel reply = Parcel.obtain(); |
| 3675 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3676 | data.writeStrongBinder(token); |
| 3677 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3678 | reply.readException(); |
| 3679 | data.recycle(); |
| 3680 | reply.recycle(); |
| 3681 | } |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 3682 | public void activityRelaunched(IBinder token) throws RemoteException |
| 3683 | { |
| 3684 | Parcel data = Parcel.obtain(); |
| 3685 | Parcel reply = Parcel.obtain(); |
| 3686 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3687 | data.writeStrongBinder(token); |
| 3688 | mRemote.transact(ACTIVITY_RELAUNCHED_TRANSACTION, data, reply, 0); |
| 3689 | reply.readException(); |
| 3690 | data.recycle(); |
| 3691 | reply.recycle(); |
| 3692 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3693 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3694 | { |
| 3695 | Parcel data = Parcel.obtain(); |
| 3696 | Parcel reply = Parcel.obtain(); |
| 3697 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3698 | data.writeStrongBinder(token); |
| 3699 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3700 | reply.readException(); |
| 3701 | String res = reply.readString(); |
| 3702 | data.recycle(); |
| 3703 | reply.recycle(); |
| 3704 | return res; |
| 3705 | } |
| 3706 | public ComponentName getCallingActivity(IBinder token) |
| 3707 | throws RemoteException { |
| 3708 | Parcel data = Parcel.obtain(); |
| 3709 | Parcel reply = Parcel.obtain(); |
| 3710 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3711 | data.writeStrongBinder(token); |
| 3712 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3713 | reply.readException(); |
| 3714 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3715 | data.recycle(); |
| 3716 | reply.recycle(); |
| 3717 | return res; |
| 3718 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3719 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3720 | Parcel data = Parcel.obtain(); |
| 3721 | Parcel reply = Parcel.obtain(); |
| 3722 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3723 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3724 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3725 | reply.readException(); |
| 3726 | ArrayList<IAppTask> list = null; |
| 3727 | int N = reply.readInt(); |
| 3728 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3729 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3730 | while (N > 0) { |
| 3731 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3732 | list.add(task); |
| 3733 | N--; |
| 3734 | } |
| 3735 | } |
| 3736 | data.recycle(); |
| 3737 | reply.recycle(); |
| 3738 | return list; |
| 3739 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3740 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3741 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3742 | Parcel data = Parcel.obtain(); |
| 3743 | Parcel reply = Parcel.obtain(); |
| 3744 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3745 | data.writeStrongBinder(activityToken); |
| 3746 | intent.writeToParcel(data, 0); |
| 3747 | description.writeToParcel(data, 0); |
| 3748 | thumbnail.writeToParcel(data, 0); |
| 3749 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3750 | reply.readException(); |
| 3751 | int res = reply.readInt(); |
| 3752 | data.recycle(); |
| 3753 | reply.recycle(); |
| 3754 | return res; |
| 3755 | } |
| 3756 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3757 | Parcel data = Parcel.obtain(); |
| 3758 | Parcel reply = Parcel.obtain(); |
| 3759 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3760 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3761 | reply.readException(); |
| 3762 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3763 | data.recycle(); |
| 3764 | reply.recycle(); |
| 3765 | return size; |
| 3766 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3767 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3768 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3769 | Parcel data = Parcel.obtain(); |
| 3770 | Parcel reply = Parcel.obtain(); |
| 3771 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3772 | data.writeInt(maxNum); |
| 3773 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3774 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3775 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3776 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3777 | int N = reply.readInt(); |
| 3778 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3779 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3780 | while (N > 0) { |
| 3781 | ActivityManager.RunningTaskInfo info = |
| 3782 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3783 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3784 | list.add(info); |
| 3785 | N--; |
| 3786 | } |
| 3787 | } |
| 3788 | data.recycle(); |
| 3789 | reply.recycle(); |
| 3790 | return list; |
| 3791 | } |
Jeff Sharkey | 479212c | 2016-06-29 16:00:55 -0600 | [diff] [blame] | 3792 | public ParceledListSlice<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3793 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3794 | Parcel data = Parcel.obtain(); |
| 3795 | Parcel reply = Parcel.obtain(); |
| 3796 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3797 | data.writeInt(maxNum); |
| 3798 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3799 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3800 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3801 | reply.readException(); |
Jeff Sharkey | 479212c | 2016-06-29 16:00:55 -0600 | [diff] [blame] | 3802 | final ParceledListSlice<ActivityManager.RecentTaskInfo> list = ParceledListSlice.CREATOR |
| 3803 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3804 | data.recycle(); |
| 3805 | reply.recycle(); |
| 3806 | return list; |
| 3807 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3808 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3809 | Parcel data = Parcel.obtain(); |
| 3810 | Parcel reply = Parcel.obtain(); |
| 3811 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3812 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3813 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3814 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3815 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3816 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3817 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3818 | } |
| 3819 | data.recycle(); |
| 3820 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3821 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3822 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3823 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3824 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3825 | Parcel data = Parcel.obtain(); |
| 3826 | Parcel reply = Parcel.obtain(); |
| 3827 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3828 | data.writeInt(maxNum); |
| 3829 | data.writeInt(flags); |
| 3830 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3831 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3832 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3833 | int N = reply.readInt(); |
| 3834 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3835 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3836 | while (N > 0) { |
| 3837 | ActivityManager.RunningServiceInfo info = |
| 3838 | ActivityManager.RunningServiceInfo.CREATOR |
| 3839 | .createFromParcel(reply); |
| 3840 | list.add(info); |
| 3841 | N--; |
| 3842 | } |
| 3843 | } |
| 3844 | data.recycle(); |
| 3845 | reply.recycle(); |
| 3846 | return list; |
| 3847 | } |
| 3848 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3849 | throws RemoteException { |
| 3850 | Parcel data = Parcel.obtain(); |
| 3851 | Parcel reply = Parcel.obtain(); |
| 3852 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3853 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3854 | reply.readException(); |
| 3855 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3856 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3857 | data.recycle(); |
| 3858 | reply.recycle(); |
| 3859 | return list; |
| 3860 | } |
| 3861 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3862 | throws RemoteException { |
| 3863 | Parcel data = Parcel.obtain(); |
| 3864 | Parcel reply = Parcel.obtain(); |
| 3865 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3866 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3867 | reply.readException(); |
| 3868 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3869 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3870 | data.recycle(); |
| 3871 | reply.recycle(); |
| 3872 | return list; |
| 3873 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3874 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3875 | throws RemoteException { |
| 3876 | Parcel data = Parcel.obtain(); |
| 3877 | Parcel reply = Parcel.obtain(); |
| 3878 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3879 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3880 | reply.readException(); |
| 3881 | ArrayList<ApplicationInfo> list |
| 3882 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3883 | data.recycle(); |
| 3884 | reply.recycle(); |
| 3885 | return list; |
| 3886 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3887 | 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] | 3888 | { |
| 3889 | Parcel data = Parcel.obtain(); |
| 3890 | Parcel reply = Parcel.obtain(); |
| 3891 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3892 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3893 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3894 | if (options != null) { |
| 3895 | data.writeInt(1); |
| 3896 | options.writeToParcel(data, 0); |
| 3897 | } else { |
| 3898 | data.writeInt(0); |
| 3899 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3900 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3901 | reply.readException(); |
| 3902 | data.recycle(); |
| 3903 | reply.recycle(); |
| 3904 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3905 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3906 | throws RemoteException { |
| 3907 | Parcel data = Parcel.obtain(); |
| 3908 | Parcel reply = Parcel.obtain(); |
| 3909 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3910 | data.writeStrongBinder(token); |
| 3911 | data.writeInt(nonRoot ? 1 : 0); |
| 3912 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3913 | reply.readException(); |
| 3914 | boolean res = reply.readInt() != 0; |
| 3915 | data.recycle(); |
| 3916 | reply.recycle(); |
| 3917 | return res; |
| 3918 | } |
| 3919 | public void moveTaskBackwards(int task) throws RemoteException |
| 3920 | { |
| 3921 | Parcel data = Parcel.obtain(); |
| 3922 | Parcel reply = Parcel.obtain(); |
| 3923 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3924 | data.writeInt(task); |
| 3925 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3926 | reply.readException(); |
| 3927 | data.recycle(); |
| 3928 | reply.recycle(); |
| 3929 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3930 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3931 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3932 | { |
| 3933 | Parcel data = Parcel.obtain(); |
| 3934 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3935 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3936 | data.writeInt(taskId); |
| 3937 | data.writeInt(stackId); |
| 3938 | data.writeInt(toTop ? 1 : 0); |
| 3939 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3940 | reply.readException(); |
| 3941 | data.recycle(); |
| 3942 | reply.recycle(); |
| 3943 | } |
| 3944 | @Override |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3945 | public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, |
Wale Ogunwale | a4d92a0 | 2016-05-01 16:02:16 -0700 | [diff] [blame] | 3946 | Rect initialBounds, boolean moveHomeStackFront) throws RemoteException |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3947 | { |
| 3948 | Parcel data = Parcel.obtain(); |
| 3949 | Parcel reply = Parcel.obtain(); |
| 3950 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3951 | data.writeInt(taskId); |
| 3952 | data.writeInt(createMode); |
| 3953 | data.writeInt(toTop ? 1 : 0); |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 3954 | data.writeInt(animate ? 1 : 0); |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3955 | if (initialBounds != null) { |
| 3956 | data.writeInt(1); |
| 3957 | initialBounds.writeToParcel(data, 0); |
| 3958 | } else { |
| 3959 | data.writeInt(0); |
| 3960 | } |
Wale Ogunwale | a4d92a0 | 2016-05-01 16:02:16 -0700 | [diff] [blame] | 3961 | data.writeInt(moveHomeStackFront ? 1 : 0); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3962 | mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3963 | reply.readException(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3964 | boolean res = reply.readInt() > 0; |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3965 | data.recycle(); |
| 3966 | reply.recycle(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3967 | return res; |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3968 | } |
| 3969 | @Override |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3970 | public boolean moveTopActivityToPinnedStack(int stackId, Rect r) |
| 3971 | throws RemoteException |
| 3972 | { |
| 3973 | Parcel data = Parcel.obtain(); |
| 3974 | Parcel reply = Parcel.obtain(); |
| 3975 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3976 | data.writeInt(stackId); |
| 3977 | r.writeToParcel(data, 0); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 3978 | mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3979 | reply.readException(); |
| 3980 | final boolean res = reply.readInt() != 0; |
| 3981 | data.recycle(); |
| 3982 | reply.recycle(); |
| 3983 | return res; |
| 3984 | } |
| 3985 | @Override |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3986 | public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode, |
Wale Ogunwale | e75a9ad | 2016-03-18 20:43:49 -0700 | [diff] [blame] | 3987 | boolean preserveWindows, boolean animate, int animationDuration) |
| 3988 | throws RemoteException { |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3989 | Parcel data = Parcel.obtain(); |
| 3990 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3991 | data.writeInterfaceToken(IActivityManager.descriptor); |
Wale Ogunwale | b34a7ad | 2015-08-14 11:05:30 -0700 | [diff] [blame] | 3992 | data.writeInt(stackId); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 3993 | if (r != null) { |
| 3994 | data.writeInt(1); |
| 3995 | r.writeToParcel(data, 0); |
| 3996 | } else { |
| 3997 | data.writeInt(0); |
| 3998 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3999 | data.writeInt(allowResizeInDockedMode ? 1 : 0); |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 4000 | data.writeInt(preserveWindows ? 1 : 0); |
| 4001 | data.writeInt(animate ? 1 : 0); |
Wale Ogunwale | e75a9ad | 2016-03-18 20:43:49 -0700 | [diff] [blame] | 4002 | data.writeInt(animationDuration); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4003 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 4004 | reply.readException(); |
| 4005 | data.recycle(); |
| 4006 | reply.recycle(); |
| 4007 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 4008 | @Override |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 4009 | public void swapDockedAndFullscreenStack() throws RemoteException |
| 4010 | { |
| 4011 | Parcel data = Parcel.obtain(); |
| 4012 | Parcel reply = Parcel.obtain(); |
| 4013 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4014 | mRemote.transact(SWAP_DOCKED_AND_FULLSCREEN_STACK, data, reply, 0); |
| 4015 | reply.readException(); |
| 4016 | data.recycle(); |
| 4017 | reply.recycle(); |
| 4018 | } |
| 4019 | @Override |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 4020 | public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds, |
| 4021 | Rect tempDockedTaskInsetBounds, |
| 4022 | Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds) |
| 4023 | throws RemoteException |
| 4024 | { |
| 4025 | Parcel data = Parcel.obtain(); |
| 4026 | Parcel reply = Parcel.obtain(); |
| 4027 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4028 | if (dockedBounds != null) { |
| 4029 | data.writeInt(1); |
| 4030 | dockedBounds.writeToParcel(data, 0); |
| 4031 | } else { |
| 4032 | data.writeInt(0); |
| 4033 | } |
| 4034 | if (tempDockedTaskBounds != null) { |
| 4035 | data.writeInt(1); |
| 4036 | tempDockedTaskBounds.writeToParcel(data, 0); |
| 4037 | } else { |
| 4038 | data.writeInt(0); |
| 4039 | } |
| 4040 | if (tempDockedTaskInsetBounds != null) { |
| 4041 | data.writeInt(1); |
| 4042 | tempDockedTaskInsetBounds.writeToParcel(data, 0); |
| 4043 | } else { |
| 4044 | data.writeInt(0); |
| 4045 | } |
| 4046 | if (tempOtherTaskBounds != null) { |
| 4047 | data.writeInt(1); |
| 4048 | tempOtherTaskBounds.writeToParcel(data, 0); |
| 4049 | } else { |
| 4050 | data.writeInt(0); |
| 4051 | } |
| 4052 | if (tempOtherTaskInsetBounds != null) { |
| 4053 | data.writeInt(1); |
| 4054 | tempOtherTaskInsetBounds.writeToParcel(data, 0); |
| 4055 | } else { |
| 4056 | data.writeInt(0); |
| 4057 | } |
| 4058 | mRemote.transact(RESIZE_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 4059 | reply.readException(); |
| 4060 | data.recycle(); |
| 4061 | reply.recycle(); |
| 4062 | } |
Robert Carr | 0d00c2e | 2016-02-29 17:45:02 -0800 | [diff] [blame] | 4063 | |
| 4064 | @Override |
| 4065 | public void resizePinnedStack(Rect pinnedBounds, Rect tempPinnedTaskBounds) throws RemoteException |
| 4066 | { |
| 4067 | Parcel data = Parcel.obtain(); |
| 4068 | Parcel reply = Parcel.obtain(); |
| 4069 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4070 | if (pinnedBounds != null) { |
| 4071 | data.writeInt(1); |
| 4072 | pinnedBounds.writeToParcel(data, 0); |
| 4073 | } else { |
| 4074 | data.writeInt(0); |
| 4075 | } |
| 4076 | if (tempPinnedTaskBounds != null) { |
| 4077 | data.writeInt(1); |
| 4078 | tempPinnedTaskBounds.writeToParcel(data, 0); |
| 4079 | } else { |
| 4080 | data.writeInt(0); |
| 4081 | } |
| 4082 | mRemote.transact(RESIZE_PINNED_STACK_TRANSACTION, data, reply, 0); |
| 4083 | reply.readException(); |
| 4084 | data.recycle(); |
| 4085 | reply.recycle(); |
| 4086 | } |
| 4087 | |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 4088 | @Override |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 4089 | public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException |
| 4090 | { |
| 4091 | Parcel data = Parcel.obtain(); |
| 4092 | Parcel reply = Parcel.obtain(); |
| 4093 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4094 | data.writeInt(taskId); |
| 4095 | data.writeInt(stackId); |
| 4096 | data.writeInt(position); |
| 4097 | mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0); |
| 4098 | reply.readException(); |
| 4099 | data.recycle(); |
| 4100 | reply.recycle(); |
| 4101 | } |
| 4102 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4103 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 4104 | { |
| 4105 | Parcel data = Parcel.obtain(); |
| 4106 | Parcel reply = Parcel.obtain(); |
| 4107 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4108 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 4109 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4110 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 4111 | data.recycle(); |
| 4112 | reply.recycle(); |
| 4113 | return list; |
| 4114 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4115 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4116 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4117 | { |
| 4118 | Parcel data = Parcel.obtain(); |
| 4119 | Parcel reply = Parcel.obtain(); |
| 4120 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4121 | data.writeInt(stackId); |
| 4122 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4123 | reply.readException(); |
| 4124 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4125 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4126 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4127 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4128 | } |
| 4129 | data.recycle(); |
| 4130 | reply.recycle(); |
| 4131 | return info; |
| 4132 | } |
| 4133 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 4134 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 4135 | Parcel data = Parcel.obtain(); |
| 4136 | Parcel reply = Parcel.obtain(); |
| 4137 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4138 | data.writeInt(taskId); |
| 4139 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 4140 | reply.readException(); |
| 4141 | boolean isInHomeStack = reply.readInt() > 0; |
| 4142 | data.recycle(); |
| 4143 | reply.recycle(); |
| 4144 | return isInHomeStack; |
| 4145 | } |
| 4146 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4147 | public void setFocusedStack(int stackId) throws RemoteException |
| 4148 | { |
| 4149 | Parcel data = Parcel.obtain(); |
| 4150 | Parcel reply = Parcel.obtain(); |
| 4151 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4152 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4153 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4154 | reply.readException(); |
| 4155 | data.recycle(); |
| 4156 | reply.recycle(); |
| 4157 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4158 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 4159 | public int getFocusedStackId() throws RemoteException { |
| 4160 | Parcel data = Parcel.obtain(); |
| 4161 | Parcel reply = Parcel.obtain(); |
| 4162 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4163 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 4164 | reply.readException(); |
| 4165 | int focusedStackId = reply.readInt(); |
| 4166 | data.recycle(); |
| 4167 | reply.recycle(); |
| 4168 | return focusedStackId; |
| 4169 | } |
| 4170 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 4171 | public void setFocusedTask(int taskId) throws RemoteException |
| 4172 | { |
| 4173 | Parcel data = Parcel.obtain(); |
| 4174 | Parcel reply = Parcel.obtain(); |
| 4175 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4176 | data.writeInt(taskId); |
| 4177 | mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0); |
| 4178 | reply.readException(); |
| 4179 | data.recycle(); |
| 4180 | reply.recycle(); |
| 4181 | } |
| 4182 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4183 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 4184 | { |
| 4185 | Parcel data = Parcel.obtain(); |
| 4186 | Parcel reply = Parcel.obtain(); |
| 4187 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4188 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4189 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4190 | reply.readException(); |
| 4191 | data.recycle(); |
| 4192 | reply.recycle(); |
| 4193 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4194 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 4195 | { |
| 4196 | Parcel data = Parcel.obtain(); |
| 4197 | Parcel reply = Parcel.obtain(); |
| 4198 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4199 | data.writeStrongBinder(token); |
| 4200 | data.writeInt(onlyRoot ? 1 : 0); |
| 4201 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4202 | reply.readException(); |
| 4203 | int res = reply.readInt(); |
| 4204 | data.recycle(); |
| 4205 | reply.recycle(); |
| 4206 | return res; |
| 4207 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4208 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4209 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4210 | Parcel data = Parcel.obtain(); |
| 4211 | Parcel reply = Parcel.obtain(); |
| 4212 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4213 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4214 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4215 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4216 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4217 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4218 | reply.readException(); |
| 4219 | int res = reply.readInt(); |
| 4220 | ContentProviderHolder cph = null; |
| 4221 | if (res != 0) { |
| 4222 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4223 | } |
| 4224 | data.recycle(); |
| 4225 | reply.recycle(); |
| 4226 | return cph; |
| 4227 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4228 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 4229 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4230 | Parcel data = Parcel.obtain(); |
| 4231 | Parcel reply = Parcel.obtain(); |
| 4232 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4233 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4234 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4235 | data.writeStrongBinder(token); |
| 4236 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4237 | reply.readException(); |
| 4238 | int res = reply.readInt(); |
| 4239 | ContentProviderHolder cph = null; |
| 4240 | if (res != 0) { |
| 4241 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4242 | } |
| 4243 | data.recycle(); |
| 4244 | reply.recycle(); |
| 4245 | return cph; |
| 4246 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4247 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4248 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4249 | { |
| 4250 | Parcel data = Parcel.obtain(); |
| 4251 | Parcel reply = Parcel.obtain(); |
| 4252 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4253 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4254 | data.writeTypedList(providers); |
| 4255 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 4256 | reply.readException(); |
| 4257 | data.recycle(); |
| 4258 | reply.recycle(); |
| 4259 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4260 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 4261 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4262 | Parcel data = Parcel.obtain(); |
| 4263 | Parcel reply = Parcel.obtain(); |
| 4264 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4265 | data.writeStrongBinder(connection); |
| 4266 | data.writeInt(stable); |
| 4267 | data.writeInt(unstable); |
| 4268 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4269 | reply.readException(); |
| 4270 | boolean res = reply.readInt() != 0; |
| 4271 | data.recycle(); |
| 4272 | reply.recycle(); |
| 4273 | return res; |
| 4274 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4275 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4276 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 4277 | Parcel data = Parcel.obtain(); |
| 4278 | Parcel reply = Parcel.obtain(); |
| 4279 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4280 | data.writeStrongBinder(connection); |
| 4281 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 4282 | reply.readException(); |
| 4283 | data.recycle(); |
| 4284 | reply.recycle(); |
| 4285 | } |
| 4286 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4287 | @Override |
| 4288 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 4289 | Parcel data = Parcel.obtain(); |
| 4290 | Parcel reply = Parcel.obtain(); |
| 4291 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4292 | data.writeStrongBinder(connection); |
| 4293 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 4294 | reply.readException(); |
| 4295 | data.recycle(); |
| 4296 | reply.recycle(); |
| 4297 | } |
| 4298 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4299 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 4300 | Parcel data = Parcel.obtain(); |
| 4301 | Parcel reply = Parcel.obtain(); |
| 4302 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4303 | data.writeStrongBinder(connection); |
| 4304 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4305 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4306 | reply.readException(); |
| 4307 | data.recycle(); |
| 4308 | reply.recycle(); |
| 4309 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4310 | |
| 4311 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 4312 | Parcel data = Parcel.obtain(); |
| 4313 | Parcel reply = Parcel.obtain(); |
| 4314 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4315 | data.writeString(name); |
| 4316 | data.writeStrongBinder(token); |
| 4317 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4318 | reply.readException(); |
| 4319 | data.recycle(); |
| 4320 | reply.recycle(); |
| 4321 | } |
| 4322 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 4323 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 4324 | throws RemoteException |
| 4325 | { |
| 4326 | Parcel data = Parcel.obtain(); |
| 4327 | Parcel reply = Parcel.obtain(); |
| 4328 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4329 | service.writeToParcel(data, 0); |
| 4330 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 4331 | reply.readException(); |
| 4332 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 4333 | data.recycle(); |
| 4334 | reply.recycle(); |
| 4335 | return res; |
| 4336 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4337 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4338 | public ComponentName startService(IApplicationThread caller, Intent service, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4339 | String resolvedType, String callingPackage, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4340 | { |
| 4341 | Parcel data = Parcel.obtain(); |
| 4342 | Parcel reply = Parcel.obtain(); |
| 4343 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4344 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4345 | service.writeToParcel(data, 0); |
| 4346 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4347 | data.writeString(callingPackage); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4348 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4349 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 4350 | reply.readException(); |
| 4351 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4352 | data.recycle(); |
| 4353 | reply.recycle(); |
| 4354 | return res; |
| 4355 | } |
| 4356 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4357 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4358 | { |
| 4359 | Parcel data = Parcel.obtain(); |
| 4360 | Parcel reply = Parcel.obtain(); |
| 4361 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4362 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4363 | service.writeToParcel(data, 0); |
| 4364 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4365 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4366 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 4367 | reply.readException(); |
| 4368 | int res = reply.readInt(); |
| 4369 | reply.recycle(); |
| 4370 | data.recycle(); |
| 4371 | return res; |
| 4372 | } |
| 4373 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 4374 | int startId) throws RemoteException { |
| 4375 | Parcel data = Parcel.obtain(); |
| 4376 | Parcel reply = Parcel.obtain(); |
| 4377 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4378 | ComponentName.writeToParcel(className, data); |
| 4379 | data.writeStrongBinder(token); |
| 4380 | data.writeInt(startId); |
| 4381 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 4382 | reply.readException(); |
| 4383 | boolean res = reply.readInt() != 0; |
| 4384 | data.recycle(); |
| 4385 | reply.recycle(); |
| 4386 | return res; |
| 4387 | } |
| 4388 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | 67324c9 | 2016-04-18 13:55:25 -0700 | [diff] [blame] | 4389 | int id, Notification notification, int flags) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4390 | Parcel data = Parcel.obtain(); |
| 4391 | Parcel reply = Parcel.obtain(); |
| 4392 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4393 | ComponentName.writeToParcel(className, data); |
| 4394 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4395 | data.writeInt(id); |
| 4396 | if (notification != null) { |
| 4397 | data.writeInt(1); |
| 4398 | notification.writeToParcel(data, 0); |
| 4399 | } else { |
| 4400 | data.writeInt(0); |
| 4401 | } |
Dianne Hackborn | 67324c9 | 2016-04-18 13:55:25 -0700 | [diff] [blame] | 4402 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4403 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4404 | reply.readException(); |
| 4405 | data.recycle(); |
| 4406 | reply.recycle(); |
| 4407 | } |
| 4408 | public int bindService(IApplicationThread caller, IBinder token, |
| 4409 | Intent service, String resolvedType, IServiceConnection connection, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4410 | int flags, String callingPackage, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4411 | Parcel data = Parcel.obtain(); |
| 4412 | Parcel reply = Parcel.obtain(); |
| 4413 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4414 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4415 | data.writeStrongBinder(token); |
| 4416 | service.writeToParcel(data, 0); |
| 4417 | data.writeString(resolvedType); |
| 4418 | data.writeStrongBinder(connection.asBinder()); |
| 4419 | data.writeInt(flags); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4420 | data.writeString(callingPackage); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 4421 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4422 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4423 | reply.readException(); |
| 4424 | int res = reply.readInt(); |
| 4425 | data.recycle(); |
| 4426 | reply.recycle(); |
| 4427 | return res; |
| 4428 | } |
| 4429 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 4430 | { |
| 4431 | Parcel data = Parcel.obtain(); |
| 4432 | Parcel reply = Parcel.obtain(); |
| 4433 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4434 | data.writeStrongBinder(connection.asBinder()); |
| 4435 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4436 | reply.readException(); |
| 4437 | boolean res = reply.readInt() != 0; |
| 4438 | data.recycle(); |
| 4439 | reply.recycle(); |
| 4440 | return res; |
| 4441 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4442 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4443 | public void publishService(IBinder token, |
| 4444 | Intent intent, IBinder service) throws RemoteException { |
| 4445 | Parcel data = Parcel.obtain(); |
| 4446 | Parcel reply = Parcel.obtain(); |
| 4447 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4448 | data.writeStrongBinder(token); |
| 4449 | intent.writeToParcel(data, 0); |
| 4450 | data.writeStrongBinder(service); |
| 4451 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 4452 | reply.readException(); |
| 4453 | data.recycle(); |
| 4454 | reply.recycle(); |
| 4455 | } |
| 4456 | |
| 4457 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 4458 | throws RemoteException { |
| 4459 | Parcel data = Parcel.obtain(); |
| 4460 | Parcel reply = Parcel.obtain(); |
| 4461 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4462 | data.writeStrongBinder(token); |
| 4463 | intent.writeToParcel(data, 0); |
| 4464 | data.writeInt(doRebind ? 1 : 0); |
| 4465 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 4466 | reply.readException(); |
| 4467 | data.recycle(); |
| 4468 | reply.recycle(); |
| 4469 | } |
| 4470 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4471 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 4472 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4473 | Parcel data = Parcel.obtain(); |
| 4474 | Parcel reply = Parcel.obtain(); |
| 4475 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4476 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4477 | data.writeInt(type); |
| 4478 | data.writeInt(startId); |
| 4479 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4480 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 4481 | reply.readException(); |
| 4482 | data.recycle(); |
| 4483 | reply.recycle(); |
| 4484 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4485 | |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4486 | public IBinder peekService(Intent service, String resolvedType, String callingPackage) |
| 4487 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4488 | Parcel data = Parcel.obtain(); |
| 4489 | Parcel reply = Parcel.obtain(); |
| 4490 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4491 | service.writeToParcel(data, 0); |
| 4492 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4493 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4494 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 4495 | reply.readException(); |
| 4496 | IBinder binder = reply.readStrongBinder(); |
| 4497 | reply.recycle(); |
| 4498 | data.recycle(); |
| 4499 | return binder; |
| 4500 | } |
| 4501 | |
Christopher Tate | c58054f | 2016-06-13 15:17:54 -0700 | [diff] [blame] | 4502 | public boolean bindBackupAgent(String packageName, int backupRestoreMode, int userId) |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4503 | throws RemoteException { |
| 4504 | Parcel data = Parcel.obtain(); |
| 4505 | Parcel reply = Parcel.obtain(); |
| 4506 | data.writeInterfaceToken(IActivityManager.descriptor); |
Christopher Tate | c58054f | 2016-06-13 15:17:54 -0700 | [diff] [blame] | 4507 | data.writeString(packageName); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4508 | data.writeInt(backupRestoreMode); |
Christopher Tate | c58054f | 2016-06-13 15:17:54 -0700 | [diff] [blame] | 4509 | data.writeInt(userId); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4510 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4511 | reply.readException(); |
| 4512 | boolean success = reply.readInt() != 0; |
| 4513 | reply.recycle(); |
| 4514 | data.recycle(); |
| 4515 | return success; |
| 4516 | } |
| 4517 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 4518 | public void clearPendingBackup() throws RemoteException { |
| 4519 | Parcel data = Parcel.obtain(); |
| 4520 | Parcel reply = Parcel.obtain(); |
| 4521 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4522 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 4523 | reply.recycle(); |
| 4524 | data.recycle(); |
| 4525 | } |
| 4526 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4527 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 4528 | Parcel data = Parcel.obtain(); |
| 4529 | Parcel reply = Parcel.obtain(); |
| 4530 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4531 | data.writeString(packageName); |
| 4532 | data.writeStrongBinder(agent); |
| 4533 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 4534 | reply.recycle(); |
| 4535 | data.recycle(); |
| 4536 | } |
| 4537 | |
| 4538 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 4539 | Parcel data = Parcel.obtain(); |
| 4540 | Parcel reply = Parcel.obtain(); |
| 4541 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4542 | app.writeToParcel(data, 0); |
| 4543 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4544 | reply.readException(); |
| 4545 | reply.recycle(); |
| 4546 | data.recycle(); |
| 4547 | } |
| 4548 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4549 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4550 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4551 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 4552 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4553 | Parcel data = Parcel.obtain(); |
| 4554 | Parcel reply = Parcel.obtain(); |
| 4555 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4556 | ComponentName.writeToParcel(className, data); |
| 4557 | data.writeString(profileFile); |
| 4558 | data.writeInt(flags); |
| 4559 | data.writeBundle(arguments); |
| 4560 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4561 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4562 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4563 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4564 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4565 | reply.readException(); |
| 4566 | boolean res = reply.readInt() != 0; |
| 4567 | reply.recycle(); |
| 4568 | data.recycle(); |
| 4569 | return res; |
| 4570 | } |
| 4571 | |
| 4572 | public void finishInstrumentation(IApplicationThread target, |
| 4573 | int resultCode, Bundle results) throws RemoteException { |
| 4574 | Parcel data = Parcel.obtain(); |
| 4575 | Parcel reply = Parcel.obtain(); |
| 4576 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4577 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 4578 | data.writeInt(resultCode); |
| 4579 | data.writeBundle(results); |
| 4580 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4581 | reply.readException(); |
| 4582 | data.recycle(); |
| 4583 | reply.recycle(); |
| 4584 | } |
| 4585 | public Configuration getConfiguration() throws RemoteException |
| 4586 | { |
| 4587 | Parcel data = Parcel.obtain(); |
| 4588 | Parcel reply = Parcel.obtain(); |
| 4589 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4590 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4591 | reply.readException(); |
| 4592 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 4593 | reply.recycle(); |
| 4594 | data.recycle(); |
| 4595 | return res; |
| 4596 | } |
Wale Ogunwale | 02896ab | 2016-10-05 09:08:43 -0700 | [diff] [blame] | 4597 | public boolean updateConfiguration(Configuration values) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4598 | { |
| 4599 | Parcel data = Parcel.obtain(); |
| 4600 | Parcel reply = Parcel.obtain(); |
| 4601 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4602 | values.writeToParcel(data, 0); |
| 4603 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4604 | reply.readException(); |
Wale Ogunwale | 02896ab | 2016-10-05 09:08:43 -0700 | [diff] [blame] | 4605 | boolean updated = reply.readInt() == 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4606 | data.recycle(); |
| 4607 | reply.recycle(); |
Wale Ogunwale | 02896ab | 2016-10-05 09:08:43 -0700 | [diff] [blame] | 4608 | return updated; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4609 | } |
| 4610 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 4611 | throws RemoteException { |
| 4612 | Parcel data = Parcel.obtain(); |
| 4613 | Parcel reply = Parcel.obtain(); |
| 4614 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4615 | data.writeStrongBinder(token); |
| 4616 | data.writeInt(requestedOrientation); |
| 4617 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4618 | reply.readException(); |
| 4619 | data.recycle(); |
| 4620 | reply.recycle(); |
| 4621 | } |
| 4622 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 4623 | Parcel data = Parcel.obtain(); |
| 4624 | Parcel reply = Parcel.obtain(); |
| 4625 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4626 | data.writeStrongBinder(token); |
| 4627 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4628 | reply.readException(); |
| 4629 | int res = reply.readInt(); |
| 4630 | data.recycle(); |
| 4631 | reply.recycle(); |
| 4632 | return res; |
| 4633 | } |
| 4634 | public ComponentName getActivityClassForToken(IBinder token) |
| 4635 | throws RemoteException { |
| 4636 | Parcel data = Parcel.obtain(); |
| 4637 | Parcel reply = Parcel.obtain(); |
| 4638 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4639 | data.writeStrongBinder(token); |
| 4640 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4641 | reply.readException(); |
| 4642 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4643 | data.recycle(); |
| 4644 | reply.recycle(); |
| 4645 | return res; |
| 4646 | } |
| 4647 | public String getPackageForToken(IBinder token) throws RemoteException |
| 4648 | { |
| 4649 | Parcel data = Parcel.obtain(); |
| 4650 | Parcel reply = Parcel.obtain(); |
| 4651 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4652 | data.writeStrongBinder(token); |
| 4653 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4654 | reply.readException(); |
| 4655 | String res = reply.readString(); |
| 4656 | data.recycle(); |
| 4657 | reply.recycle(); |
| 4658 | return res; |
| 4659 | } |
| 4660 | public IIntentSender getIntentSender(int type, |
| 4661 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4662 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4663 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4664 | Parcel data = Parcel.obtain(); |
| 4665 | Parcel reply = Parcel.obtain(); |
| 4666 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4667 | data.writeInt(type); |
| 4668 | data.writeString(packageName); |
| 4669 | data.writeStrongBinder(token); |
| 4670 | data.writeString(resultWho); |
| 4671 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4672 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4673 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4674 | data.writeTypedArray(intents, 0); |
| 4675 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4676 | } else { |
| 4677 | data.writeInt(0); |
| 4678 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4679 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4680 | if (options != null) { |
| 4681 | data.writeInt(1); |
| 4682 | options.writeToParcel(data, 0); |
| 4683 | } else { |
| 4684 | data.writeInt(0); |
| 4685 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4686 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4687 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4688 | reply.readException(); |
| 4689 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4690 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4691 | data.recycle(); |
| 4692 | reply.recycle(); |
| 4693 | return res; |
| 4694 | } |
| 4695 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 4696 | Parcel data = Parcel.obtain(); |
| 4697 | Parcel reply = Parcel.obtain(); |
| 4698 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4699 | data.writeStrongBinder(sender.asBinder()); |
| 4700 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4701 | reply.readException(); |
| 4702 | data.recycle(); |
| 4703 | reply.recycle(); |
| 4704 | } |
| 4705 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 4706 | Parcel data = Parcel.obtain(); |
| 4707 | Parcel reply = Parcel.obtain(); |
| 4708 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4709 | data.writeStrongBinder(sender.asBinder()); |
| 4710 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4711 | reply.readException(); |
| 4712 | String res = reply.readString(); |
| 4713 | data.recycle(); |
| 4714 | reply.recycle(); |
| 4715 | return res; |
| 4716 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 4717 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 4718 | Parcel data = Parcel.obtain(); |
| 4719 | Parcel reply = Parcel.obtain(); |
| 4720 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4721 | data.writeStrongBinder(sender.asBinder()); |
| 4722 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4723 | reply.readException(); |
| 4724 | int res = reply.readInt(); |
| 4725 | data.recycle(); |
| 4726 | reply.recycle(); |
| 4727 | return res; |
| 4728 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4729 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 4730 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 4731 | Parcel data = Parcel.obtain(); |
| 4732 | Parcel reply = Parcel.obtain(); |
| 4733 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4734 | data.writeInt(callingPid); |
| 4735 | data.writeInt(callingUid); |
| 4736 | data.writeInt(userId); |
| 4737 | data.writeInt(allowAll ? 1 : 0); |
| 4738 | data.writeInt(requireFull ? 1 : 0); |
| 4739 | data.writeString(name); |
| 4740 | data.writeString(callerPackage); |
| 4741 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 4742 | reply.readException(); |
| 4743 | int res = reply.readInt(); |
| 4744 | data.recycle(); |
| 4745 | reply.recycle(); |
| 4746 | return res; |
| 4747 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4748 | public void setProcessLimit(int max) throws RemoteException |
| 4749 | { |
| 4750 | Parcel data = Parcel.obtain(); |
| 4751 | Parcel reply = Parcel.obtain(); |
| 4752 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4753 | data.writeInt(max); |
| 4754 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4755 | reply.readException(); |
| 4756 | data.recycle(); |
| 4757 | reply.recycle(); |
| 4758 | } |
| 4759 | public int getProcessLimit() throws RemoteException |
| 4760 | { |
| 4761 | Parcel data = Parcel.obtain(); |
| 4762 | Parcel reply = Parcel.obtain(); |
| 4763 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4764 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4765 | reply.readException(); |
| 4766 | int res = reply.readInt(); |
| 4767 | data.recycle(); |
| 4768 | reply.recycle(); |
| 4769 | return res; |
| 4770 | } |
| 4771 | public void setProcessForeground(IBinder token, int pid, |
| 4772 | boolean isForeground) throws RemoteException { |
| 4773 | Parcel data = Parcel.obtain(); |
| 4774 | Parcel reply = Parcel.obtain(); |
| 4775 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4776 | data.writeStrongBinder(token); |
| 4777 | data.writeInt(pid); |
| 4778 | data.writeInt(isForeground ? 1 : 0); |
| 4779 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4780 | reply.readException(); |
| 4781 | data.recycle(); |
| 4782 | reply.recycle(); |
| 4783 | } |
| 4784 | public int checkPermission(String permission, int pid, int uid) |
| 4785 | throws RemoteException { |
| 4786 | Parcel data = Parcel.obtain(); |
| 4787 | Parcel reply = Parcel.obtain(); |
| 4788 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4789 | data.writeString(permission); |
| 4790 | data.writeInt(pid); |
| 4791 | data.writeInt(uid); |
| 4792 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4793 | reply.readException(); |
| 4794 | int res = reply.readInt(); |
| 4795 | data.recycle(); |
| 4796 | reply.recycle(); |
| 4797 | return res; |
| 4798 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4799 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4800 | throws RemoteException { |
| 4801 | Parcel data = Parcel.obtain(); |
| 4802 | Parcel reply = Parcel.obtain(); |
| 4803 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4804 | data.writeString(permission); |
| 4805 | data.writeInt(pid); |
| 4806 | data.writeInt(uid); |
| 4807 | data.writeStrongBinder(callerToken); |
| 4808 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4809 | reply.readException(); |
| 4810 | int res = reply.readInt(); |
| 4811 | data.recycle(); |
| 4812 | reply.recycle(); |
| 4813 | return res; |
| 4814 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4815 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4816 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4817 | Parcel data = Parcel.obtain(); |
| 4818 | Parcel reply = Parcel.obtain(); |
| 4819 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4820 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4821 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4822 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4823 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4824 | reply.readException(); |
| 4825 | boolean res = reply.readInt() != 0; |
| 4826 | data.recycle(); |
| 4827 | reply.recycle(); |
| 4828 | return res; |
| 4829 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4830 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4831 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4832 | Parcel data = Parcel.obtain(); |
| 4833 | Parcel reply = Parcel.obtain(); |
| 4834 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4835 | uri.writeToParcel(data, 0); |
| 4836 | data.writeInt(pid); |
| 4837 | data.writeInt(uid); |
| 4838 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4839 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4840 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4841 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4842 | reply.readException(); |
| 4843 | int res = reply.readInt(); |
| 4844 | data.recycle(); |
| 4845 | reply.recycle(); |
| 4846 | return res; |
| 4847 | } |
| 4848 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4849 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4850 | Parcel data = Parcel.obtain(); |
| 4851 | Parcel reply = Parcel.obtain(); |
| 4852 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4853 | data.writeStrongBinder(caller.asBinder()); |
| 4854 | data.writeString(targetPkg); |
| 4855 | uri.writeToParcel(data, 0); |
| 4856 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4857 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4858 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4859 | reply.readException(); |
| 4860 | data.recycle(); |
| 4861 | reply.recycle(); |
| 4862 | } |
| 4863 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4864 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4865 | Parcel data = Parcel.obtain(); |
| 4866 | Parcel reply = Parcel.obtain(); |
| 4867 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4868 | data.writeStrongBinder(caller.asBinder()); |
| 4869 | uri.writeToParcel(data, 0); |
| 4870 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4871 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4872 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4873 | reply.readException(); |
| 4874 | data.recycle(); |
| 4875 | reply.recycle(); |
| 4876 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4877 | |
| 4878 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4879 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4880 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4881 | Parcel data = Parcel.obtain(); |
| 4882 | Parcel reply = Parcel.obtain(); |
| 4883 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4884 | uri.writeToParcel(data, 0); |
| 4885 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4886 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4887 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4888 | reply.readException(); |
| 4889 | data.recycle(); |
| 4890 | reply.recycle(); |
| 4891 | } |
| 4892 | |
| 4893 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4894 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4895 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4896 | Parcel data = Parcel.obtain(); |
| 4897 | Parcel reply = Parcel.obtain(); |
| 4898 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4899 | uri.writeToParcel(data, 0); |
| 4900 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4901 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4902 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4903 | reply.readException(); |
| 4904 | data.recycle(); |
| 4905 | reply.recycle(); |
| 4906 | } |
| 4907 | |
| 4908 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4909 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4910 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4911 | Parcel data = Parcel.obtain(); |
| 4912 | Parcel reply = Parcel.obtain(); |
| 4913 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4914 | data.writeString(packageName); |
| 4915 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4916 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4917 | reply.readException(); |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4918 | @SuppressWarnings("unchecked") |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4919 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4920 | reply); |
| 4921 | data.recycle(); |
| 4922 | reply.recycle(); |
| 4923 | return perms; |
| 4924 | } |
| 4925 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4926 | @Override |
| 4927 | public ParceledListSlice<UriPermission> getGrantedUriPermissions(String packageName, int userId) |
| 4928 | throws RemoteException { |
| 4929 | Parcel data = Parcel.obtain(); |
| 4930 | Parcel reply = Parcel.obtain(); |
| 4931 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4932 | data.writeString(packageName); |
| 4933 | data.writeInt(userId); |
| 4934 | mRemote.transact(GET_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4935 | reply.readException(); |
| 4936 | @SuppressWarnings("unchecked") |
| 4937 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4938 | reply); |
| 4939 | data.recycle(); |
| 4940 | reply.recycle(); |
| 4941 | return perms; |
| 4942 | } |
| 4943 | |
| 4944 | @Override |
| 4945 | public void clearGrantedUriPermissions(String packageName, int userId) throws RemoteException { |
| 4946 | Parcel data = Parcel.obtain(); |
| 4947 | Parcel reply = Parcel.obtain(); |
| 4948 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4949 | data.writeString(packageName); |
| 4950 | data.writeInt(userId); |
| 4951 | mRemote.transact(CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4952 | reply.readException(); |
| 4953 | data.recycle(); |
| 4954 | reply.recycle(); |
| 4955 | } |
| 4956 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4957 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4958 | throws RemoteException { |
| 4959 | Parcel data = Parcel.obtain(); |
| 4960 | Parcel reply = Parcel.obtain(); |
| 4961 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4962 | data.writeStrongBinder(who.asBinder()); |
| 4963 | data.writeInt(waiting ? 1 : 0); |
| 4964 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4965 | reply.readException(); |
| 4966 | data.recycle(); |
| 4967 | reply.recycle(); |
| 4968 | } |
| 4969 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4970 | Parcel data = Parcel.obtain(); |
| 4971 | Parcel reply = Parcel.obtain(); |
| 4972 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4973 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4974 | reply.readException(); |
| 4975 | outInfo.readFromParcel(reply); |
| 4976 | data.recycle(); |
| 4977 | reply.recycle(); |
| 4978 | } |
| 4979 | public void unhandledBack() throws RemoteException |
| 4980 | { |
| 4981 | Parcel data = Parcel.obtain(); |
| 4982 | Parcel reply = Parcel.obtain(); |
| 4983 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4984 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4985 | reply.readException(); |
| 4986 | data.recycle(); |
| 4987 | reply.recycle(); |
| 4988 | } |
| 4989 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4990 | { |
| 4991 | Parcel data = Parcel.obtain(); |
| 4992 | Parcel reply = Parcel.obtain(); |
| 4993 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4994 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4995 | reply.readException(); |
| 4996 | ParcelFileDescriptor pfd = null; |
| 4997 | if (reply.readInt() != 0) { |
| 4998 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4999 | } |
| 5000 | data.recycle(); |
| 5001 | reply.recycle(); |
| 5002 | return pfd; |
| 5003 | } |
Wale Ogunwale | 9973294 | 2016-05-06 10:13:14 -0700 | [diff] [blame] | 5004 | public void setLockScreenShown(boolean showing, boolean occluded) throws RemoteException |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 5005 | { |
| 5006 | Parcel data = Parcel.obtain(); |
| 5007 | Parcel reply = Parcel.obtain(); |
| 5008 | data.writeInterfaceToken(IActivityManager.descriptor); |
Wale Ogunwale | 9973294 | 2016-05-06 10:13:14 -0700 | [diff] [blame] | 5009 | data.writeInt(showing ? 1 : 0); |
| 5010 | data.writeInt(occluded ? 1 : 0); |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 5011 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 5012 | reply.readException(); |
| 5013 | data.recycle(); |
| 5014 | reply.recycle(); |
| 5015 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5016 | public void setDebugApp( |
| 5017 | String packageName, boolean waitForDebugger, boolean persistent) |
| 5018 | throws RemoteException |
| 5019 | { |
| 5020 | Parcel data = Parcel.obtain(); |
| 5021 | Parcel reply = Parcel.obtain(); |
| 5022 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5023 | data.writeString(packageName); |
| 5024 | data.writeInt(waitForDebugger ? 1 : 0); |
| 5025 | data.writeInt(persistent ? 1 : 0); |
| 5026 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 5027 | reply.readException(); |
| 5028 | data.recycle(); |
| 5029 | reply.recycle(); |
| 5030 | } |
| 5031 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 5032 | { |
| 5033 | Parcel data = Parcel.obtain(); |
| 5034 | Parcel reply = Parcel.obtain(); |
| 5035 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5036 | data.writeInt(enabled ? 1 : 0); |
| 5037 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 5038 | reply.readException(); |
| 5039 | data.recycle(); |
| 5040 | reply.recycle(); |
| 5041 | } |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 5042 | public void setActivityController(IActivityController watcher, boolean imAMonkey) |
| 5043 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5044 | { |
| 5045 | Parcel data = Parcel.obtain(); |
| 5046 | Parcel reply = Parcel.obtain(); |
| 5047 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5048 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 5049 | data.writeInt(imAMonkey ? 1 : 0); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 5050 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5051 | reply.readException(); |
| 5052 | data.recycle(); |
| 5053 | reply.recycle(); |
| 5054 | } |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 5055 | public void setLenientBackgroundCheck(boolean enabled) throws RemoteException |
| 5056 | { |
| 5057 | Parcel data = Parcel.obtain(); |
| 5058 | Parcel reply = Parcel.obtain(); |
| 5059 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5060 | data.writeInt(enabled ? 1 : 0); |
| 5061 | mRemote.transact(SET_LENIENT_BACKGROUND_CHECK_TRANSACTION, data, reply, 0); |
| 5062 | reply.readException(); |
| 5063 | data.recycle(); |
| 5064 | reply.recycle(); |
| 5065 | } |
Dianne Hackborn | 970510b | 2016-02-24 16:56:42 -0800 | [diff] [blame] | 5066 | public int getMemoryTrimLevel() throws RemoteException |
| 5067 | { |
| 5068 | Parcel data = Parcel.obtain(); |
| 5069 | Parcel reply = Parcel.obtain(); |
| 5070 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5071 | mRemote.transact(GET_MEMORY_TRIM_LEVEL_TRANSACTION, data, reply, 0); |
| 5072 | reply.readException(); |
| 5073 | int level = reply.readInt(); |
| 5074 | data.recycle(); |
| 5075 | reply.recycle(); |
| 5076 | return level; |
| 5077 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5078 | public void enterSafeMode() throws RemoteException { |
| 5079 | Parcel data = Parcel.obtain(); |
| 5080 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5081 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 5082 | data.recycle(); |
| 5083 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5084 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 5085 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5086 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5087 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 5088 | data.writeStrongBinder(sender.asBinder()); |
| 5089 | data.writeInt(sourceUid); |
| 5090 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5091 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5092 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 5093 | data.recycle(); |
| 5094 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5095 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 5096 | throws RemoteException { |
| 5097 | Parcel data = Parcel.obtain(); |
| 5098 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5099 | data.writeStrongBinder(sender.asBinder()); |
| 5100 | data.writeInt(sourceUid); |
| 5101 | data.writeString(tag); |
| 5102 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 5103 | data.recycle(); |
| 5104 | } |
| 5105 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 5106 | throws RemoteException { |
| 5107 | Parcel data = Parcel.obtain(); |
| 5108 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5109 | data.writeStrongBinder(sender.asBinder()); |
| 5110 | data.writeInt(sourceUid); |
| 5111 | data.writeString(tag); |
| 5112 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 5113 | data.recycle(); |
| 5114 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 5115 | 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] | 5116 | Parcel data = Parcel.obtain(); |
| 5117 | Parcel reply = Parcel.obtain(); |
| 5118 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5119 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 5120 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 5121 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 5122 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5123 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5124 | boolean res = reply.readInt() != 0; |
| 5125 | data.recycle(); |
| 5126 | reply.recycle(); |
| 5127 | return res; |
| 5128 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 5129 | @Override |
| 5130 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 5131 | Parcel data = Parcel.obtain(); |
| 5132 | Parcel reply = Parcel.obtain(); |
| 5133 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5134 | data.writeString(reason); |
| 5135 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 5136 | boolean res = reply.readInt() != 0; |
| 5137 | data.recycle(); |
| 5138 | reply.recycle(); |
| 5139 | return res; |
| 5140 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5141 | public boolean testIsSystemReady() |
| 5142 | { |
| 5143 | /* this base class version is never called */ |
| 5144 | return true; |
| 5145 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5146 | public void handleApplicationCrash(IBinder app, |
| 5147 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 5148 | { |
| 5149 | Parcel data = Parcel.obtain(); |
| 5150 | Parcel reply = Parcel.obtain(); |
| 5151 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5152 | data.writeStrongBinder(app); |
| 5153 | crashInfo.writeToParcel(data, 0); |
| 5154 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 5155 | reply.readException(); |
| 5156 | reply.recycle(); |
| 5157 | data.recycle(); |
| 5158 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5159 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 5160 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5161 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5162 | { |
| 5163 | Parcel data = Parcel.obtain(); |
| 5164 | Parcel reply = Parcel.obtain(); |
| 5165 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5166 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5167 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 5168 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5169 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5170 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5171 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5172 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5173 | reply.recycle(); |
| 5174 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5175 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5176 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5177 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5178 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 5179 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 5180 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5181 | { |
| 5182 | Parcel data = Parcel.obtain(); |
| 5183 | Parcel reply = Parcel.obtain(); |
| 5184 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5185 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 5186 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 5187 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5188 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 5189 | reply.readException(); |
| 5190 | reply.recycle(); |
| 5191 | data.recycle(); |
| 5192 | } |
| 5193 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5194 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 5195 | Parcel data = Parcel.obtain(); |
| 5196 | Parcel reply = Parcel.obtain(); |
| 5197 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5198 | data.writeInt(sig); |
| 5199 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 5200 | reply.readException(); |
| 5201 | data.recycle(); |
| 5202 | reply.recycle(); |
| 5203 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5204 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5205 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5206 | Parcel data = Parcel.obtain(); |
| 5207 | Parcel reply = Parcel.obtain(); |
| 5208 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5209 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5210 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5211 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5212 | reply.readException(); |
| 5213 | data.recycle(); |
| 5214 | reply.recycle(); |
| 5215 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5216 | |
| 5217 | public void killAllBackgroundProcesses() throws RemoteException { |
| 5218 | Parcel data = Parcel.obtain(); |
| 5219 | Parcel reply = Parcel.obtain(); |
| 5220 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5221 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5222 | reply.readException(); |
| 5223 | data.recycle(); |
| 5224 | reply.recycle(); |
| 5225 | } |
| 5226 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 5227 | public void killPackageDependents(String packageName, int userId) throws RemoteException { |
| 5228 | Parcel data = Parcel.obtain(); |
| 5229 | Parcel reply = Parcel.obtain(); |
| 5230 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5231 | data.writeString(packageName); |
| 5232 | data.writeInt(userId); |
| 5233 | mRemote.transact(KILL_PACKAGE_DEPENDENTS_TRANSACTION, data, reply, 0); |
| 5234 | reply.readException(); |
| 5235 | data.recycle(); |
| 5236 | reply.recycle(); |
| 5237 | } |
| 5238 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5239 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5240 | Parcel data = Parcel.obtain(); |
| 5241 | Parcel reply = Parcel.obtain(); |
| 5242 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5243 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5244 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5245 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5246 | reply.readException(); |
| 5247 | data.recycle(); |
| 5248 | reply.recycle(); |
| 5249 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5250 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 5251 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 5252 | throws RemoteException |
| 5253 | { |
| 5254 | Parcel data = Parcel.obtain(); |
| 5255 | Parcel reply = Parcel.obtain(); |
| 5256 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5257 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 5258 | reply.readException(); |
| 5259 | outInfo.readFromParcel(reply); |
| 5260 | reply.recycle(); |
| 5261 | data.recycle(); |
| 5262 | } |
| 5263 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5264 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 5265 | { |
| 5266 | Parcel data = Parcel.obtain(); |
| 5267 | Parcel reply = Parcel.obtain(); |
| 5268 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5269 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5270 | reply.readException(); |
| 5271 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 5272 | reply.recycle(); |
| 5273 | data.recycle(); |
| 5274 | return res; |
| 5275 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5276 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5277 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5278 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5279 | { |
| 5280 | Parcel data = Parcel.obtain(); |
| 5281 | Parcel reply = Parcel.obtain(); |
| 5282 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5283 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5284 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5285 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 5286 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5287 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5288 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5289 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5290 | } else { |
| 5291 | data.writeInt(0); |
| 5292 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5293 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 5294 | reply.readException(); |
| 5295 | boolean res = reply.readInt() != 0; |
| 5296 | reply.recycle(); |
| 5297 | data.recycle(); |
| 5298 | return res; |
| 5299 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5300 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 5301 | public boolean shutdown(int timeout) throws RemoteException |
| 5302 | { |
| 5303 | Parcel data = Parcel.obtain(); |
| 5304 | Parcel reply = Parcel.obtain(); |
| 5305 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5306 | data.writeInt(timeout); |
| 5307 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 5308 | reply.readException(); |
| 5309 | boolean res = reply.readInt() != 0; |
| 5310 | reply.recycle(); |
| 5311 | data.recycle(); |
| 5312 | return res; |
| 5313 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5314 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5315 | public void stopAppSwitches() throws RemoteException { |
| 5316 | Parcel data = Parcel.obtain(); |
| 5317 | Parcel reply = Parcel.obtain(); |
| 5318 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5319 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5320 | reply.readException(); |
| 5321 | reply.recycle(); |
| 5322 | data.recycle(); |
| 5323 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5324 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5325 | public void resumeAppSwitches() throws RemoteException { |
| 5326 | Parcel data = Parcel.obtain(); |
| 5327 | Parcel reply = Parcel.obtain(); |
| 5328 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5329 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5330 | reply.readException(); |
| 5331 | reply.recycle(); |
| 5332 | data.recycle(); |
| 5333 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 5334 | |
| 5335 | public void addPackageDependency(String packageName) throws RemoteException { |
| 5336 | Parcel data = Parcel.obtain(); |
| 5337 | Parcel reply = Parcel.obtain(); |
| 5338 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5339 | data.writeString(packageName); |
| 5340 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 5341 | reply.readException(); |
| 5342 | data.recycle(); |
| 5343 | reply.recycle(); |
| 5344 | } |
| 5345 | |
Jeff Sharkey | 85f449e | 2016-06-23 09:26:00 -0600 | [diff] [blame] | 5346 | public void killApplication(String pkg, int appId, int userId, String reason) |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5347 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5348 | Parcel data = Parcel.obtain(); |
| 5349 | Parcel reply = Parcel.obtain(); |
| 5350 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5351 | data.writeString(pkg); |
Jeff Sharkey | 85f449e | 2016-06-23 09:26:00 -0600 | [diff] [blame] | 5352 | data.writeInt(appId); |
| 5353 | data.writeInt(userId); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5354 | data.writeString(reason); |
Jeff Sharkey | 85f449e | 2016-06-23 09:26:00 -0600 | [diff] [blame] | 5355 | mRemote.transact(KILL_APPLICATION_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5356 | reply.readException(); |
| 5357 | data.recycle(); |
| 5358 | reply.recycle(); |
| 5359 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5360 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 5361 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 5362 | Parcel data = Parcel.obtain(); |
| 5363 | Parcel reply = Parcel.obtain(); |
| 5364 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5365 | data.writeString(reason); |
| 5366 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 5367 | reply.readException(); |
| 5368 | data.recycle(); |
| 5369 | reply.recycle(); |
| 5370 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5371 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5372 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5373 | throws RemoteException { |
| 5374 | Parcel data = Parcel.obtain(); |
| 5375 | Parcel reply = Parcel.obtain(); |
| 5376 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5377 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5378 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 5379 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5380 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5381 | data.recycle(); |
| 5382 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5383 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5384 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 5385 | |
| 5386 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 5387 | Parcel data = Parcel.obtain(); |
| 5388 | Parcel reply = Parcel.obtain(); |
| 5389 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5390 | data.writeString(processName); |
| 5391 | data.writeInt(uid); |
| 5392 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 5393 | reply.readException(); |
| 5394 | data.recycle(); |
| 5395 | reply.recycle(); |
| 5396 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5397 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 5398 | public void overridePendingTransition(IBinder token, String packageName, |
| 5399 | int enterAnim, int exitAnim) throws RemoteException { |
| 5400 | Parcel data = Parcel.obtain(); |
| 5401 | Parcel reply = Parcel.obtain(); |
| 5402 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5403 | data.writeStrongBinder(token); |
| 5404 | data.writeString(packageName); |
| 5405 | data.writeInt(enterAnim); |
| 5406 | data.writeInt(exitAnim); |
| 5407 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 5408 | reply.readException(); |
| 5409 | data.recycle(); |
| 5410 | reply.recycle(); |
| 5411 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5412 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 5413 | public boolean isUserAMonkey() throws RemoteException { |
| 5414 | Parcel data = Parcel.obtain(); |
| 5415 | Parcel reply = Parcel.obtain(); |
| 5416 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5417 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 5418 | reply.readException(); |
| 5419 | boolean res = reply.readInt() != 0; |
| 5420 | data.recycle(); |
| 5421 | reply.recycle(); |
| 5422 | return res; |
| 5423 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 5424 | |
| 5425 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 5426 | Parcel data = Parcel.obtain(); |
| 5427 | Parcel reply = Parcel.obtain(); |
| 5428 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5429 | data.writeInt(monkey ? 1 : 0); |
| 5430 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 5431 | reply.readException(); |
| 5432 | data.recycle(); |
| 5433 | reply.recycle(); |
| 5434 | } |
| 5435 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 5436 | public void finishHeavyWeightApp() throws RemoteException { |
| 5437 | Parcel data = Parcel.obtain(); |
| 5438 | Parcel reply = Parcel.obtain(); |
| 5439 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5440 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 5441 | reply.readException(); |
| 5442 | data.recycle(); |
| 5443 | reply.recycle(); |
| 5444 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5445 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5446 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5447 | throws RemoteException { |
| 5448 | Parcel data = Parcel.obtain(); |
| 5449 | Parcel reply = Parcel.obtain(); |
| 5450 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5451 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5452 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 5453 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5454 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5455 | data.recycle(); |
| 5456 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5457 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5458 | } |
| 5459 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5460 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5461 | throws RemoteException { |
| 5462 | Parcel data = Parcel.obtain(); |
| 5463 | Parcel reply = Parcel.obtain(); |
| 5464 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5465 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5466 | if (options == null) { |
| 5467 | data.writeInt(0); |
| 5468 | } else { |
| 5469 | data.writeInt(1); |
| 5470 | data.writeBundle(options.toBundle()); |
| 5471 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5472 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5473 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5474 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5475 | data.recycle(); |
| 5476 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5477 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5478 | } |
| 5479 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5480 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 5481 | Parcel data = Parcel.obtain(); |
| 5482 | Parcel reply = Parcel.obtain(); |
| 5483 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5484 | data.writeStrongBinder(token); |
| 5485 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 5486 | reply.readException(); |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 5487 | ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle()); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5488 | data.recycle(); |
| 5489 | reply.recycle(); |
| 5490 | return options; |
| 5491 | } |
| 5492 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5493 | public void setImmersive(IBinder token, boolean immersive) |
| 5494 | throws RemoteException { |
| 5495 | Parcel data = Parcel.obtain(); |
| 5496 | Parcel reply = Parcel.obtain(); |
| 5497 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5498 | data.writeStrongBinder(token); |
| 5499 | data.writeInt(immersive ? 1 : 0); |
| 5500 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 5501 | reply.readException(); |
| 5502 | data.recycle(); |
| 5503 | reply.recycle(); |
| 5504 | } |
| 5505 | |
| 5506 | public boolean isImmersive(IBinder token) |
| 5507 | throws RemoteException { |
| 5508 | Parcel data = Parcel.obtain(); |
| 5509 | Parcel reply = Parcel.obtain(); |
| 5510 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5511 | data.writeStrongBinder(token); |
| 5512 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5513 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5514 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5515 | data.recycle(); |
| 5516 | reply.recycle(); |
| 5517 | return res; |
| 5518 | } |
| 5519 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5520 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 5521 | Parcel data = Parcel.obtain(); |
| 5522 | Parcel reply = Parcel.obtain(); |
| 5523 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5524 | data.writeStrongBinder(token); |
| 5525 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 5526 | reply.readException(); |
| 5527 | boolean res = reply.readInt() == 1; |
| 5528 | data.recycle(); |
| 5529 | reply.recycle(); |
| 5530 | return res; |
| 5531 | } |
| 5532 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5533 | public boolean isTopActivityImmersive() |
| 5534 | throws RemoteException { |
| 5535 | Parcel data = Parcel.obtain(); |
| 5536 | Parcel reply = Parcel.obtain(); |
| 5537 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5538 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5539 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5540 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5541 | data.recycle(); |
| 5542 | reply.recycle(); |
| 5543 | return res; |
| 5544 | } |
| 5545 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 5546 | public void crashApplication(int uid, int initialPid, String packageName, |
| 5547 | String message) throws RemoteException { |
| 5548 | Parcel data = Parcel.obtain(); |
| 5549 | Parcel reply = Parcel.obtain(); |
| 5550 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5551 | data.writeInt(uid); |
| 5552 | data.writeInt(initialPid); |
| 5553 | data.writeString(packageName); |
| 5554 | data.writeString(message); |
| 5555 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 5556 | reply.readException(); |
| 5557 | data.recycle(); |
| 5558 | reply.recycle(); |
| 5559 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5560 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5561 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5562 | Parcel data = Parcel.obtain(); |
| 5563 | Parcel reply = Parcel.obtain(); |
| 5564 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5565 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5566 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5567 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 5568 | reply.readException(); |
| 5569 | String res = reply.readString(); |
| 5570 | data.recycle(); |
| 5571 | reply.recycle(); |
| 5572 | return res; |
| 5573 | } |
| 5574 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5575 | public IBinder newUriPermissionOwner(String name) |
| 5576 | throws RemoteException { |
| 5577 | Parcel data = Parcel.obtain(); |
| 5578 | Parcel reply = Parcel.obtain(); |
| 5579 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5580 | data.writeString(name); |
| 5581 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 5582 | reply.readException(); |
| 5583 | IBinder res = reply.readStrongBinder(); |
| 5584 | data.recycle(); |
| 5585 | reply.recycle(); |
| 5586 | return res; |
| 5587 | } |
| 5588 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 5589 | public IBinder getUriPermissionOwnerForActivity(IBinder activityToken) throws RemoteException { |
| 5590 | Parcel data = Parcel.obtain(); |
| 5591 | Parcel reply = Parcel.obtain(); |
| 5592 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5593 | data.writeStrongBinder(activityToken); |
| 5594 | mRemote.transact(GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5595 | reply.readException(); |
| 5596 | IBinder res = reply.readStrongBinder(); |
| 5597 | data.recycle(); |
| 5598 | reply.recycle(); |
| 5599 | return res; |
| 5600 | } |
| 5601 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5602 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5603 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5604 | Parcel data = Parcel.obtain(); |
| 5605 | Parcel reply = Parcel.obtain(); |
| 5606 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5607 | data.writeStrongBinder(owner); |
| 5608 | data.writeInt(fromUid); |
| 5609 | data.writeString(targetPkg); |
| 5610 | uri.writeToParcel(data, 0); |
| 5611 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5612 | data.writeInt(sourceUserId); |
| 5613 | data.writeInt(targetUserId); |
Nicolas Prevot | 011aaa1 | 2016-09-14 17:01:53 +0100 | [diff] [blame] | 5614 | mRemote.transact(GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5615 | reply.readException(); |
| 5616 | data.recycle(); |
| 5617 | reply.recycle(); |
| 5618 | } |
| 5619 | |
| 5620 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5621 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5622 | Parcel data = Parcel.obtain(); |
| 5623 | Parcel reply = Parcel.obtain(); |
| 5624 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5625 | data.writeStrongBinder(owner); |
| 5626 | if (uri != null) { |
| 5627 | data.writeInt(1); |
| 5628 | uri.writeToParcel(data, 0); |
| 5629 | } else { |
| 5630 | data.writeInt(0); |
| 5631 | } |
| 5632 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5633 | data.writeInt(userId); |
Nicolas Prevot | 011aaa1 | 2016-09-14 17:01:53 +0100 | [diff] [blame] | 5634 | mRemote.transact(REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5635 | reply.readException(); |
| 5636 | data.recycle(); |
| 5637 | reply.recycle(); |
| 5638 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 5639 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5640 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5641 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5642 | Parcel data = Parcel.obtain(); |
| 5643 | Parcel reply = Parcel.obtain(); |
| 5644 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5645 | data.writeInt(callingUid); |
| 5646 | data.writeString(targetPkg); |
| 5647 | uri.writeToParcel(data, 0); |
| 5648 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5649 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5650 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5651 | reply.readException(); |
| 5652 | int res = reply.readInt(); |
| 5653 | data.recycle(); |
| 5654 | reply.recycle(); |
| 5655 | return res; |
| 5656 | } |
| 5657 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5658 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5659 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 5660 | Parcel data = Parcel.obtain(); |
| 5661 | Parcel reply = Parcel.obtain(); |
| 5662 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5663 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5664 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5665 | data.writeInt(managed ? 1 : 0); |
| 5666 | data.writeString(path); |
| 5667 | if (fd != null) { |
| 5668 | data.writeInt(1); |
| 5669 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5670 | } else { |
| 5671 | data.writeInt(0); |
| 5672 | } |
| 5673 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 5674 | reply.readException(); |
| 5675 | boolean res = reply.readInt() != 0; |
| 5676 | reply.recycle(); |
| 5677 | data.recycle(); |
| 5678 | return res; |
| 5679 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5680 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5681 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5682 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5683 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5684 | Parcel data = Parcel.obtain(); |
| 5685 | Parcel reply = Parcel.obtain(); |
| 5686 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5687 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5688 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5689 | data.writeTypedArray(intents, 0); |
| 5690 | data.writeStringArray(resolvedTypes); |
| 5691 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5692 | if (options != null) { |
| 5693 | data.writeInt(1); |
| 5694 | options.writeToParcel(data, 0); |
| 5695 | } else { |
| 5696 | data.writeInt(0); |
| 5697 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5698 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5699 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 5700 | reply.readException(); |
| 5701 | int result = reply.readInt(); |
| 5702 | reply.recycle(); |
| 5703 | data.recycle(); |
| 5704 | return result; |
| 5705 | } |
| 5706 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5707 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 5708 | Parcel data = Parcel.obtain(); |
| 5709 | Parcel reply = Parcel.obtain(); |
| 5710 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5711 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5712 | reply.readException(); |
| 5713 | int mode = reply.readInt(); |
| 5714 | reply.recycle(); |
| 5715 | data.recycle(); |
| 5716 | return mode; |
| 5717 | } |
| 5718 | |
| 5719 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 5720 | Parcel data = Parcel.obtain(); |
| 5721 | Parcel reply = Parcel.obtain(); |
| 5722 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5723 | data.writeInt(mode); |
| 5724 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5725 | reply.readException(); |
| 5726 | reply.recycle(); |
| 5727 | data.recycle(); |
| 5728 | } |
| 5729 | |
| 5730 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 5731 | Parcel data = Parcel.obtain(); |
| 5732 | Parcel reply = Parcel.obtain(); |
| 5733 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5734 | data.writeString(packageName); |
| 5735 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5736 | reply.readException(); |
| 5737 | int mode = reply.readInt(); |
| 5738 | reply.recycle(); |
| 5739 | data.recycle(); |
| 5740 | return mode; |
| 5741 | } |
| 5742 | |
| 5743 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5744 | throws RemoteException { |
| 5745 | Parcel data = Parcel.obtain(); |
| 5746 | Parcel reply = Parcel.obtain(); |
| 5747 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5748 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5749 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5750 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5751 | reply.readException(); |
| 5752 | reply.recycle(); |
| 5753 | data.recycle(); |
| 5754 | } |
| 5755 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5756 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 5757 | Parcel data = Parcel.obtain(); |
| 5758 | Parcel reply = Parcel.obtain(); |
| 5759 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5760 | data.writeString(packageName); |
| 5761 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5762 | reply.readException(); |
| 5763 | boolean ask = reply.readInt() != 0; |
| 5764 | reply.recycle(); |
| 5765 | data.recycle(); |
| 5766 | return ask; |
| 5767 | } |
| 5768 | |
| 5769 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 5770 | throws RemoteException { |
| 5771 | Parcel data = Parcel.obtain(); |
| 5772 | Parcel reply = Parcel.obtain(); |
| 5773 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5774 | data.writeString(packageName); |
| 5775 | data.writeInt(ask ? 1 : 0); |
| 5776 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5777 | reply.readException(); |
| 5778 | reply.recycle(); |
| 5779 | data.recycle(); |
| 5780 | } |
| 5781 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5782 | public boolean switchUser(int userid) throws RemoteException { |
| 5783 | Parcel data = Parcel.obtain(); |
| 5784 | Parcel reply = Parcel.obtain(); |
| 5785 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5786 | data.writeInt(userid); |
| 5787 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 5788 | reply.readException(); |
| 5789 | boolean result = reply.readInt() != 0; |
| 5790 | reply.recycle(); |
| 5791 | data.recycle(); |
| 5792 | return result; |
| 5793 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5794 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 5795 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 5796 | Parcel data = Parcel.obtain(); |
| 5797 | Parcel reply = Parcel.obtain(); |
| 5798 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5799 | data.writeInt(userid); |
| 5800 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 5801 | reply.readException(); |
| 5802 | boolean result = reply.readInt() != 0; |
| 5803 | reply.recycle(); |
| 5804 | data.recycle(); |
| 5805 | return result; |
| 5806 | } |
| 5807 | |
Jeff Sharkey | bd91e2f | 2016-03-22 15:32:31 -0600 | [diff] [blame] | 5808 | public boolean unlockUser(int userId, byte[] token, byte[] secret, IProgressListener listener) |
| 5809 | throws RemoteException { |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5810 | Parcel data = Parcel.obtain(); |
| 5811 | Parcel reply = Parcel.obtain(); |
| 5812 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5813 | data.writeInt(userId); |
| 5814 | data.writeByteArray(token); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5815 | data.writeByteArray(secret); |
Jeff Sharkey | bd91e2f | 2016-03-22 15:32:31 -0600 | [diff] [blame] | 5816 | data.writeStrongInterface(listener); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5817 | mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0); |
| 5818 | reply.readException(); |
| 5819 | boolean result = reply.readInt() != 0; |
| 5820 | reply.recycle(); |
| 5821 | data.recycle(); |
| 5822 | return result; |
| 5823 | } |
| 5824 | |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5825 | public int stopUser(int userid, boolean force, IStopUserCallback callback) |
| 5826 | throws RemoteException { |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5827 | Parcel data = Parcel.obtain(); |
| 5828 | Parcel reply = Parcel.obtain(); |
| 5829 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5830 | data.writeInt(userid); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5831 | data.writeInt(force ? 1 : 0); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5832 | data.writeStrongInterface(callback); |
| 5833 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 5834 | reply.readException(); |
| 5835 | int result = reply.readInt(); |
| 5836 | reply.recycle(); |
| 5837 | data.recycle(); |
| 5838 | return result; |
| 5839 | } |
| 5840 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5841 | public UserInfo getCurrentUser() throws RemoteException { |
| 5842 | Parcel data = Parcel.obtain(); |
| 5843 | Parcel reply = Parcel.obtain(); |
| 5844 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5845 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5846 | reply.readException(); |
| 5847 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 5848 | reply.recycle(); |
| 5849 | data.recycle(); |
| 5850 | return userInfo; |
| 5851 | } |
| 5852 | |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5853 | public boolean isUserRunning(int userid, int flags) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5854 | Parcel data = Parcel.obtain(); |
| 5855 | Parcel reply = Parcel.obtain(); |
| 5856 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5857 | data.writeInt(userid); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5858 | data.writeInt(flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5859 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5860 | reply.readException(); |
| 5861 | boolean result = reply.readInt() != 0; |
| 5862 | reply.recycle(); |
| 5863 | data.recycle(); |
| 5864 | return result; |
| 5865 | } |
| 5866 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5867 | public int[] getRunningUserIds() throws RemoteException { |
| 5868 | Parcel data = Parcel.obtain(); |
| 5869 | Parcel reply = Parcel.obtain(); |
| 5870 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5871 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5872 | reply.readException(); |
| 5873 | int[] result = reply.createIntArray(); |
| 5874 | reply.recycle(); |
| 5875 | data.recycle(); |
| 5876 | return result; |
| 5877 | } |
| 5878 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5879 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5880 | Parcel data = Parcel.obtain(); |
| 5881 | Parcel reply = Parcel.obtain(); |
| 5882 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5883 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5884 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5885 | reply.readException(); |
| 5886 | boolean result = reply.readInt() != 0; |
| 5887 | reply.recycle(); |
| 5888 | data.recycle(); |
| 5889 | return result; |
| 5890 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5891 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5892 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5893 | Parcel data = Parcel.obtain(); |
| 5894 | Parcel reply = Parcel.obtain(); |
| 5895 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5896 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5897 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5898 | reply.readException(); |
| 5899 | data.recycle(); |
| 5900 | reply.recycle(); |
| 5901 | } |
| 5902 | |
| 5903 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5904 | Parcel data = Parcel.obtain(); |
| 5905 | Parcel reply = Parcel.obtain(); |
| 5906 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5907 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5908 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5909 | reply.readException(); |
| 5910 | data.recycle(); |
| 5911 | reply.recycle(); |
| 5912 | } |
| 5913 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5914 | public void registerUidObserver(IUidObserver observer, int which) throws RemoteException { |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5915 | Parcel data = Parcel.obtain(); |
| 5916 | Parcel reply = Parcel.obtain(); |
| 5917 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5918 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5919 | data.writeInt(which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5920 | mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5921 | reply.readException(); |
| 5922 | data.recycle(); |
| 5923 | reply.recycle(); |
| 5924 | } |
| 5925 | |
| 5926 | public void unregisterUidObserver(IUidObserver observer) throws RemoteException { |
| 5927 | Parcel data = Parcel.obtain(); |
| 5928 | Parcel reply = Parcel.obtain(); |
| 5929 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5930 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5931 | mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5932 | reply.readException(); |
| 5933 | data.recycle(); |
| 5934 | reply.recycle(); |
| 5935 | } |
| 5936 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5937 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5938 | Parcel data = Parcel.obtain(); |
| 5939 | Parcel reply = Parcel.obtain(); |
| 5940 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5941 | data.writeStrongBinder(sender.asBinder()); |
| 5942 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5943 | reply.readException(); |
| 5944 | boolean res = reply.readInt() != 0; |
| 5945 | data.recycle(); |
| 5946 | reply.recycle(); |
| 5947 | return res; |
| 5948 | } |
| 5949 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5950 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5951 | Parcel data = Parcel.obtain(); |
| 5952 | Parcel reply = Parcel.obtain(); |
| 5953 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5954 | data.writeStrongBinder(sender.asBinder()); |
| 5955 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5956 | reply.readException(); |
| 5957 | boolean res = reply.readInt() != 0; |
| 5958 | data.recycle(); |
| 5959 | reply.recycle(); |
| 5960 | return res; |
| 5961 | } |
| 5962 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5963 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5964 | Parcel data = Parcel.obtain(); |
| 5965 | Parcel reply = Parcel.obtain(); |
| 5966 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5967 | data.writeStrongBinder(sender.asBinder()); |
| 5968 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5969 | reply.readException(); |
| 5970 | Intent res = reply.readInt() != 0 |
| 5971 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5972 | data.recycle(); |
| 5973 | reply.recycle(); |
| 5974 | return res; |
| 5975 | } |
| 5976 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5977 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5978 | throws RemoteException { |
| 5979 | Parcel data = Parcel.obtain(); |
| 5980 | Parcel reply = Parcel.obtain(); |
| 5981 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5982 | data.writeStrongBinder(sender.asBinder()); |
| 5983 | data.writeString(prefix); |
| 5984 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5985 | reply.readException(); |
| 5986 | String res = reply.readString(); |
| 5987 | data.recycle(); |
| 5988 | reply.recycle(); |
| 5989 | return res; |
| 5990 | } |
| 5991 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5992 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5993 | { |
| 5994 | Parcel data = Parcel.obtain(); |
| 5995 | Parcel reply = Parcel.obtain(); |
| 5996 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5997 | values.writeToParcel(data, 0); |
| 5998 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5999 | reply.readException(); |
| 6000 | data.recycle(); |
| 6001 | reply.recycle(); |
| 6002 | } |
| 6003 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 6004 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 6005 | Parcel data = Parcel.obtain(); |
| 6006 | Parcel reply = Parcel.obtain(); |
| 6007 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6008 | data.writeIntArray(pids); |
| 6009 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 6010 | reply.readException(); |
| 6011 | long[] res = reply.createLongArray(); |
| 6012 | data.recycle(); |
| 6013 | reply.recycle(); |
| 6014 | return res; |
| 6015 | } |
| 6016 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 6017 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 6018 | Parcel data = Parcel.obtain(); |
| 6019 | Parcel reply = Parcel.obtain(); |
| 6020 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6021 | TextUtils.writeToParcel(msg, data, 0); |
| 6022 | data.writeInt(always ? 1 : 0); |
| 6023 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 6024 | reply.readException(); |
| 6025 | data.recycle(); |
| 6026 | reply.recycle(); |
| 6027 | } |
| 6028 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 6029 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 6030 | Parcel data = Parcel.obtain(); |
| 6031 | Parcel reply = Parcel.obtain(); |
| 6032 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 6033 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 6034 | reply.readException(); |
| 6035 | data.recycle(); |
| 6036 | reply.recycle(); |
| 6037 | } |
| 6038 | |
Adrian Roos | d5c2db6 | 2016-03-08 16:11:31 -0800 | [diff] [blame] | 6039 | public void keyguardGoingAway(int flags) |
| 6040 | throws RemoteException { |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 6041 | Parcel data = Parcel.obtain(); |
| 6042 | Parcel reply = Parcel.obtain(); |
| 6043 | data.writeInterfaceToken(IActivityManager.descriptor); |
Adrian Roos | d5c2db6 | 2016-03-08 16:11:31 -0800 | [diff] [blame] | 6044 | data.writeInt(flags); |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 6045 | mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0); |
| 6046 | reply.readException(); |
| 6047 | data.recycle(); |
| 6048 | reply.recycle(); |
| 6049 | } |
| 6050 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 6051 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 6052 | throws RemoteException { |
| 6053 | Parcel data = Parcel.obtain(); |
| 6054 | Parcel reply = Parcel.obtain(); |
| 6055 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6056 | data.writeStrongBinder(token); |
| 6057 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 6058 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 6059 | reply.readException(); |
| 6060 | boolean result = reply.readInt() != 0; |
| 6061 | data.recycle(); |
| 6062 | reply.recycle(); |
| 6063 | return result; |
| 6064 | } |
| 6065 | |
| 6066 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 6067 | throws RemoteException { |
| 6068 | Parcel data = Parcel.obtain(); |
| 6069 | Parcel reply = Parcel.obtain(); |
| 6070 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6071 | data.writeStrongBinder(token); |
| 6072 | target.writeToParcel(data, 0); |
| 6073 | data.writeInt(resultCode); |
| 6074 | if (resultData != null) { |
| 6075 | data.writeInt(1); |
| 6076 | resultData.writeToParcel(data, 0); |
| 6077 | } else { |
| 6078 | data.writeInt(0); |
| 6079 | } |
| 6080 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 6081 | reply.readException(); |
| 6082 | boolean result = reply.readInt() != 0; |
| 6083 | data.recycle(); |
| 6084 | reply.recycle(); |
| 6085 | return result; |
| 6086 | } |
| 6087 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 6088 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 6089 | Parcel data = Parcel.obtain(); |
| 6090 | Parcel reply = Parcel.obtain(); |
| 6091 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6092 | data.writeStrongBinder(activityToken); |
| 6093 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 6094 | reply.readException(); |
| 6095 | int result = reply.readInt(); |
| 6096 | data.recycle(); |
| 6097 | reply.recycle(); |
| 6098 | return result; |
| 6099 | } |
| 6100 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 6101 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 6102 | Parcel data = Parcel.obtain(); |
| 6103 | Parcel reply = Parcel.obtain(); |
| 6104 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6105 | data.writeStrongBinder(activityToken); |
| 6106 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 6107 | reply.readException(); |
| 6108 | String result = reply.readString(); |
| 6109 | data.recycle(); |
| 6110 | reply.recycle(); |
| 6111 | return result; |
| 6112 | } |
| 6113 | |
Fyodor Kupolov | 0b77ef9 | 2016-06-20 17:16:52 -0700 | [diff] [blame] | 6114 | public void registerUserSwitchObserver(IUserSwitchObserver observer, |
| 6115 | String name) throws RemoteException { |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 6116 | Parcel data = Parcel.obtain(); |
| 6117 | Parcel reply = Parcel.obtain(); |
| 6118 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6119 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
Fyodor Kupolov | 0b77ef9 | 2016-06-20 17:16:52 -0700 | [diff] [blame] | 6120 | data.writeString(name); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 6121 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 6122 | reply.readException(); |
| 6123 | data.recycle(); |
| 6124 | reply.recycle(); |
| 6125 | } |
| 6126 | |
| 6127 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 6128 | Parcel data = Parcel.obtain(); |
| 6129 | Parcel reply = Parcel.obtain(); |
| 6130 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6131 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 6132 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 6133 | reply.readException(); |
| 6134 | data.recycle(); |
| 6135 | reply.recycle(); |
| 6136 | } |
| 6137 | |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 6138 | public void requestBugReport(@ActivityManager.BugreportMode int bugreportType) |
| 6139 | throws RemoteException { |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 6140 | Parcel data = Parcel.obtain(); |
| 6141 | Parcel reply = Parcel.obtain(); |
| 6142 | data.writeInterfaceToken(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 6143 | data.writeInt(bugreportType); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 6144 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 6145 | reply.readException(); |
| 6146 | data.recycle(); |
| 6147 | reply.recycle(); |
| 6148 | } |
| 6149 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 6150 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 6151 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 6152 | Parcel data = Parcel.obtain(); |
| 6153 | Parcel reply = Parcel.obtain(); |
| 6154 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6155 | data.writeInt(pid); |
| 6156 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 6157 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 6158 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 6159 | reply.readException(); |
| 6160 | long res = reply.readInt(); |
| 6161 | data.recycle(); |
| 6162 | reply.recycle(); |
| 6163 | return res; |
| 6164 | } |
| 6165 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6166 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6167 | Parcel data = Parcel.obtain(); |
| 6168 | Parcel reply = Parcel.obtain(); |
| 6169 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6170 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6171 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6172 | reply.readException(); |
| 6173 | Bundle res = reply.readBundle(); |
| 6174 | data.recycle(); |
| 6175 | reply.recycle(); |
| 6176 | return res; |
| 6177 | } |
| 6178 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6179 | public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, |
Amith Yamasani | e8222e5 | 2016-04-08 15:28:47 -0700 | [diff] [blame] | 6180 | Bundle receiverExtras, |
Amith Yamasani | 4f128e4 | 2016-05-10 11:44:12 -0700 | [diff] [blame] | 6181 | IBinder activityToken, boolean focused, boolean newSessionId) throws RemoteException { |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6182 | Parcel data = Parcel.obtain(); |
| 6183 | Parcel reply = Parcel.obtain(); |
| 6184 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6185 | data.writeInt(requestType); |
| 6186 | data.writeStrongBinder(receiver.asBinder()); |
Amith Yamasani | e8222e5 | 2016-04-08 15:28:47 -0700 | [diff] [blame] | 6187 | data.writeBundle(receiverExtras); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6188 | data.writeStrongBinder(activityToken); |
Amith Yamasani | e8222e5 | 2016-04-08 15:28:47 -0700 | [diff] [blame] | 6189 | data.writeInt(focused ? 1 : 0); |
Amith Yamasani | 4f128e4 | 2016-05-10 11:44:12 -0700 | [diff] [blame] | 6190 | data.writeInt(newSessionId ? 1 : 0); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6191 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 6192 | reply.readException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6193 | boolean res = reply.readInt() != 0; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6194 | data.recycle(); |
| 6195 | reply.recycle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6196 | return res; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6197 | } |
| 6198 | |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 6199 | public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 6200 | AssistContent content, Uri referrer) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6201 | Parcel data = Parcel.obtain(); |
| 6202 | Parcel reply = Parcel.obtain(); |
| 6203 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6204 | data.writeStrongBinder(token); |
| 6205 | data.writeBundle(extras); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 6206 | structure.writeToParcel(data, 0); |
| 6207 | content.writeToParcel(data, 0); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 6208 | if (referrer != null) { |
| 6209 | data.writeInt(1); |
| 6210 | referrer.writeToParcel(data, 0); |
| 6211 | } else { |
| 6212 | data.writeInt(0); |
| 6213 | } |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6214 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6215 | reply.readException(); |
| 6216 | data.recycle(); |
| 6217 | reply.recycle(); |
| 6218 | } |
| 6219 | |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6220 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, |
| 6221 | Bundle args) throws RemoteException { |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6222 | Parcel data = Parcel.obtain(); |
| 6223 | Parcel reply = Parcel.obtain(); |
| 6224 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6225 | intent.writeToParcel(data, 0); |
| 6226 | data.writeInt(requestType); |
| 6227 | data.writeString(hint); |
| 6228 | data.writeInt(userHandle); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6229 | data.writeBundle(args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6230 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 6231 | reply.readException(); |
| 6232 | boolean res = reply.readInt() != 0; |
| 6233 | data.recycle(); |
| 6234 | reply.recycle(); |
| 6235 | return res; |
| 6236 | } |
| 6237 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6238 | public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException { |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 6239 | Parcel data = Parcel.obtain(); |
| 6240 | Parcel reply = Parcel.obtain(); |
| 6241 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6242 | mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6243 | reply.readException(); |
| 6244 | boolean res = reply.readInt() != 0; |
| 6245 | data.recycle(); |
| 6246 | reply.recycle(); |
| 6247 | return res; |
| 6248 | } |
| 6249 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6250 | public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException { |
| 6251 | Parcel data = Parcel.obtain(); |
| 6252 | Parcel reply = Parcel.obtain(); |
| 6253 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6254 | data.writeStrongBinder(token); |
| 6255 | data.writeBundle(args); |
| 6256 | mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6257 | reply.readException(); |
| 6258 | boolean res = reply.readInt() != 0; |
| 6259 | data.recycle(); |
| 6260 | reply.recycle(); |
| 6261 | return res; |
| 6262 | } |
| 6263 | |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6264 | public void killUid(int appId, int userId, String reason) throws RemoteException { |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6265 | Parcel data = Parcel.obtain(); |
| 6266 | Parcel reply = Parcel.obtain(); |
| 6267 | data.writeInterfaceToken(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6268 | data.writeInt(appId); |
| 6269 | data.writeInt(userId); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6270 | data.writeString(reason); |
| 6271 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 6272 | reply.readException(); |
| 6273 | data.recycle(); |
| 6274 | reply.recycle(); |
| 6275 | } |
| 6276 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 6277 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 6278 | Parcel data = Parcel.obtain(); |
| 6279 | Parcel reply = Parcel.obtain(); |
| 6280 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6281 | data.writeStrongBinder(who); |
| 6282 | data.writeInt(allowRestart ? 1 : 0); |
| 6283 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 6284 | reply.readException(); |
| 6285 | data.recycle(); |
| 6286 | reply.recycle(); |
| 6287 | } |
| 6288 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 6289 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 6290 | Parcel data = Parcel.obtain(); |
| 6291 | Parcel reply = Parcel.obtain(); |
| 6292 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6293 | data.writeStrongBinder(token); |
| 6294 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 6295 | reply.readException(); |
| 6296 | data.recycle(); |
| 6297 | reply.recycle(); |
| 6298 | } |
| 6299 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 6300 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 6301 | Parcel data = Parcel.obtain(); |
| 6302 | Parcel reply = Parcel.obtain(); |
| 6303 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6304 | data.writeStrongBinder(token); |
| 6305 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 6306 | reply.readException(); |
| 6307 | data.recycle(); |
| 6308 | reply.recycle(); |
| 6309 | } |
| 6310 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 6311 | public void restart() throws RemoteException { |
| 6312 | Parcel data = Parcel.obtain(); |
| 6313 | Parcel reply = Parcel.obtain(); |
| 6314 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6315 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 6316 | reply.readException(); |
| 6317 | data.recycle(); |
| 6318 | reply.recycle(); |
| 6319 | } |
| 6320 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 6321 | public void performIdleMaintenance() throws RemoteException { |
| 6322 | Parcel data = Parcel.obtain(); |
| 6323 | Parcel reply = Parcel.obtain(); |
| 6324 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6325 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 6326 | reply.readException(); |
| 6327 | data.recycle(); |
| 6328 | reply.recycle(); |
| 6329 | } |
| 6330 | |
Christopher Tate | 27d92e4 | 2016-05-06 11:25:11 -0700 | [diff] [blame] | 6331 | public void sendIdleJobTrigger() throws RemoteException { |
| 6332 | Parcel data = Parcel.obtain(); |
| 6333 | Parcel reply = Parcel.obtain(); |
| 6334 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6335 | mRemote.transact(SEND_IDLE_JOB_TRIGGER_TRANSACTION, data, reply, 0); |
| 6336 | reply.readException(); |
| 6337 | data.recycle(); |
| 6338 | reply.recycle(); |
| 6339 | } |
| 6340 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6341 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6342 | IActivityContainerCallback callback) throws RemoteException { |
| 6343 | Parcel data = Parcel.obtain(); |
| 6344 | Parcel reply = Parcel.obtain(); |
| 6345 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6346 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 6347 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6348 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6349 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 6350 | final int result = reply.readInt(); |
| 6351 | final IActivityContainer res; |
| 6352 | if (result == 1) { |
| 6353 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6354 | } else { |
| 6355 | res = null; |
| 6356 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6357 | data.recycle(); |
| 6358 | reply.recycle(); |
| 6359 | return res; |
| 6360 | } |
| 6361 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 6362 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 6363 | throws RemoteException { |
| 6364 | Parcel data = Parcel.obtain(); |
| 6365 | Parcel reply = Parcel.obtain(); |
| 6366 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6367 | data.writeStrongBinder(activityContainer.asBinder()); |
| 6368 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 6369 | reply.readException(); |
| 6370 | data.recycle(); |
| 6371 | reply.recycle(); |
| 6372 | } |
| 6373 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 6374 | public boolean startBinderTracking() throws RemoteException { |
| 6375 | Parcel data = Parcel.obtain(); |
| 6376 | Parcel reply = Parcel.obtain(); |
| 6377 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6378 | mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0); |
| 6379 | reply.readException(); |
| 6380 | boolean res = reply.readInt() != 0; |
| 6381 | reply.recycle(); |
| 6382 | data.recycle(); |
| 6383 | return res; |
| 6384 | } |
| 6385 | |
| 6386 | public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException { |
| 6387 | Parcel data = Parcel.obtain(); |
| 6388 | Parcel reply = Parcel.obtain(); |
| 6389 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6390 | if (fd != null) { |
| 6391 | data.writeInt(1); |
| 6392 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 6393 | } else { |
| 6394 | data.writeInt(0); |
| 6395 | } |
| 6396 | mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0); |
| 6397 | reply.readException(); |
| 6398 | boolean res = reply.readInt() != 0; |
| 6399 | reply.recycle(); |
| 6400 | data.recycle(); |
| 6401 | return res; |
| 6402 | } |
| 6403 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6404 | public int setVrMode(IBinder token, boolean enabled, ComponentName packageName) |
| 6405 | throws RemoteException { |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6406 | Parcel data = Parcel.obtain(); |
| 6407 | Parcel reply = Parcel.obtain(); |
| 6408 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6409 | data.writeStrongBinder(token); |
| 6410 | data.writeInt(enabled ? 1 : 0); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6411 | packageName.writeToParcel(data, 0); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6412 | mRemote.transact(SET_VR_MODE_TRANSACTION, data, reply, 0); |
| 6413 | reply.readException(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6414 | int res = reply.readInt(); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6415 | data.recycle(); |
| 6416 | reply.recycle(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6417 | return res; |
| 6418 | } |
| 6419 | |
| 6420 | public boolean isVrModePackageEnabled(ComponentName packageName) |
| 6421 | throws RemoteException { |
| 6422 | Parcel data = Parcel.obtain(); |
| 6423 | Parcel reply = Parcel.obtain(); |
| 6424 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6425 | packageName.writeToParcel(data, 0); |
| 6426 | mRemote.transact(IS_VR_PACKAGE_ENABLED_TRANSACTION, data, reply, 0); |
| 6427 | reply.readException(); |
| 6428 | int res = reply.readInt(); |
| 6429 | data.recycle(); |
| 6430 | reply.recycle(); |
| 6431 | return res == 1; |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6432 | } |
| 6433 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6434 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 6435 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 6436 | Parcel data = Parcel.obtain(); |
| 6437 | Parcel reply = Parcel.obtain(); |
| 6438 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6439 | data.writeInt(displayId); |
| 6440 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 6441 | reply.readException(); |
| 6442 | final int result = reply.readInt(); |
| 6443 | final IActivityContainer res; |
| 6444 | if (result == 1) { |
| 6445 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6446 | } else { |
| 6447 | res = null; |
| 6448 | } |
| 6449 | data.recycle(); |
| 6450 | reply.recycle(); |
| 6451 | return res; |
| 6452 | } |
| 6453 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6454 | @Override |
| 6455 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6456 | throws RemoteException { |
| 6457 | Parcel data = Parcel.obtain(); |
| 6458 | Parcel reply = Parcel.obtain(); |
| 6459 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6460 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6461 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6462 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6463 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6464 | data.recycle(); |
| 6465 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6466 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6467 | } |
| 6468 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6469 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6470 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 6471 | Parcel data = Parcel.obtain(); |
| 6472 | Parcel reply = Parcel.obtain(); |
| 6473 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6474 | data.writeInt(taskId); |
| 6475 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 6476 | reply.readException(); |
| 6477 | data.recycle(); |
| 6478 | reply.recycle(); |
| 6479 | } |
| 6480 | |
| 6481 | @Override |
| 6482 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 6483 | Parcel data = Parcel.obtain(); |
| 6484 | Parcel reply = Parcel.obtain(); |
| 6485 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6486 | data.writeStrongBinder(token); |
| 6487 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 6488 | reply.readException(); |
| 6489 | data.recycle(); |
| 6490 | reply.recycle(); |
| 6491 | } |
| 6492 | |
| 6493 | @Override |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 6494 | public void startSystemLockTaskMode(int taskId) throws RemoteException { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6495 | Parcel data = Parcel.obtain(); |
| 6496 | Parcel reply = Parcel.obtain(); |
| 6497 | data.writeInterfaceToken(IActivityManager.descriptor); |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 6498 | data.writeInt(taskId); |
| 6499 | mRemote.transact(START_SYSTEM_LOCK_TASK_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6500 | reply.readException(); |
| 6501 | data.recycle(); |
| 6502 | reply.recycle(); |
| 6503 | } |
| 6504 | |
| 6505 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6506 | public void stopLockTaskMode() throws RemoteException { |
| 6507 | Parcel data = Parcel.obtain(); |
| 6508 | Parcel reply = Parcel.obtain(); |
| 6509 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6510 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6511 | reply.readException(); |
| 6512 | data.recycle(); |
| 6513 | reply.recycle(); |
| 6514 | } |
| 6515 | |
| 6516 | @Override |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 6517 | public void stopSystemLockTaskMode() throws RemoteException { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6518 | Parcel data = Parcel.obtain(); |
| 6519 | Parcel reply = Parcel.obtain(); |
| 6520 | data.writeInterfaceToken(IActivityManager.descriptor); |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 6521 | mRemote.transact(STOP_SYSTEM_LOCK_TASK_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6522 | reply.readException(); |
| 6523 | data.recycle(); |
| 6524 | reply.recycle(); |
| 6525 | } |
| 6526 | |
| 6527 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6528 | public boolean isInLockTaskMode() throws RemoteException { |
| 6529 | Parcel data = Parcel.obtain(); |
| 6530 | Parcel reply = Parcel.obtain(); |
| 6531 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6532 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6533 | reply.readException(); |
| 6534 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 6535 | data.recycle(); |
| 6536 | reply.recycle(); |
| 6537 | return isInLockTaskMode; |
| 6538 | } |
| 6539 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 6540 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 6541 | public int getLockTaskModeState() throws RemoteException { |
| 6542 | Parcel data = Parcel.obtain(); |
| 6543 | Parcel reply = Parcel.obtain(); |
| 6544 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6545 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 6546 | reply.readException(); |
| 6547 | int lockTaskModeState = reply.readInt(); |
| 6548 | data.recycle(); |
| 6549 | reply.recycle(); |
| 6550 | return lockTaskModeState; |
| 6551 | } |
| 6552 | |
| 6553 | @Override |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 6554 | public void showLockTaskEscapeMessage(IBinder token) throws RemoteException { |
| 6555 | Parcel data = Parcel.obtain(); |
| 6556 | Parcel reply = Parcel.obtain(); |
| 6557 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6558 | data.writeStrongBinder(token); |
| 6559 | mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply, |
| 6560 | IBinder.FLAG_ONEWAY); |
| 6561 | reply.readException(); |
| 6562 | data.recycle(); |
| 6563 | reply.recycle(); |
| 6564 | } |
| 6565 | |
| 6566 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 6567 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6568 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6569 | Parcel data = Parcel.obtain(); |
| 6570 | Parcel reply = Parcel.obtain(); |
| 6571 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6572 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6573 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6574 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6575 | reply.readException(); |
| 6576 | data.recycle(); |
| 6577 | reply.recycle(); |
| 6578 | } |
| 6579 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6580 | @Override |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6581 | public void setTaskResizeable(int taskId, int resizeableMode) throws RemoteException { |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6582 | Parcel data = Parcel.obtain(); |
| 6583 | Parcel reply = Parcel.obtain(); |
| 6584 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6585 | data.writeInt(taskId); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6586 | data.writeInt(resizeableMode); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6587 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6588 | reply.readException(); |
| 6589 | data.recycle(); |
| 6590 | reply.recycle(); |
| 6591 | } |
| 6592 | |
| 6593 | @Override |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6594 | public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6595 | { |
| 6596 | Parcel data = Parcel.obtain(); |
| 6597 | Parcel reply = Parcel.obtain(); |
| 6598 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6599 | data.writeInt(taskId); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6600 | data.writeInt(resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6601 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6602 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6603 | reply.readException(); |
| 6604 | data.recycle(); |
| 6605 | reply.recycle(); |
| 6606 | } |
| 6607 | |
| 6608 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 6609 | public Rect getTaskBounds(int taskId) throws RemoteException |
| 6610 | { |
| 6611 | Parcel data = Parcel.obtain(); |
| 6612 | Parcel reply = Parcel.obtain(); |
| 6613 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6614 | data.writeInt(taskId); |
| 6615 | mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0); |
| 6616 | reply.readException(); |
| 6617 | Rect rect = Rect.CREATOR.createFromParcel(reply); |
| 6618 | data.recycle(); |
| 6619 | reply.recycle(); |
| 6620 | return rect; |
| 6621 | } |
| 6622 | |
| 6623 | @Override |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6624 | public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException { |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6625 | Parcel data = Parcel.obtain(); |
| 6626 | Parcel reply = Parcel.obtain(); |
| 6627 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6628 | data.writeString(filename); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6629 | data.writeInt(userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6630 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 6631 | reply.readException(); |
| 6632 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 6633 | data.recycle(); |
| 6634 | reply.recycle(); |
| 6635 | return icon; |
| 6636 | } |
| 6637 | |
| 6638 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6639 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 6640 | throws RemoteException { |
| 6641 | Parcel data = Parcel.obtain(); |
| 6642 | Parcel reply = Parcel.obtain(); |
| 6643 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6644 | if (options == null) { |
| 6645 | data.writeInt(0); |
| 6646 | } else { |
| 6647 | data.writeInt(1); |
| 6648 | data.writeBundle(options.toBundle()); |
| 6649 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6650 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6651 | reply.readException(); |
| 6652 | data.recycle(); |
| 6653 | reply.recycle(); |
| 6654 | } |
| 6655 | |
| 6656 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6657 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6658 | Parcel data = Parcel.obtain(); |
| 6659 | Parcel reply = Parcel.obtain(); |
| 6660 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6661 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6662 | data.writeInt(visible ? 1 : 0); |
| 6663 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6664 | reply.readException(); |
| 6665 | boolean success = reply.readInt() > 0; |
| 6666 | data.recycle(); |
| 6667 | reply.recycle(); |
| 6668 | return success; |
| 6669 | } |
| 6670 | |
| 6671 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6672 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6673 | Parcel data = Parcel.obtain(); |
| 6674 | Parcel reply = Parcel.obtain(); |
| 6675 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6676 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6677 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6678 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6679 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6680 | data.recycle(); |
| 6681 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6682 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6683 | } |
| 6684 | |
| 6685 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6686 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6687 | Parcel data = Parcel.obtain(); |
| 6688 | Parcel reply = Parcel.obtain(); |
| 6689 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6690 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6691 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 6692 | reply.readException(); |
| 6693 | data.recycle(); |
| 6694 | reply.recycle(); |
| 6695 | } |
| 6696 | |
| 6697 | @Override |
| 6698 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 6699 | Parcel data = Parcel.obtain(); |
| 6700 | Parcel reply = Parcel.obtain(); |
| 6701 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6702 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6703 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6704 | reply.readException(); |
| 6705 | data.recycle(); |
| 6706 | reply.recycle(); |
| 6707 | } |
| 6708 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6709 | @Override |
| 6710 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 6711 | Parcel data = Parcel.obtain(); |
| 6712 | Parcel reply = Parcel.obtain(); |
| 6713 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6714 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6715 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6716 | reply.readException(); |
| 6717 | data.recycle(); |
| 6718 | reply.recycle(); |
| 6719 | } |
| 6720 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 6721 | @Override |
| 6722 | public void bootAnimationComplete() throws RemoteException { |
| 6723 | Parcel data = Parcel.obtain(); |
| 6724 | Parcel reply = Parcel.obtain(); |
| 6725 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6726 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 6727 | reply.readException(); |
| 6728 | data.recycle(); |
| 6729 | reply.recycle(); |
| 6730 | } |
| 6731 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 6732 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 6733 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 6734 | Parcel data = Parcel.obtain(); |
| 6735 | Parcel reply = Parcel.obtain(); |
| 6736 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6737 | data.writeInt(uid); |
| 6738 | data.writeByteArray(firstPacket); |
| 6739 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 6740 | reply.readException(); |
| 6741 | data.recycle(); |
| 6742 | reply.recycle(); |
| 6743 | } |
| 6744 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6745 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6746 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 6747 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6748 | Parcel data = Parcel.obtain(); |
| 6749 | Parcel reply = Parcel.obtain(); |
| 6750 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6751 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6752 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6753 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6754 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6755 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 6756 | reply.readException(); |
| 6757 | data.recycle(); |
| 6758 | reply.recycle(); |
| 6759 | } |
| 6760 | |
| 6761 | @Override |
| 6762 | public void dumpHeapFinished(String path) throws RemoteException { |
| 6763 | Parcel data = Parcel.obtain(); |
| 6764 | Parcel reply = Parcel.obtain(); |
| 6765 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6766 | data.writeString(path); |
| 6767 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 6768 | reply.readException(); |
| 6769 | data.recycle(); |
| 6770 | reply.recycle(); |
| 6771 | } |
| 6772 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 6773 | @Override |
| 6774 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 6775 | throws RemoteException { |
| 6776 | Parcel data = Parcel.obtain(); |
| 6777 | Parcel reply = Parcel.obtain(); |
| 6778 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6779 | data.writeStrongBinder(session.asBinder()); |
| 6780 | data.writeInt(keepAwake ? 1 : 0); |
| 6781 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 6782 | reply.readException(); |
| 6783 | data.recycle(); |
| 6784 | reply.recycle(); |
| 6785 | } |
| 6786 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6787 | @Override |
| 6788 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 6789 | Parcel data = Parcel.obtain(); |
| 6790 | Parcel reply = Parcel.obtain(); |
| 6791 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6792 | data.writeInt(userId); |
| 6793 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6794 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6795 | reply.readException(); |
| 6796 | data.recycle(); |
| 6797 | reply.recycle(); |
| 6798 | } |
| 6799 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6800 | @Override |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 6801 | public void updateDeviceOwner(String packageName) throws RemoteException { |
| 6802 | Parcel data = Parcel.obtain(); |
| 6803 | Parcel reply = Parcel.obtain(); |
| 6804 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6805 | data.writeString(packageName); |
| 6806 | mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0); |
| 6807 | reply.readException(); |
| 6808 | data.recycle(); |
| 6809 | reply.recycle(); |
| 6810 | } |
| 6811 | |
| 6812 | @Override |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6813 | public int getPackageProcessState(String packageName, String callingPackage) |
| 6814 | throws RemoteException { |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6815 | Parcel data = Parcel.obtain(); |
| 6816 | Parcel reply = Parcel.obtain(); |
| 6817 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6818 | data.writeString(packageName); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6819 | data.writeString(callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6820 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 6821 | reply.readException(); |
| 6822 | int res = reply.readInt(); |
| 6823 | data.recycle(); |
| 6824 | reply.recycle(); |
| 6825 | return res; |
| 6826 | } |
| 6827 | |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 6828 | @Override |
| 6829 | public boolean setProcessMemoryTrimLevel(String process, int userId, int level) |
| 6830 | throws RemoteException { |
| 6831 | Parcel data = Parcel.obtain(); |
| 6832 | Parcel reply = Parcel.obtain(); |
| 6833 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6834 | data.writeString(process); |
| 6835 | data.writeInt(userId); |
| 6836 | data.writeInt(level); |
| 6837 | mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0); |
| 6838 | reply.readException(); |
| 6839 | int res = reply.readInt(); |
| 6840 | data.recycle(); |
| 6841 | reply.recycle(); |
| 6842 | return res != 0; |
| 6843 | } |
| 6844 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 6845 | @Override |
| 6846 | public boolean isRootVoiceInteraction(IBinder token) throws RemoteException { |
| 6847 | Parcel data = Parcel.obtain(); |
| 6848 | Parcel reply = Parcel.obtain(); |
| 6849 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6850 | data.writeStrongBinder(token); |
| 6851 | mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 6852 | reply.readException(); |
| 6853 | int res = reply.readInt(); |
| 6854 | data.recycle(); |
| 6855 | reply.recycle(); |
| 6856 | return res != 0; |
| 6857 | } |
| 6858 | |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6859 | @Override |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6860 | public void exitFreeformMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6861 | Parcel data = Parcel.obtain(); |
| 6862 | Parcel reply = Parcel.obtain(); |
| 6863 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6864 | data.writeStrongBinder(token); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6865 | mRemote.transact(EXIT_FREEFORM_MODE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6866 | reply.readException(); |
| 6867 | data.recycle(); |
| 6868 | reply.recycle(); |
| 6869 | } |
| 6870 | |
| 6871 | @Override |
| 6872 | public int getActivityStackId(IBinder token) throws RemoteException { |
| 6873 | Parcel data = Parcel.obtain(); |
| 6874 | Parcel reply = Parcel.obtain(); |
| 6875 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6876 | data.writeStrongBinder(token); |
| 6877 | mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0); |
| 6878 | reply.readException(); |
| 6879 | int stackId = reply.readInt(); |
| 6880 | data.recycle(); |
| 6881 | reply.recycle(); |
| 6882 | return stackId; |
| 6883 | } |
| 6884 | |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6885 | @Override |
| 6886 | public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration, |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6887 | int[] verticalSizeConfigurations, int[] smallestSizeConfigurations) |
| 6888 | throws RemoteException { |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6889 | Parcel data = Parcel.obtain(); |
| 6890 | Parcel reply = Parcel.obtain(); |
| 6891 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6892 | data.writeStrongBinder(token); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6893 | writeIntArray(horizontalSizeConfiguration, data); |
| 6894 | writeIntArray(verticalSizeConfigurations, data); |
| 6895 | writeIntArray(smallestSizeConfigurations, data); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6896 | mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0); |
| 6897 | reply.readException(); |
| 6898 | data.recycle(); |
| 6899 | reply.recycle(); |
| 6900 | } |
| 6901 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6902 | private static void writeIntArray(int[] array, Parcel data) { |
| 6903 | if (array == null) { |
| 6904 | data.writeInt(0); |
| 6905 | } else { |
| 6906 | data.writeInt(array.length); |
| 6907 | data.writeIntArray(array); |
| 6908 | } |
| 6909 | } |
| 6910 | |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 6911 | @Override |
| 6912 | public void suppressResizeConfigChanges(boolean suppress) throws RemoteException { |
| 6913 | Parcel data = Parcel.obtain(); |
| 6914 | Parcel reply = Parcel.obtain(); |
| 6915 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6916 | data.writeInt(suppress ? 1 : 0); |
| 6917 | mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0); |
| 6918 | reply.readException(); |
| 6919 | data.recycle(); |
| 6920 | reply.recycle(); |
| 6921 | } |
| 6922 | |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6923 | @Override |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6924 | public void moveTasksToFullscreenStack(int fromStackId, boolean onTop) throws RemoteException { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6925 | Parcel data = Parcel.obtain(); |
| 6926 | Parcel reply = Parcel.obtain(); |
| 6927 | data.writeInterfaceToken(IActivityManager.descriptor); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6928 | data.writeInt(fromStackId); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6929 | data.writeInt(onTop ? 1 : 0); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6930 | mRemote.transact(MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION, data, reply, 0); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6931 | reply.readException(); |
| 6932 | data.recycle(); |
| 6933 | reply.recycle(); |
| 6934 | } |
| 6935 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6936 | @Override |
| 6937 | public int getAppStartMode(int uid, String packageName) throws RemoteException { |
| 6938 | Parcel data = Parcel.obtain(); |
| 6939 | Parcel reply = Parcel.obtain(); |
| 6940 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6941 | data.writeInt(uid); |
| 6942 | data.writeString(packageName); |
| 6943 | mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0); |
| 6944 | reply.readException(); |
| 6945 | int res = reply.readInt(); |
| 6946 | data.recycle(); |
| 6947 | reply.recycle(); |
| 6948 | return res; |
| 6949 | } |
| 6950 | |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6951 | @Override |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 6952 | public boolean isInMultiWindowMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6953 | Parcel data = Parcel.obtain(); |
| 6954 | Parcel reply = Parcel.obtain(); |
| 6955 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6956 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6957 | mRemote.transact(IN_MULTI_WINDOW_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6958 | reply.readException(); |
| 6959 | final boolean multiWindowMode = reply.readInt() == 1 ? true : false; |
| 6960 | data.recycle(); |
| 6961 | reply.recycle(); |
| 6962 | return multiWindowMode; |
| 6963 | } |
| 6964 | |
| 6965 | @Override |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 6966 | public boolean isInPictureInPictureMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6967 | Parcel data = Parcel.obtain(); |
| 6968 | Parcel reply = Parcel.obtain(); |
| 6969 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6970 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6971 | mRemote.transact(IN_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6972 | reply.readException(); |
| 6973 | final boolean pipMode = reply.readInt() == 1 ? true : false; |
| 6974 | data.recycle(); |
| 6975 | reply.recycle(); |
| 6976 | return pipMode; |
| 6977 | } |
| 6978 | |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6979 | @Override |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 6980 | public void enterPictureInPictureMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6981 | Parcel data = Parcel.obtain(); |
| 6982 | Parcel reply = Parcel.obtain(); |
| 6983 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6984 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6985 | mRemote.transact(ENTER_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6986 | reply.readException(); |
| 6987 | data.recycle(); |
| 6988 | reply.recycle(); |
| 6989 | } |
| 6990 | |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 6991 | @Override |
| 6992 | public boolean isAppForeground(int uid) throws RemoteException { |
| 6993 | Parcel data = Parcel.obtain(); |
| 6994 | Parcel reply = Parcel.obtain(); |
| 6995 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6996 | data.writeInt(uid); |
| 6997 | mRemote.transact(IS_APP_FOREGROUND_TRANSACTION, data, reply, 0); |
| 6998 | final boolean isForeground = reply.readInt() == 1 ? true : false; |
| 6999 | data.recycle(); |
| 7000 | reply.recycle(); |
| 7001 | return isForeground; |
| 7002 | }; |
| 7003 | |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 7004 | @Override |
| 7005 | public void notifyPinnedStackAnimationEnded() throws RemoteException { |
| 7006 | Parcel data = Parcel.obtain(); |
| 7007 | Parcel reply = Parcel.obtain(); |
| 7008 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 7009 | mRemote.transact(NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION, data, reply, 0); |
| 7010 | data.recycle(); |
| 7011 | reply.recycle(); |
| 7012 | }; |
| 7013 | |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 7014 | @Override |
| 7015 | public void removeStack(int stackId) throws RemoteException { |
| 7016 | Parcel data = Parcel.obtain(); |
| 7017 | Parcel reply = Parcel.obtain(); |
| 7018 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 7019 | data.writeInt(stackId); |
| 7020 | mRemote.transact(REMOVE_STACK, data, reply, 0); |
| 7021 | reply.readException(); |
| 7022 | data.recycle(); |
| 7023 | reply.recycle(); |
| 7024 | } |
| 7025 | |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 7026 | @Override |
| 7027 | public void notifyLockedProfile(@UserIdInt int userId) throws RemoteException { |
Tony Mak | 9c6e8ce | 2016-03-21 12:07:16 +0000 | [diff] [blame] | 7028 | Parcel data = Parcel.obtain(); |
| 7029 | Parcel reply = Parcel.obtain(); |
| 7030 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 7031 | data.writeInt(userId); |
| 7032 | mRemote.transact(NOTIFY_LOCKED_PROFILE, data, reply, 0); |
| 7033 | reply.readException(); |
| 7034 | data.recycle(); |
| 7035 | reply.recycle(); |
| 7036 | } |
| 7037 | |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 7038 | @Override |
Tony Mak | 646fe99 | 2016-04-21 16:43:08 +0100 | [diff] [blame] | 7039 | public void startConfirmDeviceCredentialIntent(Intent intent) throws RemoteException { |
| 7040 | Parcel data = Parcel.obtain(); |
| 7041 | Parcel reply = Parcel.obtain(); |
| 7042 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 7043 | intent.writeToParcel(data, 0); |
| 7044 | mRemote.transact(START_CONFIRM_DEVICE_CREDENTIAL_INTENT, data, reply, 0); |
| 7045 | reply.readException(); |
| 7046 | data.recycle(); |
| 7047 | reply.recycle(); |
| 7048 | } |
| 7049 | |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 7050 | @Override |
Dianne Hackborn | 0c4e6a8 | 2016-05-13 17:37:08 -0700 | [diff] [blame] | 7051 | public int sendIntentSender(IIntentSender target, int code, Intent intent, String resolvedType, |
| 7052 | IIntentReceiver finishedReceiver, String requiredPermission, Bundle options) |
| 7053 | throws RemoteException { |
| 7054 | Parcel data = Parcel.obtain(); |
| 7055 | Parcel reply = Parcel.obtain(); |
| 7056 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 7057 | data.writeStrongBinder(target.asBinder()); |
| 7058 | data.writeInt(code); |
| 7059 | if ((intent!=null)) { |
| 7060 | data.writeInt(1); |
| 7061 | intent.writeToParcel(data, 0); |
| 7062 | } |
| 7063 | else { |
| 7064 | data.writeInt(0); |
| 7065 | } |
| 7066 | data.writeString(resolvedType); |
| 7067 | data.writeStrongBinder((((finishedReceiver!=null))?(finishedReceiver.asBinder()):(null))); |
| 7068 | data.writeString(requiredPermission); |
| 7069 | if ((options!=null)) { |
| 7070 | data.writeInt(1); |
| 7071 | options.writeToParcel(data, 0); |
| 7072 | } |
| 7073 | else { |
| 7074 | data.writeInt(0); |
| 7075 | } |
| 7076 | mRemote.transact(SEND_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 5035d29 | 2016-05-23 14:39:45 -0700 | [diff] [blame] | 7077 | reply.readException(); |
Dianne Hackborn | 0c4e6a8 | 2016-05-13 17:37:08 -0700 | [diff] [blame] | 7078 | final int res = reply.readInt(); |
| 7079 | data.recycle(); |
| 7080 | reply.recycle(); |
| 7081 | return res; |
| 7082 | } |
| 7083 | |
Srinath Sridharan | e535a58 | 2016-06-27 18:13:47 -0700 | [diff] [blame] | 7084 | @Override |
| 7085 | public void setVrThread(int tid) |
Tim Murray | 33eb07f | 2016-06-10 10:03:20 -0700 | [diff] [blame] | 7086 | throws RemoteException { |
Srinath Sridharan | e535a58 | 2016-06-27 18:13:47 -0700 | [diff] [blame] | 7087 | Parcel data = Parcel.obtain(); |
| 7088 | Parcel reply = Parcel.obtain(); |
| 7089 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 7090 | data.writeInt(tid); |
| 7091 | mRemote.transact(SET_VR_THREAD_TRANSACTION, data, reply, 0); |
| 7092 | reply.readException(); |
| 7093 | data.recycle(); |
| 7094 | reply.recycle(); |
| 7095 | return; |
| 7096 | } |
| 7097 | |
Tim Murray | 33eb07f | 2016-06-10 10:03:20 -0700 | [diff] [blame] | 7098 | public void setRenderThread(int tid) |
| 7099 | throws RemoteException { |
| 7100 | Parcel data = Parcel.obtain(); |
| 7101 | Parcel reply = Parcel.obtain(); |
| 7102 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 7103 | data.writeInt(tid); |
| 7104 | mRemote.transact(SET_RENDER_THREAD_TRANSACTION, data, reply, 0); |
| 7105 | reply.readException(); |
| 7106 | data.recycle(); |
| 7107 | reply.recycle(); |
| 7108 | return; |
| 7109 | } |
| 7110 | |
Jorim Jaggi | f6782ee | 2016-07-22 11:40:00 +0200 | [diff] [blame] | 7111 | public void setHasTopUi(boolean hasTopUi) |
| 7112 | throws RemoteException { |
| 7113 | Parcel data = Parcel.obtain(); |
| 7114 | Parcel reply = Parcel.obtain(); |
| 7115 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 7116 | data.writeInt(hasTopUi ? 1 : 0); |
| 7117 | mRemote.transact(SET_HAS_TOP_UI, data, reply, 0); |
| 7118 | reply.readException(); |
| 7119 | data.recycle(); |
| 7120 | reply.recycle(); |
| 7121 | return; |
| 7122 | } |
Rubin Xu | 89927b3 | 2016-07-28 14:34:26 +0100 | [diff] [blame] | 7123 | @Override |
| 7124 | public boolean canBypassWorkChallenge(PendingIntent intent) |
| 7125 | throws RemoteException { |
| 7126 | Parcel data = Parcel.obtain(); |
| 7127 | Parcel reply = Parcel.obtain(); |
| 7128 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 7129 | intent.writeToParcel(data, 0); |
| 7130 | mRemote.transact(CAN_BYPASS_WORK_CHALLENGE, data, reply, 0); |
| 7131 | reply.readException(); |
| 7132 | final int result = reply.readInt(); |
| 7133 | data.recycle(); |
| 7134 | reply.recycle(); |
| 7135 | return result != 0; |
| 7136 | } |
Jorim Jaggi | f6782ee | 2016-07-22 11:40:00 +0200 | [diff] [blame] | 7137 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7138 | private IBinder mRemote; |
| 7139 | } |