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 | |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 416 | case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: { |
| 417 | data.enforceInterface(IActivityManager.descriptor); |
| 418 | IBinder token = data.readStrongBinder(); |
| 419 | boolean res = releaseActivityInstance(token); |
| 420 | reply.writeNoException(); |
| 421 | reply.writeInt(res ? 1 : 0); |
| 422 | return true; |
| 423 | } |
| 424 | |
| 425 | case RELEASE_SOME_ACTIVITIES_TRANSACTION: { |
| 426 | data.enforceInterface(IActivityManager.descriptor); |
| 427 | IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder()); |
| 428 | releaseSomeActivities(app); |
| 429 | reply.writeNoException(); |
| 430 | return true; |
| 431 | } |
| 432 | |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 433 | case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: { |
| 434 | data.enforceInterface(IActivityManager.descriptor); |
| 435 | IBinder token = data.readStrongBinder(); |
| 436 | boolean res = willActivityBeVisible(token); |
| 437 | reply.writeNoException(); |
| 438 | reply.writeInt(res ? 1 : 0); |
| 439 | return true; |
| 440 | } |
| 441 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 442 | case REGISTER_RECEIVER_TRANSACTION: |
| 443 | { |
| 444 | data.enforceInterface(IActivityManager.descriptor); |
| 445 | IBinder b = data.readStrongBinder(); |
| 446 | IApplicationThread app = |
| 447 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 448 | String packageName = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 449 | b = data.readStrongBinder(); |
| 450 | IIntentReceiver rec |
| 451 | = b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 452 | IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data); |
| 453 | String perm = data.readString(); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 454 | int userId = data.readInt(); |
| 455 | Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 456 | reply.writeNoException(); |
| 457 | if (intent != null) { |
| 458 | reply.writeInt(1); |
| 459 | intent.writeToParcel(reply, 0); |
| 460 | } else { |
| 461 | reply.writeInt(0); |
| 462 | } |
| 463 | return true; |
| 464 | } |
| 465 | |
| 466 | case UNREGISTER_RECEIVER_TRANSACTION: |
| 467 | { |
| 468 | data.enforceInterface(IActivityManager.descriptor); |
| 469 | IBinder b = data.readStrongBinder(); |
| 470 | if (b == null) { |
| 471 | return true; |
| 472 | } |
| 473 | IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b); |
| 474 | unregisterReceiver(rec); |
| 475 | reply.writeNoException(); |
| 476 | return true; |
| 477 | } |
| 478 | |
| 479 | case BROADCAST_INTENT_TRANSACTION: |
| 480 | { |
| 481 | data.enforceInterface(IActivityManager.descriptor); |
| 482 | IBinder b = data.readStrongBinder(); |
| 483 | IApplicationThread app = |
| 484 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 485 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 486 | String resolvedType = data.readString(); |
| 487 | b = data.readStrongBinder(); |
| 488 | IIntentReceiver resultTo = |
| 489 | b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 490 | int resultCode = data.readInt(); |
| 491 | String resultData = data.readString(); |
| 492 | Bundle resultExtras = data.readBundle(); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 493 | String[] perms = data.readStringArray(); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 494 | int appOp = data.readInt(); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 495 | Bundle options = data.readBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 496 | boolean serialized = data.readInt() != 0; |
| 497 | boolean sticky = data.readInt() != 0; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 498 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 499 | int res = broadcastIntent(app, intent, resolvedType, resultTo, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 500 | resultCode, resultData, resultExtras, perms, appOp, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 501 | options, serialized, sticky, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 502 | reply.writeNoException(); |
| 503 | reply.writeInt(res); |
| 504 | return true; |
| 505 | } |
| 506 | |
| 507 | case UNBROADCAST_INTENT_TRANSACTION: |
| 508 | { |
| 509 | data.enforceInterface(IActivityManager.descriptor); |
| 510 | IBinder b = data.readStrongBinder(); |
| 511 | IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 512 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 513 | int userId = data.readInt(); |
| 514 | unbroadcastIntent(app, intent, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 515 | reply.writeNoException(); |
| 516 | return true; |
| 517 | } |
| 518 | |
| 519 | case FINISH_RECEIVER_TRANSACTION: { |
| 520 | data.enforceInterface(IActivityManager.descriptor); |
| 521 | IBinder who = data.readStrongBinder(); |
| 522 | int resultCode = data.readInt(); |
| 523 | String resultData = data.readString(); |
| 524 | Bundle resultExtras = data.readBundle(); |
| 525 | boolean resultAbort = data.readInt() != 0; |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 526 | int intentFlags = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 527 | if (who != null) { |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 528 | finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 529 | } |
| 530 | reply.writeNoException(); |
| 531 | return true; |
| 532 | } |
| 533 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 534 | case ATTACH_APPLICATION_TRANSACTION: { |
| 535 | data.enforceInterface(IActivityManager.descriptor); |
| 536 | IApplicationThread app = ApplicationThreadNative.asInterface( |
| 537 | data.readStrongBinder()); |
| 538 | if (app != null) { |
| 539 | attachApplication(app); |
| 540 | } |
| 541 | reply.writeNoException(); |
| 542 | return true; |
| 543 | } |
| 544 | |
| 545 | case ACTIVITY_IDLE_TRANSACTION: { |
| 546 | data.enforceInterface(IActivityManager.descriptor); |
| 547 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 548 | Configuration config = null; |
| 549 | if (data.readInt() != 0) { |
| 550 | config = Configuration.CREATOR.createFromParcel(data); |
| 551 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 552 | boolean stopProfiling = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 553 | if (token != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 554 | activityIdle(token, config, stopProfiling); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 555 | } |
| 556 | reply.writeNoException(); |
| 557 | return true; |
| 558 | } |
| 559 | |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 560 | case ACTIVITY_RESUMED_TRANSACTION: { |
| 561 | data.enforceInterface(IActivityManager.descriptor); |
| 562 | IBinder token = data.readStrongBinder(); |
| 563 | activityResumed(token); |
| 564 | reply.writeNoException(); |
| 565 | return true; |
| 566 | } |
| 567 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 568 | case ACTIVITY_PAUSED_TRANSACTION: { |
| 569 | data.enforceInterface(IActivityManager.descriptor); |
| 570 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 571 | activityPaused(token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 572 | reply.writeNoException(); |
| 573 | return true; |
| 574 | } |
| 575 | |
| 576 | case ACTIVITY_STOPPED_TRANSACTION: { |
| 577 | data.enforceInterface(IActivityManager.descriptor); |
| 578 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 579 | Bundle map = data.readBundle(); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 580 | PersistableBundle persistentState = data.readPersistableBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 581 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 582 | activityStopped(token, map, persistentState, description); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 583 | reply.writeNoException(); |
| 584 | return true; |
| 585 | } |
| 586 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 587 | case ACTIVITY_SLEPT_TRANSACTION: { |
| 588 | data.enforceInterface(IActivityManager.descriptor); |
| 589 | IBinder token = data.readStrongBinder(); |
| 590 | activitySlept(token); |
| 591 | reply.writeNoException(); |
| 592 | return true; |
| 593 | } |
| 594 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 595 | case ACTIVITY_DESTROYED_TRANSACTION: { |
| 596 | data.enforceInterface(IActivityManager.descriptor); |
| 597 | IBinder token = data.readStrongBinder(); |
| 598 | activityDestroyed(token); |
| 599 | reply.writeNoException(); |
| 600 | return true; |
| 601 | } |
| 602 | |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 603 | case ACTIVITY_RELAUNCHED_TRANSACTION: { |
| 604 | data.enforceInterface(IActivityManager.descriptor); |
| 605 | IBinder token = data.readStrongBinder(); |
| 606 | activityRelaunched(token); |
| 607 | reply.writeNoException(); |
| 608 | return true; |
| 609 | } |
| 610 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 611 | case GET_CALLING_PACKAGE_TRANSACTION: { |
| 612 | data.enforceInterface(IActivityManager.descriptor); |
| 613 | IBinder token = data.readStrongBinder(); |
| 614 | String res = token != null ? getCallingPackage(token) : null; |
| 615 | reply.writeNoException(); |
| 616 | reply.writeString(res); |
| 617 | return true; |
| 618 | } |
| 619 | |
| 620 | case GET_CALLING_ACTIVITY_TRANSACTION: { |
| 621 | data.enforceInterface(IActivityManager.descriptor); |
| 622 | IBinder token = data.readStrongBinder(); |
| 623 | ComponentName cn = getCallingActivity(token); |
| 624 | reply.writeNoException(); |
| 625 | ComponentName.writeToParcel(cn, reply); |
| 626 | return true; |
| 627 | } |
| 628 | |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 629 | case GET_APP_TASKS_TRANSACTION: { |
| 630 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 631 | String callingPackage = data.readString(); |
| 632 | List<IAppTask> list = getAppTasks(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 633 | reply.writeNoException(); |
| 634 | int N = list != null ? list.size() : -1; |
| 635 | reply.writeInt(N); |
| 636 | int i; |
| 637 | for (i=0; i<N; i++) { |
| 638 | IAppTask task = list.get(i); |
| 639 | reply.writeStrongBinder(task.asBinder()); |
| 640 | } |
| 641 | return true; |
| 642 | } |
| 643 | |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 644 | case ADD_APP_TASK_TRANSACTION: { |
| 645 | data.enforceInterface(IActivityManager.descriptor); |
| 646 | IBinder activityToken = data.readStrongBinder(); |
| 647 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 648 | ActivityManager.TaskDescription descr |
| 649 | = ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 650 | Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data); |
| 651 | int res = addAppTask(activityToken, intent, descr, thumbnail); |
| 652 | reply.writeNoException(); |
| 653 | reply.writeInt(res); |
| 654 | return true; |
| 655 | } |
| 656 | |
| 657 | case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: { |
| 658 | data.enforceInterface(IActivityManager.descriptor); |
| 659 | Point size = getAppTaskThumbnailSize(); |
| 660 | reply.writeNoException(); |
| 661 | size.writeToParcel(reply, 0); |
| 662 | return true; |
| 663 | } |
| 664 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 665 | case GET_TASKS_TRANSACTION: { |
| 666 | data.enforceInterface(IActivityManager.descriptor); |
| 667 | int maxNum = data.readInt(); |
| 668 | int fl = data.readInt(); |
Dianne Hackborn | 0923328 | 2014-04-30 11:33:59 -0700 | [diff] [blame] | 669 | List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 670 | reply.writeNoException(); |
| 671 | int N = list != null ? list.size() : -1; |
| 672 | reply.writeInt(N); |
| 673 | int i; |
| 674 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 675 | ActivityManager.RunningTaskInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 676 | info.writeToParcel(reply, 0); |
| 677 | } |
| 678 | return true; |
| 679 | } |
| 680 | |
| 681 | case GET_RECENT_TASKS_TRANSACTION: { |
| 682 | data.enforceInterface(IActivityManager.descriptor); |
| 683 | int maxNum = data.readInt(); |
| 684 | int fl = data.readInt(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 685 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 686 | List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 687 | fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 688 | reply.writeNoException(); |
| 689 | reply.writeTypedList(list); |
| 690 | return true; |
| 691 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 692 | |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 693 | case GET_TASK_THUMBNAIL_TRANSACTION: { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 694 | data.enforceInterface(IActivityManager.descriptor); |
| 695 | int id = data.readInt(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 696 | ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 697 | reply.writeNoException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 698 | if (taskThumbnail != null) { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 699 | reply.writeInt(1); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 700 | taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 701 | } else { |
| 702 | reply.writeInt(0); |
| 703 | } |
| 704 | return true; |
| 705 | } |
| 706 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 707 | case GET_SERVICES_TRANSACTION: { |
| 708 | data.enforceInterface(IActivityManager.descriptor); |
| 709 | int maxNum = data.readInt(); |
| 710 | int fl = data.readInt(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 711 | List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 712 | reply.writeNoException(); |
| 713 | int N = list != null ? list.size() : -1; |
| 714 | reply.writeInt(N); |
| 715 | int i; |
| 716 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 717 | ActivityManager.RunningServiceInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 718 | info.writeToParcel(reply, 0); |
| 719 | } |
| 720 | return true; |
| 721 | } |
| 722 | |
| 723 | case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: { |
| 724 | data.enforceInterface(IActivityManager.descriptor); |
| 725 | List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState(); |
| 726 | reply.writeNoException(); |
| 727 | reply.writeTypedList(list); |
| 728 | return true; |
| 729 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 730 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 731 | case GET_RUNNING_APP_PROCESSES_TRANSACTION: { |
| 732 | data.enforceInterface(IActivityManager.descriptor); |
| 733 | List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses(); |
| 734 | reply.writeNoException(); |
| 735 | reply.writeTypedList(list); |
| 736 | return true; |
| 737 | } |
| 738 | |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 739 | case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: { |
| 740 | data.enforceInterface(IActivityManager.descriptor); |
| 741 | List<ApplicationInfo> list = getRunningExternalApplications(); |
| 742 | reply.writeNoException(); |
| 743 | reply.writeTypedList(list); |
| 744 | return true; |
| 745 | } |
| 746 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 747 | case MOVE_TASK_TO_FRONT_TRANSACTION: { |
| 748 | data.enforceInterface(IActivityManager.descriptor); |
| 749 | int task = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 750 | int fl = data.readInt(); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 751 | Bundle options = data.readInt() != 0 |
| 752 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 753 | moveTaskToFront(task, fl, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 754 | reply.writeNoException(); |
| 755 | return true; |
| 756 | } |
| 757 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 758 | case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: { |
| 759 | data.enforceInterface(IActivityManager.descriptor); |
| 760 | IBinder token = data.readStrongBinder(); |
| 761 | boolean nonRoot = data.readInt() != 0; |
| 762 | boolean res = moveActivityTaskToBack(token, nonRoot); |
| 763 | reply.writeNoException(); |
| 764 | reply.writeInt(res ? 1 : 0); |
| 765 | return true; |
| 766 | } |
| 767 | |
| 768 | case MOVE_TASK_BACKWARDS_TRANSACTION: { |
| 769 | data.enforceInterface(IActivityManager.descriptor); |
| 770 | int task = data.readInt(); |
| 771 | moveTaskBackwards(task); |
| 772 | reply.writeNoException(); |
| 773 | return true; |
| 774 | } |
| 775 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 776 | case MOVE_TASK_TO_STACK_TRANSACTION: { |
| 777 | data.enforceInterface(IActivityManager.descriptor); |
| 778 | int taskId = data.readInt(); |
| 779 | int stackId = data.readInt(); |
| 780 | boolean toTop = data.readInt() != 0; |
| 781 | moveTaskToStack(taskId, stackId, toTop); |
| 782 | reply.writeNoException(); |
| 783 | return true; |
| 784 | } |
| 785 | |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 786 | case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: { |
| 787 | data.enforceInterface(IActivityManager.descriptor); |
| 788 | int taskId = data.readInt(); |
| 789 | int createMode = data.readInt(); |
| 790 | boolean toTop = data.readInt() != 0; |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 791 | boolean animate = data.readInt() != 0; |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 792 | Rect bounds = null; |
| 793 | boolean hasBounds = data.readInt() != 0; |
| 794 | if (hasBounds) { |
| 795 | bounds = Rect.CREATOR.createFromParcel(data); |
| 796 | } |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 797 | boolean res = moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 798 | reply.writeNoException(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 799 | reply.writeInt(res ? 1 : 0); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 800 | return true; |
| 801 | } |
| 802 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 803 | case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: { |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 804 | data.enforceInterface(IActivityManager.descriptor); |
| 805 | final int stackId = data.readInt(); |
| 806 | final Rect r = Rect.CREATOR.createFromParcel(data); |
| 807 | final boolean res = moveTopActivityToPinnedStack(stackId, r); |
| 808 | reply.writeNoException(); |
| 809 | reply.writeInt(res ? 1 : 0); |
| 810 | return true; |
| 811 | } |
| 812 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 813 | case RESIZE_STACK_TRANSACTION: { |
| 814 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 815 | final int stackId = data.readInt(); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 816 | final boolean hasRect = data.readInt() != 0; |
| 817 | Rect r = null; |
| 818 | if (hasRect) { |
| 819 | r = Rect.CREATOR.createFromParcel(data); |
| 820 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 821 | final boolean allowResizeInDockedMode = data.readInt() == 1; |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 822 | final boolean preserveWindows = data.readInt() == 1; |
| 823 | final boolean animate = data.readInt() == 1; |
Wale Ogunwale | e75a9ad | 2016-03-18 20:43:49 -0700 | [diff] [blame] | 824 | final int animationDuration = data.readInt(); |
| 825 | resizeStack(stackId, |
| 826 | r, allowResizeInDockedMode, preserveWindows, animate, animationDuration); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 827 | reply.writeNoException(); |
| 828 | return true; |
| 829 | } |
Robert Carr | 0d00c2e | 2016-02-29 17:45:02 -0800 | [diff] [blame] | 830 | case RESIZE_PINNED_STACK_TRANSACTION: { |
| 831 | data.enforceInterface(IActivityManager.descriptor); |
| 832 | final boolean hasBounds = data.readInt() != 0; |
| 833 | Rect bounds = null; |
| 834 | if (hasBounds) { |
| 835 | bounds = Rect.CREATOR.createFromParcel(data); |
| 836 | } |
| 837 | final boolean hasTempPinnedTaskBounds = data.readInt() != 0; |
| 838 | Rect tempPinnedTaskBounds = null; |
| 839 | if (hasTempPinnedTaskBounds) { |
| 840 | tempPinnedTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 841 | } |
| 842 | resizePinnedStack(bounds, tempPinnedTaskBounds); |
| 843 | return true; |
| 844 | } |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 845 | case SWAP_DOCKED_AND_FULLSCREEN_STACK: { |
| 846 | data.enforceInterface(IActivityManager.descriptor); |
| 847 | swapDockedAndFullscreenStack(); |
| 848 | reply.writeNoException(); |
| 849 | return true; |
| 850 | } |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 851 | case RESIZE_DOCKED_STACK_TRANSACTION: { |
| 852 | data.enforceInterface(IActivityManager.descriptor); |
| 853 | final boolean hasBounds = data.readInt() != 0; |
| 854 | Rect bounds = null; |
| 855 | if (hasBounds) { |
| 856 | bounds = Rect.CREATOR.createFromParcel(data); |
| 857 | } |
| 858 | final boolean hasTempDockedTaskBounds = data.readInt() != 0; |
| 859 | Rect tempDockedTaskBounds = null; |
| 860 | if (hasTempDockedTaskBounds) { |
| 861 | tempDockedTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 862 | } |
| 863 | final boolean hasTempDockedTaskInsetBounds = data.readInt() != 0; |
| 864 | Rect tempDockedTaskInsetBounds = null; |
| 865 | if (hasTempDockedTaskInsetBounds) { |
| 866 | tempDockedTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 867 | } |
| 868 | final boolean hasTempOtherTaskBounds = data.readInt() != 0; |
| 869 | Rect tempOtherTaskBounds = null; |
| 870 | if (hasTempOtherTaskBounds) { |
| 871 | tempOtherTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 872 | } |
| 873 | final boolean hasTempOtherTaskInsetBounds = data.readInt() != 0; |
| 874 | Rect tempOtherTaskInsetBounds = null; |
| 875 | if (hasTempOtherTaskInsetBounds) { |
| 876 | tempOtherTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 877 | } |
| 878 | resizeDockedStack(bounds, tempDockedTaskBounds, tempDockedTaskInsetBounds, |
| 879 | tempOtherTaskBounds, tempOtherTaskInsetBounds); |
| 880 | reply.writeNoException(); |
| 881 | return true; |
| 882 | } |
| 883 | |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 884 | case POSITION_TASK_IN_STACK_TRANSACTION: { |
| 885 | data.enforceInterface(IActivityManager.descriptor); |
| 886 | int taskId = data.readInt(); |
| 887 | int stackId = data.readInt(); |
| 888 | int position = data.readInt(); |
| 889 | positionTaskInStack(taskId, stackId, position); |
| 890 | reply.writeNoException(); |
| 891 | return true; |
| 892 | } |
| 893 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 894 | case GET_ALL_STACK_INFOS_TRANSACTION: { |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 895 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 896 | List<StackInfo> list = getAllStackInfos(); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 897 | reply.writeNoException(); |
| 898 | reply.writeTypedList(list); |
| 899 | return true; |
| 900 | } |
| 901 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 902 | case GET_STACK_INFO_TRANSACTION: { |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 903 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 904 | int stackId = data.readInt(); |
| 905 | StackInfo info = getStackInfo(stackId); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 906 | reply.writeNoException(); |
| 907 | if (info != null) { |
| 908 | reply.writeInt(1); |
| 909 | info.writeToParcel(reply, 0); |
| 910 | } else { |
| 911 | reply.writeInt(0); |
| 912 | } |
| 913 | return true; |
| 914 | } |
| 915 | |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 916 | case IS_IN_HOME_STACK_TRANSACTION: { |
| 917 | data.enforceInterface(IActivityManager.descriptor); |
| 918 | int taskId = data.readInt(); |
| 919 | boolean isInHomeStack = isInHomeStack(taskId); |
| 920 | reply.writeNoException(); |
| 921 | reply.writeInt(isInHomeStack ? 1 : 0); |
| 922 | return true; |
| 923 | } |
| 924 | |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 925 | case SET_FOCUSED_STACK_TRANSACTION: { |
| 926 | data.enforceInterface(IActivityManager.descriptor); |
| 927 | int stackId = data.readInt(); |
| 928 | setFocusedStack(stackId); |
| 929 | reply.writeNoException(); |
| 930 | return true; |
| 931 | } |
| 932 | |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 933 | case GET_FOCUSED_STACK_ID_TRANSACTION: { |
| 934 | data.enforceInterface(IActivityManager.descriptor); |
| 935 | int focusedStackId = getFocusedStackId(); |
| 936 | reply.writeNoException(); |
| 937 | reply.writeInt(focusedStackId); |
| 938 | return true; |
| 939 | } |
| 940 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 941 | case SET_FOCUSED_TASK_TRANSACTION: { |
| 942 | data.enforceInterface(IActivityManager.descriptor); |
| 943 | int taskId = data.readInt(); |
Skuhne | f36bb0c | 2015-08-26 14:26:17 -0700 | [diff] [blame] | 944 | setFocusedTask(taskId); |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 945 | reply.writeNoException(); |
| 946 | return true; |
| 947 | } |
| 948 | |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 949 | case REGISTER_TASK_STACK_LISTENER_TRANSACTION: { |
| 950 | data.enforceInterface(IActivityManager.descriptor); |
| 951 | IBinder token = data.readStrongBinder(); |
| 952 | registerTaskStackListener(ITaskStackListener.Stub.asInterface(token)); |
| 953 | reply.writeNoException(); |
| 954 | return true; |
| 955 | } |
| 956 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 957 | case GET_TASK_FOR_ACTIVITY_TRANSACTION: { |
| 958 | data.enforceInterface(IActivityManager.descriptor); |
| 959 | IBinder token = data.readStrongBinder(); |
| 960 | boolean onlyRoot = data.readInt() != 0; |
| 961 | int res = token != null |
| 962 | ? getTaskForActivity(token, onlyRoot) : -1; |
| 963 | reply.writeNoException(); |
| 964 | reply.writeInt(res); |
| 965 | return true; |
| 966 | } |
| 967 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 968 | case GET_CONTENT_PROVIDER_TRANSACTION: { |
| 969 | data.enforceInterface(IActivityManager.descriptor); |
| 970 | IBinder b = data.readStrongBinder(); |
| 971 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 972 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 973 | int userId = data.readInt(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 974 | boolean stable = data.readInt() != 0; |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 975 | ContentProviderHolder cph = getContentProvider(app, name, userId, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 976 | reply.writeNoException(); |
| 977 | if (cph != null) { |
| 978 | reply.writeInt(1); |
| 979 | cph.writeToParcel(reply, 0); |
| 980 | } else { |
| 981 | reply.writeInt(0); |
| 982 | } |
| 983 | return true; |
| 984 | } |
| 985 | |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 986 | case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 987 | data.enforceInterface(IActivityManager.descriptor); |
| 988 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 989 | int userId = data.readInt(); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 990 | IBinder token = data.readStrongBinder(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 991 | ContentProviderHolder cph = getContentProviderExternal(name, userId, token); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 992 | reply.writeNoException(); |
| 993 | if (cph != null) { |
| 994 | reply.writeInt(1); |
| 995 | cph.writeToParcel(reply, 0); |
| 996 | } else { |
| 997 | reply.writeInt(0); |
| 998 | } |
| 999 | return true; |
| 1000 | } |
| 1001 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1002 | case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: { |
| 1003 | data.enforceInterface(IActivityManager.descriptor); |
| 1004 | IBinder b = data.readStrongBinder(); |
| 1005 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1006 | ArrayList<ContentProviderHolder> providers = |
| 1007 | data.createTypedArrayList(ContentProviderHolder.CREATOR); |
| 1008 | publishContentProviders(app, providers); |
| 1009 | reply.writeNoException(); |
| 1010 | return true; |
| 1011 | } |
| 1012 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1013 | case REF_CONTENT_PROVIDER_TRANSACTION: { |
| 1014 | data.enforceInterface(IActivityManager.descriptor); |
| 1015 | IBinder b = data.readStrongBinder(); |
| 1016 | int stable = data.readInt(); |
| 1017 | int unstable = data.readInt(); |
| 1018 | boolean res = refContentProvider(b, stable, unstable); |
| 1019 | reply.writeNoException(); |
| 1020 | reply.writeInt(res ? 1 : 0); |
| 1021 | return true; |
| 1022 | } |
| 1023 | |
| 1024 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: { |
| 1025 | data.enforceInterface(IActivityManager.descriptor); |
| 1026 | IBinder b = data.readStrongBinder(); |
| 1027 | unstableProviderDied(b); |
| 1028 | reply.writeNoException(); |
| 1029 | return true; |
| 1030 | } |
| 1031 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 1032 | case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: { |
| 1033 | data.enforceInterface(IActivityManager.descriptor); |
| 1034 | IBinder b = data.readStrongBinder(); |
| 1035 | appNotRespondingViaProvider(b); |
| 1036 | reply.writeNoException(); |
| 1037 | return true; |
| 1038 | } |
| 1039 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1040 | case REMOVE_CONTENT_PROVIDER_TRANSACTION: { |
| 1041 | data.enforceInterface(IActivityManager.descriptor); |
| 1042 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1043 | boolean stable = data.readInt() != 0; |
| 1044 | removeContentProvider(b, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1045 | reply.writeNoException(); |
| 1046 | return true; |
| 1047 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 1048 | |
| 1049 | case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 1050 | data.enforceInterface(IActivityManager.descriptor); |
| 1051 | String name = data.readString(); |
| 1052 | IBinder token = data.readStrongBinder(); |
| 1053 | removeContentProviderExternal(name, token); |
| 1054 | reply.writeNoException(); |
| 1055 | return true; |
| 1056 | } |
| 1057 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 1058 | case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: { |
| 1059 | data.enforceInterface(IActivityManager.descriptor); |
| 1060 | ComponentName comp = ComponentName.CREATOR.createFromParcel(data); |
| 1061 | PendingIntent pi = getRunningServiceControlPanel(comp); |
| 1062 | reply.writeNoException(); |
| 1063 | PendingIntent.writePendingIntentOrNullToParcel(pi, reply); |
| 1064 | return true; |
| 1065 | } |
| 1066 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1067 | case START_SERVICE_TRANSACTION: { |
| 1068 | data.enforceInterface(IActivityManager.descriptor); |
| 1069 | IBinder b = data.readStrongBinder(); |
| 1070 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1071 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1072 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1073 | String callingPackage = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1074 | int userId = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1075 | ComponentName cn = startService(app, service, resolvedType, callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1076 | reply.writeNoException(); |
| 1077 | ComponentName.writeToParcel(cn, reply); |
| 1078 | return true; |
| 1079 | } |
| 1080 | |
| 1081 | case STOP_SERVICE_TRANSACTION: { |
| 1082 | data.enforceInterface(IActivityManager.descriptor); |
| 1083 | IBinder b = data.readStrongBinder(); |
| 1084 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1085 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1086 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1087 | int userId = data.readInt(); |
| 1088 | int res = stopService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1089 | reply.writeNoException(); |
| 1090 | reply.writeInt(res); |
| 1091 | return true; |
| 1092 | } |
| 1093 | |
| 1094 | case STOP_SERVICE_TOKEN_TRANSACTION: { |
| 1095 | data.enforceInterface(IActivityManager.descriptor); |
| 1096 | ComponentName className = ComponentName.readFromParcel(data); |
| 1097 | IBinder token = data.readStrongBinder(); |
| 1098 | int startId = data.readInt(); |
| 1099 | boolean res = stopServiceToken(className, token, startId); |
| 1100 | reply.writeNoException(); |
| 1101 | reply.writeInt(res ? 1 : 0); |
| 1102 | return true; |
| 1103 | } |
| 1104 | |
| 1105 | case SET_SERVICE_FOREGROUND_TRANSACTION: { |
| 1106 | data.enforceInterface(IActivityManager.descriptor); |
| 1107 | ComponentName className = ComponentName.readFromParcel(data); |
| 1108 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 1109 | int id = data.readInt(); |
| 1110 | Notification notification = null; |
| 1111 | if (data.readInt() != 0) { |
| 1112 | notification = Notification.CREATOR.createFromParcel(data); |
| 1113 | } |
| 1114 | boolean removeNotification = data.readInt() != 0; |
| 1115 | setServiceForeground(className, token, id, notification, removeNotification); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1116 | reply.writeNoException(); |
| 1117 | return true; |
| 1118 | } |
| 1119 | |
| 1120 | case BIND_SERVICE_TRANSACTION: { |
| 1121 | data.enforceInterface(IActivityManager.descriptor); |
| 1122 | IBinder b = data.readStrongBinder(); |
| 1123 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1124 | IBinder token = data.readStrongBinder(); |
| 1125 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1126 | String resolvedType = data.readString(); |
| 1127 | b = data.readStrongBinder(); |
| 1128 | int fl = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1129 | String callingPackage = data.readString(); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 1130 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1131 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1132 | int res = bindService(app, token, service, resolvedType, conn, fl, |
| 1133 | callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1134 | reply.writeNoException(); |
| 1135 | reply.writeInt(res); |
| 1136 | return true; |
| 1137 | } |
| 1138 | |
| 1139 | case UNBIND_SERVICE_TRANSACTION: { |
| 1140 | data.enforceInterface(IActivityManager.descriptor); |
| 1141 | IBinder b = data.readStrongBinder(); |
| 1142 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
| 1143 | boolean res = unbindService(conn); |
| 1144 | reply.writeNoException(); |
| 1145 | reply.writeInt(res ? 1 : 0); |
| 1146 | return true; |
| 1147 | } |
| 1148 | |
| 1149 | case PUBLISH_SERVICE_TRANSACTION: { |
| 1150 | data.enforceInterface(IActivityManager.descriptor); |
| 1151 | IBinder token = data.readStrongBinder(); |
| 1152 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1153 | IBinder service = data.readStrongBinder(); |
| 1154 | publishService(token, intent, service); |
| 1155 | reply.writeNoException(); |
| 1156 | return true; |
| 1157 | } |
| 1158 | |
| 1159 | case UNBIND_FINISHED_TRANSACTION: { |
| 1160 | data.enforceInterface(IActivityManager.descriptor); |
| 1161 | IBinder token = data.readStrongBinder(); |
| 1162 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1163 | boolean doRebind = data.readInt() != 0; |
| 1164 | unbindFinished(token, intent, doRebind); |
| 1165 | reply.writeNoException(); |
| 1166 | return true; |
| 1167 | } |
| 1168 | |
| 1169 | case SERVICE_DONE_EXECUTING_TRANSACTION: { |
| 1170 | data.enforceInterface(IActivityManager.descriptor); |
| 1171 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 1172 | int type = data.readInt(); |
| 1173 | int startId = data.readInt(); |
| 1174 | int res = data.readInt(); |
| 1175 | serviceDoneExecuting(token, type, startId, res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1176 | reply.writeNoException(); |
| 1177 | return true; |
| 1178 | } |
| 1179 | |
| 1180 | case START_INSTRUMENTATION_TRANSACTION: { |
| 1181 | data.enforceInterface(IActivityManager.descriptor); |
| 1182 | ComponentName className = ComponentName.readFromParcel(data); |
| 1183 | String profileFile = data.readString(); |
| 1184 | int fl = data.readInt(); |
| 1185 | Bundle arguments = data.readBundle(); |
| 1186 | IBinder b = data.readStrongBinder(); |
| 1187 | IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 1188 | b = data.readStrongBinder(); |
| 1189 | IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1190 | int userId = data.readInt(); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 1191 | String abiOverride = data.readString(); |
| 1192 | boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId, |
| 1193 | abiOverride); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1194 | reply.writeNoException(); |
| 1195 | reply.writeInt(res ? 1 : 0); |
| 1196 | return true; |
| 1197 | } |
| 1198 | |
| 1199 | |
| 1200 | case FINISH_INSTRUMENTATION_TRANSACTION: { |
| 1201 | data.enforceInterface(IActivityManager.descriptor); |
| 1202 | IBinder b = data.readStrongBinder(); |
| 1203 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1204 | int resultCode = data.readInt(); |
| 1205 | Bundle results = data.readBundle(); |
| 1206 | finishInstrumentation(app, resultCode, results); |
| 1207 | reply.writeNoException(); |
| 1208 | return true; |
| 1209 | } |
| 1210 | |
| 1211 | case GET_CONFIGURATION_TRANSACTION: { |
| 1212 | data.enforceInterface(IActivityManager.descriptor); |
| 1213 | Configuration config = getConfiguration(); |
| 1214 | reply.writeNoException(); |
| 1215 | config.writeToParcel(reply, 0); |
| 1216 | return true; |
| 1217 | } |
| 1218 | |
| 1219 | case UPDATE_CONFIGURATION_TRANSACTION: { |
| 1220 | data.enforceInterface(IActivityManager.descriptor); |
| 1221 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 1222 | updateConfiguration(config); |
| 1223 | reply.writeNoException(); |
| 1224 | return true; |
| 1225 | } |
| 1226 | |
| 1227 | case SET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1228 | data.enforceInterface(IActivityManager.descriptor); |
| 1229 | IBinder token = data.readStrongBinder(); |
| 1230 | int requestedOrientation = data.readInt(); |
| 1231 | setRequestedOrientation(token, requestedOrientation); |
| 1232 | reply.writeNoException(); |
| 1233 | return true; |
| 1234 | } |
| 1235 | |
| 1236 | case GET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1237 | data.enforceInterface(IActivityManager.descriptor); |
| 1238 | IBinder token = data.readStrongBinder(); |
| 1239 | int req = getRequestedOrientation(token); |
| 1240 | reply.writeNoException(); |
| 1241 | reply.writeInt(req); |
| 1242 | return true; |
| 1243 | } |
| 1244 | |
| 1245 | case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: { |
| 1246 | data.enforceInterface(IActivityManager.descriptor); |
| 1247 | IBinder token = data.readStrongBinder(); |
| 1248 | ComponentName cn = getActivityClassForToken(token); |
| 1249 | reply.writeNoException(); |
| 1250 | ComponentName.writeToParcel(cn, reply); |
| 1251 | return true; |
| 1252 | } |
| 1253 | |
| 1254 | case GET_PACKAGE_FOR_TOKEN_TRANSACTION: { |
| 1255 | data.enforceInterface(IActivityManager.descriptor); |
| 1256 | IBinder token = data.readStrongBinder(); |
| 1257 | reply.writeNoException(); |
| 1258 | reply.writeString(getPackageForToken(token)); |
| 1259 | return true; |
| 1260 | } |
| 1261 | |
| 1262 | case GET_INTENT_SENDER_TRANSACTION: { |
| 1263 | data.enforceInterface(IActivityManager.descriptor); |
| 1264 | int type = data.readInt(); |
| 1265 | String packageName = data.readString(); |
| 1266 | IBinder token = data.readStrongBinder(); |
| 1267 | String resultWho = data.readString(); |
| 1268 | int requestCode = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1269 | Intent[] requestIntents; |
| 1270 | String[] requestResolvedTypes; |
| 1271 | if (data.readInt() != 0) { |
| 1272 | requestIntents = data.createTypedArray(Intent.CREATOR); |
| 1273 | requestResolvedTypes = data.createStringArray(); |
| 1274 | } else { |
| 1275 | requestIntents = null; |
| 1276 | requestResolvedTypes = null; |
| 1277 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1278 | int fl = data.readInt(); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 1279 | Bundle options = data.readInt() != 0 |
| 1280 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1281 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1282 | IIntentSender res = getIntentSender(type, packageName, token, |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1283 | resultWho, requestCode, requestIntents, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1284 | requestResolvedTypes, fl, options, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1285 | reply.writeNoException(); |
| 1286 | reply.writeStrongBinder(res != null ? res.asBinder() : null); |
| 1287 | return true; |
| 1288 | } |
| 1289 | |
| 1290 | case CANCEL_INTENT_SENDER_TRANSACTION: { |
| 1291 | data.enforceInterface(IActivityManager.descriptor); |
| 1292 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1293 | data.readStrongBinder()); |
| 1294 | cancelIntentSender(r); |
| 1295 | reply.writeNoException(); |
| 1296 | return true; |
| 1297 | } |
| 1298 | |
| 1299 | case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: { |
| 1300 | data.enforceInterface(IActivityManager.descriptor); |
| 1301 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1302 | data.readStrongBinder()); |
| 1303 | String res = getPackageForIntentSender(r); |
| 1304 | reply.writeNoException(); |
| 1305 | reply.writeString(res); |
| 1306 | return true; |
| 1307 | } |
| 1308 | |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 1309 | case GET_UID_FOR_INTENT_SENDER_TRANSACTION: { |
| 1310 | data.enforceInterface(IActivityManager.descriptor); |
| 1311 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1312 | data.readStrongBinder()); |
| 1313 | int res = getUidForIntentSender(r); |
| 1314 | reply.writeNoException(); |
| 1315 | reply.writeInt(res); |
| 1316 | return true; |
| 1317 | } |
| 1318 | |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1319 | case HANDLE_INCOMING_USER_TRANSACTION: { |
| 1320 | data.enforceInterface(IActivityManager.descriptor); |
| 1321 | int callingPid = data.readInt(); |
| 1322 | int callingUid = data.readInt(); |
| 1323 | int userId = data.readInt(); |
| 1324 | boolean allowAll = data.readInt() != 0 ; |
| 1325 | boolean requireFull = data.readInt() != 0; |
| 1326 | String name = data.readString(); |
| 1327 | String callerPackage = data.readString(); |
| 1328 | int res = handleIncomingUser(callingPid, callingUid, userId, allowAll, |
| 1329 | requireFull, name, callerPackage); |
| 1330 | reply.writeNoException(); |
| 1331 | reply.writeInt(res); |
| 1332 | return true; |
| 1333 | } |
| 1334 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1335 | case SET_PROCESS_LIMIT_TRANSACTION: { |
| 1336 | data.enforceInterface(IActivityManager.descriptor); |
| 1337 | int max = data.readInt(); |
| 1338 | setProcessLimit(max); |
| 1339 | reply.writeNoException(); |
| 1340 | return true; |
| 1341 | } |
| 1342 | |
| 1343 | case GET_PROCESS_LIMIT_TRANSACTION: { |
| 1344 | data.enforceInterface(IActivityManager.descriptor); |
| 1345 | int limit = getProcessLimit(); |
| 1346 | reply.writeNoException(); |
| 1347 | reply.writeInt(limit); |
| 1348 | return true; |
| 1349 | } |
| 1350 | |
| 1351 | case SET_PROCESS_FOREGROUND_TRANSACTION: { |
| 1352 | data.enforceInterface(IActivityManager.descriptor); |
| 1353 | IBinder token = data.readStrongBinder(); |
| 1354 | int pid = data.readInt(); |
| 1355 | boolean isForeground = data.readInt() != 0; |
| 1356 | setProcessForeground(token, pid, isForeground); |
| 1357 | reply.writeNoException(); |
| 1358 | return true; |
| 1359 | } |
| 1360 | |
| 1361 | case CHECK_PERMISSION_TRANSACTION: { |
| 1362 | data.enforceInterface(IActivityManager.descriptor); |
| 1363 | String perm = data.readString(); |
| 1364 | int pid = data.readInt(); |
| 1365 | int uid = data.readInt(); |
| 1366 | int res = checkPermission(perm, pid, uid); |
| 1367 | reply.writeNoException(); |
| 1368 | reply.writeInt(res); |
| 1369 | return true; |
| 1370 | } |
| 1371 | |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1372 | case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: { |
| 1373 | data.enforceInterface(IActivityManager.descriptor); |
| 1374 | String perm = data.readString(); |
| 1375 | int pid = data.readInt(); |
| 1376 | int uid = data.readInt(); |
| 1377 | IBinder token = data.readStrongBinder(); |
| 1378 | int res = checkPermissionWithToken(perm, pid, uid, token); |
| 1379 | reply.writeNoException(); |
| 1380 | reply.writeInt(res); |
| 1381 | return true; |
| 1382 | } |
| 1383 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1384 | case CHECK_URI_PERMISSION_TRANSACTION: { |
| 1385 | data.enforceInterface(IActivityManager.descriptor); |
| 1386 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1387 | int pid = data.readInt(); |
| 1388 | int uid = data.readInt(); |
| 1389 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1390 | int userId = data.readInt(); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1391 | IBinder callerToken = data.readStrongBinder(); |
| 1392 | int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1393 | reply.writeNoException(); |
| 1394 | reply.writeInt(res); |
| 1395 | return true; |
| 1396 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1397 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1398 | case CLEAR_APP_DATA_TRANSACTION: { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1399 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1400 | String packageName = data.readString(); |
| 1401 | IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface( |
| 1402 | data.readStrongBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 1403 | int userId = data.readInt(); |
| 1404 | boolean res = clearApplicationUserData(packageName, observer, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1405 | reply.writeNoException(); |
| 1406 | reply.writeInt(res ? 1 : 0); |
| 1407 | return true; |
| 1408 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1409 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1410 | case GRANT_URI_PERMISSION_TRANSACTION: { |
| 1411 | data.enforceInterface(IActivityManager.descriptor); |
| 1412 | IBinder b = data.readStrongBinder(); |
| 1413 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1414 | String targetPkg = data.readString(); |
| 1415 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1416 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1417 | int userId = data.readInt(); |
| 1418 | grantUriPermission(app, targetPkg, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1419 | reply.writeNoException(); |
| 1420 | return true; |
| 1421 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1422 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1423 | case REVOKE_URI_PERMISSION_TRANSACTION: { |
| 1424 | data.enforceInterface(IActivityManager.descriptor); |
| 1425 | IBinder b = data.readStrongBinder(); |
| 1426 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1427 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1428 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1429 | int userId = data.readInt(); |
| 1430 | revokeUriPermission(app, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1431 | reply.writeNoException(); |
| 1432 | return true; |
| 1433 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1434 | |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1435 | case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1436 | data.enforceInterface(IActivityManager.descriptor); |
| 1437 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1438 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1439 | int userId = data.readInt(); |
| 1440 | takePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1441 | reply.writeNoException(); |
| 1442 | return true; |
| 1443 | } |
| 1444 | |
| 1445 | case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1446 | data.enforceInterface(IActivityManager.descriptor); |
| 1447 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1448 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1449 | int userId = data.readInt(); |
| 1450 | releasePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1451 | reply.writeNoException(); |
| 1452 | return true; |
| 1453 | } |
| 1454 | |
| 1455 | case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: { |
| 1456 | data.enforceInterface(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 1457 | final String packageName = data.readString(); |
| 1458 | final boolean incoming = data.readInt() != 0; |
| 1459 | final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions( |
| 1460 | packageName, incoming); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1461 | reply.writeNoException(); |
| 1462 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1463 | return true; |
| 1464 | } |
| 1465 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 1466 | case GET_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1467 | data.enforceInterface(IActivityManager.descriptor); |
| 1468 | final String packageName = data.readString(); |
| 1469 | final int userId = data.readInt(); |
| 1470 | final ParceledListSlice<UriPermission> perms = getGrantedUriPermissions(packageName, |
| 1471 | userId); |
| 1472 | reply.writeNoException(); |
| 1473 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1474 | return true; |
| 1475 | } |
| 1476 | |
| 1477 | case CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1478 | data.enforceInterface(IActivityManager.descriptor); |
| 1479 | final String packageName = data.readString(); |
| 1480 | final int userId = data.readInt(); |
| 1481 | clearGrantedUriPermissions(packageName, userId); |
| 1482 | reply.writeNoException(); |
| 1483 | return true; |
| 1484 | } |
| 1485 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1486 | case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: { |
| 1487 | data.enforceInterface(IActivityManager.descriptor); |
| 1488 | IBinder b = data.readStrongBinder(); |
| 1489 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1490 | boolean waiting = data.readInt() != 0; |
| 1491 | showWaitingForDebugger(app, waiting); |
| 1492 | reply.writeNoException(); |
| 1493 | return true; |
| 1494 | } |
| 1495 | |
| 1496 | case GET_MEMORY_INFO_TRANSACTION: { |
| 1497 | data.enforceInterface(IActivityManager.descriptor); |
| 1498 | ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); |
| 1499 | getMemoryInfo(mi); |
| 1500 | reply.writeNoException(); |
| 1501 | mi.writeToParcel(reply, 0); |
| 1502 | return true; |
| 1503 | } |
| 1504 | |
| 1505 | case UNHANDLED_BACK_TRANSACTION: { |
| 1506 | data.enforceInterface(IActivityManager.descriptor); |
| 1507 | unhandledBack(); |
| 1508 | reply.writeNoException(); |
| 1509 | return true; |
| 1510 | } |
| 1511 | |
| 1512 | case OPEN_CONTENT_URI_TRANSACTION: { |
| 1513 | data.enforceInterface(IActivityManager.descriptor); |
| 1514 | Uri uri = Uri.parse(data.readString()); |
| 1515 | ParcelFileDescriptor pfd = openContentUri(uri); |
| 1516 | reply.writeNoException(); |
| 1517 | if (pfd != null) { |
| 1518 | reply.writeInt(1); |
| 1519 | pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1520 | } else { |
| 1521 | reply.writeInt(0); |
| 1522 | } |
| 1523 | return true; |
| 1524 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1525 | |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1526 | case SET_LOCK_SCREEN_SHOWN_TRANSACTION: { |
| 1527 | data.enforceInterface(IActivityManager.descriptor); |
| 1528 | setLockScreenShown(data.readInt() != 0); |
| 1529 | reply.writeNoException(); |
| 1530 | return true; |
| 1531 | } |
| 1532 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1533 | case SET_DEBUG_APP_TRANSACTION: { |
| 1534 | data.enforceInterface(IActivityManager.descriptor); |
| 1535 | String pn = data.readString(); |
| 1536 | boolean wfd = data.readInt() != 0; |
| 1537 | boolean per = data.readInt() != 0; |
| 1538 | setDebugApp(pn, wfd, per); |
| 1539 | reply.writeNoException(); |
| 1540 | return true; |
| 1541 | } |
| 1542 | |
| 1543 | case SET_ALWAYS_FINISH_TRANSACTION: { |
| 1544 | data.enforceInterface(IActivityManager.descriptor); |
| 1545 | boolean enabled = data.readInt() != 0; |
| 1546 | setAlwaysFinish(enabled); |
| 1547 | reply.writeNoException(); |
| 1548 | return true; |
| 1549 | } |
| 1550 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1551 | case SET_ACTIVITY_CONTROLLER_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1552 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1553 | IActivityController watcher = IActivityController.Stub.asInterface( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1554 | data.readStrongBinder()); |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 1555 | boolean imAMonkey = data.readInt() != 0; |
| 1556 | setActivityController(watcher, imAMonkey); |
Sungmin Choi | cdb86bb | 2012-12-20 14:08:59 +0900 | [diff] [blame] | 1557 | reply.writeNoException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1558 | return true; |
| 1559 | } |
| 1560 | |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 1561 | case SET_LENIENT_BACKGROUND_CHECK_TRANSACTION: { |
| 1562 | data.enforceInterface(IActivityManager.descriptor); |
| 1563 | boolean enabled = data.readInt() != 0; |
| 1564 | setLenientBackgroundCheck(enabled); |
| 1565 | reply.writeNoException(); |
| 1566 | return true; |
| 1567 | } |
| 1568 | |
Dianne Hackborn | 970510b | 2016-02-24 16:56:42 -0800 | [diff] [blame] | 1569 | case GET_MEMORY_TRIM_LEVEL_TRANSACTION: { |
| 1570 | data.enforceInterface(IActivityManager.descriptor); |
| 1571 | int level = getMemoryTrimLevel(); |
| 1572 | reply.writeNoException(); |
| 1573 | reply.writeInt(level); |
| 1574 | return true; |
| 1575 | } |
| 1576 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1577 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1578 | data.enforceInterface(IActivityManager.descriptor); |
| 1579 | enterSafeMode(); |
| 1580 | reply.writeNoException(); |
| 1581 | return true; |
| 1582 | } |
| 1583 | |
| 1584 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1585 | data.enforceInterface(IActivityManager.descriptor); |
| 1586 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1587 | data.readStrongBinder()); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 1588 | int sourceUid = data.readInt(); |
| 1589 | String sourcePkg = data.readString(); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 1590 | String tag = data.readString(); |
| 1591 | noteWakeupAlarm(is, sourceUid, sourcePkg, tag); |
| 1592 | reply.writeNoException(); |
| 1593 | return true; |
| 1594 | } |
| 1595 | |
| 1596 | case NOTE_ALARM_START_TRANSACTION: { |
| 1597 | data.enforceInterface(IActivityManager.descriptor); |
| 1598 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1599 | data.readStrongBinder()); |
| 1600 | int sourceUid = data.readInt(); |
| 1601 | String tag = data.readString(); |
| 1602 | noteAlarmStart(is, sourceUid, tag); |
| 1603 | reply.writeNoException(); |
| 1604 | return true; |
| 1605 | } |
| 1606 | |
| 1607 | case NOTE_ALARM_FINISH_TRANSACTION: { |
| 1608 | data.enforceInterface(IActivityManager.descriptor); |
| 1609 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1610 | data.readStrongBinder()); |
| 1611 | int sourceUid = data.readInt(); |
| 1612 | String tag = data.readString(); |
| 1613 | noteAlarmFinish(is, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1614 | reply.writeNoException(); |
| 1615 | return true; |
| 1616 | } |
| 1617 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1618 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1619 | data.enforceInterface(IActivityManager.descriptor); |
| 1620 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1621 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1622 | boolean secure = data.readInt() != 0; |
| 1623 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1624 | reply.writeNoException(); |
| 1625 | reply.writeInt(res ? 1 : 0); |
| 1626 | return true; |
| 1627 | } |
| 1628 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1629 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1630 | data.enforceInterface(IActivityManager.descriptor); |
| 1631 | String reason = data.readString(); |
| 1632 | boolean res = killProcessesBelowForeground(reason); |
| 1633 | reply.writeNoException(); |
| 1634 | reply.writeInt(res ? 1 : 0); |
| 1635 | return true; |
| 1636 | } |
| 1637 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1638 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1639 | data.enforceInterface(IActivityManager.descriptor); |
| 1640 | IBinder app = data.readStrongBinder(); |
| 1641 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1642 | handleApplicationCrash(app, ci); |
| 1643 | reply.writeNoException(); |
| 1644 | return true; |
| 1645 | } |
| 1646 | |
| 1647 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1648 | data.enforceInterface(IActivityManager.descriptor); |
| 1649 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1650 | String tag = data.readString(); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1651 | boolean system = data.readInt() != 0; |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1652 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1653 | boolean res = handleApplicationWtf(app, tag, system, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1654 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1655 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1656 | return true; |
| 1657 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1658 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1659 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1660 | data.enforceInterface(IActivityManager.descriptor); |
| 1661 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1662 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1663 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1664 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1665 | reply.writeNoException(); |
| 1666 | return true; |
| 1667 | } |
| 1668 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1669 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1670 | data.enforceInterface(IActivityManager.descriptor); |
| 1671 | int sig = data.readInt(); |
| 1672 | signalPersistentProcesses(sig); |
| 1673 | reply.writeNoException(); |
| 1674 | return true; |
| 1675 | } |
| 1676 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1677 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1678 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1679 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1680 | int userId = data.readInt(); |
| 1681 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1682 | reply.writeNoException(); |
| 1683 | return true; |
| 1684 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1685 | |
| 1686 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1687 | data.enforceInterface(IActivityManager.descriptor); |
| 1688 | killAllBackgroundProcesses(); |
| 1689 | reply.writeNoException(); |
| 1690 | return true; |
| 1691 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1692 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 1693 | case KILL_PACKAGE_DEPENDENTS_TRANSACTION: { |
| 1694 | data.enforceInterface(IActivityManager.descriptor); |
| 1695 | String packageName = data.readString(); |
| 1696 | int userId = data.readInt(); |
| 1697 | killPackageDependents(packageName, userId); |
| 1698 | reply.writeNoException(); |
| 1699 | return true; |
| 1700 | } |
| 1701 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1702 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1703 | data.enforceInterface(IActivityManager.descriptor); |
| 1704 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1705 | int userId = data.readInt(); |
| 1706 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1707 | reply.writeNoException(); |
| 1708 | return true; |
| 1709 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1710 | |
| 1711 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1712 | data.enforceInterface(IActivityManager.descriptor); |
| 1713 | ActivityManager.RunningAppProcessInfo info = |
| 1714 | new ActivityManager.RunningAppProcessInfo(); |
| 1715 | getMyMemoryState(info); |
| 1716 | reply.writeNoException(); |
| 1717 | info.writeToParcel(reply, 0); |
| 1718 | return true; |
| 1719 | } |
| 1720 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1721 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1722 | data.enforceInterface(IActivityManager.descriptor); |
| 1723 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1724 | reply.writeNoException(); |
| 1725 | config.writeToParcel(reply, 0); |
| 1726 | return true; |
| 1727 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1728 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1729 | case PROFILE_CONTROL_TRANSACTION: { |
| 1730 | data.enforceInterface(IActivityManager.descriptor); |
| 1731 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1732 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1733 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1734 | int profileType = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1735 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 1736 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
| 1737 | boolean res = profileControl(process, userId, start, profilerInfo, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1738 | reply.writeNoException(); |
| 1739 | reply.writeInt(res ? 1 : 0); |
| 1740 | return true; |
| 1741 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1742 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1743 | case SHUTDOWN_TRANSACTION: { |
| 1744 | data.enforceInterface(IActivityManager.descriptor); |
| 1745 | boolean res = shutdown(data.readInt()); |
| 1746 | reply.writeNoException(); |
| 1747 | reply.writeInt(res ? 1 : 0); |
| 1748 | return true; |
| 1749 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1750 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1751 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1752 | data.enforceInterface(IActivityManager.descriptor); |
| 1753 | stopAppSwitches(); |
| 1754 | reply.writeNoException(); |
| 1755 | return true; |
| 1756 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1757 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1758 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1759 | data.enforceInterface(IActivityManager.descriptor); |
| 1760 | resumeAppSwitches(); |
| 1761 | reply.writeNoException(); |
| 1762 | return true; |
| 1763 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1764 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1765 | case PEEK_SERVICE_TRANSACTION: { |
| 1766 | data.enforceInterface(IActivityManager.descriptor); |
| 1767 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1768 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1769 | String callingPackage = data.readString(); |
| 1770 | IBinder binder = peekService(service, resolvedType, callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1771 | reply.writeNoException(); |
| 1772 | reply.writeStrongBinder(binder); |
| 1773 | return true; |
| 1774 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1775 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1776 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1777 | data.enforceInterface(IActivityManager.descriptor); |
| 1778 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1779 | int backupRestoreMode = data.readInt(); |
| 1780 | boolean success = bindBackupAgent(info, backupRestoreMode); |
| 1781 | reply.writeNoException(); |
| 1782 | reply.writeInt(success ? 1 : 0); |
| 1783 | return true; |
| 1784 | } |
| 1785 | |
| 1786 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1787 | data.enforceInterface(IActivityManager.descriptor); |
| 1788 | String packageName = data.readString(); |
| 1789 | IBinder agent = data.readStrongBinder(); |
| 1790 | backupAgentCreated(packageName, agent); |
| 1791 | reply.writeNoException(); |
| 1792 | return true; |
| 1793 | } |
| 1794 | |
| 1795 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1796 | data.enforceInterface(IActivityManager.descriptor); |
| 1797 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1798 | unbindBackupAgent(info); |
| 1799 | reply.writeNoException(); |
| 1800 | return true; |
| 1801 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1802 | |
| 1803 | case ADD_PACKAGE_DEPENDENCY_TRANSACTION: { |
| 1804 | data.enforceInterface(IActivityManager.descriptor); |
| 1805 | String packageName = data.readString(); |
| 1806 | addPackageDependency(packageName); |
| 1807 | reply.writeNoException(); |
| 1808 | return true; |
| 1809 | } |
| 1810 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1811 | case KILL_APPLICATION_WITH_APPID_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1812 | data.enforceInterface(IActivityManager.descriptor); |
| 1813 | String pkg = data.readString(); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1814 | int appid = data.readInt(); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 1815 | String reason = data.readString(); |
| 1816 | killApplicationWithAppId(pkg, appid, reason); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1817 | reply.writeNoException(); |
| 1818 | return true; |
| 1819 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1820 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1821 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1822 | data.enforceInterface(IActivityManager.descriptor); |
| 1823 | String reason = data.readString(); |
| 1824 | closeSystemDialogs(reason); |
| 1825 | reply.writeNoException(); |
| 1826 | return true; |
| 1827 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1828 | |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1829 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1830 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1831 | int[] pids = data.createIntArray(); |
| 1832 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1833 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1834 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1835 | return true; |
| 1836 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1837 | |
| 1838 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1839 | data.enforceInterface(IActivityManager.descriptor); |
| 1840 | String processName = data.readString(); |
| 1841 | int uid = data.readInt(); |
| 1842 | killApplicationProcess(processName, uid); |
| 1843 | reply.writeNoException(); |
| 1844 | return true; |
| 1845 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1846 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1847 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1848 | data.enforceInterface(IActivityManager.descriptor); |
| 1849 | IBinder token = data.readStrongBinder(); |
| 1850 | String packageName = data.readString(); |
| 1851 | int enterAnim = data.readInt(); |
| 1852 | int exitAnim = data.readInt(); |
| 1853 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1854 | reply.writeNoException(); |
| 1855 | return true; |
| 1856 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1857 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1858 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1859 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1860 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1861 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1862 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1863 | return true; |
| 1864 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1865 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1866 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1867 | data.enforceInterface(IActivityManager.descriptor); |
| 1868 | final boolean monkey = (data.readInt() == 1); |
| 1869 | setUserIsMonkey(monkey); |
| 1870 | reply.writeNoException(); |
| 1871 | return true; |
| 1872 | } |
| 1873 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1874 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1875 | data.enforceInterface(IActivityManager.descriptor); |
| 1876 | finishHeavyWeightApp(); |
| 1877 | reply.writeNoException(); |
| 1878 | return true; |
| 1879 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1880 | |
| 1881 | case IS_IMMERSIVE_TRANSACTION: { |
| 1882 | data.enforceInterface(IActivityManager.descriptor); |
| 1883 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1884 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1885 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1886 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1887 | return true; |
| 1888 | } |
| 1889 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 1890 | case IS_TOP_OF_TASK_TRANSACTION: { |
| 1891 | data.enforceInterface(IActivityManager.descriptor); |
| 1892 | IBinder token = data.readStrongBinder(); |
| 1893 | final boolean isTopOfTask = isTopOfTask(token); |
| 1894 | reply.writeNoException(); |
| 1895 | reply.writeInt(isTopOfTask ? 1 : 0); |
| 1896 | return true; |
| 1897 | } |
| 1898 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1899 | case CONVERT_FROM_TRANSLUCENT_TRANSACTION: { |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1900 | data.enforceInterface(IActivityManager.descriptor); |
| 1901 | IBinder token = data.readStrongBinder(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1902 | boolean converted = convertFromTranslucent(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1903 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1904 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1905 | return true; |
| 1906 | } |
| 1907 | |
| 1908 | case CONVERT_TO_TRANSLUCENT_TRANSACTION: { |
| 1909 | data.enforceInterface(IActivityManager.descriptor); |
| 1910 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1911 | final Bundle bundle; |
| 1912 | if (data.readInt() == 0) { |
| 1913 | bundle = null; |
| 1914 | } else { |
| 1915 | bundle = data.readBundle(); |
| 1916 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 1917 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1918 | boolean converted = convertToTranslucent(token, options); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1919 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1920 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1921 | return true; |
| 1922 | } |
| 1923 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1924 | case GET_ACTIVITY_OPTIONS_TRANSACTION: { |
| 1925 | data.enforceInterface(IActivityManager.descriptor); |
| 1926 | IBinder token = data.readStrongBinder(); |
| 1927 | final ActivityOptions options = getActivityOptions(token); |
| 1928 | reply.writeNoException(); |
| 1929 | reply.writeBundle(options == null ? null : options.toBundle()); |
| 1930 | return true; |
| 1931 | } |
| 1932 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1933 | case SET_IMMERSIVE_TRANSACTION: { |
| 1934 | data.enforceInterface(IActivityManager.descriptor); |
| 1935 | IBinder token = data.readStrongBinder(); |
| 1936 | boolean imm = data.readInt() == 1; |
| 1937 | setImmersive(token, imm); |
| 1938 | reply.writeNoException(); |
| 1939 | return true; |
| 1940 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1941 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1942 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1943 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1944 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1945 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1946 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1947 | return true; |
| 1948 | } |
| 1949 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1950 | case CRASH_APPLICATION_TRANSACTION: { |
| 1951 | data.enforceInterface(IActivityManager.descriptor); |
| 1952 | int uid = data.readInt(); |
| 1953 | int initialPid = data.readInt(); |
| 1954 | String packageName = data.readString(); |
| 1955 | String message = data.readString(); |
| 1956 | crashApplication(uid, initialPid, packageName, message); |
| 1957 | reply.writeNoException(); |
| 1958 | return true; |
| 1959 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1960 | |
| 1961 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1962 | data.enforceInterface(IActivityManager.descriptor); |
| 1963 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1964 | int userId = data.readInt(); |
| 1965 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1966 | reply.writeNoException(); |
| 1967 | reply.writeString(type); |
| 1968 | return true; |
| 1969 | } |
| 1970 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1971 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1972 | data.enforceInterface(IActivityManager.descriptor); |
| 1973 | String name = data.readString(); |
| 1974 | IBinder perm = newUriPermissionOwner(name); |
| 1975 | reply.writeNoException(); |
| 1976 | reply.writeStrongBinder(perm); |
| 1977 | return true; |
| 1978 | } |
| 1979 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 1980 | case GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION: { |
| 1981 | data.enforceInterface(IActivityManager.descriptor); |
| 1982 | IBinder activityToken = data.readStrongBinder(); |
| 1983 | IBinder perm = getUriPermissionOwnerForActivity(activityToken); |
| 1984 | reply.writeNoException(); |
| 1985 | reply.writeStrongBinder(perm); |
| 1986 | return true; |
| 1987 | } |
| 1988 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1989 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1990 | data.enforceInterface(IActivityManager.descriptor); |
| 1991 | IBinder owner = data.readStrongBinder(); |
| 1992 | int fromUid = data.readInt(); |
| 1993 | String targetPkg = data.readString(); |
| 1994 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1995 | int mode = data.readInt(); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 1996 | int sourceUserId = data.readInt(); |
| 1997 | int targetUserId = data.readInt(); |
| 1998 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId, |
| 1999 | targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2000 | reply.writeNoException(); |
| 2001 | return true; |
| 2002 | } |
| 2003 | |
| 2004 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 2005 | data.enforceInterface(IActivityManager.descriptor); |
| 2006 | IBinder owner = data.readStrongBinder(); |
| 2007 | Uri uri = null; |
| 2008 | if (data.readInt() != 0) { |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2009 | uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2010 | } |
| 2011 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2012 | int userId = data.readInt(); |
| 2013 | revokeUriPermissionFromOwner(owner, uri, mode, userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2014 | reply.writeNoException(); |
| 2015 | return true; |
| 2016 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 2017 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 2018 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 2019 | data.enforceInterface(IActivityManager.descriptor); |
| 2020 | int callingUid = data.readInt(); |
| 2021 | String targetPkg = data.readString(); |
| 2022 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 2023 | int modeFlags = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2024 | int userId = data.readInt(); |
| 2025 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 2026 | reply.writeNoException(); |
| 2027 | reply.writeInt(res); |
| 2028 | return true; |
| 2029 | } |
| 2030 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2031 | case DUMP_HEAP_TRANSACTION: { |
| 2032 | data.enforceInterface(IActivityManager.descriptor); |
| 2033 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 2034 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2035 | boolean managed = data.readInt() != 0; |
| 2036 | String path = data.readString(); |
| 2037 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 2038 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 2039 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2040 | reply.writeNoException(); |
| 2041 | reply.writeInt(res ? 1 : 0); |
| 2042 | return true; |
| 2043 | } |
| 2044 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2045 | case START_ACTIVITIES_TRANSACTION: |
| 2046 | { |
| 2047 | data.enforceInterface(IActivityManager.descriptor); |
| 2048 | IBinder b = data.readStrongBinder(); |
| 2049 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2050 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2051 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 2052 | String[] resolvedTypes = data.createStringArray(); |
| 2053 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2054 | Bundle options = data.readInt() != 0 |
| 2055 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2056 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2057 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2058 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2059 | reply.writeNoException(); |
| 2060 | reply.writeInt(result); |
| 2061 | return true; |
| 2062 | } |
| 2063 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2064 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2065 | { |
| 2066 | data.enforceInterface(IActivityManager.descriptor); |
| 2067 | int mode = getFrontActivityScreenCompatMode(); |
| 2068 | reply.writeNoException(); |
| 2069 | reply.writeInt(mode); |
| 2070 | return true; |
| 2071 | } |
| 2072 | |
| 2073 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2074 | { |
| 2075 | data.enforceInterface(IActivityManager.descriptor); |
| 2076 | int mode = data.readInt(); |
| 2077 | setFrontActivityScreenCompatMode(mode); |
| 2078 | reply.writeNoException(); |
| 2079 | reply.writeInt(mode); |
| 2080 | return true; |
| 2081 | } |
| 2082 | |
| 2083 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2084 | { |
| 2085 | data.enforceInterface(IActivityManager.descriptor); |
| 2086 | String pkg = data.readString(); |
| 2087 | int mode = getPackageScreenCompatMode(pkg); |
| 2088 | reply.writeNoException(); |
| 2089 | reply.writeInt(mode); |
| 2090 | return true; |
| 2091 | } |
| 2092 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2093 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2094 | { |
| 2095 | data.enforceInterface(IActivityManager.descriptor); |
| 2096 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2097 | int mode = data.readInt(); |
| 2098 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2099 | reply.writeNoException(); |
| 2100 | return true; |
| 2101 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2102 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2103 | case SWITCH_USER_TRANSACTION: { |
| 2104 | data.enforceInterface(IActivityManager.descriptor); |
| 2105 | int userid = data.readInt(); |
| 2106 | boolean result = switchUser(userid); |
| 2107 | reply.writeNoException(); |
| 2108 | reply.writeInt(result ? 1 : 0); |
| 2109 | return true; |
| 2110 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2111 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 2112 | case START_USER_IN_BACKGROUND_TRANSACTION: { |
| 2113 | data.enforceInterface(IActivityManager.descriptor); |
| 2114 | int userid = data.readInt(); |
| 2115 | boolean result = startUserInBackground(userid); |
| 2116 | reply.writeNoException(); |
| 2117 | reply.writeInt(result ? 1 : 0); |
| 2118 | return true; |
| 2119 | } |
| 2120 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2121 | case UNLOCK_USER_TRANSACTION: { |
| 2122 | data.enforceInterface(IActivityManager.descriptor); |
| 2123 | int userId = data.readInt(); |
| 2124 | byte[] token = data.createByteArray(); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 2125 | byte[] secret = data.createByteArray(); |
Jeff Sharkey | bd91e2f | 2016-03-22 15:32:31 -0600 | [diff] [blame] | 2126 | IProgressListener listener = IProgressListener.Stub |
| 2127 | .asInterface(data.readStrongBinder()); |
| 2128 | boolean result = unlockUser(userId, token, secret, listener); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2129 | reply.writeNoException(); |
| 2130 | reply.writeInt(result ? 1 : 0); |
| 2131 | return true; |
| 2132 | } |
| 2133 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2134 | case STOP_USER_TRANSACTION: { |
| 2135 | data.enforceInterface(IActivityManager.descriptor); |
| 2136 | int userid = data.readInt(); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2137 | boolean force = data.readInt() != 0; |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2138 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 2139 | data.readStrongBinder()); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2140 | int result = stopUser(userid, force, callback); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2141 | reply.writeNoException(); |
| 2142 | reply.writeInt(result); |
| 2143 | return true; |
| 2144 | } |
| 2145 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2146 | case GET_CURRENT_USER_TRANSACTION: { |
| 2147 | data.enforceInterface(IActivityManager.descriptor); |
| 2148 | UserInfo userInfo = getCurrentUser(); |
| 2149 | reply.writeNoException(); |
| 2150 | userInfo.writeToParcel(reply, 0); |
| 2151 | return true; |
| 2152 | } |
| 2153 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2154 | case IS_USER_RUNNING_TRANSACTION: { |
| 2155 | data.enforceInterface(IActivityManager.descriptor); |
| 2156 | int userid = data.readInt(); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 2157 | int _flags = data.readInt(); |
| 2158 | boolean result = isUserRunning(userid, _flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2159 | reply.writeNoException(); |
| 2160 | reply.writeInt(result ? 1 : 0); |
| 2161 | return true; |
| 2162 | } |
| 2163 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 2164 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 2165 | data.enforceInterface(IActivityManager.descriptor); |
| 2166 | int[] result = getRunningUserIds(); |
| 2167 | reply.writeNoException(); |
| 2168 | reply.writeIntArray(result); |
| 2169 | return true; |
| 2170 | } |
| 2171 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2172 | case REMOVE_TASK_TRANSACTION: |
| 2173 | { |
| 2174 | data.enforceInterface(IActivityManager.descriptor); |
| 2175 | int taskId = data.readInt(); |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 2176 | boolean result = removeTask(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2177 | reply.writeNoException(); |
| 2178 | reply.writeInt(result ? 1 : 0); |
| 2179 | return true; |
| 2180 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2181 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 2182 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2183 | data.enforceInterface(IActivityManager.descriptor); |
| 2184 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2185 | data.readStrongBinder()); |
| 2186 | registerProcessObserver(observer); |
| 2187 | return true; |
| 2188 | } |
| 2189 | |
| 2190 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2191 | data.enforceInterface(IActivityManager.descriptor); |
| 2192 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2193 | data.readStrongBinder()); |
| 2194 | unregisterProcessObserver(observer); |
| 2195 | return true; |
| 2196 | } |
| 2197 | |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2198 | case REGISTER_UID_OBSERVER_TRANSACTION: { |
| 2199 | data.enforceInterface(IActivityManager.descriptor); |
| 2200 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2201 | data.readStrongBinder()); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2202 | int which = data.readInt(); |
| 2203 | registerUidObserver(observer, which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2204 | return true; |
| 2205 | } |
| 2206 | |
| 2207 | case UNREGISTER_UID_OBSERVER_TRANSACTION: { |
| 2208 | data.enforceInterface(IActivityManager.descriptor); |
| 2209 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2210 | data.readStrongBinder()); |
| 2211 | unregisterUidObserver(observer); |
| 2212 | return true; |
| 2213 | } |
| 2214 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 2215 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2216 | { |
| 2217 | data.enforceInterface(IActivityManager.descriptor); |
| 2218 | String pkg = data.readString(); |
| 2219 | boolean ask = getPackageAskScreenCompat(pkg); |
| 2220 | reply.writeNoException(); |
| 2221 | reply.writeInt(ask ? 1 : 0); |
| 2222 | return true; |
| 2223 | } |
| 2224 | |
| 2225 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2226 | { |
| 2227 | data.enforceInterface(IActivityManager.descriptor); |
| 2228 | String pkg = data.readString(); |
| 2229 | boolean ask = data.readInt() != 0; |
| 2230 | setPackageAskScreenCompat(pkg, ask); |
| 2231 | reply.writeNoException(); |
| 2232 | return true; |
| 2233 | } |
| 2234 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2235 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 2236 | data.enforceInterface(IActivityManager.descriptor); |
| 2237 | IIntentSender r = IIntentSender.Stub.asInterface( |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2238 | data.readStrongBinder()); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2239 | boolean res = isIntentSenderTargetedToPackage(r); |
| 2240 | reply.writeNoException(); |
| 2241 | reply.writeInt(res ? 1 : 0); |
| 2242 | return true; |
| 2243 | } |
| 2244 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 2245 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 2246 | data.enforceInterface(IActivityManager.descriptor); |
| 2247 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2248 | data.readStrongBinder()); |
| 2249 | boolean res = isIntentSenderAnActivity(r); |
| 2250 | reply.writeNoException(); |
| 2251 | reply.writeInt(res ? 1 : 0); |
| 2252 | return true; |
| 2253 | } |
| 2254 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 2255 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 2256 | data.enforceInterface(IActivityManager.descriptor); |
| 2257 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2258 | data.readStrongBinder()); |
| 2259 | Intent intent = getIntentForIntentSender(r); |
| 2260 | reply.writeNoException(); |
| 2261 | if (intent != null) { |
| 2262 | reply.writeInt(1); |
| 2263 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2264 | } else { |
| 2265 | reply.writeInt(0); |
| 2266 | } |
| 2267 | return true; |
| 2268 | } |
| 2269 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 2270 | case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { |
| 2271 | data.enforceInterface(IActivityManager.descriptor); |
| 2272 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2273 | data.readStrongBinder()); |
| 2274 | String prefix = data.readString(); |
| 2275 | String tag = getTagForIntentSender(r, prefix); |
| 2276 | reply.writeNoException(); |
| 2277 | reply.writeString(tag); |
| 2278 | return true; |
| 2279 | } |
| 2280 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2281 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 2282 | data.enforceInterface(IActivityManager.descriptor); |
| 2283 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 2284 | updatePersistentConfiguration(config); |
| 2285 | reply.writeNoException(); |
| 2286 | return true; |
| 2287 | } |
| 2288 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 2289 | case GET_PROCESS_PSS_TRANSACTION: { |
| 2290 | data.enforceInterface(IActivityManager.descriptor); |
| 2291 | int[] pids = data.createIntArray(); |
| 2292 | long[] pss = getProcessPss(pids); |
| 2293 | reply.writeNoException(); |
| 2294 | reply.writeLongArray(pss); |
| 2295 | return true; |
| 2296 | } |
| 2297 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 2298 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 2299 | data.enforceInterface(IActivityManager.descriptor); |
| 2300 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 2301 | boolean always = data.readInt() != 0; |
| 2302 | showBootMessage(msg, always); |
| 2303 | reply.writeNoException(); |
| 2304 | return true; |
| 2305 | } |
| 2306 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2307 | case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2308 | data.enforceInterface(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2309 | keyguardWaitingForActivityDrawn(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2310 | reply.writeNoException(); |
| 2311 | return true; |
| 2312 | } |
| 2313 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2314 | case KEYGUARD_GOING_AWAY_TRANSACTION: { |
| 2315 | data.enforceInterface(IActivityManager.descriptor); |
Adrian Roos | d5c2db6 | 2016-03-08 16:11:31 -0800 | [diff] [blame] | 2316 | keyguardGoingAway(data.readInt()); |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2317 | reply.writeNoException(); |
| 2318 | return true; |
| 2319 | } |
| 2320 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2321 | case SHOULD_UP_RECREATE_TASK_TRANSACTION: { |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2322 | data.enforceInterface(IActivityManager.descriptor); |
| 2323 | IBinder token = data.readStrongBinder(); |
| 2324 | String destAffinity = data.readString(); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2325 | boolean res = shouldUpRecreateTask(token, destAffinity); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2326 | reply.writeNoException(); |
| 2327 | reply.writeInt(res ? 1 : 0); |
| 2328 | return true; |
| 2329 | } |
| 2330 | |
| 2331 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 2332 | data.enforceInterface(IActivityManager.descriptor); |
| 2333 | IBinder token = data.readStrongBinder(); |
| 2334 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 2335 | int resultCode = data.readInt(); |
| 2336 | Intent resultData = null; |
| 2337 | if (data.readInt() != 0) { |
| 2338 | resultData = Intent.CREATOR.createFromParcel(data); |
| 2339 | } |
| 2340 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 2341 | reply.writeNoException(); |
| 2342 | reply.writeInt(res ? 1 : 0); |
| 2343 | return true; |
| 2344 | } |
| 2345 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 2346 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 2347 | data.enforceInterface(IActivityManager.descriptor); |
| 2348 | IBinder token = data.readStrongBinder(); |
| 2349 | int res = getLaunchedFromUid(token); |
| 2350 | reply.writeNoException(); |
| 2351 | reply.writeInt(res); |
| 2352 | return true; |
| 2353 | } |
| 2354 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2355 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 2356 | data.enforceInterface(IActivityManager.descriptor); |
| 2357 | IBinder token = data.readStrongBinder(); |
| 2358 | String res = getLaunchedFromPackage(token); |
| 2359 | reply.writeNoException(); |
| 2360 | reply.writeString(res); |
| 2361 | return true; |
| 2362 | } |
| 2363 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2364 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2365 | data.enforceInterface(IActivityManager.descriptor); |
| 2366 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2367 | data.readStrongBinder()); |
| 2368 | registerUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2369 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2370 | return true; |
| 2371 | } |
| 2372 | |
| 2373 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2374 | data.enforceInterface(IActivityManager.descriptor); |
| 2375 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2376 | data.readStrongBinder()); |
| 2377 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2378 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2379 | return true; |
| 2380 | } |
| 2381 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2382 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 2383 | data.enforceInterface(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 2384 | int bugreportType = data.readInt(); |
| 2385 | requestBugReport(bugreportType); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2386 | reply.writeNoException(); |
| 2387 | return true; |
| 2388 | } |
| 2389 | |
| 2390 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 2391 | data.enforceInterface(IActivityManager.descriptor); |
| 2392 | int pid = data.readInt(); |
| 2393 | boolean aboveSystem = data.readInt() != 0; |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 2394 | String reason = data.readString(); |
| 2395 | long res = inputDispatchingTimedOut(pid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2396 | reply.writeNoException(); |
| 2397 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2398 | return true; |
| 2399 | } |
| 2400 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2401 | case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2402 | data.enforceInterface(IActivityManager.descriptor); |
| 2403 | int requestType = data.readInt(); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2404 | Bundle res = getAssistContextExtras(requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2405 | reply.writeNoException(); |
| 2406 | reply.writeBundle(res); |
| 2407 | return true; |
| 2408 | } |
| 2409 | |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2410 | case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
| 2411 | data.enforceInterface(IActivityManager.descriptor); |
| 2412 | int requestType = data.readInt(); |
| 2413 | IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2414 | IBinder activityToken = data.readStrongBinder(); |
| 2415 | boolean res = requestAssistContextExtras(requestType, receiver, activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2416 | reply.writeNoException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2417 | reply.writeInt(res ? 1 : 0); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2418 | return true; |
| 2419 | } |
| 2420 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2421 | case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2422 | data.enforceInterface(IActivityManager.descriptor); |
| 2423 | IBinder token = data.readStrongBinder(); |
| 2424 | Bundle extras = data.readBundle(); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 2425 | AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data); |
| 2426 | AssistContent content = AssistContent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 2427 | Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null; |
| 2428 | reportAssistContextExtras(token, extras, structure, content, referrer); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2429 | reply.writeNoException(); |
| 2430 | return true; |
| 2431 | } |
| 2432 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2433 | case LAUNCH_ASSIST_INTENT_TRANSACTION: { |
| 2434 | data.enforceInterface(IActivityManager.descriptor); |
| 2435 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2436 | int requestType = data.readInt(); |
| 2437 | String hint = data.readString(); |
| 2438 | int userHandle = data.readInt(); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 2439 | Bundle args = data.readBundle(); |
| 2440 | boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2441 | reply.writeNoException(); |
| 2442 | reply.writeInt(res ? 1 : 0); |
| 2443 | return true; |
| 2444 | } |
| 2445 | |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2446 | case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: { |
| 2447 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2448 | boolean res = isAssistDataAllowedOnCurrentActivity(); |
| 2449 | reply.writeNoException(); |
| 2450 | reply.writeInt(res ? 1 : 0); |
| 2451 | return true; |
| 2452 | } |
| 2453 | |
| 2454 | case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: { |
| 2455 | data.enforceInterface(IActivityManager.descriptor); |
| 2456 | IBinder token = data.readStrongBinder(); |
| 2457 | Bundle args = data.readBundle(); |
| 2458 | boolean res = showAssistFromActivity(token, args); |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2459 | reply.writeNoException(); |
| 2460 | reply.writeInt(res ? 1 : 0); |
| 2461 | return true; |
| 2462 | } |
| 2463 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2464 | case KILL_UID_TRANSACTION: { |
| 2465 | data.enforceInterface(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2466 | int appId = data.readInt(); |
| 2467 | int userId = data.readInt(); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2468 | String reason = data.readString(); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2469 | killUid(appId, userId, reason); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2470 | reply.writeNoException(); |
| 2471 | return true; |
| 2472 | } |
| 2473 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2474 | case HANG_TRANSACTION: { |
| 2475 | data.enforceInterface(IActivityManager.descriptor); |
| 2476 | IBinder who = data.readStrongBinder(); |
| 2477 | boolean allowRestart = data.readInt() != 0; |
| 2478 | hang(who, allowRestart); |
| 2479 | reply.writeNoException(); |
| 2480 | return true; |
| 2481 | } |
| 2482 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2483 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2484 | data.enforceInterface(IActivityManager.descriptor); |
| 2485 | IBinder token = data.readStrongBinder(); |
| 2486 | reportActivityFullyDrawn(token); |
| 2487 | reply.writeNoException(); |
| 2488 | return true; |
| 2489 | } |
| 2490 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2491 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2492 | data.enforceInterface(IActivityManager.descriptor); |
| 2493 | IBinder token = data.readStrongBinder(); |
| 2494 | notifyActivityDrawn(token); |
| 2495 | reply.writeNoException(); |
| 2496 | return true; |
| 2497 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2498 | |
| 2499 | case RESTART_TRANSACTION: { |
| 2500 | data.enforceInterface(IActivityManager.descriptor); |
| 2501 | restart(); |
| 2502 | reply.writeNoException(); |
| 2503 | return true; |
| 2504 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2505 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2506 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2507 | data.enforceInterface(IActivityManager.descriptor); |
| 2508 | performIdleMaintenance(); |
| 2509 | reply.writeNoException(); |
| 2510 | return true; |
| 2511 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2512 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2513 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2514 | data.enforceInterface(IActivityManager.descriptor); |
| 2515 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2516 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2517 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2518 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2519 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2520 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2521 | if (activityContainer != null) { |
| 2522 | reply.writeInt(1); |
| 2523 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2524 | } else { |
| 2525 | reply.writeInt(0); |
| 2526 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2527 | return true; |
| 2528 | } |
| 2529 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2530 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2531 | data.enforceInterface(IActivityManager.descriptor); |
| 2532 | IActivityContainer activityContainer = |
| 2533 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2534 | deleteActivityContainer(activityContainer); |
| 2535 | reply.writeNoException(); |
| 2536 | return true; |
| 2537 | } |
| 2538 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2539 | case CREATE_STACK_ON_DISPLAY: { |
| 2540 | data.enforceInterface(IActivityManager.descriptor); |
| 2541 | int displayId = data.readInt(); |
| 2542 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2543 | reply.writeNoException(); |
| 2544 | if (activityContainer != null) { |
| 2545 | reply.writeInt(1); |
| 2546 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2547 | } else { |
| 2548 | reply.writeInt(0); |
| 2549 | } |
| 2550 | return true; |
| 2551 | } |
| 2552 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2553 | case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: { |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2554 | data.enforceInterface(IActivityManager.descriptor); |
| 2555 | IBinder activityToken = data.readStrongBinder(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2556 | int displayId = getActivityDisplayId(activityToken); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2557 | reply.writeNoException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2558 | reply.writeInt(displayId); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2559 | return true; |
| 2560 | } |
| 2561 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2562 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2563 | data.enforceInterface(IActivityManager.descriptor); |
| 2564 | final int taskId = data.readInt(); |
| 2565 | startLockTaskMode(taskId); |
| 2566 | reply.writeNoException(); |
| 2567 | return true; |
| 2568 | } |
| 2569 | |
| 2570 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2571 | data.enforceInterface(IActivityManager.descriptor); |
| 2572 | IBinder token = data.readStrongBinder(); |
| 2573 | startLockTaskMode(token); |
| 2574 | reply.writeNoException(); |
| 2575 | return true; |
| 2576 | } |
| 2577 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2578 | case START_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2579 | data.enforceInterface(IActivityManager.descriptor); |
| 2580 | startLockTaskModeOnCurrent(); |
| 2581 | reply.writeNoException(); |
| 2582 | return true; |
| 2583 | } |
| 2584 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2585 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2586 | data.enforceInterface(IActivityManager.descriptor); |
| 2587 | stopLockTaskMode(); |
| 2588 | reply.writeNoException(); |
| 2589 | return true; |
| 2590 | } |
| 2591 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2592 | case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2593 | data.enforceInterface(IActivityManager.descriptor); |
| 2594 | stopLockTaskModeOnCurrent(); |
| 2595 | reply.writeNoException(); |
| 2596 | return true; |
| 2597 | } |
| 2598 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2599 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2600 | data.enforceInterface(IActivityManager.descriptor); |
| 2601 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2602 | reply.writeNoException(); |
| 2603 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2604 | return true; |
| 2605 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2606 | |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 2607 | case GET_LOCK_TASK_MODE_STATE_TRANSACTION: { |
| 2608 | data.enforceInterface(IActivityManager.descriptor); |
| 2609 | final int lockTaskModeState = getLockTaskModeState(); |
| 2610 | reply.writeNoException(); |
| 2611 | reply.writeInt(lockTaskModeState); |
| 2612 | return true; |
| 2613 | } |
| 2614 | |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 2615 | case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: { |
| 2616 | data.enforceInterface(IActivityManager.descriptor); |
| 2617 | final IBinder token = data.readStrongBinder(); |
| 2618 | showLockTaskEscapeMessage(token); |
| 2619 | reply.writeNoException(); |
| 2620 | return true; |
| 2621 | } |
| 2622 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2623 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2624 | data.enforceInterface(IActivityManager.descriptor); |
| 2625 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2626 | ActivityManager.TaskDescription values = |
| 2627 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2628 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2629 | reply.writeNoException(); |
| 2630 | return true; |
| 2631 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2632 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2633 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2634 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 2635 | final int taskId = data.readInt(); |
| 2636 | final int resizeableMode = data.readInt(); |
| 2637 | setTaskResizeable(taskId, resizeableMode); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2638 | reply.writeNoException(); |
| 2639 | return true; |
| 2640 | } |
| 2641 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2642 | case RESIZE_TASK_TRANSACTION: { |
| 2643 | data.enforceInterface(IActivityManager.descriptor); |
| 2644 | int taskId = data.readInt(); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2645 | int resizeMode = data.readInt(); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2646 | Rect r = Rect.CREATOR.createFromParcel(data); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2647 | resizeTask(taskId, r, resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2648 | reply.writeNoException(); |
| 2649 | return true; |
| 2650 | } |
| 2651 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 2652 | case GET_TASK_BOUNDS_TRANSACTION: { |
| 2653 | data.enforceInterface(IActivityManager.descriptor); |
| 2654 | int taskId = data.readInt(); |
| 2655 | Rect r = getTaskBounds(taskId); |
| 2656 | reply.writeNoException(); |
| 2657 | r.writeToParcel(reply, 0); |
| 2658 | return true; |
| 2659 | } |
| 2660 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2661 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2662 | data.enforceInterface(IActivityManager.descriptor); |
| 2663 | String filename = data.readString(); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 2664 | int userId = data.readInt(); |
| 2665 | Bitmap icon = getTaskDescriptionIcon(filename, userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2666 | reply.writeNoException(); |
| 2667 | if (icon == null) { |
| 2668 | reply.writeInt(0); |
| 2669 | } else { |
| 2670 | reply.writeInt(1); |
| 2671 | icon.writeToParcel(reply, 0); |
| 2672 | } |
| 2673 | return true; |
| 2674 | } |
| 2675 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2676 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2677 | data.enforceInterface(IActivityManager.descriptor); |
| 2678 | final Bundle bundle; |
| 2679 | if (data.readInt() == 0) { |
| 2680 | bundle = null; |
| 2681 | } else { |
| 2682 | bundle = data.readBundle(); |
| 2683 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 2684 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2685 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2686 | reply.writeNoException(); |
| 2687 | return true; |
| 2688 | } |
| 2689 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2690 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2691 | data.enforceInterface(IActivityManager.descriptor); |
| 2692 | IBinder token = data.readStrongBinder(); |
| 2693 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2694 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2695 | reply.writeNoException(); |
| 2696 | reply.writeInt(success ? 1 : 0); |
| 2697 | return true; |
| 2698 | } |
| 2699 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2700 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2701 | data.enforceInterface(IActivityManager.descriptor); |
| 2702 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2703 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2704 | reply.writeNoException(); |
| 2705 | reply.writeInt(enabled ? 1 : 0); |
| 2706 | return true; |
| 2707 | } |
| 2708 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2709 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2710 | data.enforceInterface(IActivityManager.descriptor); |
| 2711 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2712 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2713 | reply.writeNoException(); |
| 2714 | return true; |
| 2715 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2716 | |
| 2717 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2718 | data.enforceInterface(IActivityManager.descriptor); |
| 2719 | IBinder token = data.readStrongBinder(); |
| 2720 | notifyLaunchTaskBehindComplete(token); |
| 2721 | reply.writeNoException(); |
| 2722 | return true; |
| 2723 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2724 | |
| 2725 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2726 | data.enforceInterface(IActivityManager.descriptor); |
| 2727 | IBinder token = data.readStrongBinder(); |
| 2728 | notifyEnterAnimationComplete(token); |
| 2729 | reply.writeNoException(); |
| 2730 | return true; |
| 2731 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2732 | |
| 2733 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2734 | data.enforceInterface(IActivityManager.descriptor); |
| 2735 | bootAnimationComplete(); |
| 2736 | reply.writeNoException(); |
| 2737 | return true; |
| 2738 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2739 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2740 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2741 | data.enforceInterface(IActivityManager.descriptor); |
| 2742 | final int uid = data.readInt(); |
| 2743 | final byte[] firstPacket = data.createByteArray(); |
| 2744 | notifyCleartextNetwork(uid, firstPacket); |
| 2745 | reply.writeNoException(); |
| 2746 | return true; |
| 2747 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2748 | |
| 2749 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2750 | data.enforceInterface(IActivityManager.descriptor); |
| 2751 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2752 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2753 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2754 | String reportPackage = data.readString(); |
| 2755 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2756 | reply.writeNoException(); |
| 2757 | return true; |
| 2758 | } |
| 2759 | |
| 2760 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2761 | data.enforceInterface(IActivityManager.descriptor); |
| 2762 | String path = data.readString(); |
| 2763 | dumpHeapFinished(path); |
| 2764 | reply.writeNoException(); |
| 2765 | return true; |
| 2766 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2767 | |
| 2768 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2769 | data.enforceInterface(IActivityManager.descriptor); |
| 2770 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2771 | data.readStrongBinder()); |
| 2772 | boolean keepAwake = data.readInt() != 0; |
| 2773 | setVoiceKeepAwake(session, keepAwake); |
| 2774 | reply.writeNoException(); |
| 2775 | return true; |
| 2776 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2777 | |
| 2778 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2779 | data.enforceInterface(IActivityManager.descriptor); |
| 2780 | int userId = data.readInt(); |
| 2781 | String[] packages = data.readStringArray(); |
| 2782 | updateLockTaskPackages(userId, packages); |
| 2783 | reply.writeNoException(); |
| 2784 | return true; |
| 2785 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2786 | |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 2787 | case UPDATE_DEVICE_OWNER_TRANSACTION: { |
| 2788 | data.enforceInterface(IActivityManager.descriptor); |
| 2789 | String packageName = data.readString(); |
| 2790 | updateDeviceOwner(packageName); |
| 2791 | reply.writeNoException(); |
| 2792 | return true; |
| 2793 | } |
| 2794 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2795 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2796 | data.enforceInterface(IActivityManager.descriptor); |
| 2797 | String pkg = data.readString(); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 2798 | String callingPackage = data.readString(); |
| 2799 | int res = getPackageProcessState(pkg, callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2800 | reply.writeNoException(); |
| 2801 | reply.writeInt(res); |
| 2802 | return true; |
| 2803 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2804 | |
| 2805 | case SET_PROCESS_MEMORY_TRIM_TRANSACTION: { |
| 2806 | data.enforceInterface(IActivityManager.descriptor); |
| 2807 | String process = data.readString(); |
| 2808 | int userId = data.readInt(); |
| 2809 | int level = data.readInt(); |
| 2810 | boolean res = setProcessMemoryTrimLevel(process, userId, level); |
| 2811 | reply.writeNoException(); |
| 2812 | reply.writeInt(res ? 1 : 0); |
| 2813 | return true; |
| 2814 | } |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2815 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 2816 | case IS_ROOT_VOICE_INTERACTION_TRANSACTION: { |
| 2817 | data.enforceInterface(IActivityManager.descriptor); |
| 2818 | IBinder token = data.readStrongBinder(); |
| 2819 | boolean res = isRootVoiceInteraction(token); |
| 2820 | reply.writeNoException(); |
| 2821 | reply.writeInt(res ? 1 : 0); |
| 2822 | return true; |
| 2823 | } |
Ian Pedowitz | a371084 | 2015-08-03 23:36:15 -0700 | [diff] [blame] | 2824 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2825 | case START_BINDER_TRACKING_TRANSACTION: { |
| 2826 | data.enforceInterface(IActivityManager.descriptor); |
| 2827 | boolean res = startBinderTracking(); |
| 2828 | reply.writeNoException(); |
| 2829 | reply.writeInt(res ? 1 : 0); |
| 2830 | return true; |
| 2831 | } |
| 2832 | |
| 2833 | case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: { |
| 2834 | data.enforceInterface(IActivityManager.descriptor); |
| 2835 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 2836 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
| 2837 | boolean res = stopBinderTrackingAndDump(fd); |
| 2838 | reply.writeNoException(); |
| 2839 | reply.writeInt(res ? 1 : 0); |
| 2840 | return true; |
| 2841 | } |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2842 | case GET_ACTIVITY_STACK_ID_TRANSACTION: { |
| 2843 | data.enforceInterface(IActivityManager.descriptor); |
| 2844 | IBinder token = data.readStrongBinder(); |
| 2845 | int stackId = getActivityStackId(token); |
| 2846 | reply.writeNoException(); |
| 2847 | reply.writeInt(stackId); |
| 2848 | return true; |
| 2849 | } |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2850 | case EXIT_FREEFORM_MODE_TRANSACTION: { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2851 | data.enforceInterface(IActivityManager.descriptor); |
| 2852 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2853 | exitFreeformMode(token); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2854 | reply.writeNoException(); |
| 2855 | return true; |
| 2856 | } |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2857 | case REPORT_SIZE_CONFIGURATIONS: { |
| 2858 | data.enforceInterface(IActivityManager.descriptor); |
| 2859 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2860 | int[] horizontal = readIntArray(data); |
| 2861 | int[] vertical = readIntArray(data); |
| 2862 | int[] smallest = readIntArray(data); |
| 2863 | reportSizeConfigurations(token, horizontal, vertical, smallest); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2864 | return true; |
| 2865 | } |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 2866 | case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: { |
| 2867 | data.enforceInterface(IActivityManager.descriptor); |
| 2868 | final boolean suppress = data.readInt() == 1; |
| 2869 | suppressResizeConfigChanges(suppress); |
| 2870 | reply.writeNoException(); |
| 2871 | return true; |
| 2872 | } |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 2873 | case MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION: { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2874 | data.enforceInterface(IActivityManager.descriptor); |
| 2875 | final int stackId = data.readInt(); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 2876 | final boolean onTop = data.readInt() == 1; |
| 2877 | moveTasksToFullscreenStack(stackId, onTop); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2878 | reply.writeNoException(); |
| 2879 | return true; |
| 2880 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2881 | case GET_APP_START_MODE_TRANSACTION: { |
| 2882 | data.enforceInterface(IActivityManager.descriptor); |
| 2883 | final int uid = data.readInt(); |
| 2884 | final String pkg = data.readString(); |
| 2885 | int res = getAppStartMode(uid, pkg); |
| 2886 | reply.writeNoException(); |
| 2887 | reply.writeInt(res); |
| 2888 | return true; |
| 2889 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2890 | case IN_MULTI_WINDOW_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2891 | data.enforceInterface(IActivityManager.descriptor); |
| 2892 | final IBinder token = data.readStrongBinder(); |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 2893 | final boolean inMultiWindow = isInMultiWindowMode(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2894 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2895 | reply.writeInt(inMultiWindow ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2896 | return true; |
| 2897 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2898 | case IN_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2899 | data.enforceInterface(IActivityManager.descriptor); |
| 2900 | final IBinder token = data.readStrongBinder(); |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 2901 | final boolean inPip = isInPictureInPictureMode(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2902 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2903 | reply.writeInt(inPip ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2904 | return true; |
| 2905 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2906 | case ENTER_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2907 | data.enforceInterface(IActivityManager.descriptor); |
| 2908 | final IBinder token = data.readStrongBinder(); |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 2909 | enterPictureInPictureMode(token); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2910 | reply.writeNoException(); |
| 2911 | return true; |
| 2912 | } |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2913 | case SET_VR_MODE_TRANSACTION: { |
| 2914 | data.enforceInterface(IActivityManager.descriptor); |
| 2915 | final IBinder token = data.readStrongBinder(); |
| 2916 | final boolean enable = data.readInt() == 1; |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 2917 | final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data); |
| 2918 | int res = setVrMode(token, enable, packageName); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2919 | reply.writeNoException(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 2920 | reply.writeInt(res); |
| 2921 | return true; |
| 2922 | } |
| 2923 | case IS_VR_PACKAGE_ENABLED_TRANSACTION: { |
| 2924 | data.enforceInterface(IActivityManager.descriptor); |
| 2925 | final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data); |
| 2926 | boolean res = isVrModePackageEnabled(packageName); |
| 2927 | reply.writeNoException(); |
| 2928 | reply.writeInt(res ? 1 : 0); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2929 | return true; |
| 2930 | } |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 2931 | case IS_APP_FOREGROUND_TRANSACTION: { |
| 2932 | data.enforceInterface(IActivityManager.descriptor); |
| 2933 | final int userHandle = data.readInt(); |
| 2934 | final boolean isForeground = isAppForeground(userHandle); |
| 2935 | reply.writeNoException(); |
| 2936 | reply.writeInt(isForeground ? 1 : 0); |
| 2937 | return true; |
| 2938 | } |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 2939 | case NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION: { |
| 2940 | data.enforceInterface(IActivityManager.descriptor); |
| 2941 | reply.writeNoException(); |
| 2942 | return true; |
| 2943 | } |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 2944 | case REMOVE_STACK: { |
| 2945 | data.enforceInterface(IActivityManager.descriptor); |
| 2946 | final int stackId = data.readInt(); |
| 2947 | removeStack(stackId); |
| 2948 | reply.writeNoException(); |
| 2949 | return true; |
| 2950 | } |
Tony Mak | 9c6e8ce | 2016-03-21 12:07:16 +0000 | [diff] [blame] | 2951 | case NOTIFY_LOCKED_PROFILE: { |
| 2952 | data.enforceInterface(IActivityManager.descriptor); |
| 2953 | final int userId = data.readInt(); |
| 2954 | notifyLockedProfile(userId); |
| 2955 | reply.writeNoException(); |
| 2956 | return true; |
| 2957 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2958 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2959 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2960 | return super.onTransact(code, data, reply, flags); |
| 2961 | } |
| 2962 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2963 | private int[] readIntArray(Parcel data) { |
| 2964 | int[] smallest = null; |
| 2965 | int smallestSize = data.readInt(); |
| 2966 | if (smallestSize > 0) { |
| 2967 | smallest = new int[smallestSize]; |
| 2968 | data.readIntArray(smallest); |
| 2969 | } |
| 2970 | return smallest; |
| 2971 | } |
| 2972 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2973 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2974 | return this; |
| 2975 | } |
| 2976 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2977 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2978 | protected IActivityManager create() { |
| 2979 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2980 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2981 | Log.v("ActivityManager", "default service binder = " + b); |
| 2982 | } |
| 2983 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2984 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2985 | Log.v("ActivityManager", "default service = " + am); |
| 2986 | } |
| 2987 | return am; |
| 2988 | } |
| 2989 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2990 | } |
| 2991 | |
| 2992 | class ActivityManagerProxy implements IActivityManager |
| 2993 | { |
| 2994 | public ActivityManagerProxy(IBinder remote) |
| 2995 | { |
| 2996 | mRemote = remote; |
| 2997 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2998 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2999 | public IBinder asBinder() |
| 3000 | { |
| 3001 | return mRemote; |
| 3002 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 3003 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3004 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3005 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3006 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3007 | Parcel data = Parcel.obtain(); |
| 3008 | Parcel reply = Parcel.obtain(); |
| 3009 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3010 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3011 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3012 | intent.writeToParcel(data, 0); |
| 3013 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3014 | data.writeStrongBinder(resultTo); |
| 3015 | data.writeString(resultWho); |
| 3016 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3017 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3018 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3019 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3020 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3021 | } else { |
| 3022 | data.writeInt(0); |
| 3023 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3024 | if (options != null) { |
| 3025 | data.writeInt(1); |
| 3026 | options.writeToParcel(data, 0); |
| 3027 | } else { |
| 3028 | data.writeInt(0); |
| 3029 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3030 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3031 | reply.readException(); |
| 3032 | int result = reply.readInt(); |
| 3033 | reply.recycle(); |
| 3034 | data.recycle(); |
| 3035 | return result; |
| 3036 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3037 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3038 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3039 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3040 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3041 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3042 | Parcel data = Parcel.obtain(); |
| 3043 | Parcel reply = Parcel.obtain(); |
| 3044 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3045 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3046 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3047 | intent.writeToParcel(data, 0); |
| 3048 | data.writeString(resolvedType); |
| 3049 | data.writeStrongBinder(resultTo); |
| 3050 | data.writeString(resultWho); |
| 3051 | data.writeInt(requestCode); |
| 3052 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3053 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3054 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3055 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3056 | } else { |
| 3057 | data.writeInt(0); |
| 3058 | } |
| 3059 | if (options != null) { |
| 3060 | data.writeInt(1); |
| 3061 | options.writeToParcel(data, 0); |
| 3062 | } else { |
| 3063 | data.writeInt(0); |
| 3064 | } |
| 3065 | data.writeInt(userId); |
| 3066 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 3067 | reply.readException(); |
| 3068 | int result = reply.readInt(); |
| 3069 | reply.recycle(); |
| 3070 | data.recycle(); |
| 3071 | return result; |
| 3072 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3073 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 3074 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3075 | int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, |
| 3076 | int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3077 | Parcel data = Parcel.obtain(); |
| 3078 | Parcel reply = Parcel.obtain(); |
| 3079 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3080 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3081 | data.writeString(callingPackage); |
| 3082 | intent.writeToParcel(data, 0); |
| 3083 | data.writeString(resolvedType); |
| 3084 | data.writeStrongBinder(resultTo); |
| 3085 | data.writeString(resultWho); |
| 3086 | data.writeInt(requestCode); |
| 3087 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3088 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3089 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3090 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3091 | } else { |
| 3092 | data.writeInt(0); |
| 3093 | } |
| 3094 | if (options != null) { |
| 3095 | data.writeInt(1); |
| 3096 | options.writeToParcel(data, 0); |
| 3097 | } else { |
| 3098 | data.writeInt(0); |
| 3099 | } |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3100 | data.writeInt(ignoreTargetSecurity ? 1 : 0); |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 3101 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3102 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 3103 | reply.readException(); |
| 3104 | int result = reply.readInt(); |
| 3105 | reply.recycle(); |
| 3106 | data.recycle(); |
| 3107 | return result; |
| 3108 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3109 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 3110 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3111 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3112 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3113 | Parcel data = Parcel.obtain(); |
| 3114 | Parcel reply = Parcel.obtain(); |
| 3115 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3116 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3117 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3118 | intent.writeToParcel(data, 0); |
| 3119 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3120 | data.writeStrongBinder(resultTo); |
| 3121 | data.writeString(resultWho); |
| 3122 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3123 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3124 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3125 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3126 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3127 | } else { |
| 3128 | data.writeInt(0); |
| 3129 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3130 | if (options != null) { |
| 3131 | data.writeInt(1); |
| 3132 | options.writeToParcel(data, 0); |
| 3133 | } else { |
| 3134 | data.writeInt(0); |
| 3135 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3136 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3137 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 3138 | reply.readException(); |
| 3139 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 3140 | reply.recycle(); |
| 3141 | data.recycle(); |
| 3142 | return result; |
| 3143 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3144 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 3145 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3146 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3147 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3148 | Parcel data = Parcel.obtain(); |
| 3149 | Parcel reply = Parcel.obtain(); |
| 3150 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3151 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3152 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3153 | intent.writeToParcel(data, 0); |
| 3154 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3155 | data.writeStrongBinder(resultTo); |
| 3156 | data.writeString(resultWho); |
| 3157 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3158 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3159 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3160 | if (options != null) { |
| 3161 | data.writeInt(1); |
| 3162 | options.writeToParcel(data, 0); |
| 3163 | } else { |
| 3164 | data.writeInt(0); |
| 3165 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3166 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3167 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3168 | reply.readException(); |
| 3169 | int result = reply.readInt(); |
| 3170 | reply.recycle(); |
| 3171 | data.recycle(); |
| 3172 | return result; |
| 3173 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3174 | public int startActivityIntentSender(IApplicationThread caller, |
| 3175 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3176 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3177 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3178 | Parcel data = Parcel.obtain(); |
| 3179 | Parcel reply = Parcel.obtain(); |
| 3180 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3181 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3182 | intent.writeToParcel(data, 0); |
| 3183 | if (fillInIntent != null) { |
| 3184 | data.writeInt(1); |
| 3185 | fillInIntent.writeToParcel(data, 0); |
| 3186 | } else { |
| 3187 | data.writeInt(0); |
| 3188 | } |
| 3189 | data.writeString(resolvedType); |
| 3190 | data.writeStrongBinder(resultTo); |
| 3191 | data.writeString(resultWho); |
| 3192 | data.writeInt(requestCode); |
| 3193 | data.writeInt(flagsMask); |
| 3194 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3195 | if (options != null) { |
| 3196 | data.writeInt(1); |
| 3197 | options.writeToParcel(data, 0); |
| 3198 | } else { |
| 3199 | data.writeInt(0); |
| 3200 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3201 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3202 | reply.readException(); |
| 3203 | int result = reply.readInt(); |
| 3204 | reply.recycle(); |
| 3205 | data.recycle(); |
| 3206 | return result; |
| 3207 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3208 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 3209 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3210 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 3211 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3212 | Parcel data = Parcel.obtain(); |
| 3213 | Parcel reply = Parcel.obtain(); |
| 3214 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3215 | data.writeString(callingPackage); |
| 3216 | data.writeInt(callingPid); |
| 3217 | data.writeInt(callingUid); |
| 3218 | intent.writeToParcel(data, 0); |
| 3219 | data.writeString(resolvedType); |
| 3220 | data.writeStrongBinder(session.asBinder()); |
| 3221 | data.writeStrongBinder(interactor.asBinder()); |
| 3222 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3223 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3224 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3225 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3226 | } else { |
| 3227 | data.writeInt(0); |
| 3228 | } |
| 3229 | if (options != null) { |
| 3230 | data.writeInt(1); |
| 3231 | options.writeToParcel(data, 0); |
| 3232 | } else { |
| 3233 | data.writeInt(0); |
| 3234 | } |
| 3235 | data.writeInt(userId); |
| 3236 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3237 | reply.readException(); |
| 3238 | int result = reply.readInt(); |
| 3239 | reply.recycle(); |
| 3240 | data.recycle(); |
| 3241 | return result; |
| 3242 | } |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 3243 | |
| 3244 | public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options) |
| 3245 | throws RemoteException { |
| 3246 | Parcel data = Parcel.obtain(); |
| 3247 | Parcel reply = Parcel.obtain(); |
| 3248 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3249 | data.writeStrongBinder(callingActivity); |
| 3250 | data.writeBundle(options); |
| 3251 | mRemote.transact(START_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3252 | reply.readException(); |
| 3253 | reply.recycle(); |
| 3254 | data.recycle(); |
| 3255 | } |
| 3256 | |
| 3257 | public void stopLocalVoiceInteraction(IBinder callingActivity) throws RemoteException { |
| 3258 | Parcel data = Parcel.obtain(); |
| 3259 | Parcel reply = Parcel.obtain(); |
| 3260 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3261 | data.writeStrongBinder(callingActivity); |
| 3262 | mRemote.transact(STOP_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3263 | reply.readException(); |
| 3264 | reply.recycle(); |
| 3265 | data.recycle(); |
| 3266 | } |
| 3267 | |
| 3268 | public boolean supportsLocalVoiceInteraction() throws RemoteException { |
| 3269 | Parcel data = Parcel.obtain(); |
| 3270 | Parcel reply = Parcel.obtain(); |
| 3271 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3272 | mRemote.transact(SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3273 | reply.readException(); |
| 3274 | int result = reply.readInt(); |
| 3275 | reply.recycle(); |
| 3276 | data.recycle(); |
| 3277 | return result != 0; |
| 3278 | } |
| 3279 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3280 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3281 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3282 | Parcel data = Parcel.obtain(); |
| 3283 | Parcel reply = Parcel.obtain(); |
| 3284 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3285 | data.writeStrongBinder(callingActivity); |
| 3286 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3287 | if (options != null) { |
| 3288 | data.writeInt(1); |
| 3289 | options.writeToParcel(data, 0); |
| 3290 | } else { |
| 3291 | data.writeInt(0); |
| 3292 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3293 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3294 | reply.readException(); |
| 3295 | int result = reply.readInt(); |
| 3296 | reply.recycle(); |
| 3297 | data.recycle(); |
| 3298 | return result != 0; |
| 3299 | } |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 3300 | public int startActivityFromRecents(int taskId, Bundle options) |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3301 | throws RemoteException { |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3302 | Parcel data = Parcel.obtain(); |
| 3303 | Parcel reply = Parcel.obtain(); |
| 3304 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3305 | data.writeInt(taskId); |
| 3306 | if (options == null) { |
| 3307 | data.writeInt(0); |
| 3308 | } else { |
| 3309 | data.writeInt(1); |
| 3310 | options.writeToParcel(data, 0); |
| 3311 | } |
| 3312 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 3313 | reply.readException(); |
| 3314 | int result = reply.readInt(); |
| 3315 | reply.recycle(); |
| 3316 | data.recycle(); |
| 3317 | return result; |
| 3318 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3319 | 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] | 3320 | throws RemoteException { |
| 3321 | Parcel data = Parcel.obtain(); |
| 3322 | Parcel reply = Parcel.obtain(); |
| 3323 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3324 | data.writeStrongBinder(token); |
| 3325 | data.writeInt(resultCode); |
| 3326 | if (resultData != null) { |
| 3327 | data.writeInt(1); |
| 3328 | resultData.writeToParcel(data, 0); |
| 3329 | } else { |
| 3330 | data.writeInt(0); |
| 3331 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3332 | data.writeInt(finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3333 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3334 | reply.readException(); |
| 3335 | boolean res = reply.readInt() != 0; |
| 3336 | data.recycle(); |
| 3337 | reply.recycle(); |
| 3338 | return res; |
| 3339 | } |
| 3340 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 3341 | { |
| 3342 | Parcel data = Parcel.obtain(); |
| 3343 | Parcel reply = Parcel.obtain(); |
| 3344 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3345 | data.writeStrongBinder(token); |
| 3346 | data.writeString(resultWho); |
| 3347 | data.writeInt(requestCode); |
| 3348 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3349 | reply.readException(); |
| 3350 | data.recycle(); |
| 3351 | reply.recycle(); |
| 3352 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 3353 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 3354 | Parcel data = Parcel.obtain(); |
| 3355 | Parcel reply = Parcel.obtain(); |
| 3356 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3357 | data.writeStrongBinder(token); |
| 3358 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 3359 | reply.readException(); |
| 3360 | boolean res = reply.readInt() != 0; |
| 3361 | data.recycle(); |
| 3362 | reply.recycle(); |
| 3363 | return res; |
| 3364 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 3365 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 3366 | Parcel data = Parcel.obtain(); |
| 3367 | Parcel reply = Parcel.obtain(); |
| 3368 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3369 | data.writeStrongBinder(session.asBinder()); |
| 3370 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 3371 | reply.readException(); |
| 3372 | data.recycle(); |
| 3373 | reply.recycle(); |
| 3374 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 3375 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 3376 | Parcel data = Parcel.obtain(); |
| 3377 | Parcel reply = Parcel.obtain(); |
| 3378 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3379 | data.writeStrongBinder(token); |
| 3380 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 3381 | reply.readException(); |
| 3382 | boolean res = reply.readInt() != 0; |
| 3383 | data.recycle(); |
| 3384 | reply.recycle(); |
| 3385 | return res; |
| 3386 | } |
| 3387 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 3388 | Parcel data = Parcel.obtain(); |
| 3389 | Parcel reply = Parcel.obtain(); |
| 3390 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3391 | data.writeStrongBinder(app.asBinder()); |
| 3392 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 3393 | reply.readException(); |
| 3394 | data.recycle(); |
| 3395 | reply.recycle(); |
| 3396 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 3397 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 3398 | Parcel data = Parcel.obtain(); |
| 3399 | Parcel reply = Parcel.obtain(); |
| 3400 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3401 | data.writeStrongBinder(token); |
| 3402 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 3403 | reply.readException(); |
| 3404 | boolean res = reply.readInt() != 0; |
| 3405 | data.recycle(); |
| 3406 | reply.recycle(); |
| 3407 | return res; |
| 3408 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3409 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3410 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3411 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3412 | { |
| 3413 | Parcel data = Parcel.obtain(); |
| 3414 | Parcel reply = Parcel.obtain(); |
| 3415 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3416 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3417 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3418 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 3419 | filter.writeToParcel(data, 0); |
| 3420 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3421 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3422 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3423 | reply.readException(); |
| 3424 | Intent intent = null; |
| 3425 | int haveIntent = reply.readInt(); |
| 3426 | if (haveIntent != 0) { |
| 3427 | intent = Intent.CREATOR.createFromParcel(reply); |
| 3428 | } |
| 3429 | reply.recycle(); |
| 3430 | data.recycle(); |
| 3431 | return intent; |
| 3432 | } |
| 3433 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 3434 | { |
| 3435 | Parcel data = Parcel.obtain(); |
| 3436 | Parcel reply = Parcel.obtain(); |
| 3437 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3438 | data.writeStrongBinder(receiver.asBinder()); |
| 3439 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3440 | reply.readException(); |
| 3441 | data.recycle(); |
| 3442 | reply.recycle(); |
| 3443 | } |
| 3444 | public int broadcastIntent(IApplicationThread caller, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3445 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3446 | int resultCode, String resultData, Bundle map, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3447 | String[] requiredPermissions, int appOp, Bundle options, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3448 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3449 | { |
| 3450 | Parcel data = Parcel.obtain(); |
| 3451 | Parcel reply = Parcel.obtain(); |
| 3452 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3453 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3454 | intent.writeToParcel(data, 0); |
| 3455 | data.writeString(resolvedType); |
| 3456 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 3457 | data.writeInt(resultCode); |
| 3458 | data.writeString(resultData); |
| 3459 | data.writeBundle(map); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3460 | data.writeStringArray(requiredPermissions); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 3461 | data.writeInt(appOp); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3462 | data.writeBundle(options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3463 | data.writeInt(serialized ? 1 : 0); |
| 3464 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3465 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3466 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3467 | reply.readException(); |
| 3468 | int res = reply.readInt(); |
| 3469 | reply.recycle(); |
| 3470 | data.recycle(); |
| 3471 | return res; |
| 3472 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3473 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 3474 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3475 | { |
| 3476 | Parcel data = Parcel.obtain(); |
| 3477 | Parcel reply = Parcel.obtain(); |
| 3478 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3479 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3480 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3481 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3482 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3483 | reply.readException(); |
| 3484 | data.recycle(); |
| 3485 | reply.recycle(); |
| 3486 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3487 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 3488 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3489 | { |
| 3490 | Parcel data = Parcel.obtain(); |
| 3491 | Parcel reply = Parcel.obtain(); |
| 3492 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3493 | data.writeStrongBinder(who); |
| 3494 | data.writeInt(resultCode); |
| 3495 | data.writeString(resultData); |
| 3496 | data.writeBundle(map); |
| 3497 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3498 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3499 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3500 | reply.readException(); |
| 3501 | data.recycle(); |
| 3502 | reply.recycle(); |
| 3503 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3504 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3505 | { |
| 3506 | Parcel data = Parcel.obtain(); |
| 3507 | Parcel reply = Parcel.obtain(); |
| 3508 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3509 | data.writeStrongBinder(app.asBinder()); |
| 3510 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3511 | reply.readException(); |
| 3512 | data.recycle(); |
| 3513 | reply.recycle(); |
| 3514 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3515 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3516 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3517 | { |
| 3518 | Parcel data = Parcel.obtain(); |
| 3519 | Parcel reply = Parcel.obtain(); |
| 3520 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3521 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3522 | if (config != null) { |
| 3523 | data.writeInt(1); |
| 3524 | config.writeToParcel(data, 0); |
| 3525 | } else { |
| 3526 | data.writeInt(0); |
| 3527 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3528 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3529 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3530 | reply.readException(); |
| 3531 | data.recycle(); |
| 3532 | reply.recycle(); |
| 3533 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3534 | public void activityResumed(IBinder token) throws RemoteException |
| 3535 | { |
| 3536 | Parcel data = Parcel.obtain(); |
| 3537 | Parcel reply = Parcel.obtain(); |
| 3538 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3539 | data.writeStrongBinder(token); |
| 3540 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3541 | reply.readException(); |
| 3542 | data.recycle(); |
| 3543 | reply.recycle(); |
| 3544 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3545 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3546 | { |
| 3547 | Parcel data = Parcel.obtain(); |
| 3548 | Parcel reply = Parcel.obtain(); |
| 3549 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3550 | data.writeStrongBinder(token); |
| 3551 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3552 | reply.readException(); |
| 3553 | data.recycle(); |
| 3554 | reply.recycle(); |
| 3555 | } |
| 3556 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3557 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3558 | { |
| 3559 | Parcel data = Parcel.obtain(); |
| 3560 | Parcel reply = Parcel.obtain(); |
| 3561 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3562 | data.writeStrongBinder(token); |
| 3563 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3564 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3565 | TextUtils.writeToParcel(description, data, 0); |
| 3566 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3567 | reply.readException(); |
| 3568 | data.recycle(); |
| 3569 | reply.recycle(); |
| 3570 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3571 | public void activitySlept(IBinder token) throws RemoteException |
| 3572 | { |
| 3573 | Parcel data = Parcel.obtain(); |
| 3574 | Parcel reply = Parcel.obtain(); |
| 3575 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3576 | data.writeStrongBinder(token); |
| 3577 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3578 | reply.readException(); |
| 3579 | data.recycle(); |
| 3580 | reply.recycle(); |
| 3581 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3582 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3583 | { |
| 3584 | Parcel data = Parcel.obtain(); |
| 3585 | Parcel reply = Parcel.obtain(); |
| 3586 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3587 | data.writeStrongBinder(token); |
| 3588 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3589 | reply.readException(); |
| 3590 | data.recycle(); |
| 3591 | reply.recycle(); |
| 3592 | } |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 3593 | public void activityRelaunched(IBinder token) throws RemoteException |
| 3594 | { |
| 3595 | Parcel data = Parcel.obtain(); |
| 3596 | Parcel reply = Parcel.obtain(); |
| 3597 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3598 | data.writeStrongBinder(token); |
| 3599 | mRemote.transact(ACTIVITY_RELAUNCHED_TRANSACTION, data, reply, 0); |
| 3600 | reply.readException(); |
| 3601 | data.recycle(); |
| 3602 | reply.recycle(); |
| 3603 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3604 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3605 | { |
| 3606 | Parcel data = Parcel.obtain(); |
| 3607 | Parcel reply = Parcel.obtain(); |
| 3608 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3609 | data.writeStrongBinder(token); |
| 3610 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3611 | reply.readException(); |
| 3612 | String res = reply.readString(); |
| 3613 | data.recycle(); |
| 3614 | reply.recycle(); |
| 3615 | return res; |
| 3616 | } |
| 3617 | public ComponentName getCallingActivity(IBinder token) |
| 3618 | throws RemoteException { |
| 3619 | Parcel data = Parcel.obtain(); |
| 3620 | Parcel reply = Parcel.obtain(); |
| 3621 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3622 | data.writeStrongBinder(token); |
| 3623 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3624 | reply.readException(); |
| 3625 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3626 | data.recycle(); |
| 3627 | reply.recycle(); |
| 3628 | return res; |
| 3629 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3630 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3631 | Parcel data = Parcel.obtain(); |
| 3632 | Parcel reply = Parcel.obtain(); |
| 3633 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3634 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3635 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3636 | reply.readException(); |
| 3637 | ArrayList<IAppTask> list = null; |
| 3638 | int N = reply.readInt(); |
| 3639 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3640 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3641 | while (N > 0) { |
| 3642 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3643 | list.add(task); |
| 3644 | N--; |
| 3645 | } |
| 3646 | } |
| 3647 | data.recycle(); |
| 3648 | reply.recycle(); |
| 3649 | return list; |
| 3650 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3651 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3652 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3653 | Parcel data = Parcel.obtain(); |
| 3654 | Parcel reply = Parcel.obtain(); |
| 3655 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3656 | data.writeStrongBinder(activityToken); |
| 3657 | intent.writeToParcel(data, 0); |
| 3658 | description.writeToParcel(data, 0); |
| 3659 | thumbnail.writeToParcel(data, 0); |
| 3660 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3661 | reply.readException(); |
| 3662 | int res = reply.readInt(); |
| 3663 | data.recycle(); |
| 3664 | reply.recycle(); |
| 3665 | return res; |
| 3666 | } |
| 3667 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3668 | Parcel data = Parcel.obtain(); |
| 3669 | Parcel reply = Parcel.obtain(); |
| 3670 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3671 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3672 | reply.readException(); |
| 3673 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3674 | data.recycle(); |
| 3675 | reply.recycle(); |
| 3676 | return size; |
| 3677 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3678 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3679 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3680 | Parcel data = Parcel.obtain(); |
| 3681 | Parcel reply = Parcel.obtain(); |
| 3682 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3683 | data.writeInt(maxNum); |
| 3684 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3685 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3686 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3687 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3688 | int N = reply.readInt(); |
| 3689 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3690 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3691 | while (N > 0) { |
| 3692 | ActivityManager.RunningTaskInfo info = |
| 3693 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3694 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3695 | list.add(info); |
| 3696 | N--; |
| 3697 | } |
| 3698 | } |
| 3699 | data.recycle(); |
| 3700 | reply.recycle(); |
| 3701 | return list; |
| 3702 | } |
| 3703 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3704 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3705 | Parcel data = Parcel.obtain(); |
| 3706 | Parcel reply = Parcel.obtain(); |
| 3707 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3708 | data.writeInt(maxNum); |
| 3709 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3710 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3711 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3712 | reply.readException(); |
| 3713 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3714 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3715 | data.recycle(); |
| 3716 | reply.recycle(); |
| 3717 | return list; |
| 3718 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3719 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3720 | Parcel data = Parcel.obtain(); |
| 3721 | Parcel reply = Parcel.obtain(); |
| 3722 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3723 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3724 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3725 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3726 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3727 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3728 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3729 | } |
| 3730 | data.recycle(); |
| 3731 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3732 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3733 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3734 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3735 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3736 | Parcel data = Parcel.obtain(); |
| 3737 | Parcel reply = Parcel.obtain(); |
| 3738 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3739 | data.writeInt(maxNum); |
| 3740 | data.writeInt(flags); |
| 3741 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3742 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3743 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3744 | int N = reply.readInt(); |
| 3745 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3746 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3747 | while (N > 0) { |
| 3748 | ActivityManager.RunningServiceInfo info = |
| 3749 | ActivityManager.RunningServiceInfo.CREATOR |
| 3750 | .createFromParcel(reply); |
| 3751 | list.add(info); |
| 3752 | N--; |
| 3753 | } |
| 3754 | } |
| 3755 | data.recycle(); |
| 3756 | reply.recycle(); |
| 3757 | return list; |
| 3758 | } |
| 3759 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3760 | throws RemoteException { |
| 3761 | Parcel data = Parcel.obtain(); |
| 3762 | Parcel reply = Parcel.obtain(); |
| 3763 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3764 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3765 | reply.readException(); |
| 3766 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3767 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3768 | data.recycle(); |
| 3769 | reply.recycle(); |
| 3770 | return list; |
| 3771 | } |
| 3772 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3773 | throws RemoteException { |
| 3774 | Parcel data = Parcel.obtain(); |
| 3775 | Parcel reply = Parcel.obtain(); |
| 3776 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3777 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3778 | reply.readException(); |
| 3779 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3780 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3781 | data.recycle(); |
| 3782 | reply.recycle(); |
| 3783 | return list; |
| 3784 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3785 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3786 | throws RemoteException { |
| 3787 | Parcel data = Parcel.obtain(); |
| 3788 | Parcel reply = Parcel.obtain(); |
| 3789 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3790 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3791 | reply.readException(); |
| 3792 | ArrayList<ApplicationInfo> list |
| 3793 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3794 | data.recycle(); |
| 3795 | reply.recycle(); |
| 3796 | return list; |
| 3797 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3798 | 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] | 3799 | { |
| 3800 | Parcel data = Parcel.obtain(); |
| 3801 | Parcel reply = Parcel.obtain(); |
| 3802 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3803 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3804 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3805 | if (options != null) { |
| 3806 | data.writeInt(1); |
| 3807 | options.writeToParcel(data, 0); |
| 3808 | } else { |
| 3809 | data.writeInt(0); |
| 3810 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3811 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3812 | reply.readException(); |
| 3813 | data.recycle(); |
| 3814 | reply.recycle(); |
| 3815 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3816 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3817 | throws RemoteException { |
| 3818 | Parcel data = Parcel.obtain(); |
| 3819 | Parcel reply = Parcel.obtain(); |
| 3820 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3821 | data.writeStrongBinder(token); |
| 3822 | data.writeInt(nonRoot ? 1 : 0); |
| 3823 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3824 | reply.readException(); |
| 3825 | boolean res = reply.readInt() != 0; |
| 3826 | data.recycle(); |
| 3827 | reply.recycle(); |
| 3828 | return res; |
| 3829 | } |
| 3830 | public void moveTaskBackwards(int task) throws RemoteException |
| 3831 | { |
| 3832 | Parcel data = Parcel.obtain(); |
| 3833 | Parcel reply = Parcel.obtain(); |
| 3834 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3835 | data.writeInt(task); |
| 3836 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3837 | reply.readException(); |
| 3838 | data.recycle(); |
| 3839 | reply.recycle(); |
| 3840 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3841 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3842 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3843 | { |
| 3844 | Parcel data = Parcel.obtain(); |
| 3845 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3846 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3847 | data.writeInt(taskId); |
| 3848 | data.writeInt(stackId); |
| 3849 | data.writeInt(toTop ? 1 : 0); |
| 3850 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3851 | reply.readException(); |
| 3852 | data.recycle(); |
| 3853 | reply.recycle(); |
| 3854 | } |
| 3855 | @Override |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3856 | public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3857 | Rect initialBounds) throws RemoteException |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3858 | { |
| 3859 | Parcel data = Parcel.obtain(); |
| 3860 | Parcel reply = Parcel.obtain(); |
| 3861 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3862 | data.writeInt(taskId); |
| 3863 | data.writeInt(createMode); |
| 3864 | data.writeInt(toTop ? 1 : 0); |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 3865 | data.writeInt(animate ? 1 : 0); |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3866 | if (initialBounds != null) { |
| 3867 | data.writeInt(1); |
| 3868 | initialBounds.writeToParcel(data, 0); |
| 3869 | } else { |
| 3870 | data.writeInt(0); |
| 3871 | } |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3872 | mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3873 | reply.readException(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3874 | boolean res = reply.readInt() > 0; |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3875 | data.recycle(); |
| 3876 | reply.recycle(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3877 | return res; |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3878 | } |
| 3879 | @Override |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3880 | public boolean moveTopActivityToPinnedStack(int stackId, Rect r) |
| 3881 | throws RemoteException |
| 3882 | { |
| 3883 | Parcel data = Parcel.obtain(); |
| 3884 | Parcel reply = Parcel.obtain(); |
| 3885 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3886 | data.writeInt(stackId); |
| 3887 | r.writeToParcel(data, 0); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 3888 | mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3889 | reply.readException(); |
| 3890 | final boolean res = reply.readInt() != 0; |
| 3891 | data.recycle(); |
| 3892 | reply.recycle(); |
| 3893 | return res; |
| 3894 | } |
| 3895 | @Override |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3896 | public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode, |
Wale Ogunwale | e75a9ad | 2016-03-18 20:43:49 -0700 | [diff] [blame] | 3897 | boolean preserveWindows, boolean animate, int animationDuration) |
| 3898 | throws RemoteException { |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3899 | Parcel data = Parcel.obtain(); |
| 3900 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3901 | data.writeInterfaceToken(IActivityManager.descriptor); |
Wale Ogunwale | b34a7ad | 2015-08-14 11:05:30 -0700 | [diff] [blame] | 3902 | data.writeInt(stackId); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 3903 | if (r != null) { |
| 3904 | data.writeInt(1); |
| 3905 | r.writeToParcel(data, 0); |
| 3906 | } else { |
| 3907 | data.writeInt(0); |
| 3908 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3909 | data.writeInt(allowResizeInDockedMode ? 1 : 0); |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3910 | data.writeInt(preserveWindows ? 1 : 0); |
| 3911 | data.writeInt(animate ? 1 : 0); |
Wale Ogunwale | e75a9ad | 2016-03-18 20:43:49 -0700 | [diff] [blame] | 3912 | data.writeInt(animationDuration); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3913 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3914 | reply.readException(); |
| 3915 | data.recycle(); |
| 3916 | reply.recycle(); |
| 3917 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3918 | @Override |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 3919 | public void swapDockedAndFullscreenStack() throws RemoteException |
| 3920 | { |
| 3921 | Parcel data = Parcel.obtain(); |
| 3922 | Parcel reply = Parcel.obtain(); |
| 3923 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3924 | mRemote.transact(SWAP_DOCKED_AND_FULLSCREEN_STACK, data, reply, 0); |
| 3925 | reply.readException(); |
| 3926 | data.recycle(); |
| 3927 | reply.recycle(); |
| 3928 | } |
| 3929 | @Override |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 3930 | public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds, |
| 3931 | Rect tempDockedTaskInsetBounds, |
| 3932 | Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds) |
| 3933 | throws RemoteException |
| 3934 | { |
| 3935 | Parcel data = Parcel.obtain(); |
| 3936 | Parcel reply = Parcel.obtain(); |
| 3937 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3938 | if (dockedBounds != null) { |
| 3939 | data.writeInt(1); |
| 3940 | dockedBounds.writeToParcel(data, 0); |
| 3941 | } else { |
| 3942 | data.writeInt(0); |
| 3943 | } |
| 3944 | if (tempDockedTaskBounds != null) { |
| 3945 | data.writeInt(1); |
| 3946 | tempDockedTaskBounds.writeToParcel(data, 0); |
| 3947 | } else { |
| 3948 | data.writeInt(0); |
| 3949 | } |
| 3950 | if (tempDockedTaskInsetBounds != null) { |
| 3951 | data.writeInt(1); |
| 3952 | tempDockedTaskInsetBounds.writeToParcel(data, 0); |
| 3953 | } else { |
| 3954 | data.writeInt(0); |
| 3955 | } |
| 3956 | if (tempOtherTaskBounds != null) { |
| 3957 | data.writeInt(1); |
| 3958 | tempOtherTaskBounds.writeToParcel(data, 0); |
| 3959 | } else { |
| 3960 | data.writeInt(0); |
| 3961 | } |
| 3962 | if (tempOtherTaskInsetBounds != null) { |
| 3963 | data.writeInt(1); |
| 3964 | tempOtherTaskInsetBounds.writeToParcel(data, 0); |
| 3965 | } else { |
| 3966 | data.writeInt(0); |
| 3967 | } |
| 3968 | mRemote.transact(RESIZE_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3969 | reply.readException(); |
| 3970 | data.recycle(); |
| 3971 | reply.recycle(); |
| 3972 | } |
Robert Carr | 0d00c2e | 2016-02-29 17:45:02 -0800 | [diff] [blame] | 3973 | |
| 3974 | @Override |
| 3975 | public void resizePinnedStack(Rect pinnedBounds, Rect tempPinnedTaskBounds) throws RemoteException |
| 3976 | { |
| 3977 | Parcel data = Parcel.obtain(); |
| 3978 | Parcel reply = Parcel.obtain(); |
| 3979 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3980 | if (pinnedBounds != null) { |
| 3981 | data.writeInt(1); |
| 3982 | pinnedBounds.writeToParcel(data, 0); |
| 3983 | } else { |
| 3984 | data.writeInt(0); |
| 3985 | } |
| 3986 | if (tempPinnedTaskBounds != null) { |
| 3987 | data.writeInt(1); |
| 3988 | tempPinnedTaskBounds.writeToParcel(data, 0); |
| 3989 | } else { |
| 3990 | data.writeInt(0); |
| 3991 | } |
| 3992 | mRemote.transact(RESIZE_PINNED_STACK_TRANSACTION, data, reply, 0); |
| 3993 | reply.readException(); |
| 3994 | data.recycle(); |
| 3995 | reply.recycle(); |
| 3996 | } |
| 3997 | |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 3998 | @Override |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 3999 | public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException |
| 4000 | { |
| 4001 | Parcel data = Parcel.obtain(); |
| 4002 | Parcel reply = Parcel.obtain(); |
| 4003 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4004 | data.writeInt(taskId); |
| 4005 | data.writeInt(stackId); |
| 4006 | data.writeInt(position); |
| 4007 | mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0); |
| 4008 | reply.readException(); |
| 4009 | data.recycle(); |
| 4010 | reply.recycle(); |
| 4011 | } |
| 4012 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4013 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 4014 | { |
| 4015 | Parcel data = Parcel.obtain(); |
| 4016 | Parcel reply = Parcel.obtain(); |
| 4017 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4018 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 4019 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4020 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 4021 | data.recycle(); |
| 4022 | reply.recycle(); |
| 4023 | return list; |
| 4024 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4025 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4026 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4027 | { |
| 4028 | Parcel data = Parcel.obtain(); |
| 4029 | Parcel reply = Parcel.obtain(); |
| 4030 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4031 | data.writeInt(stackId); |
| 4032 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4033 | reply.readException(); |
| 4034 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4035 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4036 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4037 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4038 | } |
| 4039 | data.recycle(); |
| 4040 | reply.recycle(); |
| 4041 | return info; |
| 4042 | } |
| 4043 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 4044 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 4045 | Parcel data = Parcel.obtain(); |
| 4046 | Parcel reply = Parcel.obtain(); |
| 4047 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4048 | data.writeInt(taskId); |
| 4049 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 4050 | reply.readException(); |
| 4051 | boolean isInHomeStack = reply.readInt() > 0; |
| 4052 | data.recycle(); |
| 4053 | reply.recycle(); |
| 4054 | return isInHomeStack; |
| 4055 | } |
| 4056 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4057 | public void setFocusedStack(int stackId) throws RemoteException |
| 4058 | { |
| 4059 | Parcel data = Parcel.obtain(); |
| 4060 | Parcel reply = Parcel.obtain(); |
| 4061 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4062 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4063 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4064 | reply.readException(); |
| 4065 | data.recycle(); |
| 4066 | reply.recycle(); |
| 4067 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4068 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 4069 | public int getFocusedStackId() throws RemoteException { |
| 4070 | Parcel data = Parcel.obtain(); |
| 4071 | Parcel reply = Parcel.obtain(); |
| 4072 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4073 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 4074 | reply.readException(); |
| 4075 | int focusedStackId = reply.readInt(); |
| 4076 | data.recycle(); |
| 4077 | reply.recycle(); |
| 4078 | return focusedStackId; |
| 4079 | } |
| 4080 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 4081 | public void setFocusedTask(int taskId) throws RemoteException |
| 4082 | { |
| 4083 | Parcel data = Parcel.obtain(); |
| 4084 | Parcel reply = Parcel.obtain(); |
| 4085 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4086 | data.writeInt(taskId); |
| 4087 | mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0); |
| 4088 | reply.readException(); |
| 4089 | data.recycle(); |
| 4090 | reply.recycle(); |
| 4091 | } |
| 4092 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4093 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 4094 | { |
| 4095 | Parcel data = Parcel.obtain(); |
| 4096 | Parcel reply = Parcel.obtain(); |
| 4097 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4098 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4099 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4100 | reply.readException(); |
| 4101 | data.recycle(); |
| 4102 | reply.recycle(); |
| 4103 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4104 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 4105 | { |
| 4106 | Parcel data = Parcel.obtain(); |
| 4107 | Parcel reply = Parcel.obtain(); |
| 4108 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4109 | data.writeStrongBinder(token); |
| 4110 | data.writeInt(onlyRoot ? 1 : 0); |
| 4111 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4112 | reply.readException(); |
| 4113 | int res = reply.readInt(); |
| 4114 | data.recycle(); |
| 4115 | reply.recycle(); |
| 4116 | return res; |
| 4117 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4118 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4119 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4120 | Parcel data = Parcel.obtain(); |
| 4121 | Parcel reply = Parcel.obtain(); |
| 4122 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4123 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4124 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4125 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4126 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4127 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4128 | reply.readException(); |
| 4129 | int res = reply.readInt(); |
| 4130 | ContentProviderHolder cph = null; |
| 4131 | if (res != 0) { |
| 4132 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4133 | } |
| 4134 | data.recycle(); |
| 4135 | reply.recycle(); |
| 4136 | return cph; |
| 4137 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4138 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 4139 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4140 | Parcel data = Parcel.obtain(); |
| 4141 | Parcel reply = Parcel.obtain(); |
| 4142 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4143 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4144 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4145 | data.writeStrongBinder(token); |
| 4146 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4147 | reply.readException(); |
| 4148 | int res = reply.readInt(); |
| 4149 | ContentProviderHolder cph = null; |
| 4150 | if (res != 0) { |
| 4151 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4152 | } |
| 4153 | data.recycle(); |
| 4154 | reply.recycle(); |
| 4155 | return cph; |
| 4156 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4157 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4158 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4159 | { |
| 4160 | Parcel data = Parcel.obtain(); |
| 4161 | Parcel reply = Parcel.obtain(); |
| 4162 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4163 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4164 | data.writeTypedList(providers); |
| 4165 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 4166 | reply.readException(); |
| 4167 | data.recycle(); |
| 4168 | reply.recycle(); |
| 4169 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4170 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 4171 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4172 | Parcel data = Parcel.obtain(); |
| 4173 | Parcel reply = Parcel.obtain(); |
| 4174 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4175 | data.writeStrongBinder(connection); |
| 4176 | data.writeInt(stable); |
| 4177 | data.writeInt(unstable); |
| 4178 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4179 | reply.readException(); |
| 4180 | boolean res = reply.readInt() != 0; |
| 4181 | data.recycle(); |
| 4182 | reply.recycle(); |
| 4183 | return res; |
| 4184 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4185 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4186 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 4187 | Parcel data = Parcel.obtain(); |
| 4188 | Parcel reply = Parcel.obtain(); |
| 4189 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4190 | data.writeStrongBinder(connection); |
| 4191 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 4192 | reply.readException(); |
| 4193 | data.recycle(); |
| 4194 | reply.recycle(); |
| 4195 | } |
| 4196 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4197 | @Override |
| 4198 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 4199 | Parcel data = Parcel.obtain(); |
| 4200 | Parcel reply = Parcel.obtain(); |
| 4201 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4202 | data.writeStrongBinder(connection); |
| 4203 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 4204 | reply.readException(); |
| 4205 | data.recycle(); |
| 4206 | reply.recycle(); |
| 4207 | } |
| 4208 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4209 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 4210 | Parcel data = Parcel.obtain(); |
| 4211 | Parcel reply = Parcel.obtain(); |
| 4212 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4213 | data.writeStrongBinder(connection); |
| 4214 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4215 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4216 | reply.readException(); |
| 4217 | data.recycle(); |
| 4218 | reply.recycle(); |
| 4219 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4220 | |
| 4221 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 4222 | Parcel data = Parcel.obtain(); |
| 4223 | Parcel reply = Parcel.obtain(); |
| 4224 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4225 | data.writeString(name); |
| 4226 | data.writeStrongBinder(token); |
| 4227 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4228 | reply.readException(); |
| 4229 | data.recycle(); |
| 4230 | reply.recycle(); |
| 4231 | } |
| 4232 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 4233 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 4234 | throws RemoteException |
| 4235 | { |
| 4236 | Parcel data = Parcel.obtain(); |
| 4237 | Parcel reply = Parcel.obtain(); |
| 4238 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4239 | service.writeToParcel(data, 0); |
| 4240 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 4241 | reply.readException(); |
| 4242 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 4243 | data.recycle(); |
| 4244 | reply.recycle(); |
| 4245 | return res; |
| 4246 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4247 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4248 | public ComponentName startService(IApplicationThread caller, Intent service, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4249 | String resolvedType, String callingPackage, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4250 | { |
| 4251 | Parcel data = Parcel.obtain(); |
| 4252 | Parcel reply = Parcel.obtain(); |
| 4253 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4254 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4255 | service.writeToParcel(data, 0); |
| 4256 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4257 | data.writeString(callingPackage); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4258 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4259 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 4260 | reply.readException(); |
| 4261 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4262 | data.recycle(); |
| 4263 | reply.recycle(); |
| 4264 | return res; |
| 4265 | } |
| 4266 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4267 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4268 | { |
| 4269 | Parcel data = Parcel.obtain(); |
| 4270 | Parcel reply = Parcel.obtain(); |
| 4271 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4272 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4273 | service.writeToParcel(data, 0); |
| 4274 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4275 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4276 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 4277 | reply.readException(); |
| 4278 | int res = reply.readInt(); |
| 4279 | reply.recycle(); |
| 4280 | data.recycle(); |
| 4281 | return res; |
| 4282 | } |
| 4283 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 4284 | int startId) throws RemoteException { |
| 4285 | Parcel data = Parcel.obtain(); |
| 4286 | Parcel reply = Parcel.obtain(); |
| 4287 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4288 | ComponentName.writeToParcel(className, data); |
| 4289 | data.writeStrongBinder(token); |
| 4290 | data.writeInt(startId); |
| 4291 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 4292 | reply.readException(); |
| 4293 | boolean res = reply.readInt() != 0; |
| 4294 | data.recycle(); |
| 4295 | reply.recycle(); |
| 4296 | return res; |
| 4297 | } |
| 4298 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4299 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4300 | Parcel data = Parcel.obtain(); |
| 4301 | Parcel reply = Parcel.obtain(); |
| 4302 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4303 | ComponentName.writeToParcel(className, data); |
| 4304 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4305 | data.writeInt(id); |
| 4306 | if (notification != null) { |
| 4307 | data.writeInt(1); |
| 4308 | notification.writeToParcel(data, 0); |
| 4309 | } else { |
| 4310 | data.writeInt(0); |
| 4311 | } |
| 4312 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4313 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4314 | reply.readException(); |
| 4315 | data.recycle(); |
| 4316 | reply.recycle(); |
| 4317 | } |
| 4318 | public int bindService(IApplicationThread caller, IBinder token, |
| 4319 | Intent service, String resolvedType, IServiceConnection connection, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4320 | int flags, String callingPackage, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4321 | Parcel data = Parcel.obtain(); |
| 4322 | Parcel reply = Parcel.obtain(); |
| 4323 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4324 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4325 | data.writeStrongBinder(token); |
| 4326 | service.writeToParcel(data, 0); |
| 4327 | data.writeString(resolvedType); |
| 4328 | data.writeStrongBinder(connection.asBinder()); |
| 4329 | data.writeInt(flags); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4330 | data.writeString(callingPackage); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 4331 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4332 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4333 | reply.readException(); |
| 4334 | int res = reply.readInt(); |
| 4335 | data.recycle(); |
| 4336 | reply.recycle(); |
| 4337 | return res; |
| 4338 | } |
| 4339 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 4340 | { |
| 4341 | Parcel data = Parcel.obtain(); |
| 4342 | Parcel reply = Parcel.obtain(); |
| 4343 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4344 | data.writeStrongBinder(connection.asBinder()); |
| 4345 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4346 | reply.readException(); |
| 4347 | boolean res = reply.readInt() != 0; |
| 4348 | data.recycle(); |
| 4349 | reply.recycle(); |
| 4350 | return res; |
| 4351 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4352 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4353 | public void publishService(IBinder token, |
| 4354 | Intent intent, IBinder service) throws RemoteException { |
| 4355 | Parcel data = Parcel.obtain(); |
| 4356 | Parcel reply = Parcel.obtain(); |
| 4357 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4358 | data.writeStrongBinder(token); |
| 4359 | intent.writeToParcel(data, 0); |
| 4360 | data.writeStrongBinder(service); |
| 4361 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 4362 | reply.readException(); |
| 4363 | data.recycle(); |
| 4364 | reply.recycle(); |
| 4365 | } |
| 4366 | |
| 4367 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 4368 | throws RemoteException { |
| 4369 | Parcel data = Parcel.obtain(); |
| 4370 | Parcel reply = Parcel.obtain(); |
| 4371 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4372 | data.writeStrongBinder(token); |
| 4373 | intent.writeToParcel(data, 0); |
| 4374 | data.writeInt(doRebind ? 1 : 0); |
| 4375 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 4376 | reply.readException(); |
| 4377 | data.recycle(); |
| 4378 | reply.recycle(); |
| 4379 | } |
| 4380 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4381 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 4382 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4383 | Parcel data = Parcel.obtain(); |
| 4384 | Parcel reply = Parcel.obtain(); |
| 4385 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4386 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4387 | data.writeInt(type); |
| 4388 | data.writeInt(startId); |
| 4389 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4390 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 4391 | reply.readException(); |
| 4392 | data.recycle(); |
| 4393 | reply.recycle(); |
| 4394 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4395 | |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4396 | public IBinder peekService(Intent service, String resolvedType, String callingPackage) |
| 4397 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4398 | Parcel data = Parcel.obtain(); |
| 4399 | Parcel reply = Parcel.obtain(); |
| 4400 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4401 | service.writeToParcel(data, 0); |
| 4402 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4403 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4404 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 4405 | reply.readException(); |
| 4406 | IBinder binder = reply.readStrongBinder(); |
| 4407 | reply.recycle(); |
| 4408 | data.recycle(); |
| 4409 | return binder; |
| 4410 | } |
| 4411 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4412 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 4413 | throws RemoteException { |
| 4414 | Parcel data = Parcel.obtain(); |
| 4415 | Parcel reply = Parcel.obtain(); |
| 4416 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4417 | app.writeToParcel(data, 0); |
| 4418 | data.writeInt(backupRestoreMode); |
| 4419 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4420 | reply.readException(); |
| 4421 | boolean success = reply.readInt() != 0; |
| 4422 | reply.recycle(); |
| 4423 | data.recycle(); |
| 4424 | return success; |
| 4425 | } |
| 4426 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 4427 | public void clearPendingBackup() throws RemoteException { |
| 4428 | Parcel data = Parcel.obtain(); |
| 4429 | Parcel reply = Parcel.obtain(); |
| 4430 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4431 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 4432 | reply.recycle(); |
| 4433 | data.recycle(); |
| 4434 | } |
| 4435 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4436 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 4437 | Parcel data = Parcel.obtain(); |
| 4438 | Parcel reply = Parcel.obtain(); |
| 4439 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4440 | data.writeString(packageName); |
| 4441 | data.writeStrongBinder(agent); |
| 4442 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 4443 | reply.recycle(); |
| 4444 | data.recycle(); |
| 4445 | } |
| 4446 | |
| 4447 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 4448 | Parcel data = Parcel.obtain(); |
| 4449 | Parcel reply = Parcel.obtain(); |
| 4450 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4451 | app.writeToParcel(data, 0); |
| 4452 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4453 | reply.readException(); |
| 4454 | reply.recycle(); |
| 4455 | data.recycle(); |
| 4456 | } |
| 4457 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4458 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4459 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4460 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 4461 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4462 | Parcel data = Parcel.obtain(); |
| 4463 | Parcel reply = Parcel.obtain(); |
| 4464 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4465 | ComponentName.writeToParcel(className, data); |
| 4466 | data.writeString(profileFile); |
| 4467 | data.writeInt(flags); |
| 4468 | data.writeBundle(arguments); |
| 4469 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4470 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4471 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4472 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4473 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4474 | reply.readException(); |
| 4475 | boolean res = reply.readInt() != 0; |
| 4476 | reply.recycle(); |
| 4477 | data.recycle(); |
| 4478 | return res; |
| 4479 | } |
| 4480 | |
| 4481 | public void finishInstrumentation(IApplicationThread target, |
| 4482 | int resultCode, Bundle results) throws RemoteException { |
| 4483 | Parcel data = Parcel.obtain(); |
| 4484 | Parcel reply = Parcel.obtain(); |
| 4485 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4486 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 4487 | data.writeInt(resultCode); |
| 4488 | data.writeBundle(results); |
| 4489 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4490 | reply.readException(); |
| 4491 | data.recycle(); |
| 4492 | reply.recycle(); |
| 4493 | } |
| 4494 | public Configuration getConfiguration() throws RemoteException |
| 4495 | { |
| 4496 | Parcel data = Parcel.obtain(); |
| 4497 | Parcel reply = Parcel.obtain(); |
| 4498 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4499 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4500 | reply.readException(); |
| 4501 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 4502 | reply.recycle(); |
| 4503 | data.recycle(); |
| 4504 | return res; |
| 4505 | } |
| 4506 | public void updateConfiguration(Configuration values) throws RemoteException |
| 4507 | { |
| 4508 | Parcel data = Parcel.obtain(); |
| 4509 | Parcel reply = Parcel.obtain(); |
| 4510 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4511 | values.writeToParcel(data, 0); |
| 4512 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4513 | reply.readException(); |
| 4514 | data.recycle(); |
| 4515 | reply.recycle(); |
| 4516 | } |
| 4517 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 4518 | throws RemoteException { |
| 4519 | Parcel data = Parcel.obtain(); |
| 4520 | Parcel reply = Parcel.obtain(); |
| 4521 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4522 | data.writeStrongBinder(token); |
| 4523 | data.writeInt(requestedOrientation); |
| 4524 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4525 | reply.readException(); |
| 4526 | data.recycle(); |
| 4527 | reply.recycle(); |
| 4528 | } |
| 4529 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 4530 | Parcel data = Parcel.obtain(); |
| 4531 | Parcel reply = Parcel.obtain(); |
| 4532 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4533 | data.writeStrongBinder(token); |
| 4534 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4535 | reply.readException(); |
| 4536 | int res = reply.readInt(); |
| 4537 | data.recycle(); |
| 4538 | reply.recycle(); |
| 4539 | return res; |
| 4540 | } |
| 4541 | public ComponentName getActivityClassForToken(IBinder token) |
| 4542 | throws RemoteException { |
| 4543 | Parcel data = Parcel.obtain(); |
| 4544 | Parcel reply = Parcel.obtain(); |
| 4545 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4546 | data.writeStrongBinder(token); |
| 4547 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4548 | reply.readException(); |
| 4549 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4550 | data.recycle(); |
| 4551 | reply.recycle(); |
| 4552 | return res; |
| 4553 | } |
| 4554 | public String getPackageForToken(IBinder token) throws RemoteException |
| 4555 | { |
| 4556 | Parcel data = Parcel.obtain(); |
| 4557 | Parcel reply = Parcel.obtain(); |
| 4558 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4559 | data.writeStrongBinder(token); |
| 4560 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4561 | reply.readException(); |
| 4562 | String res = reply.readString(); |
| 4563 | data.recycle(); |
| 4564 | reply.recycle(); |
| 4565 | return res; |
| 4566 | } |
| 4567 | public IIntentSender getIntentSender(int type, |
| 4568 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4569 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4570 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4571 | Parcel data = Parcel.obtain(); |
| 4572 | Parcel reply = Parcel.obtain(); |
| 4573 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4574 | data.writeInt(type); |
| 4575 | data.writeString(packageName); |
| 4576 | data.writeStrongBinder(token); |
| 4577 | data.writeString(resultWho); |
| 4578 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4579 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4580 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4581 | data.writeTypedArray(intents, 0); |
| 4582 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4583 | } else { |
| 4584 | data.writeInt(0); |
| 4585 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4586 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4587 | if (options != null) { |
| 4588 | data.writeInt(1); |
| 4589 | options.writeToParcel(data, 0); |
| 4590 | } else { |
| 4591 | data.writeInt(0); |
| 4592 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4593 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4594 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4595 | reply.readException(); |
| 4596 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4597 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4598 | data.recycle(); |
| 4599 | reply.recycle(); |
| 4600 | return res; |
| 4601 | } |
| 4602 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 4603 | Parcel data = Parcel.obtain(); |
| 4604 | Parcel reply = Parcel.obtain(); |
| 4605 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4606 | data.writeStrongBinder(sender.asBinder()); |
| 4607 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4608 | reply.readException(); |
| 4609 | data.recycle(); |
| 4610 | reply.recycle(); |
| 4611 | } |
| 4612 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 4613 | Parcel data = Parcel.obtain(); |
| 4614 | Parcel reply = Parcel.obtain(); |
| 4615 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4616 | data.writeStrongBinder(sender.asBinder()); |
| 4617 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4618 | reply.readException(); |
| 4619 | String res = reply.readString(); |
| 4620 | data.recycle(); |
| 4621 | reply.recycle(); |
| 4622 | return res; |
| 4623 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 4624 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 4625 | Parcel data = Parcel.obtain(); |
| 4626 | Parcel reply = Parcel.obtain(); |
| 4627 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4628 | data.writeStrongBinder(sender.asBinder()); |
| 4629 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4630 | reply.readException(); |
| 4631 | int res = reply.readInt(); |
| 4632 | data.recycle(); |
| 4633 | reply.recycle(); |
| 4634 | return res; |
| 4635 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4636 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 4637 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 4638 | Parcel data = Parcel.obtain(); |
| 4639 | Parcel reply = Parcel.obtain(); |
| 4640 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4641 | data.writeInt(callingPid); |
| 4642 | data.writeInt(callingUid); |
| 4643 | data.writeInt(userId); |
| 4644 | data.writeInt(allowAll ? 1 : 0); |
| 4645 | data.writeInt(requireFull ? 1 : 0); |
| 4646 | data.writeString(name); |
| 4647 | data.writeString(callerPackage); |
| 4648 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 4649 | reply.readException(); |
| 4650 | int res = reply.readInt(); |
| 4651 | data.recycle(); |
| 4652 | reply.recycle(); |
| 4653 | return res; |
| 4654 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4655 | public void setProcessLimit(int max) throws RemoteException |
| 4656 | { |
| 4657 | Parcel data = Parcel.obtain(); |
| 4658 | Parcel reply = Parcel.obtain(); |
| 4659 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4660 | data.writeInt(max); |
| 4661 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4662 | reply.readException(); |
| 4663 | data.recycle(); |
| 4664 | reply.recycle(); |
| 4665 | } |
| 4666 | public int getProcessLimit() throws RemoteException |
| 4667 | { |
| 4668 | Parcel data = Parcel.obtain(); |
| 4669 | Parcel reply = Parcel.obtain(); |
| 4670 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4671 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4672 | reply.readException(); |
| 4673 | int res = reply.readInt(); |
| 4674 | data.recycle(); |
| 4675 | reply.recycle(); |
| 4676 | return res; |
| 4677 | } |
| 4678 | public void setProcessForeground(IBinder token, int pid, |
| 4679 | boolean isForeground) throws RemoteException { |
| 4680 | Parcel data = Parcel.obtain(); |
| 4681 | Parcel reply = Parcel.obtain(); |
| 4682 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4683 | data.writeStrongBinder(token); |
| 4684 | data.writeInt(pid); |
| 4685 | data.writeInt(isForeground ? 1 : 0); |
| 4686 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4687 | reply.readException(); |
| 4688 | data.recycle(); |
| 4689 | reply.recycle(); |
| 4690 | } |
| 4691 | public int checkPermission(String permission, int pid, int uid) |
| 4692 | throws RemoteException { |
| 4693 | Parcel data = Parcel.obtain(); |
| 4694 | Parcel reply = Parcel.obtain(); |
| 4695 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4696 | data.writeString(permission); |
| 4697 | data.writeInt(pid); |
| 4698 | data.writeInt(uid); |
| 4699 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4700 | reply.readException(); |
| 4701 | int res = reply.readInt(); |
| 4702 | data.recycle(); |
| 4703 | reply.recycle(); |
| 4704 | return res; |
| 4705 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4706 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4707 | throws RemoteException { |
| 4708 | Parcel data = Parcel.obtain(); |
| 4709 | Parcel reply = Parcel.obtain(); |
| 4710 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4711 | data.writeString(permission); |
| 4712 | data.writeInt(pid); |
| 4713 | data.writeInt(uid); |
| 4714 | data.writeStrongBinder(callerToken); |
| 4715 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4716 | reply.readException(); |
| 4717 | int res = reply.readInt(); |
| 4718 | data.recycle(); |
| 4719 | reply.recycle(); |
| 4720 | return res; |
| 4721 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4722 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4723 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4724 | Parcel data = Parcel.obtain(); |
| 4725 | Parcel reply = Parcel.obtain(); |
| 4726 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4727 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4728 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4729 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4730 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4731 | reply.readException(); |
| 4732 | boolean res = reply.readInt() != 0; |
| 4733 | data.recycle(); |
| 4734 | reply.recycle(); |
| 4735 | return res; |
| 4736 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4737 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4738 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4739 | Parcel data = Parcel.obtain(); |
| 4740 | Parcel reply = Parcel.obtain(); |
| 4741 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4742 | uri.writeToParcel(data, 0); |
| 4743 | data.writeInt(pid); |
| 4744 | data.writeInt(uid); |
| 4745 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4746 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4747 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4748 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4749 | reply.readException(); |
| 4750 | int res = reply.readInt(); |
| 4751 | data.recycle(); |
| 4752 | reply.recycle(); |
| 4753 | return res; |
| 4754 | } |
| 4755 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4756 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4757 | Parcel data = Parcel.obtain(); |
| 4758 | Parcel reply = Parcel.obtain(); |
| 4759 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4760 | data.writeStrongBinder(caller.asBinder()); |
| 4761 | data.writeString(targetPkg); |
| 4762 | uri.writeToParcel(data, 0); |
| 4763 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4764 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4765 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4766 | reply.readException(); |
| 4767 | data.recycle(); |
| 4768 | reply.recycle(); |
| 4769 | } |
| 4770 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4771 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4772 | Parcel data = Parcel.obtain(); |
| 4773 | Parcel reply = Parcel.obtain(); |
| 4774 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4775 | data.writeStrongBinder(caller.asBinder()); |
| 4776 | uri.writeToParcel(data, 0); |
| 4777 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4778 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4779 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4780 | reply.readException(); |
| 4781 | data.recycle(); |
| 4782 | reply.recycle(); |
| 4783 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4784 | |
| 4785 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4786 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4787 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4788 | Parcel data = Parcel.obtain(); |
| 4789 | Parcel reply = Parcel.obtain(); |
| 4790 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4791 | uri.writeToParcel(data, 0); |
| 4792 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4793 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4794 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4795 | reply.readException(); |
| 4796 | data.recycle(); |
| 4797 | reply.recycle(); |
| 4798 | } |
| 4799 | |
| 4800 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4801 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4802 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4803 | Parcel data = Parcel.obtain(); |
| 4804 | Parcel reply = Parcel.obtain(); |
| 4805 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4806 | uri.writeToParcel(data, 0); |
| 4807 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4808 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4809 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4810 | reply.readException(); |
| 4811 | data.recycle(); |
| 4812 | reply.recycle(); |
| 4813 | } |
| 4814 | |
| 4815 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4816 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4817 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4818 | Parcel data = Parcel.obtain(); |
| 4819 | Parcel reply = Parcel.obtain(); |
| 4820 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4821 | data.writeString(packageName); |
| 4822 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4823 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4824 | reply.readException(); |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4825 | @SuppressWarnings("unchecked") |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4826 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4827 | reply); |
| 4828 | data.recycle(); |
| 4829 | reply.recycle(); |
| 4830 | return perms; |
| 4831 | } |
| 4832 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4833 | @Override |
| 4834 | public ParceledListSlice<UriPermission> getGrantedUriPermissions(String packageName, int userId) |
| 4835 | throws RemoteException { |
| 4836 | Parcel data = Parcel.obtain(); |
| 4837 | Parcel reply = Parcel.obtain(); |
| 4838 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4839 | data.writeString(packageName); |
| 4840 | data.writeInt(userId); |
| 4841 | mRemote.transact(GET_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4842 | reply.readException(); |
| 4843 | @SuppressWarnings("unchecked") |
| 4844 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4845 | reply); |
| 4846 | data.recycle(); |
| 4847 | reply.recycle(); |
| 4848 | return perms; |
| 4849 | } |
| 4850 | |
| 4851 | @Override |
| 4852 | public void clearGrantedUriPermissions(String packageName, int userId) throws RemoteException { |
| 4853 | Parcel data = Parcel.obtain(); |
| 4854 | Parcel reply = Parcel.obtain(); |
| 4855 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4856 | data.writeString(packageName); |
| 4857 | data.writeInt(userId); |
| 4858 | mRemote.transact(CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4859 | reply.readException(); |
| 4860 | data.recycle(); |
| 4861 | reply.recycle(); |
| 4862 | } |
| 4863 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4864 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4865 | throws RemoteException { |
| 4866 | Parcel data = Parcel.obtain(); |
| 4867 | Parcel reply = Parcel.obtain(); |
| 4868 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4869 | data.writeStrongBinder(who.asBinder()); |
| 4870 | data.writeInt(waiting ? 1 : 0); |
| 4871 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4872 | reply.readException(); |
| 4873 | data.recycle(); |
| 4874 | reply.recycle(); |
| 4875 | } |
| 4876 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4877 | Parcel data = Parcel.obtain(); |
| 4878 | Parcel reply = Parcel.obtain(); |
| 4879 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4880 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4881 | reply.readException(); |
| 4882 | outInfo.readFromParcel(reply); |
| 4883 | data.recycle(); |
| 4884 | reply.recycle(); |
| 4885 | } |
| 4886 | public void unhandledBack() throws RemoteException |
| 4887 | { |
| 4888 | Parcel data = Parcel.obtain(); |
| 4889 | Parcel reply = Parcel.obtain(); |
| 4890 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4891 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4892 | reply.readException(); |
| 4893 | data.recycle(); |
| 4894 | reply.recycle(); |
| 4895 | } |
| 4896 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4897 | { |
| 4898 | Parcel data = Parcel.obtain(); |
| 4899 | Parcel reply = Parcel.obtain(); |
| 4900 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4901 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4902 | reply.readException(); |
| 4903 | ParcelFileDescriptor pfd = null; |
| 4904 | if (reply.readInt() != 0) { |
| 4905 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4906 | } |
| 4907 | data.recycle(); |
| 4908 | reply.recycle(); |
| 4909 | return pfd; |
| 4910 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4911 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4912 | { |
| 4913 | Parcel data = Parcel.obtain(); |
| 4914 | Parcel reply = Parcel.obtain(); |
| 4915 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4916 | data.writeInt(shown ? 1 : 0); |
| 4917 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4918 | reply.readException(); |
| 4919 | data.recycle(); |
| 4920 | reply.recycle(); |
| 4921 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4922 | public void setDebugApp( |
| 4923 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4924 | throws RemoteException |
| 4925 | { |
| 4926 | Parcel data = Parcel.obtain(); |
| 4927 | Parcel reply = Parcel.obtain(); |
| 4928 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4929 | data.writeString(packageName); |
| 4930 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4931 | data.writeInt(persistent ? 1 : 0); |
| 4932 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4933 | reply.readException(); |
| 4934 | data.recycle(); |
| 4935 | reply.recycle(); |
| 4936 | } |
| 4937 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4938 | { |
| 4939 | Parcel data = Parcel.obtain(); |
| 4940 | Parcel reply = Parcel.obtain(); |
| 4941 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4942 | data.writeInt(enabled ? 1 : 0); |
| 4943 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4944 | reply.readException(); |
| 4945 | data.recycle(); |
| 4946 | reply.recycle(); |
| 4947 | } |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 4948 | public void setActivityController(IActivityController watcher, boolean imAMonkey) |
| 4949 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4950 | { |
| 4951 | Parcel data = Parcel.obtain(); |
| 4952 | Parcel reply = Parcel.obtain(); |
| 4953 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4954 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 4955 | data.writeInt(imAMonkey ? 1 : 0); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4956 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4957 | reply.readException(); |
| 4958 | data.recycle(); |
| 4959 | reply.recycle(); |
| 4960 | } |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 4961 | public void setLenientBackgroundCheck(boolean enabled) throws RemoteException |
| 4962 | { |
| 4963 | Parcel data = Parcel.obtain(); |
| 4964 | Parcel reply = Parcel.obtain(); |
| 4965 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4966 | data.writeInt(enabled ? 1 : 0); |
| 4967 | mRemote.transact(SET_LENIENT_BACKGROUND_CHECK_TRANSACTION, data, reply, 0); |
| 4968 | reply.readException(); |
| 4969 | data.recycle(); |
| 4970 | reply.recycle(); |
| 4971 | } |
Dianne Hackborn | 970510b | 2016-02-24 16:56:42 -0800 | [diff] [blame] | 4972 | public int getMemoryTrimLevel() throws RemoteException |
| 4973 | { |
| 4974 | Parcel data = Parcel.obtain(); |
| 4975 | Parcel reply = Parcel.obtain(); |
| 4976 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4977 | mRemote.transact(GET_MEMORY_TRIM_LEVEL_TRANSACTION, data, reply, 0); |
| 4978 | reply.readException(); |
| 4979 | int level = reply.readInt(); |
| 4980 | data.recycle(); |
| 4981 | reply.recycle(); |
| 4982 | return level; |
| 4983 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4984 | public void enterSafeMode() throws RemoteException { |
| 4985 | Parcel data = Parcel.obtain(); |
| 4986 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4987 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4988 | data.recycle(); |
| 4989 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4990 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4991 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4992 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4993 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4994 | data.writeStrongBinder(sender.asBinder()); |
| 4995 | data.writeInt(sourceUid); |
| 4996 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4997 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4998 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4999 | data.recycle(); |
| 5000 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5001 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 5002 | throws RemoteException { |
| 5003 | Parcel data = Parcel.obtain(); |
| 5004 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5005 | data.writeStrongBinder(sender.asBinder()); |
| 5006 | data.writeInt(sourceUid); |
| 5007 | data.writeString(tag); |
| 5008 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 5009 | data.recycle(); |
| 5010 | } |
| 5011 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 5012 | throws RemoteException { |
| 5013 | Parcel data = Parcel.obtain(); |
| 5014 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5015 | data.writeStrongBinder(sender.asBinder()); |
| 5016 | data.writeInt(sourceUid); |
| 5017 | data.writeString(tag); |
| 5018 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 5019 | data.recycle(); |
| 5020 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 5021 | 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] | 5022 | Parcel data = Parcel.obtain(); |
| 5023 | Parcel reply = Parcel.obtain(); |
| 5024 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5025 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 5026 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 5027 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 5028 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5029 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5030 | boolean res = reply.readInt() != 0; |
| 5031 | data.recycle(); |
| 5032 | reply.recycle(); |
| 5033 | return res; |
| 5034 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 5035 | @Override |
| 5036 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 5037 | Parcel data = Parcel.obtain(); |
| 5038 | Parcel reply = Parcel.obtain(); |
| 5039 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5040 | data.writeString(reason); |
| 5041 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 5042 | boolean res = reply.readInt() != 0; |
| 5043 | data.recycle(); |
| 5044 | reply.recycle(); |
| 5045 | return res; |
| 5046 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5047 | public boolean testIsSystemReady() |
| 5048 | { |
| 5049 | /* this base class version is never called */ |
| 5050 | return true; |
| 5051 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5052 | public void handleApplicationCrash(IBinder app, |
| 5053 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 5054 | { |
| 5055 | Parcel data = Parcel.obtain(); |
| 5056 | Parcel reply = Parcel.obtain(); |
| 5057 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5058 | data.writeStrongBinder(app); |
| 5059 | crashInfo.writeToParcel(data, 0); |
| 5060 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 5061 | reply.readException(); |
| 5062 | reply.recycle(); |
| 5063 | data.recycle(); |
| 5064 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5065 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 5066 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5067 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5068 | { |
| 5069 | Parcel data = Parcel.obtain(); |
| 5070 | Parcel reply = Parcel.obtain(); |
| 5071 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5072 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5073 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 5074 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5075 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5076 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5077 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5078 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5079 | reply.recycle(); |
| 5080 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5081 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5082 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5083 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5084 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 5085 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 5086 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5087 | { |
| 5088 | Parcel data = Parcel.obtain(); |
| 5089 | Parcel reply = Parcel.obtain(); |
| 5090 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5091 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 5092 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 5093 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5094 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 5095 | reply.readException(); |
| 5096 | reply.recycle(); |
| 5097 | data.recycle(); |
| 5098 | } |
| 5099 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5100 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 5101 | Parcel data = Parcel.obtain(); |
| 5102 | Parcel reply = Parcel.obtain(); |
| 5103 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5104 | data.writeInt(sig); |
| 5105 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 5106 | reply.readException(); |
| 5107 | data.recycle(); |
| 5108 | reply.recycle(); |
| 5109 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5110 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5111 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5112 | Parcel data = Parcel.obtain(); |
| 5113 | Parcel reply = Parcel.obtain(); |
| 5114 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5115 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5116 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5117 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5118 | reply.readException(); |
| 5119 | data.recycle(); |
| 5120 | reply.recycle(); |
| 5121 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5122 | |
| 5123 | public void killAllBackgroundProcesses() throws RemoteException { |
| 5124 | Parcel data = Parcel.obtain(); |
| 5125 | Parcel reply = Parcel.obtain(); |
| 5126 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5127 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5128 | reply.readException(); |
| 5129 | data.recycle(); |
| 5130 | reply.recycle(); |
| 5131 | } |
| 5132 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 5133 | public void killPackageDependents(String packageName, int userId) throws RemoteException { |
| 5134 | Parcel data = Parcel.obtain(); |
| 5135 | Parcel reply = Parcel.obtain(); |
| 5136 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5137 | data.writeString(packageName); |
| 5138 | data.writeInt(userId); |
| 5139 | mRemote.transact(KILL_PACKAGE_DEPENDENTS_TRANSACTION, data, reply, 0); |
| 5140 | reply.readException(); |
| 5141 | data.recycle(); |
| 5142 | reply.recycle(); |
| 5143 | } |
| 5144 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5145 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5146 | Parcel data = Parcel.obtain(); |
| 5147 | Parcel reply = Parcel.obtain(); |
| 5148 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5149 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5150 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5151 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5152 | reply.readException(); |
| 5153 | data.recycle(); |
| 5154 | reply.recycle(); |
| 5155 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5156 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 5157 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 5158 | throws RemoteException |
| 5159 | { |
| 5160 | Parcel data = Parcel.obtain(); |
| 5161 | Parcel reply = Parcel.obtain(); |
| 5162 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5163 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 5164 | reply.readException(); |
| 5165 | outInfo.readFromParcel(reply); |
| 5166 | reply.recycle(); |
| 5167 | data.recycle(); |
| 5168 | } |
| 5169 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5170 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 5171 | { |
| 5172 | Parcel data = Parcel.obtain(); |
| 5173 | Parcel reply = Parcel.obtain(); |
| 5174 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5175 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5176 | reply.readException(); |
| 5177 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 5178 | reply.recycle(); |
| 5179 | data.recycle(); |
| 5180 | return res; |
| 5181 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5182 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5183 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5184 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5185 | { |
| 5186 | Parcel data = Parcel.obtain(); |
| 5187 | Parcel reply = Parcel.obtain(); |
| 5188 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5189 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5190 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5191 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 5192 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5193 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5194 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5195 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5196 | } else { |
| 5197 | data.writeInt(0); |
| 5198 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5199 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 5200 | reply.readException(); |
| 5201 | boolean res = reply.readInt() != 0; |
| 5202 | reply.recycle(); |
| 5203 | data.recycle(); |
| 5204 | return res; |
| 5205 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5206 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 5207 | public boolean shutdown(int timeout) throws RemoteException |
| 5208 | { |
| 5209 | Parcel data = Parcel.obtain(); |
| 5210 | Parcel reply = Parcel.obtain(); |
| 5211 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5212 | data.writeInt(timeout); |
| 5213 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 5214 | reply.readException(); |
| 5215 | boolean res = reply.readInt() != 0; |
| 5216 | reply.recycle(); |
| 5217 | data.recycle(); |
| 5218 | return res; |
| 5219 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5220 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5221 | public void stopAppSwitches() throws RemoteException { |
| 5222 | Parcel data = Parcel.obtain(); |
| 5223 | Parcel reply = Parcel.obtain(); |
| 5224 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5225 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5226 | reply.readException(); |
| 5227 | reply.recycle(); |
| 5228 | data.recycle(); |
| 5229 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5230 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5231 | public void resumeAppSwitches() throws RemoteException { |
| 5232 | Parcel data = Parcel.obtain(); |
| 5233 | Parcel reply = Parcel.obtain(); |
| 5234 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5235 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5236 | reply.readException(); |
| 5237 | reply.recycle(); |
| 5238 | data.recycle(); |
| 5239 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 5240 | |
| 5241 | public void addPackageDependency(String packageName) throws RemoteException { |
| 5242 | Parcel data = Parcel.obtain(); |
| 5243 | Parcel reply = Parcel.obtain(); |
| 5244 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5245 | data.writeString(packageName); |
| 5246 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 5247 | reply.readException(); |
| 5248 | data.recycle(); |
| 5249 | reply.recycle(); |
| 5250 | } |
| 5251 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5252 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 5253 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5254 | Parcel data = Parcel.obtain(); |
| 5255 | Parcel reply = Parcel.obtain(); |
| 5256 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5257 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5258 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5259 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5260 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5261 | reply.readException(); |
| 5262 | data.recycle(); |
| 5263 | reply.recycle(); |
| 5264 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5265 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 5266 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 5267 | Parcel data = Parcel.obtain(); |
| 5268 | Parcel reply = Parcel.obtain(); |
| 5269 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5270 | data.writeString(reason); |
| 5271 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 5272 | reply.readException(); |
| 5273 | data.recycle(); |
| 5274 | reply.recycle(); |
| 5275 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5276 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5277 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5278 | throws RemoteException { |
| 5279 | Parcel data = Parcel.obtain(); |
| 5280 | Parcel reply = Parcel.obtain(); |
| 5281 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5282 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5283 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 5284 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5285 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5286 | data.recycle(); |
| 5287 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5288 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5289 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 5290 | |
| 5291 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 5292 | Parcel data = Parcel.obtain(); |
| 5293 | Parcel reply = Parcel.obtain(); |
| 5294 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5295 | data.writeString(processName); |
| 5296 | data.writeInt(uid); |
| 5297 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 5298 | reply.readException(); |
| 5299 | data.recycle(); |
| 5300 | reply.recycle(); |
| 5301 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5302 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 5303 | public void overridePendingTransition(IBinder token, String packageName, |
| 5304 | int enterAnim, int exitAnim) throws RemoteException { |
| 5305 | Parcel data = Parcel.obtain(); |
| 5306 | Parcel reply = Parcel.obtain(); |
| 5307 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5308 | data.writeStrongBinder(token); |
| 5309 | data.writeString(packageName); |
| 5310 | data.writeInt(enterAnim); |
| 5311 | data.writeInt(exitAnim); |
| 5312 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 5313 | reply.readException(); |
| 5314 | data.recycle(); |
| 5315 | reply.recycle(); |
| 5316 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5317 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 5318 | public boolean isUserAMonkey() throws RemoteException { |
| 5319 | Parcel data = Parcel.obtain(); |
| 5320 | Parcel reply = Parcel.obtain(); |
| 5321 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5322 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 5323 | reply.readException(); |
| 5324 | boolean res = reply.readInt() != 0; |
| 5325 | data.recycle(); |
| 5326 | reply.recycle(); |
| 5327 | return res; |
| 5328 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 5329 | |
| 5330 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 5331 | Parcel data = Parcel.obtain(); |
| 5332 | Parcel reply = Parcel.obtain(); |
| 5333 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5334 | data.writeInt(monkey ? 1 : 0); |
| 5335 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 5336 | reply.readException(); |
| 5337 | data.recycle(); |
| 5338 | reply.recycle(); |
| 5339 | } |
| 5340 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 5341 | public void finishHeavyWeightApp() throws RemoteException { |
| 5342 | Parcel data = Parcel.obtain(); |
| 5343 | Parcel reply = Parcel.obtain(); |
| 5344 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5345 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 5346 | reply.readException(); |
| 5347 | data.recycle(); |
| 5348 | reply.recycle(); |
| 5349 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5350 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5351 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5352 | throws RemoteException { |
| 5353 | Parcel data = Parcel.obtain(); |
| 5354 | Parcel reply = Parcel.obtain(); |
| 5355 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5356 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5357 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 5358 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5359 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5360 | data.recycle(); |
| 5361 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5362 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5363 | } |
| 5364 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5365 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5366 | throws RemoteException { |
| 5367 | Parcel data = Parcel.obtain(); |
| 5368 | Parcel reply = Parcel.obtain(); |
| 5369 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5370 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5371 | if (options == null) { |
| 5372 | data.writeInt(0); |
| 5373 | } else { |
| 5374 | data.writeInt(1); |
| 5375 | data.writeBundle(options.toBundle()); |
| 5376 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5377 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5378 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5379 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5380 | data.recycle(); |
| 5381 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5382 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5383 | } |
| 5384 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5385 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 5386 | Parcel data = Parcel.obtain(); |
| 5387 | Parcel reply = Parcel.obtain(); |
| 5388 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5389 | data.writeStrongBinder(token); |
| 5390 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 5391 | reply.readException(); |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 5392 | ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle()); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5393 | data.recycle(); |
| 5394 | reply.recycle(); |
| 5395 | return options; |
| 5396 | } |
| 5397 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5398 | public void setImmersive(IBinder token, boolean immersive) |
| 5399 | throws RemoteException { |
| 5400 | Parcel data = Parcel.obtain(); |
| 5401 | Parcel reply = Parcel.obtain(); |
| 5402 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5403 | data.writeStrongBinder(token); |
| 5404 | data.writeInt(immersive ? 1 : 0); |
| 5405 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 5406 | reply.readException(); |
| 5407 | data.recycle(); |
| 5408 | reply.recycle(); |
| 5409 | } |
| 5410 | |
| 5411 | public boolean isImmersive(IBinder token) |
| 5412 | throws RemoteException { |
| 5413 | Parcel data = Parcel.obtain(); |
| 5414 | Parcel reply = Parcel.obtain(); |
| 5415 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5416 | data.writeStrongBinder(token); |
| 5417 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5418 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5419 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5420 | data.recycle(); |
| 5421 | reply.recycle(); |
| 5422 | return res; |
| 5423 | } |
| 5424 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5425 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 5426 | Parcel data = Parcel.obtain(); |
| 5427 | Parcel reply = Parcel.obtain(); |
| 5428 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5429 | data.writeStrongBinder(token); |
| 5430 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 5431 | reply.readException(); |
| 5432 | boolean res = reply.readInt() == 1; |
| 5433 | data.recycle(); |
| 5434 | reply.recycle(); |
| 5435 | return res; |
| 5436 | } |
| 5437 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5438 | public boolean isTopActivityImmersive() |
| 5439 | throws RemoteException { |
| 5440 | Parcel data = Parcel.obtain(); |
| 5441 | Parcel reply = Parcel.obtain(); |
| 5442 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5443 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5444 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5445 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5446 | data.recycle(); |
| 5447 | reply.recycle(); |
| 5448 | return res; |
| 5449 | } |
| 5450 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 5451 | public void crashApplication(int uid, int initialPid, String packageName, |
| 5452 | String message) throws RemoteException { |
| 5453 | Parcel data = Parcel.obtain(); |
| 5454 | Parcel reply = Parcel.obtain(); |
| 5455 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5456 | data.writeInt(uid); |
| 5457 | data.writeInt(initialPid); |
| 5458 | data.writeString(packageName); |
| 5459 | data.writeString(message); |
| 5460 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 5461 | reply.readException(); |
| 5462 | data.recycle(); |
| 5463 | reply.recycle(); |
| 5464 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5465 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5466 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5467 | Parcel data = Parcel.obtain(); |
| 5468 | Parcel reply = Parcel.obtain(); |
| 5469 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5470 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5471 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5472 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 5473 | reply.readException(); |
| 5474 | String res = reply.readString(); |
| 5475 | data.recycle(); |
| 5476 | reply.recycle(); |
| 5477 | return res; |
| 5478 | } |
| 5479 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5480 | public IBinder newUriPermissionOwner(String name) |
| 5481 | throws RemoteException { |
| 5482 | Parcel data = Parcel.obtain(); |
| 5483 | Parcel reply = Parcel.obtain(); |
| 5484 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5485 | data.writeString(name); |
| 5486 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 5487 | reply.readException(); |
| 5488 | IBinder res = reply.readStrongBinder(); |
| 5489 | data.recycle(); |
| 5490 | reply.recycle(); |
| 5491 | return res; |
| 5492 | } |
| 5493 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 5494 | public IBinder getUriPermissionOwnerForActivity(IBinder activityToken) throws RemoteException { |
| 5495 | Parcel data = Parcel.obtain(); |
| 5496 | Parcel reply = Parcel.obtain(); |
| 5497 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5498 | data.writeStrongBinder(activityToken); |
| 5499 | mRemote.transact(GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5500 | reply.readException(); |
| 5501 | IBinder res = reply.readStrongBinder(); |
| 5502 | data.recycle(); |
| 5503 | reply.recycle(); |
| 5504 | return res; |
| 5505 | } |
| 5506 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5507 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5508 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5509 | Parcel data = Parcel.obtain(); |
| 5510 | Parcel reply = Parcel.obtain(); |
| 5511 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5512 | data.writeStrongBinder(owner); |
| 5513 | data.writeInt(fromUid); |
| 5514 | data.writeString(targetPkg); |
| 5515 | uri.writeToParcel(data, 0); |
| 5516 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5517 | data.writeInt(sourceUserId); |
| 5518 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5519 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5520 | reply.readException(); |
| 5521 | data.recycle(); |
| 5522 | reply.recycle(); |
| 5523 | } |
| 5524 | |
| 5525 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5526 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5527 | Parcel data = Parcel.obtain(); |
| 5528 | Parcel reply = Parcel.obtain(); |
| 5529 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5530 | data.writeStrongBinder(owner); |
| 5531 | if (uri != null) { |
| 5532 | data.writeInt(1); |
| 5533 | uri.writeToParcel(data, 0); |
| 5534 | } else { |
| 5535 | data.writeInt(0); |
| 5536 | } |
| 5537 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5538 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5539 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5540 | reply.readException(); |
| 5541 | data.recycle(); |
| 5542 | reply.recycle(); |
| 5543 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 5544 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5545 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5546 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5547 | Parcel data = Parcel.obtain(); |
| 5548 | Parcel reply = Parcel.obtain(); |
| 5549 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5550 | data.writeInt(callingUid); |
| 5551 | data.writeString(targetPkg); |
| 5552 | uri.writeToParcel(data, 0); |
| 5553 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5554 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5555 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5556 | reply.readException(); |
| 5557 | int res = reply.readInt(); |
| 5558 | data.recycle(); |
| 5559 | reply.recycle(); |
| 5560 | return res; |
| 5561 | } |
| 5562 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5563 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5564 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 5565 | Parcel data = Parcel.obtain(); |
| 5566 | Parcel reply = Parcel.obtain(); |
| 5567 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5568 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5569 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5570 | data.writeInt(managed ? 1 : 0); |
| 5571 | data.writeString(path); |
| 5572 | if (fd != null) { |
| 5573 | data.writeInt(1); |
| 5574 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5575 | } else { |
| 5576 | data.writeInt(0); |
| 5577 | } |
| 5578 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 5579 | reply.readException(); |
| 5580 | boolean res = reply.readInt() != 0; |
| 5581 | reply.recycle(); |
| 5582 | data.recycle(); |
| 5583 | return res; |
| 5584 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5585 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5586 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5587 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5588 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5589 | Parcel data = Parcel.obtain(); |
| 5590 | Parcel reply = Parcel.obtain(); |
| 5591 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5592 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5593 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5594 | data.writeTypedArray(intents, 0); |
| 5595 | data.writeStringArray(resolvedTypes); |
| 5596 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5597 | if (options != null) { |
| 5598 | data.writeInt(1); |
| 5599 | options.writeToParcel(data, 0); |
| 5600 | } else { |
| 5601 | data.writeInt(0); |
| 5602 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5603 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5604 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 5605 | reply.readException(); |
| 5606 | int result = reply.readInt(); |
| 5607 | reply.recycle(); |
| 5608 | data.recycle(); |
| 5609 | return result; |
| 5610 | } |
| 5611 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5612 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 5613 | Parcel data = Parcel.obtain(); |
| 5614 | Parcel reply = Parcel.obtain(); |
| 5615 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5616 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5617 | reply.readException(); |
| 5618 | int mode = reply.readInt(); |
| 5619 | reply.recycle(); |
| 5620 | data.recycle(); |
| 5621 | return mode; |
| 5622 | } |
| 5623 | |
| 5624 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 5625 | Parcel data = Parcel.obtain(); |
| 5626 | Parcel reply = Parcel.obtain(); |
| 5627 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5628 | data.writeInt(mode); |
| 5629 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5630 | reply.readException(); |
| 5631 | reply.recycle(); |
| 5632 | data.recycle(); |
| 5633 | } |
| 5634 | |
| 5635 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 5636 | Parcel data = Parcel.obtain(); |
| 5637 | Parcel reply = Parcel.obtain(); |
| 5638 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5639 | data.writeString(packageName); |
| 5640 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5641 | reply.readException(); |
| 5642 | int mode = reply.readInt(); |
| 5643 | reply.recycle(); |
| 5644 | data.recycle(); |
| 5645 | return mode; |
| 5646 | } |
| 5647 | |
| 5648 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5649 | throws RemoteException { |
| 5650 | Parcel data = Parcel.obtain(); |
| 5651 | Parcel reply = Parcel.obtain(); |
| 5652 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5653 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5654 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5655 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5656 | reply.readException(); |
| 5657 | reply.recycle(); |
| 5658 | data.recycle(); |
| 5659 | } |
| 5660 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5661 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 5662 | Parcel data = Parcel.obtain(); |
| 5663 | Parcel reply = Parcel.obtain(); |
| 5664 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5665 | data.writeString(packageName); |
| 5666 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5667 | reply.readException(); |
| 5668 | boolean ask = reply.readInt() != 0; |
| 5669 | reply.recycle(); |
| 5670 | data.recycle(); |
| 5671 | return ask; |
| 5672 | } |
| 5673 | |
| 5674 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 5675 | throws RemoteException { |
| 5676 | Parcel data = Parcel.obtain(); |
| 5677 | Parcel reply = Parcel.obtain(); |
| 5678 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5679 | data.writeString(packageName); |
| 5680 | data.writeInt(ask ? 1 : 0); |
| 5681 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5682 | reply.readException(); |
| 5683 | reply.recycle(); |
| 5684 | data.recycle(); |
| 5685 | } |
| 5686 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5687 | public boolean switchUser(int userid) throws RemoteException { |
| 5688 | Parcel data = Parcel.obtain(); |
| 5689 | Parcel reply = Parcel.obtain(); |
| 5690 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5691 | data.writeInt(userid); |
| 5692 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 5693 | reply.readException(); |
| 5694 | boolean result = reply.readInt() != 0; |
| 5695 | reply.recycle(); |
| 5696 | data.recycle(); |
| 5697 | return result; |
| 5698 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5699 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 5700 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 5701 | Parcel data = Parcel.obtain(); |
| 5702 | Parcel reply = Parcel.obtain(); |
| 5703 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5704 | data.writeInt(userid); |
| 5705 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 5706 | reply.readException(); |
| 5707 | boolean result = reply.readInt() != 0; |
| 5708 | reply.recycle(); |
| 5709 | data.recycle(); |
| 5710 | return result; |
| 5711 | } |
| 5712 | |
Jeff Sharkey | bd91e2f | 2016-03-22 15:32:31 -0600 | [diff] [blame] | 5713 | public boolean unlockUser(int userId, byte[] token, byte[] secret, IProgressListener listener) |
| 5714 | throws RemoteException { |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5715 | Parcel data = Parcel.obtain(); |
| 5716 | Parcel reply = Parcel.obtain(); |
| 5717 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5718 | data.writeInt(userId); |
| 5719 | data.writeByteArray(token); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5720 | data.writeByteArray(secret); |
Jeff Sharkey | bd91e2f | 2016-03-22 15:32:31 -0600 | [diff] [blame] | 5721 | data.writeStrongInterface(listener); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5722 | mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0); |
| 5723 | reply.readException(); |
| 5724 | boolean result = reply.readInt() != 0; |
| 5725 | reply.recycle(); |
| 5726 | data.recycle(); |
| 5727 | return result; |
| 5728 | } |
| 5729 | |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5730 | public int stopUser(int userid, boolean force, IStopUserCallback callback) |
| 5731 | throws RemoteException { |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5732 | Parcel data = Parcel.obtain(); |
| 5733 | Parcel reply = Parcel.obtain(); |
| 5734 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5735 | data.writeInt(userid); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5736 | data.writeInt(force ? 1 : 0); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5737 | data.writeStrongInterface(callback); |
| 5738 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 5739 | reply.readException(); |
| 5740 | int result = reply.readInt(); |
| 5741 | reply.recycle(); |
| 5742 | data.recycle(); |
| 5743 | return result; |
| 5744 | } |
| 5745 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5746 | public UserInfo getCurrentUser() throws RemoteException { |
| 5747 | Parcel data = Parcel.obtain(); |
| 5748 | Parcel reply = Parcel.obtain(); |
| 5749 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5750 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5751 | reply.readException(); |
| 5752 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 5753 | reply.recycle(); |
| 5754 | data.recycle(); |
| 5755 | return userInfo; |
| 5756 | } |
| 5757 | |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5758 | public boolean isUserRunning(int userid, int flags) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5759 | Parcel data = Parcel.obtain(); |
| 5760 | Parcel reply = Parcel.obtain(); |
| 5761 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5762 | data.writeInt(userid); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5763 | data.writeInt(flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5764 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5765 | reply.readException(); |
| 5766 | boolean result = reply.readInt() != 0; |
| 5767 | reply.recycle(); |
| 5768 | data.recycle(); |
| 5769 | return result; |
| 5770 | } |
| 5771 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5772 | public int[] getRunningUserIds() throws RemoteException { |
| 5773 | Parcel data = Parcel.obtain(); |
| 5774 | Parcel reply = Parcel.obtain(); |
| 5775 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5776 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5777 | reply.readException(); |
| 5778 | int[] result = reply.createIntArray(); |
| 5779 | reply.recycle(); |
| 5780 | data.recycle(); |
| 5781 | return result; |
| 5782 | } |
| 5783 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5784 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5785 | Parcel data = Parcel.obtain(); |
| 5786 | Parcel reply = Parcel.obtain(); |
| 5787 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5788 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5789 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5790 | reply.readException(); |
| 5791 | boolean result = reply.readInt() != 0; |
| 5792 | reply.recycle(); |
| 5793 | data.recycle(); |
| 5794 | return result; |
| 5795 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5796 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5797 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5798 | Parcel data = Parcel.obtain(); |
| 5799 | Parcel reply = Parcel.obtain(); |
| 5800 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5801 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5802 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5803 | reply.readException(); |
| 5804 | data.recycle(); |
| 5805 | reply.recycle(); |
| 5806 | } |
| 5807 | |
| 5808 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5809 | Parcel data = Parcel.obtain(); |
| 5810 | Parcel reply = Parcel.obtain(); |
| 5811 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5812 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5813 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5814 | reply.readException(); |
| 5815 | data.recycle(); |
| 5816 | reply.recycle(); |
| 5817 | } |
| 5818 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5819 | public void registerUidObserver(IUidObserver observer, int which) throws RemoteException { |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5820 | Parcel data = Parcel.obtain(); |
| 5821 | Parcel reply = Parcel.obtain(); |
| 5822 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5823 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5824 | data.writeInt(which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5825 | mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5826 | reply.readException(); |
| 5827 | data.recycle(); |
| 5828 | reply.recycle(); |
| 5829 | } |
| 5830 | |
| 5831 | public void unregisterUidObserver(IUidObserver observer) throws RemoteException { |
| 5832 | Parcel data = Parcel.obtain(); |
| 5833 | Parcel reply = Parcel.obtain(); |
| 5834 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5835 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5836 | mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5837 | reply.readException(); |
| 5838 | data.recycle(); |
| 5839 | reply.recycle(); |
| 5840 | } |
| 5841 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5842 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5843 | Parcel data = Parcel.obtain(); |
| 5844 | Parcel reply = Parcel.obtain(); |
| 5845 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5846 | data.writeStrongBinder(sender.asBinder()); |
| 5847 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5848 | reply.readException(); |
| 5849 | boolean res = reply.readInt() != 0; |
| 5850 | data.recycle(); |
| 5851 | reply.recycle(); |
| 5852 | return res; |
| 5853 | } |
| 5854 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5855 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5856 | Parcel data = Parcel.obtain(); |
| 5857 | Parcel reply = Parcel.obtain(); |
| 5858 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5859 | data.writeStrongBinder(sender.asBinder()); |
| 5860 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5861 | reply.readException(); |
| 5862 | boolean res = reply.readInt() != 0; |
| 5863 | data.recycle(); |
| 5864 | reply.recycle(); |
| 5865 | return res; |
| 5866 | } |
| 5867 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5868 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5869 | Parcel data = Parcel.obtain(); |
| 5870 | Parcel reply = Parcel.obtain(); |
| 5871 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5872 | data.writeStrongBinder(sender.asBinder()); |
| 5873 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5874 | reply.readException(); |
| 5875 | Intent res = reply.readInt() != 0 |
| 5876 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5877 | data.recycle(); |
| 5878 | reply.recycle(); |
| 5879 | return res; |
| 5880 | } |
| 5881 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5882 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5883 | throws RemoteException { |
| 5884 | Parcel data = Parcel.obtain(); |
| 5885 | Parcel reply = Parcel.obtain(); |
| 5886 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5887 | data.writeStrongBinder(sender.asBinder()); |
| 5888 | data.writeString(prefix); |
| 5889 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5890 | reply.readException(); |
| 5891 | String res = reply.readString(); |
| 5892 | data.recycle(); |
| 5893 | reply.recycle(); |
| 5894 | return res; |
| 5895 | } |
| 5896 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5897 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5898 | { |
| 5899 | Parcel data = Parcel.obtain(); |
| 5900 | Parcel reply = Parcel.obtain(); |
| 5901 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5902 | values.writeToParcel(data, 0); |
| 5903 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5904 | reply.readException(); |
| 5905 | data.recycle(); |
| 5906 | reply.recycle(); |
| 5907 | } |
| 5908 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 5909 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 5910 | Parcel data = Parcel.obtain(); |
| 5911 | Parcel reply = Parcel.obtain(); |
| 5912 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5913 | data.writeIntArray(pids); |
| 5914 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 5915 | reply.readException(); |
| 5916 | long[] res = reply.createLongArray(); |
| 5917 | data.recycle(); |
| 5918 | reply.recycle(); |
| 5919 | return res; |
| 5920 | } |
| 5921 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5922 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5923 | Parcel data = Parcel.obtain(); |
| 5924 | Parcel reply = Parcel.obtain(); |
| 5925 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5926 | TextUtils.writeToParcel(msg, data, 0); |
| 5927 | data.writeInt(always ? 1 : 0); |
| 5928 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5929 | reply.readException(); |
| 5930 | data.recycle(); |
| 5931 | reply.recycle(); |
| 5932 | } |
| 5933 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5934 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5935 | Parcel data = Parcel.obtain(); |
| 5936 | Parcel reply = Parcel.obtain(); |
| 5937 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5938 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5939 | reply.readException(); |
| 5940 | data.recycle(); |
| 5941 | reply.recycle(); |
| 5942 | } |
| 5943 | |
Adrian Roos | d5c2db6 | 2016-03-08 16:11:31 -0800 | [diff] [blame] | 5944 | public void keyguardGoingAway(int flags) |
| 5945 | throws RemoteException { |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5946 | Parcel data = Parcel.obtain(); |
| 5947 | Parcel reply = Parcel.obtain(); |
| 5948 | data.writeInterfaceToken(IActivityManager.descriptor); |
Adrian Roos | d5c2db6 | 2016-03-08 16:11:31 -0800 | [diff] [blame] | 5949 | data.writeInt(flags); |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5950 | mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0); |
| 5951 | reply.readException(); |
| 5952 | data.recycle(); |
| 5953 | reply.recycle(); |
| 5954 | } |
| 5955 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5956 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5957 | throws RemoteException { |
| 5958 | Parcel data = Parcel.obtain(); |
| 5959 | Parcel reply = Parcel.obtain(); |
| 5960 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5961 | data.writeStrongBinder(token); |
| 5962 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5963 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5964 | reply.readException(); |
| 5965 | boolean result = reply.readInt() != 0; |
| 5966 | data.recycle(); |
| 5967 | reply.recycle(); |
| 5968 | return result; |
| 5969 | } |
| 5970 | |
| 5971 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5972 | throws RemoteException { |
| 5973 | Parcel data = Parcel.obtain(); |
| 5974 | Parcel reply = Parcel.obtain(); |
| 5975 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5976 | data.writeStrongBinder(token); |
| 5977 | target.writeToParcel(data, 0); |
| 5978 | data.writeInt(resultCode); |
| 5979 | if (resultData != null) { |
| 5980 | data.writeInt(1); |
| 5981 | resultData.writeToParcel(data, 0); |
| 5982 | } else { |
| 5983 | data.writeInt(0); |
| 5984 | } |
| 5985 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5986 | reply.readException(); |
| 5987 | boolean result = reply.readInt() != 0; |
| 5988 | data.recycle(); |
| 5989 | reply.recycle(); |
| 5990 | return result; |
| 5991 | } |
| 5992 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5993 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5994 | Parcel data = Parcel.obtain(); |
| 5995 | Parcel reply = Parcel.obtain(); |
| 5996 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5997 | data.writeStrongBinder(activityToken); |
| 5998 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5999 | reply.readException(); |
| 6000 | int result = reply.readInt(); |
| 6001 | data.recycle(); |
| 6002 | reply.recycle(); |
| 6003 | return result; |
| 6004 | } |
| 6005 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 6006 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 6007 | Parcel data = Parcel.obtain(); |
| 6008 | Parcel reply = Parcel.obtain(); |
| 6009 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6010 | data.writeStrongBinder(activityToken); |
| 6011 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 6012 | reply.readException(); |
| 6013 | String result = reply.readString(); |
| 6014 | data.recycle(); |
| 6015 | reply.recycle(); |
| 6016 | return result; |
| 6017 | } |
| 6018 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 6019 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 6020 | Parcel data = Parcel.obtain(); |
| 6021 | Parcel reply = Parcel.obtain(); |
| 6022 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6023 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 6024 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 6025 | reply.readException(); |
| 6026 | data.recycle(); |
| 6027 | reply.recycle(); |
| 6028 | } |
| 6029 | |
| 6030 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 6031 | Parcel data = Parcel.obtain(); |
| 6032 | Parcel reply = Parcel.obtain(); |
| 6033 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6034 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 6035 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 6036 | reply.readException(); |
| 6037 | data.recycle(); |
| 6038 | reply.recycle(); |
| 6039 | } |
| 6040 | |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 6041 | public void requestBugReport(@ActivityManager.BugreportMode int bugreportType) |
| 6042 | throws RemoteException { |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 6043 | Parcel data = Parcel.obtain(); |
| 6044 | Parcel reply = Parcel.obtain(); |
| 6045 | data.writeInterfaceToken(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 6046 | data.writeInt(bugreportType); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 6047 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 6048 | reply.readException(); |
| 6049 | data.recycle(); |
| 6050 | reply.recycle(); |
| 6051 | } |
| 6052 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 6053 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 6054 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 6055 | Parcel data = Parcel.obtain(); |
| 6056 | Parcel reply = Parcel.obtain(); |
| 6057 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6058 | data.writeInt(pid); |
| 6059 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 6060 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 6061 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 6062 | reply.readException(); |
| 6063 | long res = reply.readInt(); |
| 6064 | data.recycle(); |
| 6065 | reply.recycle(); |
| 6066 | return res; |
| 6067 | } |
| 6068 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6069 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6070 | Parcel data = Parcel.obtain(); |
| 6071 | Parcel reply = Parcel.obtain(); |
| 6072 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6073 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6074 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6075 | reply.readException(); |
| 6076 | Bundle res = reply.readBundle(); |
| 6077 | data.recycle(); |
| 6078 | reply.recycle(); |
| 6079 | return res; |
| 6080 | } |
| 6081 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6082 | public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, |
| 6083 | IBinder activityToken) throws RemoteException { |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6084 | Parcel data = Parcel.obtain(); |
| 6085 | Parcel reply = Parcel.obtain(); |
| 6086 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6087 | data.writeInt(requestType); |
| 6088 | data.writeStrongBinder(receiver.asBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6089 | data.writeStrongBinder(activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6090 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 6091 | reply.readException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6092 | boolean res = reply.readInt() != 0; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6093 | data.recycle(); |
| 6094 | reply.recycle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6095 | return res; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6096 | } |
| 6097 | |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 6098 | public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 6099 | AssistContent content, Uri referrer) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6100 | Parcel data = Parcel.obtain(); |
| 6101 | Parcel reply = Parcel.obtain(); |
| 6102 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6103 | data.writeStrongBinder(token); |
| 6104 | data.writeBundle(extras); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 6105 | structure.writeToParcel(data, 0); |
| 6106 | content.writeToParcel(data, 0); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 6107 | if (referrer != null) { |
| 6108 | data.writeInt(1); |
| 6109 | referrer.writeToParcel(data, 0); |
| 6110 | } else { |
| 6111 | data.writeInt(0); |
| 6112 | } |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6113 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6114 | reply.readException(); |
| 6115 | data.recycle(); |
| 6116 | reply.recycle(); |
| 6117 | } |
| 6118 | |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6119 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, |
| 6120 | Bundle args) throws RemoteException { |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6121 | Parcel data = Parcel.obtain(); |
| 6122 | Parcel reply = Parcel.obtain(); |
| 6123 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6124 | intent.writeToParcel(data, 0); |
| 6125 | data.writeInt(requestType); |
| 6126 | data.writeString(hint); |
| 6127 | data.writeInt(userHandle); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6128 | data.writeBundle(args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6129 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 6130 | reply.readException(); |
| 6131 | boolean res = reply.readInt() != 0; |
| 6132 | data.recycle(); |
| 6133 | reply.recycle(); |
| 6134 | return res; |
| 6135 | } |
| 6136 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6137 | public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException { |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 6138 | Parcel data = Parcel.obtain(); |
| 6139 | Parcel reply = Parcel.obtain(); |
| 6140 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6141 | mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6142 | reply.readException(); |
| 6143 | boolean res = reply.readInt() != 0; |
| 6144 | data.recycle(); |
| 6145 | reply.recycle(); |
| 6146 | return res; |
| 6147 | } |
| 6148 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6149 | public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException { |
| 6150 | Parcel data = Parcel.obtain(); |
| 6151 | Parcel reply = Parcel.obtain(); |
| 6152 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6153 | data.writeStrongBinder(token); |
| 6154 | data.writeBundle(args); |
| 6155 | mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6156 | reply.readException(); |
| 6157 | boolean res = reply.readInt() != 0; |
| 6158 | data.recycle(); |
| 6159 | reply.recycle(); |
| 6160 | return res; |
| 6161 | } |
| 6162 | |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6163 | public void killUid(int appId, int userId, String reason) throws RemoteException { |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6164 | Parcel data = Parcel.obtain(); |
| 6165 | Parcel reply = Parcel.obtain(); |
| 6166 | data.writeInterfaceToken(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6167 | data.writeInt(appId); |
| 6168 | data.writeInt(userId); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6169 | data.writeString(reason); |
| 6170 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 6171 | reply.readException(); |
| 6172 | data.recycle(); |
| 6173 | reply.recycle(); |
| 6174 | } |
| 6175 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 6176 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 6177 | Parcel data = Parcel.obtain(); |
| 6178 | Parcel reply = Parcel.obtain(); |
| 6179 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6180 | data.writeStrongBinder(who); |
| 6181 | data.writeInt(allowRestart ? 1 : 0); |
| 6182 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 6183 | reply.readException(); |
| 6184 | data.recycle(); |
| 6185 | reply.recycle(); |
| 6186 | } |
| 6187 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 6188 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 6189 | Parcel data = Parcel.obtain(); |
| 6190 | Parcel reply = Parcel.obtain(); |
| 6191 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6192 | data.writeStrongBinder(token); |
| 6193 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 6194 | reply.readException(); |
| 6195 | data.recycle(); |
| 6196 | reply.recycle(); |
| 6197 | } |
| 6198 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 6199 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 6200 | Parcel data = Parcel.obtain(); |
| 6201 | Parcel reply = Parcel.obtain(); |
| 6202 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6203 | data.writeStrongBinder(token); |
| 6204 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 6205 | reply.readException(); |
| 6206 | data.recycle(); |
| 6207 | reply.recycle(); |
| 6208 | } |
| 6209 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 6210 | public void restart() throws RemoteException { |
| 6211 | Parcel data = Parcel.obtain(); |
| 6212 | Parcel reply = Parcel.obtain(); |
| 6213 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6214 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 6215 | reply.readException(); |
| 6216 | data.recycle(); |
| 6217 | reply.recycle(); |
| 6218 | } |
| 6219 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 6220 | public void performIdleMaintenance() throws RemoteException { |
| 6221 | Parcel data = Parcel.obtain(); |
| 6222 | Parcel reply = Parcel.obtain(); |
| 6223 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6224 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 6225 | reply.readException(); |
| 6226 | data.recycle(); |
| 6227 | reply.recycle(); |
| 6228 | } |
| 6229 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6230 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6231 | IActivityContainerCallback callback) throws RemoteException { |
| 6232 | Parcel data = Parcel.obtain(); |
| 6233 | Parcel reply = Parcel.obtain(); |
| 6234 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6235 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 6236 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6237 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6238 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 6239 | final int result = reply.readInt(); |
| 6240 | final IActivityContainer res; |
| 6241 | if (result == 1) { |
| 6242 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6243 | } else { |
| 6244 | res = null; |
| 6245 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6246 | data.recycle(); |
| 6247 | reply.recycle(); |
| 6248 | return res; |
| 6249 | } |
| 6250 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 6251 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 6252 | throws RemoteException { |
| 6253 | Parcel data = Parcel.obtain(); |
| 6254 | Parcel reply = Parcel.obtain(); |
| 6255 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6256 | data.writeStrongBinder(activityContainer.asBinder()); |
| 6257 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 6258 | reply.readException(); |
| 6259 | data.recycle(); |
| 6260 | reply.recycle(); |
| 6261 | } |
| 6262 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 6263 | public boolean startBinderTracking() throws RemoteException { |
| 6264 | Parcel data = Parcel.obtain(); |
| 6265 | Parcel reply = Parcel.obtain(); |
| 6266 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6267 | mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0); |
| 6268 | reply.readException(); |
| 6269 | boolean res = reply.readInt() != 0; |
| 6270 | reply.recycle(); |
| 6271 | data.recycle(); |
| 6272 | return res; |
| 6273 | } |
| 6274 | |
| 6275 | public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException { |
| 6276 | Parcel data = Parcel.obtain(); |
| 6277 | Parcel reply = Parcel.obtain(); |
| 6278 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6279 | if (fd != null) { |
| 6280 | data.writeInt(1); |
| 6281 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 6282 | } else { |
| 6283 | data.writeInt(0); |
| 6284 | } |
| 6285 | mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0); |
| 6286 | reply.readException(); |
| 6287 | boolean res = reply.readInt() != 0; |
| 6288 | reply.recycle(); |
| 6289 | data.recycle(); |
| 6290 | return res; |
| 6291 | } |
| 6292 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6293 | public int setVrMode(IBinder token, boolean enabled, ComponentName packageName) |
| 6294 | throws RemoteException { |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6295 | Parcel data = Parcel.obtain(); |
| 6296 | Parcel reply = Parcel.obtain(); |
| 6297 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6298 | data.writeStrongBinder(token); |
| 6299 | data.writeInt(enabled ? 1 : 0); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6300 | packageName.writeToParcel(data, 0); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6301 | mRemote.transact(SET_VR_MODE_TRANSACTION, data, reply, 0); |
| 6302 | reply.readException(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6303 | int res = reply.readInt(); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6304 | data.recycle(); |
| 6305 | reply.recycle(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6306 | return res; |
| 6307 | } |
| 6308 | |
| 6309 | public boolean isVrModePackageEnabled(ComponentName packageName) |
| 6310 | throws RemoteException { |
| 6311 | Parcel data = Parcel.obtain(); |
| 6312 | Parcel reply = Parcel.obtain(); |
| 6313 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6314 | packageName.writeToParcel(data, 0); |
| 6315 | mRemote.transact(IS_VR_PACKAGE_ENABLED_TRANSACTION, data, reply, 0); |
| 6316 | reply.readException(); |
| 6317 | int res = reply.readInt(); |
| 6318 | data.recycle(); |
| 6319 | reply.recycle(); |
| 6320 | return res == 1; |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6321 | } |
| 6322 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6323 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 6324 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 6325 | Parcel data = Parcel.obtain(); |
| 6326 | Parcel reply = Parcel.obtain(); |
| 6327 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6328 | data.writeInt(displayId); |
| 6329 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 6330 | reply.readException(); |
| 6331 | final int result = reply.readInt(); |
| 6332 | final IActivityContainer res; |
| 6333 | if (result == 1) { |
| 6334 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6335 | } else { |
| 6336 | res = null; |
| 6337 | } |
| 6338 | data.recycle(); |
| 6339 | reply.recycle(); |
| 6340 | return res; |
| 6341 | } |
| 6342 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6343 | @Override |
| 6344 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6345 | throws RemoteException { |
| 6346 | Parcel data = Parcel.obtain(); |
| 6347 | Parcel reply = Parcel.obtain(); |
| 6348 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6349 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6350 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6351 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6352 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6353 | data.recycle(); |
| 6354 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6355 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6356 | } |
| 6357 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6358 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6359 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 6360 | Parcel data = Parcel.obtain(); |
| 6361 | Parcel reply = Parcel.obtain(); |
| 6362 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6363 | data.writeInt(taskId); |
| 6364 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 6365 | reply.readException(); |
| 6366 | data.recycle(); |
| 6367 | reply.recycle(); |
| 6368 | } |
| 6369 | |
| 6370 | @Override |
| 6371 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 6372 | Parcel data = Parcel.obtain(); |
| 6373 | Parcel reply = Parcel.obtain(); |
| 6374 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6375 | data.writeStrongBinder(token); |
| 6376 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 6377 | reply.readException(); |
| 6378 | data.recycle(); |
| 6379 | reply.recycle(); |
| 6380 | } |
| 6381 | |
| 6382 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6383 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 6384 | Parcel data = Parcel.obtain(); |
| 6385 | Parcel reply = Parcel.obtain(); |
| 6386 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6387 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6388 | reply.readException(); |
| 6389 | data.recycle(); |
| 6390 | reply.recycle(); |
| 6391 | } |
| 6392 | |
| 6393 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6394 | public void stopLockTaskMode() throws RemoteException { |
| 6395 | Parcel data = Parcel.obtain(); |
| 6396 | Parcel reply = Parcel.obtain(); |
| 6397 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6398 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6399 | reply.readException(); |
| 6400 | data.recycle(); |
| 6401 | reply.recycle(); |
| 6402 | } |
| 6403 | |
| 6404 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6405 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 6406 | Parcel data = Parcel.obtain(); |
| 6407 | Parcel reply = Parcel.obtain(); |
| 6408 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6409 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6410 | reply.readException(); |
| 6411 | data.recycle(); |
| 6412 | reply.recycle(); |
| 6413 | } |
| 6414 | |
| 6415 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6416 | public boolean isInLockTaskMode() throws RemoteException { |
| 6417 | Parcel data = Parcel.obtain(); |
| 6418 | Parcel reply = Parcel.obtain(); |
| 6419 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6420 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6421 | reply.readException(); |
| 6422 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 6423 | data.recycle(); |
| 6424 | reply.recycle(); |
| 6425 | return isInLockTaskMode; |
| 6426 | } |
| 6427 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 6428 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 6429 | public int getLockTaskModeState() throws RemoteException { |
| 6430 | Parcel data = Parcel.obtain(); |
| 6431 | Parcel reply = Parcel.obtain(); |
| 6432 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6433 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 6434 | reply.readException(); |
| 6435 | int lockTaskModeState = reply.readInt(); |
| 6436 | data.recycle(); |
| 6437 | reply.recycle(); |
| 6438 | return lockTaskModeState; |
| 6439 | } |
| 6440 | |
| 6441 | @Override |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 6442 | public void showLockTaskEscapeMessage(IBinder token) throws RemoteException { |
| 6443 | Parcel data = Parcel.obtain(); |
| 6444 | Parcel reply = Parcel.obtain(); |
| 6445 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6446 | data.writeStrongBinder(token); |
| 6447 | mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply, |
| 6448 | IBinder.FLAG_ONEWAY); |
| 6449 | reply.readException(); |
| 6450 | data.recycle(); |
| 6451 | reply.recycle(); |
| 6452 | } |
| 6453 | |
| 6454 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 6455 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6456 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6457 | Parcel data = Parcel.obtain(); |
| 6458 | Parcel reply = Parcel.obtain(); |
| 6459 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6460 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6461 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6462 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6463 | reply.readException(); |
| 6464 | data.recycle(); |
| 6465 | reply.recycle(); |
| 6466 | } |
| 6467 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6468 | @Override |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6469 | public void setTaskResizeable(int taskId, int resizeableMode) throws RemoteException { |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6470 | Parcel data = Parcel.obtain(); |
| 6471 | Parcel reply = Parcel.obtain(); |
| 6472 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6473 | data.writeInt(taskId); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6474 | data.writeInt(resizeableMode); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6475 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6476 | reply.readException(); |
| 6477 | data.recycle(); |
| 6478 | reply.recycle(); |
| 6479 | } |
| 6480 | |
| 6481 | @Override |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6482 | public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6483 | { |
| 6484 | Parcel data = Parcel.obtain(); |
| 6485 | Parcel reply = Parcel.obtain(); |
| 6486 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6487 | data.writeInt(taskId); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6488 | data.writeInt(resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6489 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6490 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6491 | reply.readException(); |
| 6492 | data.recycle(); |
| 6493 | reply.recycle(); |
| 6494 | } |
| 6495 | |
| 6496 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 6497 | public Rect getTaskBounds(int taskId) throws RemoteException |
| 6498 | { |
| 6499 | Parcel data = Parcel.obtain(); |
| 6500 | Parcel reply = Parcel.obtain(); |
| 6501 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6502 | data.writeInt(taskId); |
| 6503 | mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0); |
| 6504 | reply.readException(); |
| 6505 | Rect rect = Rect.CREATOR.createFromParcel(reply); |
| 6506 | data.recycle(); |
| 6507 | reply.recycle(); |
| 6508 | return rect; |
| 6509 | } |
| 6510 | |
| 6511 | @Override |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6512 | public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException { |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6513 | Parcel data = Parcel.obtain(); |
| 6514 | Parcel reply = Parcel.obtain(); |
| 6515 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6516 | data.writeString(filename); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6517 | data.writeInt(userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6518 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 6519 | reply.readException(); |
| 6520 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 6521 | data.recycle(); |
| 6522 | reply.recycle(); |
| 6523 | return icon; |
| 6524 | } |
| 6525 | |
| 6526 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6527 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 6528 | throws RemoteException { |
| 6529 | Parcel data = Parcel.obtain(); |
| 6530 | Parcel reply = Parcel.obtain(); |
| 6531 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6532 | if (options == null) { |
| 6533 | data.writeInt(0); |
| 6534 | } else { |
| 6535 | data.writeInt(1); |
| 6536 | data.writeBundle(options.toBundle()); |
| 6537 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6538 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6539 | reply.readException(); |
| 6540 | data.recycle(); |
| 6541 | reply.recycle(); |
| 6542 | } |
| 6543 | |
| 6544 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6545 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6546 | Parcel data = Parcel.obtain(); |
| 6547 | Parcel reply = Parcel.obtain(); |
| 6548 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6549 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6550 | data.writeInt(visible ? 1 : 0); |
| 6551 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6552 | reply.readException(); |
| 6553 | boolean success = reply.readInt() > 0; |
| 6554 | data.recycle(); |
| 6555 | reply.recycle(); |
| 6556 | return success; |
| 6557 | } |
| 6558 | |
| 6559 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6560 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6561 | Parcel data = Parcel.obtain(); |
| 6562 | Parcel reply = Parcel.obtain(); |
| 6563 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6564 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6565 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6566 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6567 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6568 | data.recycle(); |
| 6569 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6570 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6571 | } |
| 6572 | |
| 6573 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6574 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6575 | Parcel data = Parcel.obtain(); |
| 6576 | Parcel reply = Parcel.obtain(); |
| 6577 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6578 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6579 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 6580 | reply.readException(); |
| 6581 | data.recycle(); |
| 6582 | reply.recycle(); |
| 6583 | } |
| 6584 | |
| 6585 | @Override |
| 6586 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 6587 | Parcel data = Parcel.obtain(); |
| 6588 | Parcel reply = Parcel.obtain(); |
| 6589 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6590 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6591 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6592 | reply.readException(); |
| 6593 | data.recycle(); |
| 6594 | reply.recycle(); |
| 6595 | } |
| 6596 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6597 | @Override |
| 6598 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 6599 | Parcel data = Parcel.obtain(); |
| 6600 | Parcel reply = Parcel.obtain(); |
| 6601 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6602 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6603 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6604 | reply.readException(); |
| 6605 | data.recycle(); |
| 6606 | reply.recycle(); |
| 6607 | } |
| 6608 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 6609 | @Override |
| 6610 | public void bootAnimationComplete() throws RemoteException { |
| 6611 | Parcel data = Parcel.obtain(); |
| 6612 | Parcel reply = Parcel.obtain(); |
| 6613 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6614 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 6615 | reply.readException(); |
| 6616 | data.recycle(); |
| 6617 | reply.recycle(); |
| 6618 | } |
| 6619 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 6620 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 6621 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 6622 | Parcel data = Parcel.obtain(); |
| 6623 | Parcel reply = Parcel.obtain(); |
| 6624 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6625 | data.writeInt(uid); |
| 6626 | data.writeByteArray(firstPacket); |
| 6627 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 6628 | reply.readException(); |
| 6629 | data.recycle(); |
| 6630 | reply.recycle(); |
| 6631 | } |
| 6632 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6633 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6634 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 6635 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6636 | Parcel data = Parcel.obtain(); |
| 6637 | Parcel reply = Parcel.obtain(); |
| 6638 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6639 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6640 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6641 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6642 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6643 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 6644 | reply.readException(); |
| 6645 | data.recycle(); |
| 6646 | reply.recycle(); |
| 6647 | } |
| 6648 | |
| 6649 | @Override |
| 6650 | public void dumpHeapFinished(String path) throws RemoteException { |
| 6651 | Parcel data = Parcel.obtain(); |
| 6652 | Parcel reply = Parcel.obtain(); |
| 6653 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6654 | data.writeString(path); |
| 6655 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 6656 | reply.readException(); |
| 6657 | data.recycle(); |
| 6658 | reply.recycle(); |
| 6659 | } |
| 6660 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 6661 | @Override |
| 6662 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 6663 | throws RemoteException { |
| 6664 | Parcel data = Parcel.obtain(); |
| 6665 | Parcel reply = Parcel.obtain(); |
| 6666 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6667 | data.writeStrongBinder(session.asBinder()); |
| 6668 | data.writeInt(keepAwake ? 1 : 0); |
| 6669 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 6670 | reply.readException(); |
| 6671 | data.recycle(); |
| 6672 | reply.recycle(); |
| 6673 | } |
| 6674 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6675 | @Override |
| 6676 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 6677 | Parcel data = Parcel.obtain(); |
| 6678 | Parcel reply = Parcel.obtain(); |
| 6679 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6680 | data.writeInt(userId); |
| 6681 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6682 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6683 | reply.readException(); |
| 6684 | data.recycle(); |
| 6685 | reply.recycle(); |
| 6686 | } |
| 6687 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6688 | @Override |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 6689 | public void updateDeviceOwner(String packageName) throws RemoteException { |
| 6690 | Parcel data = Parcel.obtain(); |
| 6691 | Parcel reply = Parcel.obtain(); |
| 6692 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6693 | data.writeString(packageName); |
| 6694 | mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0); |
| 6695 | reply.readException(); |
| 6696 | data.recycle(); |
| 6697 | reply.recycle(); |
| 6698 | } |
| 6699 | |
| 6700 | @Override |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6701 | public int getPackageProcessState(String packageName, String callingPackage) |
| 6702 | throws RemoteException { |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6703 | Parcel data = Parcel.obtain(); |
| 6704 | Parcel reply = Parcel.obtain(); |
| 6705 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6706 | data.writeString(packageName); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6707 | data.writeString(callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6708 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 6709 | reply.readException(); |
| 6710 | int res = reply.readInt(); |
| 6711 | data.recycle(); |
| 6712 | reply.recycle(); |
| 6713 | return res; |
| 6714 | } |
| 6715 | |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 6716 | @Override |
| 6717 | public boolean setProcessMemoryTrimLevel(String process, int userId, int level) |
| 6718 | throws RemoteException { |
| 6719 | Parcel data = Parcel.obtain(); |
| 6720 | Parcel reply = Parcel.obtain(); |
| 6721 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6722 | data.writeString(process); |
| 6723 | data.writeInt(userId); |
| 6724 | data.writeInt(level); |
| 6725 | mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0); |
| 6726 | reply.readException(); |
| 6727 | int res = reply.readInt(); |
| 6728 | data.recycle(); |
| 6729 | reply.recycle(); |
| 6730 | return res != 0; |
| 6731 | } |
| 6732 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 6733 | @Override |
| 6734 | public boolean isRootVoiceInteraction(IBinder token) throws RemoteException { |
| 6735 | Parcel data = Parcel.obtain(); |
| 6736 | Parcel reply = Parcel.obtain(); |
| 6737 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6738 | data.writeStrongBinder(token); |
| 6739 | mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 6740 | reply.readException(); |
| 6741 | int res = reply.readInt(); |
| 6742 | data.recycle(); |
| 6743 | reply.recycle(); |
| 6744 | return res != 0; |
| 6745 | } |
| 6746 | |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6747 | @Override |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6748 | public void exitFreeformMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6749 | Parcel data = Parcel.obtain(); |
| 6750 | Parcel reply = Parcel.obtain(); |
| 6751 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6752 | data.writeStrongBinder(token); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6753 | mRemote.transact(EXIT_FREEFORM_MODE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6754 | reply.readException(); |
| 6755 | data.recycle(); |
| 6756 | reply.recycle(); |
| 6757 | } |
| 6758 | |
| 6759 | @Override |
| 6760 | public int getActivityStackId(IBinder token) throws RemoteException { |
| 6761 | Parcel data = Parcel.obtain(); |
| 6762 | Parcel reply = Parcel.obtain(); |
| 6763 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6764 | data.writeStrongBinder(token); |
| 6765 | mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0); |
| 6766 | reply.readException(); |
| 6767 | int stackId = reply.readInt(); |
| 6768 | data.recycle(); |
| 6769 | reply.recycle(); |
| 6770 | return stackId; |
| 6771 | } |
| 6772 | |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6773 | @Override |
| 6774 | public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration, |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6775 | int[] verticalSizeConfigurations, int[] smallestSizeConfigurations) |
| 6776 | throws RemoteException { |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6777 | Parcel data = Parcel.obtain(); |
| 6778 | Parcel reply = Parcel.obtain(); |
| 6779 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6780 | data.writeStrongBinder(token); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6781 | writeIntArray(horizontalSizeConfiguration, data); |
| 6782 | writeIntArray(verticalSizeConfigurations, data); |
| 6783 | writeIntArray(smallestSizeConfigurations, data); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6784 | mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0); |
| 6785 | reply.readException(); |
| 6786 | data.recycle(); |
| 6787 | reply.recycle(); |
| 6788 | } |
| 6789 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6790 | private static void writeIntArray(int[] array, Parcel data) { |
| 6791 | if (array == null) { |
| 6792 | data.writeInt(0); |
| 6793 | } else { |
| 6794 | data.writeInt(array.length); |
| 6795 | data.writeIntArray(array); |
| 6796 | } |
| 6797 | } |
| 6798 | |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 6799 | @Override |
| 6800 | public void suppressResizeConfigChanges(boolean suppress) throws RemoteException { |
| 6801 | Parcel data = Parcel.obtain(); |
| 6802 | Parcel reply = Parcel.obtain(); |
| 6803 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6804 | data.writeInt(suppress ? 1 : 0); |
| 6805 | mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0); |
| 6806 | reply.readException(); |
| 6807 | data.recycle(); |
| 6808 | reply.recycle(); |
| 6809 | } |
| 6810 | |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6811 | @Override |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6812 | public void moveTasksToFullscreenStack(int fromStackId, boolean onTop) throws RemoteException { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6813 | Parcel data = Parcel.obtain(); |
| 6814 | Parcel reply = Parcel.obtain(); |
| 6815 | data.writeInterfaceToken(IActivityManager.descriptor); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6816 | data.writeInt(fromStackId); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6817 | data.writeInt(onTop ? 1 : 0); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6818 | mRemote.transact(MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION, data, reply, 0); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6819 | reply.readException(); |
| 6820 | data.recycle(); |
| 6821 | reply.recycle(); |
| 6822 | } |
| 6823 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6824 | @Override |
| 6825 | public int getAppStartMode(int uid, String packageName) throws RemoteException { |
| 6826 | Parcel data = Parcel.obtain(); |
| 6827 | Parcel reply = Parcel.obtain(); |
| 6828 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6829 | data.writeInt(uid); |
| 6830 | data.writeString(packageName); |
| 6831 | mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0); |
| 6832 | reply.readException(); |
| 6833 | int res = reply.readInt(); |
| 6834 | data.recycle(); |
| 6835 | reply.recycle(); |
| 6836 | return res; |
| 6837 | } |
| 6838 | |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6839 | @Override |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 6840 | public boolean isInMultiWindowMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6841 | Parcel data = Parcel.obtain(); |
| 6842 | Parcel reply = Parcel.obtain(); |
| 6843 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6844 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6845 | mRemote.transact(IN_MULTI_WINDOW_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6846 | reply.readException(); |
| 6847 | final boolean multiWindowMode = reply.readInt() == 1 ? true : false; |
| 6848 | data.recycle(); |
| 6849 | reply.recycle(); |
| 6850 | return multiWindowMode; |
| 6851 | } |
| 6852 | |
| 6853 | @Override |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 6854 | public boolean isInPictureInPictureMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6855 | Parcel data = Parcel.obtain(); |
| 6856 | Parcel reply = Parcel.obtain(); |
| 6857 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6858 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6859 | mRemote.transact(IN_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6860 | reply.readException(); |
| 6861 | final boolean pipMode = reply.readInt() == 1 ? true : false; |
| 6862 | data.recycle(); |
| 6863 | reply.recycle(); |
| 6864 | return pipMode; |
| 6865 | } |
| 6866 | |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6867 | @Override |
Andrii Kulian | 933076d | 2016-03-29 17:04:42 -0700 | [diff] [blame] | 6868 | public void enterPictureInPictureMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6869 | Parcel data = Parcel.obtain(); |
| 6870 | Parcel reply = Parcel.obtain(); |
| 6871 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6872 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6873 | mRemote.transact(ENTER_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6874 | reply.readException(); |
| 6875 | data.recycle(); |
| 6876 | reply.recycle(); |
| 6877 | } |
| 6878 | |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 6879 | @Override |
| 6880 | public boolean isAppForeground(int uid) throws RemoteException { |
| 6881 | Parcel data = Parcel.obtain(); |
| 6882 | Parcel reply = Parcel.obtain(); |
| 6883 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6884 | data.writeInt(uid); |
| 6885 | mRemote.transact(IS_APP_FOREGROUND_TRANSACTION, data, reply, 0); |
| 6886 | final boolean isForeground = reply.readInt() == 1 ? true : false; |
| 6887 | data.recycle(); |
| 6888 | reply.recycle(); |
| 6889 | return isForeground; |
| 6890 | }; |
| 6891 | |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 6892 | @Override |
| 6893 | public void notifyPinnedStackAnimationEnded() throws RemoteException { |
| 6894 | Parcel data = Parcel.obtain(); |
| 6895 | Parcel reply = Parcel.obtain(); |
| 6896 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6897 | mRemote.transact(NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION, data, reply, 0); |
| 6898 | data.recycle(); |
| 6899 | reply.recycle(); |
| 6900 | }; |
| 6901 | |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 6902 | @Override |
| 6903 | public void removeStack(int stackId) throws RemoteException { |
| 6904 | Parcel data = Parcel.obtain(); |
| 6905 | Parcel reply = Parcel.obtain(); |
| 6906 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6907 | data.writeInt(stackId); |
| 6908 | mRemote.transact(REMOVE_STACK, data, reply, 0); |
| 6909 | reply.readException(); |
| 6910 | data.recycle(); |
| 6911 | reply.recycle(); |
| 6912 | } |
| 6913 | |
Tony Mak | 9c6e8ce | 2016-03-21 12:07:16 +0000 | [diff] [blame] | 6914 | public void notifyLockedProfile(@UserIdInt int userId) throws RemoteException |
| 6915 | { |
| 6916 | Parcel data = Parcel.obtain(); |
| 6917 | Parcel reply = Parcel.obtain(); |
| 6918 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6919 | data.writeInt(userId); |
| 6920 | mRemote.transact(NOTIFY_LOCKED_PROFILE, data, reply, 0); |
| 6921 | reply.readException(); |
| 6922 | data.recycle(); |
| 6923 | reply.recycle(); |
| 6924 | } |
| 6925 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6926 | private IBinder mRemote; |
| 6927 | } |