The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.app; |
| 18 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 19 | import android.app.ActivityManager.StackInfo; |
Dianne Hackborn | 69c6adc | 2015-06-02 10:52:59 -0700 | [diff] [blame] | 20 | import android.app.assist.AssistContent; |
| 21 | import android.app.assist.AssistStructure; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.content.ComponentName; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 23 | import android.content.IIntentReceiver; |
| 24 | import android.content.IIntentSender; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | import android.content.Intent; |
| 26 | import android.content.IntentFilter; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 27 | import android.content.IntentSender; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 28 | import android.content.UriPermission; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 29 | import android.content.pm.ApplicationInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | import android.content.pm.ConfigurationInfo; |
| 31 | import android.content.pm.IPackageDataObserver; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 32 | import android.content.pm.ParceledListSlice; |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 33 | import android.content.pm.UserInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 34 | import android.content.res.Configuration; |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 35 | import android.graphics.Bitmap; |
| 36 | import android.graphics.Point; |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 37 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 38 | import android.net.Uri; |
| 39 | import android.os.Binder; |
| 40 | import android.os.Bundle; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 41 | import android.os.Debug; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | import android.os.IBinder; |
| 43 | import android.os.Parcel; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 44 | import android.os.ParcelFileDescriptor; |
| 45 | import android.os.Parcelable; |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 46 | import android.os.PersistableBundle; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 47 | import android.os.RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | import android.os.ServiceManager; |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 49 | import android.os.StrictMode; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 50 | import android.service.voice.IVoiceInteractionSession; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 51 | import android.text.TextUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | import android.util.Log; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 53 | import android.util.Singleton; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 54 | import com.android.internal.app.IVoiceInteractor; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 55 | import com.android.internal.os.IResultReceiver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | import java.util.ArrayList; |
| 58 | import java.util.List; |
| 59 | |
| 60 | /** {@hide} */ |
| 61 | public abstract class ActivityManagerNative extends Binder implements IActivityManager |
| 62 | { |
| 63 | /** |
| 64 | * Cast a Binder object into an activity manager interface, generating |
| 65 | * a proxy if needed. |
| 66 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 67 | static public IActivityManager asInterface(IBinder obj) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 68 | if (obj == null) { |
| 69 | return null; |
| 70 | } |
| 71 | IActivityManager in = |
| 72 | (IActivityManager)obj.queryLocalInterface(descriptor); |
| 73 | if (in != null) { |
| 74 | return in; |
| 75 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 76 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 77 | return new ActivityManagerProxy(obj); |
| 78 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 79 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | /** |
| 81 | * Retrieve the system's default/global activity manager. |
| 82 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 83 | static public IActivityManager getDefault() { |
| 84 | return gDefault.get(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Convenience for checking whether the system is ready. For internal use only. |
| 89 | */ |
| 90 | static public boolean isSystemReady() { |
| 91 | if (!sSystemReady) { |
| 92 | sSystemReady = getDefault().testIsSystemReady(); |
| 93 | } |
| 94 | return sSystemReady; |
| 95 | } |
| 96 | static boolean sSystemReady = false; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 97 | |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 98 | static public void broadcastStickyIntent(Intent intent, String permission, int userId) { |
| 99 | broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId); |
| 100 | } |
| 101 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 102 | /** |
| 103 | * Convenience for sending a sticky broadcast. For internal use only. |
| 104 | * If you don't care about permission, use null. |
| 105 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 106 | static public void broadcastStickyIntent(Intent intent, String permission, int appOp, |
| 107 | int userId) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 108 | try { |
| 109 | getDefault().broadcastIntent( |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 110 | null, intent, null, null, Activity.RESULT_OK, null, null, |
| 111 | null /*permission*/, appOp, null, false, true, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 112 | } catch (RemoteException ex) { |
| 113 | } |
| 114 | } |
| 115 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 116 | static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg, |
| 117 | String tag) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 118 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 119 | getDefault().noteWakeupAlarm((ps != null) ? ps.getTarget() : null, |
| 120 | sourceUid, sourcePkg, tag); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 121 | } catch (RemoteException ex) { |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) { |
| 126 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 127 | getDefault().noteAlarmStart((ps != null) ? ps.getTarget() : null, sourceUid, tag); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 128 | } catch (RemoteException ex) { |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) { |
| 133 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 134 | getDefault().noteAlarmFinish((ps != null) ? ps.getTarget() : null, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 135 | } catch (RemoteException ex) { |
| 136 | } |
| 137 | } |
| 138 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 139 | public ActivityManagerNative() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 140 | attachInterface(this, descriptor); |
| 141 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 142 | |
| 143 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 144 | public boolean onTransact(int code, Parcel data, Parcel reply, int flags) |
| 145 | throws RemoteException { |
| 146 | switch (code) { |
| 147 | case START_ACTIVITY_TRANSACTION: |
| 148 | { |
| 149 | data.enforceInterface(IActivityManager.descriptor); |
| 150 | IBinder b = data.readStrongBinder(); |
| 151 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 152 | String callingPackage = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 153 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 154 | String resolvedType = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 155 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 156 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 157 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 158 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 159 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 160 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 161 | Bundle options = data.readInt() != 0 |
| 162 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 163 | int result = startActivity(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 164 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 165 | reply.writeNoException(); |
| 166 | reply.writeInt(result); |
| 167 | return true; |
| 168 | } |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 169 | |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 170 | case START_ACTIVITY_AS_USER_TRANSACTION: |
| 171 | { |
| 172 | data.enforceInterface(IActivityManager.descriptor); |
| 173 | IBinder b = data.readStrongBinder(); |
| 174 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 175 | String callingPackage = data.readString(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 176 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 177 | String resolvedType = data.readString(); |
| 178 | IBinder resultTo = data.readStrongBinder(); |
| 179 | String resultWho = data.readString(); |
| 180 | int requestCode = data.readInt(); |
| 181 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 182 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 183 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 184 | Bundle options = data.readInt() != 0 |
| 185 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 186 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 187 | int result = startActivityAsUser(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 188 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 189 | reply.writeNoException(); |
| 190 | reply.writeInt(result); |
| 191 | return true; |
| 192 | } |
| 193 | |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 194 | case START_ACTIVITY_AS_CALLER_TRANSACTION: |
| 195 | { |
| 196 | data.enforceInterface(IActivityManager.descriptor); |
| 197 | IBinder b = data.readStrongBinder(); |
| 198 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 199 | String callingPackage = data.readString(); |
| 200 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 201 | String resolvedType = data.readString(); |
| 202 | IBinder resultTo = data.readStrongBinder(); |
| 203 | String resultWho = data.readString(); |
| 204 | int requestCode = data.readInt(); |
| 205 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 206 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 207 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 208 | Bundle options = data.readInt() != 0 |
| 209 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 210 | boolean ignoreTargetSecurity = data.readInt() != 0; |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 211 | int userId = data.readInt(); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 212 | int result = startActivityAsCaller(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 213 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, |
| 214 | ignoreTargetSecurity, userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 215 | reply.writeNoException(); |
| 216 | reply.writeInt(result); |
| 217 | return true; |
| 218 | } |
| 219 | |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 220 | case START_ACTIVITY_AND_WAIT_TRANSACTION: |
| 221 | { |
| 222 | data.enforceInterface(IActivityManager.descriptor); |
| 223 | IBinder b = data.readStrongBinder(); |
| 224 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 225 | String callingPackage = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 226 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 227 | String resolvedType = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 228 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 229 | String resultWho = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 230 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 231 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 232 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 233 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 234 | Bundle options = data.readInt() != 0 |
| 235 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 236 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 237 | WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 238 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 239 | reply.writeNoException(); |
| 240 | result.writeToParcel(reply, 0); |
| 241 | return true; |
| 242 | } |
| 243 | |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 244 | case START_ACTIVITY_WITH_CONFIG_TRANSACTION: |
| 245 | { |
| 246 | data.enforceInterface(IActivityManager.descriptor); |
| 247 | IBinder b = data.readStrongBinder(); |
| 248 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 249 | String callingPackage = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 250 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 251 | String resolvedType = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 252 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 253 | String resultWho = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 254 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 255 | int startFlags = data.readInt(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 256 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 257 | Bundle options = data.readInt() != 0 |
| 258 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 259 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 260 | int result = startActivityWithConfig(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 261 | resultTo, resultWho, requestCode, startFlags, config, options, userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 262 | reply.writeNoException(); |
| 263 | reply.writeInt(result); |
| 264 | return true; |
| 265 | } |
| 266 | |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 267 | case START_ACTIVITY_INTENT_SENDER_TRANSACTION: |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 268 | { |
| 269 | data.enforceInterface(IActivityManager.descriptor); |
| 270 | IBinder b = data.readStrongBinder(); |
| 271 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 272 | IntentSender intent = IntentSender.CREATOR.createFromParcel(data); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 273 | Intent fillInIntent = null; |
| 274 | if (data.readInt() != 0) { |
| 275 | fillInIntent = Intent.CREATOR.createFromParcel(data); |
| 276 | } |
| 277 | String resolvedType = data.readString(); |
| 278 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 279 | String resultWho = data.readString(); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 280 | int requestCode = data.readInt(); |
| 281 | int flagsMask = data.readInt(); |
| 282 | int flagsValues = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 283 | Bundle options = data.readInt() != 0 |
| 284 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 285 | int result = startActivityIntentSender(app, intent, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 286 | fillInIntent, resolvedType, resultTo, resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 287 | requestCode, flagsMask, flagsValues, options); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 288 | reply.writeNoException(); |
| 289 | reply.writeInt(result); |
| 290 | return true; |
| 291 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 292 | |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 293 | case START_VOICE_ACTIVITY_TRANSACTION: |
| 294 | { |
| 295 | data.enforceInterface(IActivityManager.descriptor); |
| 296 | String callingPackage = data.readString(); |
| 297 | int callingPid = data.readInt(); |
| 298 | int callingUid = data.readInt(); |
| 299 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 300 | String resolvedType = data.readString(); |
| 301 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 302 | data.readStrongBinder()); |
| 303 | IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface( |
| 304 | data.readStrongBinder()); |
| 305 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 306 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 307 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 308 | Bundle options = data.readInt() != 0 |
| 309 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 310 | int userId = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 311 | int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent, |
| 312 | resolvedType, session, interactor, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 313 | reply.writeNoException(); |
| 314 | reply.writeInt(result); |
| 315 | return true; |
| 316 | } |
| 317 | |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 318 | case START_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 319 | { |
| 320 | data.enforceInterface(IActivityManager.descriptor); |
| 321 | IBinder token = data.readStrongBinder(); |
| 322 | Bundle options = data.readBundle(); |
| 323 | startLocalVoiceInteraction(token, options); |
| 324 | reply.writeNoException(); |
| 325 | return true; |
| 326 | } |
| 327 | |
| 328 | case STOP_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 329 | { |
| 330 | data.enforceInterface(IActivityManager.descriptor); |
| 331 | IBinder token = data.readStrongBinder(); |
| 332 | stopLocalVoiceInteraction(token); |
| 333 | reply.writeNoException(); |
| 334 | return true; |
| 335 | } |
| 336 | |
| 337 | case SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 338 | { |
| 339 | data.enforceInterface(IActivityManager.descriptor); |
| 340 | boolean result = supportsLocalVoiceInteraction(); |
| 341 | reply.writeNoException(); |
| 342 | reply.writeInt(result? 1 : 0); |
| 343 | return true; |
| 344 | } |
| 345 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 346 | case START_NEXT_MATCHING_ACTIVITY_TRANSACTION: |
| 347 | { |
| 348 | data.enforceInterface(IActivityManager.descriptor); |
| 349 | IBinder callingActivity = data.readStrongBinder(); |
| 350 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 351 | Bundle options = data.readInt() != 0 |
| 352 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 353 | boolean result = startNextMatchingActivity(callingActivity, intent, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 354 | reply.writeNoException(); |
| 355 | reply.writeInt(result ? 1 : 0); |
| 356 | return true; |
| 357 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 358 | |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 359 | case START_ACTIVITY_FROM_RECENTS_TRANSACTION: |
| 360 | { |
| 361 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 362 | final int taskId = data.readInt(); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 363 | final Bundle options = |
| 364 | data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data); |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 365 | final int result = startActivityFromRecents(taskId, options); |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 366 | reply.writeNoException(); |
| 367 | reply.writeInt(result); |
| 368 | return true; |
| 369 | } |
| 370 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 371 | case FINISH_ACTIVITY_TRANSACTION: { |
| 372 | data.enforceInterface(IActivityManager.descriptor); |
| 373 | IBinder token = data.readStrongBinder(); |
| 374 | Intent resultData = null; |
| 375 | int resultCode = data.readInt(); |
| 376 | if (data.readInt() != 0) { |
| 377 | resultData = Intent.CREATOR.createFromParcel(data); |
| 378 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 379 | int finishTask = data.readInt(); |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 380 | boolean res = finishActivity(token, resultCode, resultData, finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 381 | reply.writeNoException(); |
| 382 | reply.writeInt(res ? 1 : 0); |
| 383 | return true; |
| 384 | } |
| 385 | |
| 386 | case FINISH_SUB_ACTIVITY_TRANSACTION: { |
| 387 | data.enforceInterface(IActivityManager.descriptor); |
| 388 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 389 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 390 | int requestCode = data.readInt(); |
| 391 | finishSubActivity(token, resultWho, requestCode); |
| 392 | reply.writeNoException(); |
| 393 | return true; |
| 394 | } |
| 395 | |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 396 | case FINISH_ACTIVITY_AFFINITY_TRANSACTION: { |
| 397 | data.enforceInterface(IActivityManager.descriptor); |
| 398 | IBinder token = data.readStrongBinder(); |
| 399 | boolean res = finishActivityAffinity(token); |
| 400 | reply.writeNoException(); |
| 401 | reply.writeInt(res ? 1 : 0); |
| 402 | return true; |
| 403 | } |
| 404 | |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 405 | case FINISH_VOICE_TASK_TRANSACTION: { |
| 406 | data.enforceInterface(IActivityManager.descriptor); |
| 407 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 408 | data.readStrongBinder()); |
| 409 | finishVoiceTask(session); |
| 410 | reply.writeNoException(); |
| 411 | return true; |
| 412 | } |
| 413 | |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 414 | case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: { |
| 415 | data.enforceInterface(IActivityManager.descriptor); |
| 416 | IBinder token = data.readStrongBinder(); |
| 417 | boolean res = releaseActivityInstance(token); |
| 418 | reply.writeNoException(); |
| 419 | reply.writeInt(res ? 1 : 0); |
| 420 | return true; |
| 421 | } |
| 422 | |
| 423 | case RELEASE_SOME_ACTIVITIES_TRANSACTION: { |
| 424 | data.enforceInterface(IActivityManager.descriptor); |
| 425 | IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder()); |
| 426 | releaseSomeActivities(app); |
| 427 | reply.writeNoException(); |
| 428 | return true; |
| 429 | } |
| 430 | |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 431 | case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: { |
| 432 | data.enforceInterface(IActivityManager.descriptor); |
| 433 | IBinder token = data.readStrongBinder(); |
| 434 | boolean res = willActivityBeVisible(token); |
| 435 | reply.writeNoException(); |
| 436 | reply.writeInt(res ? 1 : 0); |
| 437 | return true; |
| 438 | } |
| 439 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 440 | case REGISTER_RECEIVER_TRANSACTION: |
| 441 | { |
| 442 | data.enforceInterface(IActivityManager.descriptor); |
| 443 | IBinder b = data.readStrongBinder(); |
| 444 | IApplicationThread app = |
| 445 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 446 | String packageName = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 447 | b = data.readStrongBinder(); |
| 448 | IIntentReceiver rec |
| 449 | = b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 450 | IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data); |
| 451 | String perm = data.readString(); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 452 | int userId = data.readInt(); |
| 453 | Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 454 | reply.writeNoException(); |
| 455 | if (intent != null) { |
| 456 | reply.writeInt(1); |
| 457 | intent.writeToParcel(reply, 0); |
| 458 | } else { |
| 459 | reply.writeInt(0); |
| 460 | } |
| 461 | return true; |
| 462 | } |
| 463 | |
| 464 | case UNREGISTER_RECEIVER_TRANSACTION: |
| 465 | { |
| 466 | data.enforceInterface(IActivityManager.descriptor); |
| 467 | IBinder b = data.readStrongBinder(); |
| 468 | if (b == null) { |
| 469 | return true; |
| 470 | } |
| 471 | IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b); |
| 472 | unregisterReceiver(rec); |
| 473 | reply.writeNoException(); |
| 474 | return true; |
| 475 | } |
| 476 | |
| 477 | case BROADCAST_INTENT_TRANSACTION: |
| 478 | { |
| 479 | data.enforceInterface(IActivityManager.descriptor); |
| 480 | IBinder b = data.readStrongBinder(); |
| 481 | IApplicationThread app = |
| 482 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 483 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 484 | String resolvedType = data.readString(); |
| 485 | b = data.readStrongBinder(); |
| 486 | IIntentReceiver resultTo = |
| 487 | b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 488 | int resultCode = data.readInt(); |
| 489 | String resultData = data.readString(); |
| 490 | Bundle resultExtras = data.readBundle(); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 491 | String[] perms = data.readStringArray(); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 492 | int appOp = data.readInt(); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 493 | Bundle options = data.readBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 494 | boolean serialized = data.readInt() != 0; |
| 495 | boolean sticky = data.readInt() != 0; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 496 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 497 | int res = broadcastIntent(app, intent, resolvedType, resultTo, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 498 | resultCode, resultData, resultExtras, perms, appOp, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 499 | options, serialized, sticky, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 500 | reply.writeNoException(); |
| 501 | reply.writeInt(res); |
| 502 | return true; |
| 503 | } |
| 504 | |
| 505 | case UNBROADCAST_INTENT_TRANSACTION: |
| 506 | { |
| 507 | data.enforceInterface(IActivityManager.descriptor); |
| 508 | IBinder b = data.readStrongBinder(); |
| 509 | IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 510 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 511 | int userId = data.readInt(); |
| 512 | unbroadcastIntent(app, intent, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 513 | reply.writeNoException(); |
| 514 | return true; |
| 515 | } |
| 516 | |
| 517 | case FINISH_RECEIVER_TRANSACTION: { |
| 518 | data.enforceInterface(IActivityManager.descriptor); |
| 519 | IBinder who = data.readStrongBinder(); |
| 520 | int resultCode = data.readInt(); |
| 521 | String resultData = data.readString(); |
| 522 | Bundle resultExtras = data.readBundle(); |
| 523 | boolean resultAbort = data.readInt() != 0; |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 524 | int intentFlags = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 525 | if (who != null) { |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 526 | finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 527 | } |
| 528 | reply.writeNoException(); |
| 529 | return true; |
| 530 | } |
| 531 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 532 | case ATTACH_APPLICATION_TRANSACTION: { |
| 533 | data.enforceInterface(IActivityManager.descriptor); |
| 534 | IApplicationThread app = ApplicationThreadNative.asInterface( |
| 535 | data.readStrongBinder()); |
| 536 | if (app != null) { |
| 537 | attachApplication(app); |
| 538 | } |
| 539 | reply.writeNoException(); |
| 540 | return true; |
| 541 | } |
| 542 | |
| 543 | case ACTIVITY_IDLE_TRANSACTION: { |
| 544 | data.enforceInterface(IActivityManager.descriptor); |
| 545 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 546 | Configuration config = null; |
| 547 | if (data.readInt() != 0) { |
| 548 | config = Configuration.CREATOR.createFromParcel(data); |
| 549 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 550 | boolean stopProfiling = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 551 | if (token != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 552 | activityIdle(token, config, stopProfiling); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 553 | } |
| 554 | reply.writeNoException(); |
| 555 | return true; |
| 556 | } |
| 557 | |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 558 | case ACTIVITY_RESUMED_TRANSACTION: { |
| 559 | data.enforceInterface(IActivityManager.descriptor); |
| 560 | IBinder token = data.readStrongBinder(); |
| 561 | activityResumed(token); |
| 562 | reply.writeNoException(); |
| 563 | return true; |
| 564 | } |
| 565 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 566 | case ACTIVITY_PAUSED_TRANSACTION: { |
| 567 | data.enforceInterface(IActivityManager.descriptor); |
| 568 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 569 | activityPaused(token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 570 | reply.writeNoException(); |
| 571 | return true; |
| 572 | } |
| 573 | |
| 574 | case ACTIVITY_STOPPED_TRANSACTION: { |
| 575 | data.enforceInterface(IActivityManager.descriptor); |
| 576 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 577 | Bundle map = data.readBundle(); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 578 | PersistableBundle persistentState = data.readPersistableBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 579 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 580 | activityStopped(token, map, persistentState, description); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 581 | reply.writeNoException(); |
| 582 | return true; |
| 583 | } |
| 584 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 585 | case ACTIVITY_SLEPT_TRANSACTION: { |
| 586 | data.enforceInterface(IActivityManager.descriptor); |
| 587 | IBinder token = data.readStrongBinder(); |
| 588 | activitySlept(token); |
| 589 | reply.writeNoException(); |
| 590 | return true; |
| 591 | } |
| 592 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 593 | case ACTIVITY_DESTROYED_TRANSACTION: { |
| 594 | data.enforceInterface(IActivityManager.descriptor); |
| 595 | IBinder token = data.readStrongBinder(); |
| 596 | activityDestroyed(token); |
| 597 | reply.writeNoException(); |
| 598 | return true; |
| 599 | } |
| 600 | |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 601 | case ACTIVITY_RELAUNCHED_TRANSACTION: { |
| 602 | data.enforceInterface(IActivityManager.descriptor); |
| 603 | IBinder token = data.readStrongBinder(); |
| 604 | activityRelaunched(token); |
| 605 | reply.writeNoException(); |
| 606 | return true; |
| 607 | } |
| 608 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 609 | case GET_CALLING_PACKAGE_TRANSACTION: { |
| 610 | data.enforceInterface(IActivityManager.descriptor); |
| 611 | IBinder token = data.readStrongBinder(); |
| 612 | String res = token != null ? getCallingPackage(token) : null; |
| 613 | reply.writeNoException(); |
| 614 | reply.writeString(res); |
| 615 | return true; |
| 616 | } |
| 617 | |
| 618 | case GET_CALLING_ACTIVITY_TRANSACTION: { |
| 619 | data.enforceInterface(IActivityManager.descriptor); |
| 620 | IBinder token = data.readStrongBinder(); |
| 621 | ComponentName cn = getCallingActivity(token); |
| 622 | reply.writeNoException(); |
| 623 | ComponentName.writeToParcel(cn, reply); |
| 624 | return true; |
| 625 | } |
| 626 | |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 627 | case GET_APP_TASKS_TRANSACTION: { |
| 628 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 629 | String callingPackage = data.readString(); |
| 630 | List<IAppTask> list = getAppTasks(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 631 | reply.writeNoException(); |
| 632 | int N = list != null ? list.size() : -1; |
| 633 | reply.writeInt(N); |
| 634 | int i; |
| 635 | for (i=0; i<N; i++) { |
| 636 | IAppTask task = list.get(i); |
| 637 | reply.writeStrongBinder(task.asBinder()); |
| 638 | } |
| 639 | return true; |
| 640 | } |
| 641 | |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 642 | case ADD_APP_TASK_TRANSACTION: { |
| 643 | data.enforceInterface(IActivityManager.descriptor); |
| 644 | IBinder activityToken = data.readStrongBinder(); |
| 645 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 646 | ActivityManager.TaskDescription descr |
| 647 | = ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 648 | Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data); |
| 649 | int res = addAppTask(activityToken, intent, descr, thumbnail); |
| 650 | reply.writeNoException(); |
| 651 | reply.writeInt(res); |
| 652 | return true; |
| 653 | } |
| 654 | |
| 655 | case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: { |
| 656 | data.enforceInterface(IActivityManager.descriptor); |
| 657 | Point size = getAppTaskThumbnailSize(); |
| 658 | reply.writeNoException(); |
| 659 | size.writeToParcel(reply, 0); |
| 660 | return true; |
| 661 | } |
| 662 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 663 | case GET_TASKS_TRANSACTION: { |
| 664 | data.enforceInterface(IActivityManager.descriptor); |
| 665 | int maxNum = data.readInt(); |
| 666 | int fl = data.readInt(); |
Dianne Hackborn | 0923328 | 2014-04-30 11:33:59 -0700 | [diff] [blame] | 667 | List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 668 | reply.writeNoException(); |
| 669 | int N = list != null ? list.size() : -1; |
| 670 | reply.writeInt(N); |
| 671 | int i; |
| 672 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 673 | ActivityManager.RunningTaskInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 674 | info.writeToParcel(reply, 0); |
| 675 | } |
| 676 | return true; |
| 677 | } |
| 678 | |
| 679 | case GET_RECENT_TASKS_TRANSACTION: { |
| 680 | data.enforceInterface(IActivityManager.descriptor); |
| 681 | int maxNum = data.readInt(); |
| 682 | int fl = data.readInt(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 683 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 684 | List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 685 | fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 686 | reply.writeNoException(); |
| 687 | reply.writeTypedList(list); |
| 688 | return true; |
| 689 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 690 | |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 691 | case GET_TASK_THUMBNAIL_TRANSACTION: { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 692 | data.enforceInterface(IActivityManager.descriptor); |
| 693 | int id = data.readInt(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 694 | ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 695 | reply.writeNoException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 696 | if (taskThumbnail != null) { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 697 | reply.writeInt(1); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 698 | taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 699 | } else { |
| 700 | reply.writeInt(0); |
| 701 | } |
| 702 | return true; |
| 703 | } |
| 704 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 705 | case GET_SERVICES_TRANSACTION: { |
| 706 | data.enforceInterface(IActivityManager.descriptor); |
| 707 | int maxNum = data.readInt(); |
| 708 | int fl = data.readInt(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 709 | List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 710 | reply.writeNoException(); |
| 711 | int N = list != null ? list.size() : -1; |
| 712 | reply.writeInt(N); |
| 713 | int i; |
| 714 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 715 | ActivityManager.RunningServiceInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 716 | info.writeToParcel(reply, 0); |
| 717 | } |
| 718 | return true; |
| 719 | } |
| 720 | |
| 721 | case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: { |
| 722 | data.enforceInterface(IActivityManager.descriptor); |
| 723 | List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState(); |
| 724 | reply.writeNoException(); |
| 725 | reply.writeTypedList(list); |
| 726 | return true; |
| 727 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 728 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 729 | case GET_RUNNING_APP_PROCESSES_TRANSACTION: { |
| 730 | data.enforceInterface(IActivityManager.descriptor); |
| 731 | List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses(); |
| 732 | reply.writeNoException(); |
| 733 | reply.writeTypedList(list); |
| 734 | return true; |
| 735 | } |
| 736 | |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 737 | case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: { |
| 738 | data.enforceInterface(IActivityManager.descriptor); |
| 739 | List<ApplicationInfo> list = getRunningExternalApplications(); |
| 740 | reply.writeNoException(); |
| 741 | reply.writeTypedList(list); |
| 742 | return true; |
| 743 | } |
| 744 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 745 | case MOVE_TASK_TO_FRONT_TRANSACTION: { |
| 746 | data.enforceInterface(IActivityManager.descriptor); |
| 747 | int task = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 748 | int fl = data.readInt(); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 749 | Bundle options = data.readInt() != 0 |
| 750 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 751 | moveTaskToFront(task, fl, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 752 | reply.writeNoException(); |
| 753 | return true; |
| 754 | } |
| 755 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 756 | case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: { |
| 757 | data.enforceInterface(IActivityManager.descriptor); |
| 758 | IBinder token = data.readStrongBinder(); |
| 759 | boolean nonRoot = data.readInt() != 0; |
| 760 | boolean res = moveActivityTaskToBack(token, nonRoot); |
| 761 | reply.writeNoException(); |
| 762 | reply.writeInt(res ? 1 : 0); |
| 763 | return true; |
| 764 | } |
| 765 | |
| 766 | case MOVE_TASK_BACKWARDS_TRANSACTION: { |
| 767 | data.enforceInterface(IActivityManager.descriptor); |
| 768 | int task = data.readInt(); |
| 769 | moveTaskBackwards(task); |
| 770 | reply.writeNoException(); |
| 771 | return true; |
| 772 | } |
| 773 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 774 | case MOVE_TASK_TO_STACK_TRANSACTION: { |
| 775 | data.enforceInterface(IActivityManager.descriptor); |
| 776 | int taskId = data.readInt(); |
| 777 | int stackId = data.readInt(); |
| 778 | boolean toTop = data.readInt() != 0; |
| 779 | moveTaskToStack(taskId, stackId, toTop); |
| 780 | reply.writeNoException(); |
| 781 | return true; |
| 782 | } |
| 783 | |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 784 | case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: { |
| 785 | data.enforceInterface(IActivityManager.descriptor); |
| 786 | int taskId = data.readInt(); |
| 787 | int createMode = data.readInt(); |
| 788 | boolean toTop = data.readInt() != 0; |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 789 | boolean animate = data.readInt() != 0; |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 790 | Rect bounds = null; |
| 791 | boolean hasBounds = data.readInt() != 0; |
| 792 | if (hasBounds) { |
| 793 | bounds = Rect.CREATOR.createFromParcel(data); |
| 794 | } |
| 795 | moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 796 | reply.writeNoException(); |
| 797 | return true; |
| 798 | } |
| 799 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 800 | case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: { |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 801 | data.enforceInterface(IActivityManager.descriptor); |
| 802 | final int stackId = data.readInt(); |
| 803 | final Rect r = Rect.CREATOR.createFromParcel(data); |
| 804 | final boolean res = moveTopActivityToPinnedStack(stackId, r); |
| 805 | reply.writeNoException(); |
| 806 | reply.writeInt(res ? 1 : 0); |
| 807 | return true; |
| 808 | } |
| 809 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 810 | case RESIZE_STACK_TRANSACTION: { |
| 811 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 812 | final int stackId = data.readInt(); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 813 | final boolean hasRect = data.readInt() != 0; |
| 814 | Rect r = null; |
| 815 | if (hasRect) { |
| 816 | r = Rect.CREATOR.createFromParcel(data); |
| 817 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 818 | final boolean allowResizeInDockedMode = data.readInt() == 1; |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 819 | final boolean preserveWindows = data.readInt() == 1; |
| 820 | final boolean animate = data.readInt() == 1; |
| 821 | resizeStack(stackId, r, allowResizeInDockedMode, preserveWindows, animate); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 822 | reply.writeNoException(); |
| 823 | return true; |
| 824 | } |
| 825 | |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 826 | case RESIZE_DOCKED_STACK_TRANSACTION: { |
| 827 | data.enforceInterface(IActivityManager.descriptor); |
| 828 | final boolean hasBounds = data.readInt() != 0; |
| 829 | Rect bounds = null; |
| 830 | if (hasBounds) { |
| 831 | bounds = Rect.CREATOR.createFromParcel(data); |
| 832 | } |
| 833 | final boolean hasTempDockedTaskBounds = data.readInt() != 0; |
| 834 | Rect tempDockedTaskBounds = null; |
| 835 | if (hasTempDockedTaskBounds) { |
| 836 | tempDockedTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 837 | } |
| 838 | final boolean hasTempDockedTaskInsetBounds = data.readInt() != 0; |
| 839 | Rect tempDockedTaskInsetBounds = null; |
| 840 | if (hasTempDockedTaskInsetBounds) { |
| 841 | tempDockedTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 842 | } |
| 843 | final boolean hasTempOtherTaskBounds = data.readInt() != 0; |
| 844 | Rect tempOtherTaskBounds = null; |
| 845 | if (hasTempOtherTaskBounds) { |
| 846 | tempOtherTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 847 | } |
| 848 | final boolean hasTempOtherTaskInsetBounds = data.readInt() != 0; |
| 849 | Rect tempOtherTaskInsetBounds = null; |
| 850 | if (hasTempOtherTaskInsetBounds) { |
| 851 | tempOtherTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 852 | } |
| 853 | resizeDockedStack(bounds, tempDockedTaskBounds, tempDockedTaskInsetBounds, |
| 854 | tempOtherTaskBounds, tempOtherTaskInsetBounds); |
| 855 | reply.writeNoException(); |
| 856 | return true; |
| 857 | } |
| 858 | |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 859 | case POSITION_TASK_IN_STACK_TRANSACTION: { |
| 860 | data.enforceInterface(IActivityManager.descriptor); |
| 861 | int taskId = data.readInt(); |
| 862 | int stackId = data.readInt(); |
| 863 | int position = data.readInt(); |
| 864 | positionTaskInStack(taskId, stackId, position); |
| 865 | reply.writeNoException(); |
| 866 | return true; |
| 867 | } |
| 868 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 869 | case GET_ALL_STACK_INFOS_TRANSACTION: { |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 870 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 871 | List<StackInfo> list = getAllStackInfos(); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 872 | reply.writeNoException(); |
| 873 | reply.writeTypedList(list); |
| 874 | return true; |
| 875 | } |
| 876 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 877 | case GET_STACK_INFO_TRANSACTION: { |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 878 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 879 | int stackId = data.readInt(); |
| 880 | StackInfo info = getStackInfo(stackId); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 881 | reply.writeNoException(); |
| 882 | if (info != null) { |
| 883 | reply.writeInt(1); |
| 884 | info.writeToParcel(reply, 0); |
| 885 | } else { |
| 886 | reply.writeInt(0); |
| 887 | } |
| 888 | return true; |
| 889 | } |
| 890 | |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 891 | case IS_IN_HOME_STACK_TRANSACTION: { |
| 892 | data.enforceInterface(IActivityManager.descriptor); |
| 893 | int taskId = data.readInt(); |
| 894 | boolean isInHomeStack = isInHomeStack(taskId); |
| 895 | reply.writeNoException(); |
| 896 | reply.writeInt(isInHomeStack ? 1 : 0); |
| 897 | return true; |
| 898 | } |
| 899 | |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 900 | case SET_FOCUSED_STACK_TRANSACTION: { |
| 901 | data.enforceInterface(IActivityManager.descriptor); |
| 902 | int stackId = data.readInt(); |
| 903 | setFocusedStack(stackId); |
| 904 | reply.writeNoException(); |
| 905 | return true; |
| 906 | } |
| 907 | |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 908 | case GET_FOCUSED_STACK_ID_TRANSACTION: { |
| 909 | data.enforceInterface(IActivityManager.descriptor); |
| 910 | int focusedStackId = getFocusedStackId(); |
| 911 | reply.writeNoException(); |
| 912 | reply.writeInt(focusedStackId); |
| 913 | return true; |
| 914 | } |
| 915 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 916 | case SET_FOCUSED_TASK_TRANSACTION: { |
| 917 | data.enforceInterface(IActivityManager.descriptor); |
| 918 | int taskId = data.readInt(); |
Skuhne | f36bb0c | 2015-08-26 14:26:17 -0700 | [diff] [blame] | 919 | setFocusedTask(taskId); |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 920 | reply.writeNoException(); |
| 921 | return true; |
| 922 | } |
| 923 | |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 924 | case REGISTER_TASK_STACK_LISTENER_TRANSACTION: { |
| 925 | data.enforceInterface(IActivityManager.descriptor); |
| 926 | IBinder token = data.readStrongBinder(); |
| 927 | registerTaskStackListener(ITaskStackListener.Stub.asInterface(token)); |
| 928 | reply.writeNoException(); |
| 929 | return true; |
| 930 | } |
| 931 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 932 | case GET_TASK_FOR_ACTIVITY_TRANSACTION: { |
| 933 | data.enforceInterface(IActivityManager.descriptor); |
| 934 | IBinder token = data.readStrongBinder(); |
| 935 | boolean onlyRoot = data.readInt() != 0; |
| 936 | int res = token != null |
| 937 | ? getTaskForActivity(token, onlyRoot) : -1; |
| 938 | reply.writeNoException(); |
| 939 | reply.writeInt(res); |
| 940 | return true; |
| 941 | } |
| 942 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 943 | case GET_CONTENT_PROVIDER_TRANSACTION: { |
| 944 | data.enforceInterface(IActivityManager.descriptor); |
| 945 | IBinder b = data.readStrongBinder(); |
| 946 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 947 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 948 | int userId = data.readInt(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 949 | boolean stable = data.readInt() != 0; |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 950 | ContentProviderHolder cph = getContentProvider(app, name, userId, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 951 | reply.writeNoException(); |
| 952 | if (cph != null) { |
| 953 | reply.writeInt(1); |
| 954 | cph.writeToParcel(reply, 0); |
| 955 | } else { |
| 956 | reply.writeInt(0); |
| 957 | } |
| 958 | return true; |
| 959 | } |
| 960 | |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 961 | case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 962 | data.enforceInterface(IActivityManager.descriptor); |
| 963 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 964 | int userId = data.readInt(); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 965 | IBinder token = data.readStrongBinder(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 966 | ContentProviderHolder cph = getContentProviderExternal(name, userId, token); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 967 | reply.writeNoException(); |
| 968 | if (cph != null) { |
| 969 | reply.writeInt(1); |
| 970 | cph.writeToParcel(reply, 0); |
| 971 | } else { |
| 972 | reply.writeInt(0); |
| 973 | } |
| 974 | return true; |
| 975 | } |
| 976 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 977 | case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: { |
| 978 | data.enforceInterface(IActivityManager.descriptor); |
| 979 | IBinder b = data.readStrongBinder(); |
| 980 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 981 | ArrayList<ContentProviderHolder> providers = |
| 982 | data.createTypedArrayList(ContentProviderHolder.CREATOR); |
| 983 | publishContentProviders(app, providers); |
| 984 | reply.writeNoException(); |
| 985 | return true; |
| 986 | } |
| 987 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 988 | case REF_CONTENT_PROVIDER_TRANSACTION: { |
| 989 | data.enforceInterface(IActivityManager.descriptor); |
| 990 | IBinder b = data.readStrongBinder(); |
| 991 | int stable = data.readInt(); |
| 992 | int unstable = data.readInt(); |
| 993 | boolean res = refContentProvider(b, stable, unstable); |
| 994 | reply.writeNoException(); |
| 995 | reply.writeInt(res ? 1 : 0); |
| 996 | return true; |
| 997 | } |
| 998 | |
| 999 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: { |
| 1000 | data.enforceInterface(IActivityManager.descriptor); |
| 1001 | IBinder b = data.readStrongBinder(); |
| 1002 | unstableProviderDied(b); |
| 1003 | reply.writeNoException(); |
| 1004 | return true; |
| 1005 | } |
| 1006 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 1007 | case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: { |
| 1008 | data.enforceInterface(IActivityManager.descriptor); |
| 1009 | IBinder b = data.readStrongBinder(); |
| 1010 | appNotRespondingViaProvider(b); |
| 1011 | reply.writeNoException(); |
| 1012 | return true; |
| 1013 | } |
| 1014 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1015 | case REMOVE_CONTENT_PROVIDER_TRANSACTION: { |
| 1016 | data.enforceInterface(IActivityManager.descriptor); |
| 1017 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1018 | boolean stable = data.readInt() != 0; |
| 1019 | removeContentProvider(b, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1020 | reply.writeNoException(); |
| 1021 | return true; |
| 1022 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 1023 | |
| 1024 | case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 1025 | data.enforceInterface(IActivityManager.descriptor); |
| 1026 | String name = data.readString(); |
| 1027 | IBinder token = data.readStrongBinder(); |
| 1028 | removeContentProviderExternal(name, token); |
| 1029 | reply.writeNoException(); |
| 1030 | return true; |
| 1031 | } |
| 1032 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 1033 | case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: { |
| 1034 | data.enforceInterface(IActivityManager.descriptor); |
| 1035 | ComponentName comp = ComponentName.CREATOR.createFromParcel(data); |
| 1036 | PendingIntent pi = getRunningServiceControlPanel(comp); |
| 1037 | reply.writeNoException(); |
| 1038 | PendingIntent.writePendingIntentOrNullToParcel(pi, reply); |
| 1039 | return true; |
| 1040 | } |
| 1041 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1042 | case START_SERVICE_TRANSACTION: { |
| 1043 | data.enforceInterface(IActivityManager.descriptor); |
| 1044 | IBinder b = data.readStrongBinder(); |
| 1045 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1046 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1047 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1048 | String callingPackage = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1049 | int userId = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1050 | ComponentName cn = startService(app, service, resolvedType, callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1051 | reply.writeNoException(); |
| 1052 | ComponentName.writeToParcel(cn, reply); |
| 1053 | return true; |
| 1054 | } |
| 1055 | |
| 1056 | case STOP_SERVICE_TRANSACTION: { |
| 1057 | data.enforceInterface(IActivityManager.descriptor); |
| 1058 | IBinder b = data.readStrongBinder(); |
| 1059 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1060 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1061 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1062 | int userId = data.readInt(); |
| 1063 | int res = stopService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1064 | reply.writeNoException(); |
| 1065 | reply.writeInt(res); |
| 1066 | return true; |
| 1067 | } |
| 1068 | |
| 1069 | case STOP_SERVICE_TOKEN_TRANSACTION: { |
| 1070 | data.enforceInterface(IActivityManager.descriptor); |
| 1071 | ComponentName className = ComponentName.readFromParcel(data); |
| 1072 | IBinder token = data.readStrongBinder(); |
| 1073 | int startId = data.readInt(); |
| 1074 | boolean res = stopServiceToken(className, token, startId); |
| 1075 | reply.writeNoException(); |
| 1076 | reply.writeInt(res ? 1 : 0); |
| 1077 | return true; |
| 1078 | } |
| 1079 | |
| 1080 | case SET_SERVICE_FOREGROUND_TRANSACTION: { |
| 1081 | data.enforceInterface(IActivityManager.descriptor); |
| 1082 | ComponentName className = ComponentName.readFromParcel(data); |
| 1083 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 1084 | int id = data.readInt(); |
| 1085 | Notification notification = null; |
| 1086 | if (data.readInt() != 0) { |
| 1087 | notification = Notification.CREATOR.createFromParcel(data); |
| 1088 | } |
| 1089 | boolean removeNotification = data.readInt() != 0; |
| 1090 | setServiceForeground(className, token, id, notification, removeNotification); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1091 | reply.writeNoException(); |
| 1092 | return true; |
| 1093 | } |
| 1094 | |
| 1095 | case BIND_SERVICE_TRANSACTION: { |
| 1096 | data.enforceInterface(IActivityManager.descriptor); |
| 1097 | IBinder b = data.readStrongBinder(); |
| 1098 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1099 | IBinder token = data.readStrongBinder(); |
| 1100 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1101 | String resolvedType = data.readString(); |
| 1102 | b = data.readStrongBinder(); |
| 1103 | int fl = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1104 | String callingPackage = data.readString(); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 1105 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1106 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1107 | int res = bindService(app, token, service, resolvedType, conn, fl, |
| 1108 | callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1109 | reply.writeNoException(); |
| 1110 | reply.writeInt(res); |
| 1111 | return true; |
| 1112 | } |
| 1113 | |
| 1114 | case UNBIND_SERVICE_TRANSACTION: { |
| 1115 | data.enforceInterface(IActivityManager.descriptor); |
| 1116 | IBinder b = data.readStrongBinder(); |
| 1117 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
| 1118 | boolean res = unbindService(conn); |
| 1119 | reply.writeNoException(); |
| 1120 | reply.writeInt(res ? 1 : 0); |
| 1121 | return true; |
| 1122 | } |
| 1123 | |
| 1124 | case PUBLISH_SERVICE_TRANSACTION: { |
| 1125 | data.enforceInterface(IActivityManager.descriptor); |
| 1126 | IBinder token = data.readStrongBinder(); |
| 1127 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1128 | IBinder service = data.readStrongBinder(); |
| 1129 | publishService(token, intent, service); |
| 1130 | reply.writeNoException(); |
| 1131 | return true; |
| 1132 | } |
| 1133 | |
| 1134 | case UNBIND_FINISHED_TRANSACTION: { |
| 1135 | data.enforceInterface(IActivityManager.descriptor); |
| 1136 | IBinder token = data.readStrongBinder(); |
| 1137 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1138 | boolean doRebind = data.readInt() != 0; |
| 1139 | unbindFinished(token, intent, doRebind); |
| 1140 | reply.writeNoException(); |
| 1141 | return true; |
| 1142 | } |
| 1143 | |
| 1144 | case SERVICE_DONE_EXECUTING_TRANSACTION: { |
| 1145 | data.enforceInterface(IActivityManager.descriptor); |
| 1146 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 1147 | int type = data.readInt(); |
| 1148 | int startId = data.readInt(); |
| 1149 | int res = data.readInt(); |
| 1150 | serviceDoneExecuting(token, type, startId, res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1151 | reply.writeNoException(); |
| 1152 | return true; |
| 1153 | } |
| 1154 | |
| 1155 | case START_INSTRUMENTATION_TRANSACTION: { |
| 1156 | data.enforceInterface(IActivityManager.descriptor); |
| 1157 | ComponentName className = ComponentName.readFromParcel(data); |
| 1158 | String profileFile = data.readString(); |
| 1159 | int fl = data.readInt(); |
| 1160 | Bundle arguments = data.readBundle(); |
| 1161 | IBinder b = data.readStrongBinder(); |
| 1162 | IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 1163 | b = data.readStrongBinder(); |
| 1164 | IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1165 | int userId = data.readInt(); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 1166 | String abiOverride = data.readString(); |
| 1167 | boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId, |
| 1168 | abiOverride); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1169 | reply.writeNoException(); |
| 1170 | reply.writeInt(res ? 1 : 0); |
| 1171 | return true; |
| 1172 | } |
| 1173 | |
| 1174 | |
| 1175 | case FINISH_INSTRUMENTATION_TRANSACTION: { |
| 1176 | data.enforceInterface(IActivityManager.descriptor); |
| 1177 | IBinder b = data.readStrongBinder(); |
| 1178 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1179 | int resultCode = data.readInt(); |
| 1180 | Bundle results = data.readBundle(); |
| 1181 | finishInstrumentation(app, resultCode, results); |
| 1182 | reply.writeNoException(); |
| 1183 | return true; |
| 1184 | } |
| 1185 | |
| 1186 | case GET_CONFIGURATION_TRANSACTION: { |
| 1187 | data.enforceInterface(IActivityManager.descriptor); |
| 1188 | Configuration config = getConfiguration(); |
| 1189 | reply.writeNoException(); |
| 1190 | config.writeToParcel(reply, 0); |
| 1191 | return true; |
| 1192 | } |
| 1193 | |
| 1194 | case UPDATE_CONFIGURATION_TRANSACTION: { |
| 1195 | data.enforceInterface(IActivityManager.descriptor); |
| 1196 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 1197 | updateConfiguration(config); |
| 1198 | reply.writeNoException(); |
| 1199 | return true; |
| 1200 | } |
| 1201 | |
| 1202 | case SET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1203 | data.enforceInterface(IActivityManager.descriptor); |
| 1204 | IBinder token = data.readStrongBinder(); |
| 1205 | int requestedOrientation = data.readInt(); |
| 1206 | setRequestedOrientation(token, requestedOrientation); |
| 1207 | reply.writeNoException(); |
| 1208 | return true; |
| 1209 | } |
| 1210 | |
| 1211 | case GET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1212 | data.enforceInterface(IActivityManager.descriptor); |
| 1213 | IBinder token = data.readStrongBinder(); |
| 1214 | int req = getRequestedOrientation(token); |
| 1215 | reply.writeNoException(); |
| 1216 | reply.writeInt(req); |
| 1217 | return true; |
| 1218 | } |
| 1219 | |
| 1220 | case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: { |
| 1221 | data.enforceInterface(IActivityManager.descriptor); |
| 1222 | IBinder token = data.readStrongBinder(); |
| 1223 | ComponentName cn = getActivityClassForToken(token); |
| 1224 | reply.writeNoException(); |
| 1225 | ComponentName.writeToParcel(cn, reply); |
| 1226 | return true; |
| 1227 | } |
| 1228 | |
| 1229 | case GET_PACKAGE_FOR_TOKEN_TRANSACTION: { |
| 1230 | data.enforceInterface(IActivityManager.descriptor); |
| 1231 | IBinder token = data.readStrongBinder(); |
| 1232 | reply.writeNoException(); |
| 1233 | reply.writeString(getPackageForToken(token)); |
| 1234 | return true; |
| 1235 | } |
| 1236 | |
| 1237 | case GET_INTENT_SENDER_TRANSACTION: { |
| 1238 | data.enforceInterface(IActivityManager.descriptor); |
| 1239 | int type = data.readInt(); |
| 1240 | String packageName = data.readString(); |
| 1241 | IBinder token = data.readStrongBinder(); |
| 1242 | String resultWho = data.readString(); |
| 1243 | int requestCode = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1244 | Intent[] requestIntents; |
| 1245 | String[] requestResolvedTypes; |
| 1246 | if (data.readInt() != 0) { |
| 1247 | requestIntents = data.createTypedArray(Intent.CREATOR); |
| 1248 | requestResolvedTypes = data.createStringArray(); |
| 1249 | } else { |
| 1250 | requestIntents = null; |
| 1251 | requestResolvedTypes = null; |
| 1252 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1253 | int fl = data.readInt(); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 1254 | Bundle options = data.readInt() != 0 |
| 1255 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1256 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1257 | IIntentSender res = getIntentSender(type, packageName, token, |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1258 | resultWho, requestCode, requestIntents, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1259 | requestResolvedTypes, fl, options, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1260 | reply.writeNoException(); |
| 1261 | reply.writeStrongBinder(res != null ? res.asBinder() : null); |
| 1262 | return true; |
| 1263 | } |
| 1264 | |
| 1265 | case CANCEL_INTENT_SENDER_TRANSACTION: { |
| 1266 | data.enforceInterface(IActivityManager.descriptor); |
| 1267 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1268 | data.readStrongBinder()); |
| 1269 | cancelIntentSender(r); |
| 1270 | reply.writeNoException(); |
| 1271 | return true; |
| 1272 | } |
| 1273 | |
| 1274 | case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: { |
| 1275 | data.enforceInterface(IActivityManager.descriptor); |
| 1276 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1277 | data.readStrongBinder()); |
| 1278 | String res = getPackageForIntentSender(r); |
| 1279 | reply.writeNoException(); |
| 1280 | reply.writeString(res); |
| 1281 | return true; |
| 1282 | } |
| 1283 | |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 1284 | case GET_UID_FOR_INTENT_SENDER_TRANSACTION: { |
| 1285 | data.enforceInterface(IActivityManager.descriptor); |
| 1286 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1287 | data.readStrongBinder()); |
| 1288 | int res = getUidForIntentSender(r); |
| 1289 | reply.writeNoException(); |
| 1290 | reply.writeInt(res); |
| 1291 | return true; |
| 1292 | } |
| 1293 | |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1294 | case HANDLE_INCOMING_USER_TRANSACTION: { |
| 1295 | data.enforceInterface(IActivityManager.descriptor); |
| 1296 | int callingPid = data.readInt(); |
| 1297 | int callingUid = data.readInt(); |
| 1298 | int userId = data.readInt(); |
| 1299 | boolean allowAll = data.readInt() != 0 ; |
| 1300 | boolean requireFull = data.readInt() != 0; |
| 1301 | String name = data.readString(); |
| 1302 | String callerPackage = data.readString(); |
| 1303 | int res = handleIncomingUser(callingPid, callingUid, userId, allowAll, |
| 1304 | requireFull, name, callerPackage); |
| 1305 | reply.writeNoException(); |
| 1306 | reply.writeInt(res); |
| 1307 | return true; |
| 1308 | } |
| 1309 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1310 | case SET_PROCESS_LIMIT_TRANSACTION: { |
| 1311 | data.enforceInterface(IActivityManager.descriptor); |
| 1312 | int max = data.readInt(); |
| 1313 | setProcessLimit(max); |
| 1314 | reply.writeNoException(); |
| 1315 | return true; |
| 1316 | } |
| 1317 | |
| 1318 | case GET_PROCESS_LIMIT_TRANSACTION: { |
| 1319 | data.enforceInterface(IActivityManager.descriptor); |
| 1320 | int limit = getProcessLimit(); |
| 1321 | reply.writeNoException(); |
| 1322 | reply.writeInt(limit); |
| 1323 | return true; |
| 1324 | } |
| 1325 | |
| 1326 | case SET_PROCESS_FOREGROUND_TRANSACTION: { |
| 1327 | data.enforceInterface(IActivityManager.descriptor); |
| 1328 | IBinder token = data.readStrongBinder(); |
| 1329 | int pid = data.readInt(); |
| 1330 | boolean isForeground = data.readInt() != 0; |
| 1331 | setProcessForeground(token, pid, isForeground); |
| 1332 | reply.writeNoException(); |
| 1333 | return true; |
| 1334 | } |
| 1335 | |
| 1336 | case CHECK_PERMISSION_TRANSACTION: { |
| 1337 | data.enforceInterface(IActivityManager.descriptor); |
| 1338 | String perm = data.readString(); |
| 1339 | int pid = data.readInt(); |
| 1340 | int uid = data.readInt(); |
| 1341 | int res = checkPermission(perm, pid, uid); |
| 1342 | reply.writeNoException(); |
| 1343 | reply.writeInt(res); |
| 1344 | return true; |
| 1345 | } |
| 1346 | |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1347 | case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: { |
| 1348 | data.enforceInterface(IActivityManager.descriptor); |
| 1349 | String perm = data.readString(); |
| 1350 | int pid = data.readInt(); |
| 1351 | int uid = data.readInt(); |
| 1352 | IBinder token = data.readStrongBinder(); |
| 1353 | int res = checkPermissionWithToken(perm, pid, uid, token); |
| 1354 | reply.writeNoException(); |
| 1355 | reply.writeInt(res); |
| 1356 | return true; |
| 1357 | } |
| 1358 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1359 | case CHECK_URI_PERMISSION_TRANSACTION: { |
| 1360 | data.enforceInterface(IActivityManager.descriptor); |
| 1361 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1362 | int pid = data.readInt(); |
| 1363 | int uid = data.readInt(); |
| 1364 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1365 | int userId = data.readInt(); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1366 | IBinder callerToken = data.readStrongBinder(); |
| 1367 | int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1368 | reply.writeNoException(); |
| 1369 | reply.writeInt(res); |
| 1370 | return true; |
| 1371 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1372 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1373 | case CLEAR_APP_DATA_TRANSACTION: { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1374 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1375 | String packageName = data.readString(); |
| 1376 | IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface( |
| 1377 | data.readStrongBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 1378 | int userId = data.readInt(); |
| 1379 | boolean res = clearApplicationUserData(packageName, observer, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1380 | reply.writeNoException(); |
| 1381 | reply.writeInt(res ? 1 : 0); |
| 1382 | return true; |
| 1383 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1384 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1385 | case GRANT_URI_PERMISSION_TRANSACTION: { |
| 1386 | data.enforceInterface(IActivityManager.descriptor); |
| 1387 | IBinder b = data.readStrongBinder(); |
| 1388 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1389 | String targetPkg = data.readString(); |
| 1390 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1391 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1392 | int userId = data.readInt(); |
| 1393 | grantUriPermission(app, targetPkg, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1394 | reply.writeNoException(); |
| 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 REVOKE_URI_PERMISSION_TRANSACTION: { |
| 1399 | data.enforceInterface(IActivityManager.descriptor); |
| 1400 | IBinder b = data.readStrongBinder(); |
| 1401 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1402 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1403 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1404 | int userId = data.readInt(); |
| 1405 | revokeUriPermission(app, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1406 | reply.writeNoException(); |
| 1407 | return true; |
| 1408 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1409 | |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1410 | case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1411 | data.enforceInterface(IActivityManager.descriptor); |
| 1412 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1413 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1414 | int userId = data.readInt(); |
| 1415 | takePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1416 | reply.writeNoException(); |
| 1417 | return true; |
| 1418 | } |
| 1419 | |
| 1420 | case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1421 | data.enforceInterface(IActivityManager.descriptor); |
| 1422 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1423 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1424 | int userId = data.readInt(); |
| 1425 | releasePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1426 | reply.writeNoException(); |
| 1427 | return true; |
| 1428 | } |
| 1429 | |
| 1430 | case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: { |
| 1431 | data.enforceInterface(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 1432 | final String packageName = data.readString(); |
| 1433 | final boolean incoming = data.readInt() != 0; |
| 1434 | final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions( |
| 1435 | packageName, incoming); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1436 | reply.writeNoException(); |
| 1437 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1438 | return true; |
| 1439 | } |
| 1440 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 1441 | case GET_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1442 | data.enforceInterface(IActivityManager.descriptor); |
| 1443 | final String packageName = data.readString(); |
| 1444 | final int userId = data.readInt(); |
| 1445 | final ParceledListSlice<UriPermission> perms = getGrantedUriPermissions(packageName, |
| 1446 | userId); |
| 1447 | reply.writeNoException(); |
| 1448 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1449 | return true; |
| 1450 | } |
| 1451 | |
| 1452 | case CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1453 | data.enforceInterface(IActivityManager.descriptor); |
| 1454 | final String packageName = data.readString(); |
| 1455 | final int userId = data.readInt(); |
| 1456 | clearGrantedUriPermissions(packageName, userId); |
| 1457 | reply.writeNoException(); |
| 1458 | return true; |
| 1459 | } |
| 1460 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1461 | case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: { |
| 1462 | data.enforceInterface(IActivityManager.descriptor); |
| 1463 | IBinder b = data.readStrongBinder(); |
| 1464 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1465 | boolean waiting = data.readInt() != 0; |
| 1466 | showWaitingForDebugger(app, waiting); |
| 1467 | reply.writeNoException(); |
| 1468 | return true; |
| 1469 | } |
| 1470 | |
| 1471 | case GET_MEMORY_INFO_TRANSACTION: { |
| 1472 | data.enforceInterface(IActivityManager.descriptor); |
| 1473 | ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); |
| 1474 | getMemoryInfo(mi); |
| 1475 | reply.writeNoException(); |
| 1476 | mi.writeToParcel(reply, 0); |
| 1477 | return true; |
| 1478 | } |
| 1479 | |
| 1480 | case UNHANDLED_BACK_TRANSACTION: { |
| 1481 | data.enforceInterface(IActivityManager.descriptor); |
| 1482 | unhandledBack(); |
| 1483 | reply.writeNoException(); |
| 1484 | return true; |
| 1485 | } |
| 1486 | |
| 1487 | case OPEN_CONTENT_URI_TRANSACTION: { |
| 1488 | data.enforceInterface(IActivityManager.descriptor); |
| 1489 | Uri uri = Uri.parse(data.readString()); |
| 1490 | ParcelFileDescriptor pfd = openContentUri(uri); |
| 1491 | reply.writeNoException(); |
| 1492 | if (pfd != null) { |
| 1493 | reply.writeInt(1); |
| 1494 | pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1495 | } else { |
| 1496 | reply.writeInt(0); |
| 1497 | } |
| 1498 | return true; |
| 1499 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1500 | |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1501 | case SET_LOCK_SCREEN_SHOWN_TRANSACTION: { |
| 1502 | data.enforceInterface(IActivityManager.descriptor); |
| 1503 | setLockScreenShown(data.readInt() != 0); |
| 1504 | reply.writeNoException(); |
| 1505 | return true; |
| 1506 | } |
| 1507 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1508 | case SET_DEBUG_APP_TRANSACTION: { |
| 1509 | data.enforceInterface(IActivityManager.descriptor); |
| 1510 | String pn = data.readString(); |
| 1511 | boolean wfd = data.readInt() != 0; |
| 1512 | boolean per = data.readInt() != 0; |
| 1513 | setDebugApp(pn, wfd, per); |
| 1514 | reply.writeNoException(); |
| 1515 | return true; |
| 1516 | } |
| 1517 | |
| 1518 | case SET_ALWAYS_FINISH_TRANSACTION: { |
| 1519 | data.enforceInterface(IActivityManager.descriptor); |
| 1520 | boolean enabled = data.readInt() != 0; |
| 1521 | setAlwaysFinish(enabled); |
| 1522 | reply.writeNoException(); |
| 1523 | return true; |
| 1524 | } |
| 1525 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1526 | case SET_ACTIVITY_CONTROLLER_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1527 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1528 | IActivityController watcher = IActivityController.Stub.asInterface( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1529 | data.readStrongBinder()); |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 1530 | boolean imAMonkey = data.readInt() != 0; |
| 1531 | setActivityController(watcher, imAMonkey); |
Sungmin Choi | cdb86bb | 2012-12-20 14:08:59 +0900 | [diff] [blame] | 1532 | reply.writeNoException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1533 | return true; |
| 1534 | } |
| 1535 | |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 1536 | case SET_LENIENT_BACKGROUND_CHECK_TRANSACTION: { |
| 1537 | data.enforceInterface(IActivityManager.descriptor); |
| 1538 | boolean enabled = data.readInt() != 0; |
| 1539 | setLenientBackgroundCheck(enabled); |
| 1540 | reply.writeNoException(); |
| 1541 | return true; |
| 1542 | } |
| 1543 | |
Dianne Hackborn | 970510b | 2016-02-24 16:56:42 -0800 | [diff] [blame] | 1544 | case GET_MEMORY_TRIM_LEVEL_TRANSACTION: { |
| 1545 | data.enforceInterface(IActivityManager.descriptor); |
| 1546 | int level = getMemoryTrimLevel(); |
| 1547 | reply.writeNoException(); |
| 1548 | reply.writeInt(level); |
| 1549 | return true; |
| 1550 | } |
| 1551 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1552 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1553 | data.enforceInterface(IActivityManager.descriptor); |
| 1554 | enterSafeMode(); |
| 1555 | reply.writeNoException(); |
| 1556 | return true; |
| 1557 | } |
| 1558 | |
| 1559 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1560 | data.enforceInterface(IActivityManager.descriptor); |
| 1561 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1562 | data.readStrongBinder()); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 1563 | int sourceUid = data.readInt(); |
| 1564 | String sourcePkg = data.readString(); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 1565 | String tag = data.readString(); |
| 1566 | noteWakeupAlarm(is, sourceUid, sourcePkg, tag); |
| 1567 | reply.writeNoException(); |
| 1568 | return true; |
| 1569 | } |
| 1570 | |
| 1571 | case NOTE_ALARM_START_TRANSACTION: { |
| 1572 | data.enforceInterface(IActivityManager.descriptor); |
| 1573 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1574 | data.readStrongBinder()); |
| 1575 | int sourceUid = data.readInt(); |
| 1576 | String tag = data.readString(); |
| 1577 | noteAlarmStart(is, sourceUid, tag); |
| 1578 | reply.writeNoException(); |
| 1579 | return true; |
| 1580 | } |
| 1581 | |
| 1582 | case NOTE_ALARM_FINISH_TRANSACTION: { |
| 1583 | data.enforceInterface(IActivityManager.descriptor); |
| 1584 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1585 | data.readStrongBinder()); |
| 1586 | int sourceUid = data.readInt(); |
| 1587 | String tag = data.readString(); |
| 1588 | noteAlarmFinish(is, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1589 | reply.writeNoException(); |
| 1590 | return true; |
| 1591 | } |
| 1592 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1593 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1594 | data.enforceInterface(IActivityManager.descriptor); |
| 1595 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1596 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1597 | boolean secure = data.readInt() != 0; |
| 1598 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1599 | reply.writeNoException(); |
| 1600 | reply.writeInt(res ? 1 : 0); |
| 1601 | return true; |
| 1602 | } |
| 1603 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1604 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1605 | data.enforceInterface(IActivityManager.descriptor); |
| 1606 | String reason = data.readString(); |
| 1607 | boolean res = killProcessesBelowForeground(reason); |
| 1608 | reply.writeNoException(); |
| 1609 | reply.writeInt(res ? 1 : 0); |
| 1610 | return true; |
| 1611 | } |
| 1612 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1613 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1614 | data.enforceInterface(IActivityManager.descriptor); |
| 1615 | IBinder app = data.readStrongBinder(); |
| 1616 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1617 | handleApplicationCrash(app, ci); |
| 1618 | reply.writeNoException(); |
| 1619 | return true; |
| 1620 | } |
| 1621 | |
| 1622 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1623 | data.enforceInterface(IActivityManager.descriptor); |
| 1624 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1625 | String tag = data.readString(); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1626 | boolean system = data.readInt() != 0; |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1627 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1628 | boolean res = handleApplicationWtf(app, tag, system, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1629 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1630 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1631 | return true; |
| 1632 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1633 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1634 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1635 | data.enforceInterface(IActivityManager.descriptor); |
| 1636 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1637 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1638 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1639 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1640 | reply.writeNoException(); |
| 1641 | return true; |
| 1642 | } |
| 1643 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1644 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1645 | data.enforceInterface(IActivityManager.descriptor); |
| 1646 | int sig = data.readInt(); |
| 1647 | signalPersistentProcesses(sig); |
| 1648 | reply.writeNoException(); |
| 1649 | return true; |
| 1650 | } |
| 1651 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1652 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1653 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1654 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1655 | int userId = data.readInt(); |
| 1656 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1657 | reply.writeNoException(); |
| 1658 | return true; |
| 1659 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1660 | |
| 1661 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1662 | data.enforceInterface(IActivityManager.descriptor); |
| 1663 | killAllBackgroundProcesses(); |
| 1664 | reply.writeNoException(); |
| 1665 | return true; |
| 1666 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1667 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 1668 | case KILL_PACKAGE_DEPENDENTS_TRANSACTION: { |
| 1669 | data.enforceInterface(IActivityManager.descriptor); |
| 1670 | String packageName = data.readString(); |
| 1671 | int userId = data.readInt(); |
| 1672 | killPackageDependents(packageName, userId); |
| 1673 | reply.writeNoException(); |
| 1674 | return true; |
| 1675 | } |
| 1676 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1677 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1678 | data.enforceInterface(IActivityManager.descriptor); |
| 1679 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1680 | int userId = data.readInt(); |
| 1681 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1682 | reply.writeNoException(); |
| 1683 | return true; |
| 1684 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1685 | |
| 1686 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1687 | data.enforceInterface(IActivityManager.descriptor); |
| 1688 | ActivityManager.RunningAppProcessInfo info = |
| 1689 | new ActivityManager.RunningAppProcessInfo(); |
| 1690 | getMyMemoryState(info); |
| 1691 | reply.writeNoException(); |
| 1692 | info.writeToParcel(reply, 0); |
| 1693 | return true; |
| 1694 | } |
| 1695 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1696 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1697 | data.enforceInterface(IActivityManager.descriptor); |
| 1698 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1699 | reply.writeNoException(); |
| 1700 | config.writeToParcel(reply, 0); |
| 1701 | return true; |
| 1702 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1703 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1704 | case PROFILE_CONTROL_TRANSACTION: { |
| 1705 | data.enforceInterface(IActivityManager.descriptor); |
| 1706 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1707 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1708 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1709 | int profileType = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1710 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 1711 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
| 1712 | boolean res = profileControl(process, userId, start, profilerInfo, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1713 | reply.writeNoException(); |
| 1714 | reply.writeInt(res ? 1 : 0); |
| 1715 | return true; |
| 1716 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1717 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1718 | case SHUTDOWN_TRANSACTION: { |
| 1719 | data.enforceInterface(IActivityManager.descriptor); |
| 1720 | boolean res = shutdown(data.readInt()); |
| 1721 | reply.writeNoException(); |
| 1722 | reply.writeInt(res ? 1 : 0); |
| 1723 | return true; |
| 1724 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1725 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1726 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1727 | data.enforceInterface(IActivityManager.descriptor); |
| 1728 | stopAppSwitches(); |
| 1729 | reply.writeNoException(); |
| 1730 | return true; |
| 1731 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1732 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1733 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1734 | data.enforceInterface(IActivityManager.descriptor); |
| 1735 | resumeAppSwitches(); |
| 1736 | reply.writeNoException(); |
| 1737 | return true; |
| 1738 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1739 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1740 | case PEEK_SERVICE_TRANSACTION: { |
| 1741 | data.enforceInterface(IActivityManager.descriptor); |
| 1742 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1743 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1744 | String callingPackage = data.readString(); |
| 1745 | IBinder binder = peekService(service, resolvedType, callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1746 | reply.writeNoException(); |
| 1747 | reply.writeStrongBinder(binder); |
| 1748 | return true; |
| 1749 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1750 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1751 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1752 | data.enforceInterface(IActivityManager.descriptor); |
| 1753 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1754 | int backupRestoreMode = data.readInt(); |
| 1755 | boolean success = bindBackupAgent(info, backupRestoreMode); |
| 1756 | reply.writeNoException(); |
| 1757 | reply.writeInt(success ? 1 : 0); |
| 1758 | return true; |
| 1759 | } |
| 1760 | |
| 1761 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1762 | data.enforceInterface(IActivityManager.descriptor); |
| 1763 | String packageName = data.readString(); |
| 1764 | IBinder agent = data.readStrongBinder(); |
| 1765 | backupAgentCreated(packageName, agent); |
| 1766 | reply.writeNoException(); |
| 1767 | return true; |
| 1768 | } |
| 1769 | |
| 1770 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1771 | data.enforceInterface(IActivityManager.descriptor); |
| 1772 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1773 | unbindBackupAgent(info); |
| 1774 | reply.writeNoException(); |
| 1775 | return true; |
| 1776 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1777 | |
| 1778 | case ADD_PACKAGE_DEPENDENCY_TRANSACTION: { |
| 1779 | data.enforceInterface(IActivityManager.descriptor); |
| 1780 | String packageName = data.readString(); |
| 1781 | addPackageDependency(packageName); |
| 1782 | reply.writeNoException(); |
| 1783 | return true; |
| 1784 | } |
| 1785 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1786 | case KILL_APPLICATION_WITH_APPID_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1787 | data.enforceInterface(IActivityManager.descriptor); |
| 1788 | String pkg = data.readString(); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1789 | int appid = data.readInt(); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 1790 | String reason = data.readString(); |
| 1791 | killApplicationWithAppId(pkg, appid, reason); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1792 | reply.writeNoException(); |
| 1793 | return true; |
| 1794 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1795 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1796 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1797 | data.enforceInterface(IActivityManager.descriptor); |
| 1798 | String reason = data.readString(); |
| 1799 | closeSystemDialogs(reason); |
| 1800 | reply.writeNoException(); |
| 1801 | return true; |
| 1802 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1803 | |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1804 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1805 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1806 | int[] pids = data.createIntArray(); |
| 1807 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1808 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1809 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1810 | return true; |
| 1811 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1812 | |
| 1813 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1814 | data.enforceInterface(IActivityManager.descriptor); |
| 1815 | String processName = data.readString(); |
| 1816 | int uid = data.readInt(); |
| 1817 | killApplicationProcess(processName, uid); |
| 1818 | reply.writeNoException(); |
| 1819 | return true; |
| 1820 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1821 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1822 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1823 | data.enforceInterface(IActivityManager.descriptor); |
| 1824 | IBinder token = data.readStrongBinder(); |
| 1825 | String packageName = data.readString(); |
| 1826 | int enterAnim = data.readInt(); |
| 1827 | int exitAnim = data.readInt(); |
| 1828 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1829 | reply.writeNoException(); |
| 1830 | return true; |
| 1831 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1832 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1833 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1834 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1835 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1836 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1837 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1838 | return true; |
| 1839 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1840 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1841 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1842 | data.enforceInterface(IActivityManager.descriptor); |
| 1843 | final boolean monkey = (data.readInt() == 1); |
| 1844 | setUserIsMonkey(monkey); |
| 1845 | reply.writeNoException(); |
| 1846 | return true; |
| 1847 | } |
| 1848 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1849 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1850 | data.enforceInterface(IActivityManager.descriptor); |
| 1851 | finishHeavyWeightApp(); |
| 1852 | reply.writeNoException(); |
| 1853 | return true; |
| 1854 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1855 | |
| 1856 | case IS_IMMERSIVE_TRANSACTION: { |
| 1857 | data.enforceInterface(IActivityManager.descriptor); |
| 1858 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1859 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1860 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1861 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1862 | return true; |
| 1863 | } |
| 1864 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 1865 | case IS_TOP_OF_TASK_TRANSACTION: { |
| 1866 | data.enforceInterface(IActivityManager.descriptor); |
| 1867 | IBinder token = data.readStrongBinder(); |
| 1868 | final boolean isTopOfTask = isTopOfTask(token); |
| 1869 | reply.writeNoException(); |
| 1870 | reply.writeInt(isTopOfTask ? 1 : 0); |
| 1871 | return true; |
| 1872 | } |
| 1873 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1874 | case CONVERT_FROM_TRANSLUCENT_TRANSACTION: { |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1875 | data.enforceInterface(IActivityManager.descriptor); |
| 1876 | IBinder token = data.readStrongBinder(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1877 | boolean converted = convertFromTranslucent(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1878 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1879 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1880 | return true; |
| 1881 | } |
| 1882 | |
| 1883 | case CONVERT_TO_TRANSLUCENT_TRANSACTION: { |
| 1884 | data.enforceInterface(IActivityManager.descriptor); |
| 1885 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1886 | final Bundle bundle; |
| 1887 | if (data.readInt() == 0) { |
| 1888 | bundle = null; |
| 1889 | } else { |
| 1890 | bundle = data.readBundle(); |
| 1891 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 1892 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1893 | boolean converted = convertToTranslucent(token, options); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1894 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1895 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1896 | return true; |
| 1897 | } |
| 1898 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1899 | case GET_ACTIVITY_OPTIONS_TRANSACTION: { |
| 1900 | data.enforceInterface(IActivityManager.descriptor); |
| 1901 | IBinder token = data.readStrongBinder(); |
| 1902 | final ActivityOptions options = getActivityOptions(token); |
| 1903 | reply.writeNoException(); |
| 1904 | reply.writeBundle(options == null ? null : options.toBundle()); |
| 1905 | return true; |
| 1906 | } |
| 1907 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1908 | case SET_IMMERSIVE_TRANSACTION: { |
| 1909 | data.enforceInterface(IActivityManager.descriptor); |
| 1910 | IBinder token = data.readStrongBinder(); |
| 1911 | boolean imm = data.readInt() == 1; |
| 1912 | setImmersive(token, imm); |
| 1913 | reply.writeNoException(); |
| 1914 | return true; |
| 1915 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1916 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1917 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1918 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1919 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1920 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1921 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1922 | return true; |
| 1923 | } |
| 1924 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1925 | case CRASH_APPLICATION_TRANSACTION: { |
| 1926 | data.enforceInterface(IActivityManager.descriptor); |
| 1927 | int uid = data.readInt(); |
| 1928 | int initialPid = data.readInt(); |
| 1929 | String packageName = data.readString(); |
| 1930 | String message = data.readString(); |
| 1931 | crashApplication(uid, initialPid, packageName, message); |
| 1932 | reply.writeNoException(); |
| 1933 | return true; |
| 1934 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1935 | |
| 1936 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1937 | data.enforceInterface(IActivityManager.descriptor); |
| 1938 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1939 | int userId = data.readInt(); |
| 1940 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1941 | reply.writeNoException(); |
| 1942 | reply.writeString(type); |
| 1943 | return true; |
| 1944 | } |
| 1945 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1946 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1947 | data.enforceInterface(IActivityManager.descriptor); |
| 1948 | String name = data.readString(); |
| 1949 | IBinder perm = newUriPermissionOwner(name); |
| 1950 | reply.writeNoException(); |
| 1951 | reply.writeStrongBinder(perm); |
| 1952 | return true; |
| 1953 | } |
| 1954 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 1955 | case GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION: { |
| 1956 | data.enforceInterface(IActivityManager.descriptor); |
| 1957 | IBinder activityToken = data.readStrongBinder(); |
| 1958 | IBinder perm = getUriPermissionOwnerForActivity(activityToken); |
| 1959 | reply.writeNoException(); |
| 1960 | reply.writeStrongBinder(perm); |
| 1961 | return true; |
| 1962 | } |
| 1963 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1964 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1965 | data.enforceInterface(IActivityManager.descriptor); |
| 1966 | IBinder owner = data.readStrongBinder(); |
| 1967 | int fromUid = data.readInt(); |
| 1968 | String targetPkg = data.readString(); |
| 1969 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1970 | int mode = data.readInt(); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 1971 | int sourceUserId = data.readInt(); |
| 1972 | int targetUserId = data.readInt(); |
| 1973 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId, |
| 1974 | targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1975 | reply.writeNoException(); |
| 1976 | return true; |
| 1977 | } |
| 1978 | |
| 1979 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1980 | data.enforceInterface(IActivityManager.descriptor); |
| 1981 | IBinder owner = data.readStrongBinder(); |
| 1982 | Uri uri = null; |
| 1983 | if (data.readInt() != 0) { |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1984 | uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1985 | } |
| 1986 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1987 | int userId = data.readInt(); |
| 1988 | revokeUriPermissionFromOwner(owner, uri, mode, userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1989 | reply.writeNoException(); |
| 1990 | return true; |
| 1991 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1992 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1993 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 1994 | data.enforceInterface(IActivityManager.descriptor); |
| 1995 | int callingUid = data.readInt(); |
| 1996 | String targetPkg = data.readString(); |
| 1997 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1998 | int modeFlags = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1999 | int userId = data.readInt(); |
| 2000 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 2001 | reply.writeNoException(); |
| 2002 | reply.writeInt(res); |
| 2003 | return true; |
| 2004 | } |
| 2005 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2006 | case DUMP_HEAP_TRANSACTION: { |
| 2007 | data.enforceInterface(IActivityManager.descriptor); |
| 2008 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 2009 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2010 | boolean managed = data.readInt() != 0; |
| 2011 | String path = data.readString(); |
| 2012 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 2013 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 2014 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2015 | reply.writeNoException(); |
| 2016 | reply.writeInt(res ? 1 : 0); |
| 2017 | return true; |
| 2018 | } |
| 2019 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2020 | case START_ACTIVITIES_TRANSACTION: |
| 2021 | { |
| 2022 | data.enforceInterface(IActivityManager.descriptor); |
| 2023 | IBinder b = data.readStrongBinder(); |
| 2024 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2025 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2026 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 2027 | String[] resolvedTypes = data.createStringArray(); |
| 2028 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2029 | Bundle options = data.readInt() != 0 |
| 2030 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2031 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2032 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2033 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2034 | reply.writeNoException(); |
| 2035 | reply.writeInt(result); |
| 2036 | return true; |
| 2037 | } |
| 2038 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2039 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2040 | { |
| 2041 | data.enforceInterface(IActivityManager.descriptor); |
| 2042 | int mode = getFrontActivityScreenCompatMode(); |
| 2043 | reply.writeNoException(); |
| 2044 | reply.writeInt(mode); |
| 2045 | return true; |
| 2046 | } |
| 2047 | |
| 2048 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2049 | { |
| 2050 | data.enforceInterface(IActivityManager.descriptor); |
| 2051 | int mode = data.readInt(); |
| 2052 | setFrontActivityScreenCompatMode(mode); |
| 2053 | reply.writeNoException(); |
| 2054 | reply.writeInt(mode); |
| 2055 | return true; |
| 2056 | } |
| 2057 | |
| 2058 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2059 | { |
| 2060 | data.enforceInterface(IActivityManager.descriptor); |
| 2061 | String pkg = data.readString(); |
| 2062 | int mode = getPackageScreenCompatMode(pkg); |
| 2063 | reply.writeNoException(); |
| 2064 | reply.writeInt(mode); |
| 2065 | return true; |
| 2066 | } |
| 2067 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2068 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2069 | { |
| 2070 | data.enforceInterface(IActivityManager.descriptor); |
| 2071 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2072 | int mode = data.readInt(); |
| 2073 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2074 | reply.writeNoException(); |
| 2075 | return true; |
| 2076 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2077 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2078 | case SWITCH_USER_TRANSACTION: { |
| 2079 | data.enforceInterface(IActivityManager.descriptor); |
| 2080 | int userid = data.readInt(); |
| 2081 | boolean result = switchUser(userid); |
| 2082 | reply.writeNoException(); |
| 2083 | reply.writeInt(result ? 1 : 0); |
| 2084 | return true; |
| 2085 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2086 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 2087 | case START_USER_IN_BACKGROUND_TRANSACTION: { |
| 2088 | data.enforceInterface(IActivityManager.descriptor); |
| 2089 | int userid = data.readInt(); |
| 2090 | boolean result = startUserInBackground(userid); |
| 2091 | reply.writeNoException(); |
| 2092 | reply.writeInt(result ? 1 : 0); |
| 2093 | return true; |
| 2094 | } |
| 2095 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2096 | case UNLOCK_USER_TRANSACTION: { |
| 2097 | data.enforceInterface(IActivityManager.descriptor); |
| 2098 | int userId = data.readInt(); |
| 2099 | byte[] token = data.createByteArray(); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 2100 | byte[] secret = data.createByteArray(); |
| 2101 | boolean result = unlockUser(userId, token, secret); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2102 | reply.writeNoException(); |
| 2103 | reply.writeInt(result ? 1 : 0); |
| 2104 | return true; |
| 2105 | } |
| 2106 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2107 | case STOP_USER_TRANSACTION: { |
| 2108 | data.enforceInterface(IActivityManager.descriptor); |
| 2109 | int userid = data.readInt(); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2110 | boolean force = data.readInt() != 0; |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2111 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 2112 | data.readStrongBinder()); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2113 | int result = stopUser(userid, force, callback); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2114 | reply.writeNoException(); |
| 2115 | reply.writeInt(result); |
| 2116 | return true; |
| 2117 | } |
| 2118 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2119 | case GET_CURRENT_USER_TRANSACTION: { |
| 2120 | data.enforceInterface(IActivityManager.descriptor); |
| 2121 | UserInfo userInfo = getCurrentUser(); |
| 2122 | reply.writeNoException(); |
| 2123 | userInfo.writeToParcel(reply, 0); |
| 2124 | return true; |
| 2125 | } |
| 2126 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2127 | case IS_USER_RUNNING_TRANSACTION: { |
| 2128 | data.enforceInterface(IActivityManager.descriptor); |
| 2129 | int userid = data.readInt(); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 2130 | int _flags = data.readInt(); |
| 2131 | boolean result = isUserRunning(userid, _flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2132 | reply.writeNoException(); |
| 2133 | reply.writeInt(result ? 1 : 0); |
| 2134 | return true; |
| 2135 | } |
| 2136 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 2137 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 2138 | data.enforceInterface(IActivityManager.descriptor); |
| 2139 | int[] result = getRunningUserIds(); |
| 2140 | reply.writeNoException(); |
| 2141 | reply.writeIntArray(result); |
| 2142 | return true; |
| 2143 | } |
| 2144 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2145 | case REMOVE_TASK_TRANSACTION: |
| 2146 | { |
| 2147 | data.enforceInterface(IActivityManager.descriptor); |
| 2148 | int taskId = data.readInt(); |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 2149 | boolean result = removeTask(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2150 | reply.writeNoException(); |
| 2151 | reply.writeInt(result ? 1 : 0); |
| 2152 | return true; |
| 2153 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2154 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 2155 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2156 | data.enforceInterface(IActivityManager.descriptor); |
| 2157 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2158 | data.readStrongBinder()); |
| 2159 | registerProcessObserver(observer); |
| 2160 | return true; |
| 2161 | } |
| 2162 | |
| 2163 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2164 | data.enforceInterface(IActivityManager.descriptor); |
| 2165 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2166 | data.readStrongBinder()); |
| 2167 | unregisterProcessObserver(observer); |
| 2168 | return true; |
| 2169 | } |
| 2170 | |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2171 | case REGISTER_UID_OBSERVER_TRANSACTION: { |
| 2172 | data.enforceInterface(IActivityManager.descriptor); |
| 2173 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2174 | data.readStrongBinder()); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2175 | int which = data.readInt(); |
| 2176 | registerUidObserver(observer, which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2177 | return true; |
| 2178 | } |
| 2179 | |
| 2180 | case UNREGISTER_UID_OBSERVER_TRANSACTION: { |
| 2181 | data.enforceInterface(IActivityManager.descriptor); |
| 2182 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2183 | data.readStrongBinder()); |
| 2184 | unregisterUidObserver(observer); |
| 2185 | return true; |
| 2186 | } |
| 2187 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 2188 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2189 | { |
| 2190 | data.enforceInterface(IActivityManager.descriptor); |
| 2191 | String pkg = data.readString(); |
| 2192 | boolean ask = getPackageAskScreenCompat(pkg); |
| 2193 | reply.writeNoException(); |
| 2194 | reply.writeInt(ask ? 1 : 0); |
| 2195 | return true; |
| 2196 | } |
| 2197 | |
| 2198 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2199 | { |
| 2200 | data.enforceInterface(IActivityManager.descriptor); |
| 2201 | String pkg = data.readString(); |
| 2202 | boolean ask = data.readInt() != 0; |
| 2203 | setPackageAskScreenCompat(pkg, ask); |
| 2204 | reply.writeNoException(); |
| 2205 | return true; |
| 2206 | } |
| 2207 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2208 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 2209 | data.enforceInterface(IActivityManager.descriptor); |
| 2210 | IIntentSender r = IIntentSender.Stub.asInterface( |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2211 | data.readStrongBinder()); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2212 | boolean res = isIntentSenderTargetedToPackage(r); |
| 2213 | reply.writeNoException(); |
| 2214 | reply.writeInt(res ? 1 : 0); |
| 2215 | return true; |
| 2216 | } |
| 2217 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 2218 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 2219 | data.enforceInterface(IActivityManager.descriptor); |
| 2220 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2221 | data.readStrongBinder()); |
| 2222 | boolean res = isIntentSenderAnActivity(r); |
| 2223 | reply.writeNoException(); |
| 2224 | reply.writeInt(res ? 1 : 0); |
| 2225 | return true; |
| 2226 | } |
| 2227 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 2228 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 2229 | data.enforceInterface(IActivityManager.descriptor); |
| 2230 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2231 | data.readStrongBinder()); |
| 2232 | Intent intent = getIntentForIntentSender(r); |
| 2233 | reply.writeNoException(); |
| 2234 | if (intent != null) { |
| 2235 | reply.writeInt(1); |
| 2236 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2237 | } else { |
| 2238 | reply.writeInt(0); |
| 2239 | } |
| 2240 | return true; |
| 2241 | } |
| 2242 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 2243 | case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { |
| 2244 | data.enforceInterface(IActivityManager.descriptor); |
| 2245 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2246 | data.readStrongBinder()); |
| 2247 | String prefix = data.readString(); |
| 2248 | String tag = getTagForIntentSender(r, prefix); |
| 2249 | reply.writeNoException(); |
| 2250 | reply.writeString(tag); |
| 2251 | return true; |
| 2252 | } |
| 2253 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2254 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 2255 | data.enforceInterface(IActivityManager.descriptor); |
| 2256 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 2257 | updatePersistentConfiguration(config); |
| 2258 | reply.writeNoException(); |
| 2259 | return true; |
| 2260 | } |
| 2261 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 2262 | case GET_PROCESS_PSS_TRANSACTION: { |
| 2263 | data.enforceInterface(IActivityManager.descriptor); |
| 2264 | int[] pids = data.createIntArray(); |
| 2265 | long[] pss = getProcessPss(pids); |
| 2266 | reply.writeNoException(); |
| 2267 | reply.writeLongArray(pss); |
| 2268 | return true; |
| 2269 | } |
| 2270 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 2271 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 2272 | data.enforceInterface(IActivityManager.descriptor); |
| 2273 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 2274 | boolean always = data.readInt() != 0; |
| 2275 | showBootMessage(msg, always); |
| 2276 | reply.writeNoException(); |
| 2277 | return true; |
| 2278 | } |
| 2279 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2280 | case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2281 | data.enforceInterface(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2282 | keyguardWaitingForActivityDrawn(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2283 | reply.writeNoException(); |
| 2284 | return true; |
| 2285 | } |
| 2286 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2287 | case KEYGUARD_GOING_AWAY_TRANSACTION: { |
| 2288 | data.enforceInterface(IActivityManager.descriptor); |
| 2289 | keyguardGoingAway(data.readInt() != 0, data.readInt() != 0); |
| 2290 | reply.writeNoException(); |
| 2291 | return true; |
| 2292 | } |
| 2293 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2294 | case SHOULD_UP_RECREATE_TASK_TRANSACTION: { |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2295 | data.enforceInterface(IActivityManager.descriptor); |
| 2296 | IBinder token = data.readStrongBinder(); |
| 2297 | String destAffinity = data.readString(); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2298 | boolean res = shouldUpRecreateTask(token, destAffinity); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2299 | reply.writeNoException(); |
| 2300 | reply.writeInt(res ? 1 : 0); |
| 2301 | return true; |
| 2302 | } |
| 2303 | |
| 2304 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 2305 | data.enforceInterface(IActivityManager.descriptor); |
| 2306 | IBinder token = data.readStrongBinder(); |
| 2307 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 2308 | int resultCode = data.readInt(); |
| 2309 | Intent resultData = null; |
| 2310 | if (data.readInt() != 0) { |
| 2311 | resultData = Intent.CREATOR.createFromParcel(data); |
| 2312 | } |
| 2313 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 2314 | reply.writeNoException(); |
| 2315 | reply.writeInt(res ? 1 : 0); |
| 2316 | return true; |
| 2317 | } |
| 2318 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 2319 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 2320 | data.enforceInterface(IActivityManager.descriptor); |
| 2321 | IBinder token = data.readStrongBinder(); |
| 2322 | int res = getLaunchedFromUid(token); |
| 2323 | reply.writeNoException(); |
| 2324 | reply.writeInt(res); |
| 2325 | return true; |
| 2326 | } |
| 2327 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2328 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 2329 | data.enforceInterface(IActivityManager.descriptor); |
| 2330 | IBinder token = data.readStrongBinder(); |
| 2331 | String res = getLaunchedFromPackage(token); |
| 2332 | reply.writeNoException(); |
| 2333 | reply.writeString(res); |
| 2334 | return true; |
| 2335 | } |
| 2336 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2337 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2338 | data.enforceInterface(IActivityManager.descriptor); |
| 2339 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2340 | data.readStrongBinder()); |
| 2341 | registerUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2342 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2343 | return true; |
| 2344 | } |
| 2345 | |
| 2346 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2347 | data.enforceInterface(IActivityManager.descriptor); |
| 2348 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2349 | data.readStrongBinder()); |
| 2350 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2351 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2352 | return true; |
| 2353 | } |
| 2354 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2355 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 2356 | data.enforceInterface(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 2357 | int bugreportType = data.readInt(); |
| 2358 | requestBugReport(bugreportType); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2359 | reply.writeNoException(); |
| 2360 | return true; |
| 2361 | } |
| 2362 | |
| 2363 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 2364 | data.enforceInterface(IActivityManager.descriptor); |
| 2365 | int pid = data.readInt(); |
| 2366 | boolean aboveSystem = data.readInt() != 0; |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 2367 | String reason = data.readString(); |
| 2368 | long res = inputDispatchingTimedOut(pid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2369 | reply.writeNoException(); |
| 2370 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2371 | return true; |
| 2372 | } |
| 2373 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2374 | case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2375 | data.enforceInterface(IActivityManager.descriptor); |
| 2376 | int requestType = data.readInt(); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2377 | Bundle res = getAssistContextExtras(requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2378 | reply.writeNoException(); |
| 2379 | reply.writeBundle(res); |
| 2380 | return true; |
| 2381 | } |
| 2382 | |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2383 | case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
| 2384 | data.enforceInterface(IActivityManager.descriptor); |
| 2385 | int requestType = data.readInt(); |
| 2386 | IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2387 | IBinder activityToken = data.readStrongBinder(); |
| 2388 | boolean res = requestAssistContextExtras(requestType, receiver, activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2389 | reply.writeNoException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2390 | reply.writeInt(res ? 1 : 0); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2391 | return true; |
| 2392 | } |
| 2393 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2394 | case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2395 | data.enforceInterface(IActivityManager.descriptor); |
| 2396 | IBinder token = data.readStrongBinder(); |
| 2397 | Bundle extras = data.readBundle(); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 2398 | AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data); |
| 2399 | AssistContent content = AssistContent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 2400 | Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null; |
| 2401 | reportAssistContextExtras(token, extras, structure, content, referrer); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2402 | reply.writeNoException(); |
| 2403 | return true; |
| 2404 | } |
| 2405 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2406 | case LAUNCH_ASSIST_INTENT_TRANSACTION: { |
| 2407 | data.enforceInterface(IActivityManager.descriptor); |
| 2408 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2409 | int requestType = data.readInt(); |
| 2410 | String hint = data.readString(); |
| 2411 | int userHandle = data.readInt(); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 2412 | Bundle args = data.readBundle(); |
| 2413 | boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2414 | reply.writeNoException(); |
| 2415 | reply.writeInt(res ? 1 : 0); |
| 2416 | return true; |
| 2417 | } |
| 2418 | |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2419 | case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: { |
| 2420 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2421 | boolean res = isAssistDataAllowedOnCurrentActivity(); |
| 2422 | reply.writeNoException(); |
| 2423 | reply.writeInt(res ? 1 : 0); |
| 2424 | return true; |
| 2425 | } |
| 2426 | |
| 2427 | case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: { |
| 2428 | data.enforceInterface(IActivityManager.descriptor); |
| 2429 | IBinder token = data.readStrongBinder(); |
| 2430 | Bundle args = data.readBundle(); |
| 2431 | boolean res = showAssistFromActivity(token, args); |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2432 | reply.writeNoException(); |
| 2433 | reply.writeInt(res ? 1 : 0); |
| 2434 | return true; |
| 2435 | } |
| 2436 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2437 | case KILL_UID_TRANSACTION: { |
| 2438 | data.enforceInterface(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2439 | int appId = data.readInt(); |
| 2440 | int userId = data.readInt(); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2441 | String reason = data.readString(); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2442 | killUid(appId, userId, reason); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2443 | reply.writeNoException(); |
| 2444 | return true; |
| 2445 | } |
| 2446 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2447 | case HANG_TRANSACTION: { |
| 2448 | data.enforceInterface(IActivityManager.descriptor); |
| 2449 | IBinder who = data.readStrongBinder(); |
| 2450 | boolean allowRestart = data.readInt() != 0; |
| 2451 | hang(who, allowRestart); |
| 2452 | reply.writeNoException(); |
| 2453 | return true; |
| 2454 | } |
| 2455 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2456 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2457 | data.enforceInterface(IActivityManager.descriptor); |
| 2458 | IBinder token = data.readStrongBinder(); |
| 2459 | reportActivityFullyDrawn(token); |
| 2460 | reply.writeNoException(); |
| 2461 | return true; |
| 2462 | } |
| 2463 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2464 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2465 | data.enforceInterface(IActivityManager.descriptor); |
| 2466 | IBinder token = data.readStrongBinder(); |
| 2467 | notifyActivityDrawn(token); |
| 2468 | reply.writeNoException(); |
| 2469 | return true; |
| 2470 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2471 | |
| 2472 | case RESTART_TRANSACTION: { |
| 2473 | data.enforceInterface(IActivityManager.descriptor); |
| 2474 | restart(); |
| 2475 | reply.writeNoException(); |
| 2476 | return true; |
| 2477 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2478 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2479 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2480 | data.enforceInterface(IActivityManager.descriptor); |
| 2481 | performIdleMaintenance(); |
| 2482 | reply.writeNoException(); |
| 2483 | return true; |
| 2484 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2485 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2486 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2487 | data.enforceInterface(IActivityManager.descriptor); |
| 2488 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2489 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2490 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2491 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2492 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2493 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2494 | if (activityContainer != null) { |
| 2495 | reply.writeInt(1); |
| 2496 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2497 | } else { |
| 2498 | reply.writeInt(0); |
| 2499 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2500 | return true; |
| 2501 | } |
| 2502 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2503 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2504 | data.enforceInterface(IActivityManager.descriptor); |
| 2505 | IActivityContainer activityContainer = |
| 2506 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2507 | deleteActivityContainer(activityContainer); |
| 2508 | reply.writeNoException(); |
| 2509 | return true; |
| 2510 | } |
| 2511 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2512 | case CREATE_STACK_ON_DISPLAY: { |
| 2513 | data.enforceInterface(IActivityManager.descriptor); |
| 2514 | int displayId = data.readInt(); |
| 2515 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2516 | reply.writeNoException(); |
| 2517 | if (activityContainer != null) { |
| 2518 | reply.writeInt(1); |
| 2519 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2520 | } else { |
| 2521 | reply.writeInt(0); |
| 2522 | } |
| 2523 | return true; |
| 2524 | } |
| 2525 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2526 | case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: { |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2527 | data.enforceInterface(IActivityManager.descriptor); |
| 2528 | IBinder activityToken = data.readStrongBinder(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2529 | int displayId = getActivityDisplayId(activityToken); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2530 | reply.writeNoException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2531 | reply.writeInt(displayId); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2532 | return true; |
| 2533 | } |
| 2534 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2535 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2536 | data.enforceInterface(IActivityManager.descriptor); |
| 2537 | final int taskId = data.readInt(); |
| 2538 | startLockTaskMode(taskId); |
| 2539 | reply.writeNoException(); |
| 2540 | return true; |
| 2541 | } |
| 2542 | |
| 2543 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2544 | data.enforceInterface(IActivityManager.descriptor); |
| 2545 | IBinder token = data.readStrongBinder(); |
| 2546 | startLockTaskMode(token); |
| 2547 | reply.writeNoException(); |
| 2548 | return true; |
| 2549 | } |
| 2550 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2551 | case START_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2552 | data.enforceInterface(IActivityManager.descriptor); |
| 2553 | startLockTaskModeOnCurrent(); |
| 2554 | reply.writeNoException(); |
| 2555 | return true; |
| 2556 | } |
| 2557 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2558 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2559 | data.enforceInterface(IActivityManager.descriptor); |
| 2560 | stopLockTaskMode(); |
| 2561 | reply.writeNoException(); |
| 2562 | return true; |
| 2563 | } |
| 2564 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2565 | case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2566 | data.enforceInterface(IActivityManager.descriptor); |
| 2567 | stopLockTaskModeOnCurrent(); |
| 2568 | reply.writeNoException(); |
| 2569 | return true; |
| 2570 | } |
| 2571 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2572 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2573 | data.enforceInterface(IActivityManager.descriptor); |
| 2574 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2575 | reply.writeNoException(); |
| 2576 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2577 | return true; |
| 2578 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2579 | |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 2580 | case GET_LOCK_TASK_MODE_STATE_TRANSACTION: { |
| 2581 | data.enforceInterface(IActivityManager.descriptor); |
| 2582 | final int lockTaskModeState = getLockTaskModeState(); |
| 2583 | reply.writeNoException(); |
| 2584 | reply.writeInt(lockTaskModeState); |
| 2585 | return true; |
| 2586 | } |
| 2587 | |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 2588 | case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: { |
| 2589 | data.enforceInterface(IActivityManager.descriptor); |
| 2590 | final IBinder token = data.readStrongBinder(); |
| 2591 | showLockTaskEscapeMessage(token); |
| 2592 | reply.writeNoException(); |
| 2593 | return true; |
| 2594 | } |
| 2595 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2596 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2597 | data.enforceInterface(IActivityManager.descriptor); |
| 2598 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2599 | ActivityManager.TaskDescription values = |
| 2600 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2601 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2602 | reply.writeNoException(); |
| 2603 | return true; |
| 2604 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2605 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2606 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2607 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 2608 | final int taskId = data.readInt(); |
| 2609 | final int resizeableMode = data.readInt(); |
| 2610 | setTaskResizeable(taskId, resizeableMode); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2611 | reply.writeNoException(); |
| 2612 | return true; |
| 2613 | } |
| 2614 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2615 | case RESIZE_TASK_TRANSACTION: { |
| 2616 | data.enforceInterface(IActivityManager.descriptor); |
| 2617 | int taskId = data.readInt(); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2618 | int resizeMode = data.readInt(); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2619 | Rect r = Rect.CREATOR.createFromParcel(data); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2620 | resizeTask(taskId, r, resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2621 | reply.writeNoException(); |
| 2622 | return true; |
| 2623 | } |
| 2624 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 2625 | case GET_TASK_BOUNDS_TRANSACTION: { |
| 2626 | data.enforceInterface(IActivityManager.descriptor); |
| 2627 | int taskId = data.readInt(); |
| 2628 | Rect r = getTaskBounds(taskId); |
| 2629 | reply.writeNoException(); |
| 2630 | r.writeToParcel(reply, 0); |
| 2631 | return true; |
| 2632 | } |
| 2633 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2634 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2635 | data.enforceInterface(IActivityManager.descriptor); |
| 2636 | String filename = data.readString(); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 2637 | int userId = data.readInt(); |
| 2638 | Bitmap icon = getTaskDescriptionIcon(filename, userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2639 | reply.writeNoException(); |
| 2640 | if (icon == null) { |
| 2641 | reply.writeInt(0); |
| 2642 | } else { |
| 2643 | reply.writeInt(1); |
| 2644 | icon.writeToParcel(reply, 0); |
| 2645 | } |
| 2646 | return true; |
| 2647 | } |
| 2648 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2649 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2650 | data.enforceInterface(IActivityManager.descriptor); |
| 2651 | final Bundle bundle; |
| 2652 | if (data.readInt() == 0) { |
| 2653 | bundle = null; |
| 2654 | } else { |
| 2655 | bundle = data.readBundle(); |
| 2656 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 2657 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2658 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2659 | reply.writeNoException(); |
| 2660 | return true; |
| 2661 | } |
| 2662 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2663 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2664 | data.enforceInterface(IActivityManager.descriptor); |
| 2665 | IBinder token = data.readStrongBinder(); |
| 2666 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2667 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2668 | reply.writeNoException(); |
| 2669 | reply.writeInt(success ? 1 : 0); |
| 2670 | return true; |
| 2671 | } |
| 2672 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2673 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2674 | data.enforceInterface(IActivityManager.descriptor); |
| 2675 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2676 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2677 | reply.writeNoException(); |
| 2678 | reply.writeInt(enabled ? 1 : 0); |
| 2679 | return true; |
| 2680 | } |
| 2681 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2682 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2683 | data.enforceInterface(IActivityManager.descriptor); |
| 2684 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2685 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2686 | reply.writeNoException(); |
| 2687 | return true; |
| 2688 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2689 | |
| 2690 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2691 | data.enforceInterface(IActivityManager.descriptor); |
| 2692 | IBinder token = data.readStrongBinder(); |
| 2693 | notifyLaunchTaskBehindComplete(token); |
| 2694 | reply.writeNoException(); |
| 2695 | return true; |
| 2696 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2697 | |
| 2698 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2699 | data.enforceInterface(IActivityManager.descriptor); |
| 2700 | IBinder token = data.readStrongBinder(); |
| 2701 | notifyEnterAnimationComplete(token); |
| 2702 | reply.writeNoException(); |
| 2703 | return true; |
| 2704 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2705 | |
| 2706 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2707 | data.enforceInterface(IActivityManager.descriptor); |
| 2708 | bootAnimationComplete(); |
| 2709 | reply.writeNoException(); |
| 2710 | return true; |
| 2711 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2712 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2713 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2714 | data.enforceInterface(IActivityManager.descriptor); |
| 2715 | final int uid = data.readInt(); |
| 2716 | final byte[] firstPacket = data.createByteArray(); |
| 2717 | notifyCleartextNetwork(uid, firstPacket); |
| 2718 | reply.writeNoException(); |
| 2719 | return true; |
| 2720 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2721 | |
| 2722 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2723 | data.enforceInterface(IActivityManager.descriptor); |
| 2724 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2725 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2726 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2727 | String reportPackage = data.readString(); |
| 2728 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2729 | reply.writeNoException(); |
| 2730 | return true; |
| 2731 | } |
| 2732 | |
| 2733 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2734 | data.enforceInterface(IActivityManager.descriptor); |
| 2735 | String path = data.readString(); |
| 2736 | dumpHeapFinished(path); |
| 2737 | reply.writeNoException(); |
| 2738 | return true; |
| 2739 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2740 | |
| 2741 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2742 | data.enforceInterface(IActivityManager.descriptor); |
| 2743 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2744 | data.readStrongBinder()); |
| 2745 | boolean keepAwake = data.readInt() != 0; |
| 2746 | setVoiceKeepAwake(session, keepAwake); |
| 2747 | reply.writeNoException(); |
| 2748 | return true; |
| 2749 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2750 | |
| 2751 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2752 | data.enforceInterface(IActivityManager.descriptor); |
| 2753 | int userId = data.readInt(); |
| 2754 | String[] packages = data.readStringArray(); |
| 2755 | updateLockTaskPackages(userId, packages); |
| 2756 | reply.writeNoException(); |
| 2757 | return true; |
| 2758 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2759 | |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 2760 | case UPDATE_DEVICE_OWNER_TRANSACTION: { |
| 2761 | data.enforceInterface(IActivityManager.descriptor); |
| 2762 | String packageName = data.readString(); |
| 2763 | updateDeviceOwner(packageName); |
| 2764 | reply.writeNoException(); |
| 2765 | return true; |
| 2766 | } |
| 2767 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2768 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2769 | data.enforceInterface(IActivityManager.descriptor); |
| 2770 | String pkg = data.readString(); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 2771 | String callingPackage = data.readString(); |
| 2772 | int res = getPackageProcessState(pkg, callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2773 | reply.writeNoException(); |
| 2774 | reply.writeInt(res); |
| 2775 | return true; |
| 2776 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2777 | |
| 2778 | case SET_PROCESS_MEMORY_TRIM_TRANSACTION: { |
| 2779 | data.enforceInterface(IActivityManager.descriptor); |
| 2780 | String process = data.readString(); |
| 2781 | int userId = data.readInt(); |
| 2782 | int level = data.readInt(); |
| 2783 | boolean res = setProcessMemoryTrimLevel(process, userId, level); |
| 2784 | reply.writeNoException(); |
| 2785 | reply.writeInt(res ? 1 : 0); |
| 2786 | return true; |
| 2787 | } |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2788 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 2789 | case IS_ROOT_VOICE_INTERACTION_TRANSACTION: { |
| 2790 | data.enforceInterface(IActivityManager.descriptor); |
| 2791 | IBinder token = data.readStrongBinder(); |
| 2792 | boolean res = isRootVoiceInteraction(token); |
| 2793 | reply.writeNoException(); |
| 2794 | reply.writeInt(res ? 1 : 0); |
| 2795 | return true; |
| 2796 | } |
Ian Pedowitz | a371084 | 2015-08-03 23:36:15 -0700 | [diff] [blame] | 2797 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2798 | case START_BINDER_TRACKING_TRANSACTION: { |
| 2799 | data.enforceInterface(IActivityManager.descriptor); |
| 2800 | boolean res = startBinderTracking(); |
| 2801 | reply.writeNoException(); |
| 2802 | reply.writeInt(res ? 1 : 0); |
| 2803 | return true; |
| 2804 | } |
| 2805 | |
| 2806 | case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: { |
| 2807 | data.enforceInterface(IActivityManager.descriptor); |
| 2808 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 2809 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
| 2810 | boolean res = stopBinderTrackingAndDump(fd); |
| 2811 | reply.writeNoException(); |
| 2812 | reply.writeInt(res ? 1 : 0); |
| 2813 | return true; |
| 2814 | } |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2815 | case GET_ACTIVITY_STACK_ID_TRANSACTION: { |
| 2816 | data.enforceInterface(IActivityManager.descriptor); |
| 2817 | IBinder token = data.readStrongBinder(); |
| 2818 | int stackId = getActivityStackId(token); |
| 2819 | reply.writeNoException(); |
| 2820 | reply.writeInt(stackId); |
| 2821 | return true; |
| 2822 | } |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2823 | case EXIT_FREEFORM_MODE_TRANSACTION: { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2824 | data.enforceInterface(IActivityManager.descriptor); |
| 2825 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2826 | exitFreeformMode(token); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2827 | reply.writeNoException(); |
| 2828 | return true; |
| 2829 | } |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2830 | case REPORT_SIZE_CONFIGURATIONS: { |
| 2831 | data.enforceInterface(IActivityManager.descriptor); |
| 2832 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2833 | int[] horizontal = readIntArray(data); |
| 2834 | int[] vertical = readIntArray(data); |
| 2835 | int[] smallest = readIntArray(data); |
| 2836 | reportSizeConfigurations(token, horizontal, vertical, smallest); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2837 | return true; |
| 2838 | } |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 2839 | case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: { |
| 2840 | data.enforceInterface(IActivityManager.descriptor); |
| 2841 | final boolean suppress = data.readInt() == 1; |
| 2842 | suppressResizeConfigChanges(suppress); |
| 2843 | reply.writeNoException(); |
| 2844 | return true; |
| 2845 | } |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 2846 | case MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION: { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2847 | data.enforceInterface(IActivityManager.descriptor); |
| 2848 | final int stackId = data.readInt(); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 2849 | final boolean onTop = data.readInt() == 1; |
| 2850 | moveTasksToFullscreenStack(stackId, onTop); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2851 | reply.writeNoException(); |
| 2852 | return true; |
| 2853 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2854 | case GET_APP_START_MODE_TRANSACTION: { |
| 2855 | data.enforceInterface(IActivityManager.descriptor); |
| 2856 | final int uid = data.readInt(); |
| 2857 | final String pkg = data.readString(); |
| 2858 | int res = getAppStartMode(uid, pkg); |
| 2859 | reply.writeNoException(); |
| 2860 | reply.writeInt(res); |
| 2861 | return true; |
| 2862 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2863 | case IN_MULTI_WINDOW_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2864 | data.enforceInterface(IActivityManager.descriptor); |
| 2865 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2866 | final boolean inMultiWindow = inMultiWindow(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2867 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2868 | reply.writeInt(inMultiWindow ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2869 | return true; |
| 2870 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2871 | case IN_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2872 | data.enforceInterface(IActivityManager.descriptor); |
| 2873 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2874 | final boolean inPip = inPictureInPicture(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2875 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2876 | reply.writeInt(inPip ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2877 | return true; |
| 2878 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2879 | case ENTER_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2880 | data.enforceInterface(IActivityManager.descriptor); |
| 2881 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2882 | enterPictureInPicture(token); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2883 | reply.writeNoException(); |
| 2884 | return true; |
| 2885 | } |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2886 | case SET_VR_MODE_TRANSACTION: { |
| 2887 | data.enforceInterface(IActivityManager.descriptor); |
| 2888 | final IBinder token = data.readStrongBinder(); |
| 2889 | final boolean enable = data.readInt() == 1; |
| 2890 | setVrMode(token, enable); |
| 2891 | reply.writeNoException(); |
| 2892 | return true; |
| 2893 | } |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 2894 | case IS_APP_FOREGROUND_TRANSACTION: { |
| 2895 | data.enforceInterface(IActivityManager.descriptor); |
| 2896 | final int userHandle = data.readInt(); |
| 2897 | final boolean isForeground = isAppForeground(userHandle); |
| 2898 | reply.writeNoException(); |
| 2899 | reply.writeInt(isForeground ? 1 : 0); |
| 2900 | return true; |
| 2901 | } |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 2902 | case NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION: { |
| 2903 | data.enforceInterface(IActivityManager.descriptor); |
| 2904 | reply.writeNoException(); |
| 2905 | return true; |
| 2906 | } |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 2907 | case REMOVE_STACK: { |
| 2908 | data.enforceInterface(IActivityManager.descriptor); |
| 2909 | final int stackId = data.readInt(); |
| 2910 | removeStack(stackId); |
| 2911 | reply.writeNoException(); |
| 2912 | return true; |
| 2913 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2914 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2915 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2916 | return super.onTransact(code, data, reply, flags); |
| 2917 | } |
| 2918 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2919 | private int[] readIntArray(Parcel data) { |
| 2920 | int[] smallest = null; |
| 2921 | int smallestSize = data.readInt(); |
| 2922 | if (smallestSize > 0) { |
| 2923 | smallest = new int[smallestSize]; |
| 2924 | data.readIntArray(smallest); |
| 2925 | } |
| 2926 | return smallest; |
| 2927 | } |
| 2928 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2929 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2930 | return this; |
| 2931 | } |
| 2932 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2933 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2934 | protected IActivityManager create() { |
| 2935 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2936 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2937 | Log.v("ActivityManager", "default service binder = " + b); |
| 2938 | } |
| 2939 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2940 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2941 | Log.v("ActivityManager", "default service = " + am); |
| 2942 | } |
| 2943 | return am; |
| 2944 | } |
| 2945 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2946 | } |
| 2947 | |
| 2948 | class ActivityManagerProxy implements IActivityManager |
| 2949 | { |
| 2950 | public ActivityManagerProxy(IBinder remote) |
| 2951 | { |
| 2952 | mRemote = remote; |
| 2953 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2954 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2955 | public IBinder asBinder() |
| 2956 | { |
| 2957 | return mRemote; |
| 2958 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2959 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2960 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2961 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2962 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2963 | Parcel data = Parcel.obtain(); |
| 2964 | Parcel reply = Parcel.obtain(); |
| 2965 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2966 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2967 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2968 | intent.writeToParcel(data, 0); |
| 2969 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2970 | data.writeStrongBinder(resultTo); |
| 2971 | data.writeString(resultWho); |
| 2972 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2973 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2974 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2975 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2976 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2977 | } else { |
| 2978 | data.writeInt(0); |
| 2979 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2980 | if (options != null) { |
| 2981 | data.writeInt(1); |
| 2982 | options.writeToParcel(data, 0); |
| 2983 | } else { |
| 2984 | data.writeInt(0); |
| 2985 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2986 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2987 | reply.readException(); |
| 2988 | int result = reply.readInt(); |
| 2989 | reply.recycle(); |
| 2990 | data.recycle(); |
| 2991 | return result; |
| 2992 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2993 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2994 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2995 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2996 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2997 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2998 | Parcel data = Parcel.obtain(); |
| 2999 | Parcel reply = Parcel.obtain(); |
| 3000 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3001 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3002 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3003 | intent.writeToParcel(data, 0); |
| 3004 | data.writeString(resolvedType); |
| 3005 | data.writeStrongBinder(resultTo); |
| 3006 | data.writeString(resultWho); |
| 3007 | data.writeInt(requestCode); |
| 3008 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3009 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3010 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3011 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3012 | } else { |
| 3013 | data.writeInt(0); |
| 3014 | } |
| 3015 | if (options != null) { |
| 3016 | data.writeInt(1); |
| 3017 | options.writeToParcel(data, 0); |
| 3018 | } else { |
| 3019 | data.writeInt(0); |
| 3020 | } |
| 3021 | data.writeInt(userId); |
| 3022 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 3023 | reply.readException(); |
| 3024 | int result = reply.readInt(); |
| 3025 | reply.recycle(); |
| 3026 | data.recycle(); |
| 3027 | return result; |
| 3028 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3029 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 3030 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3031 | int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, |
| 3032 | int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3033 | Parcel data = Parcel.obtain(); |
| 3034 | Parcel reply = Parcel.obtain(); |
| 3035 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3036 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3037 | data.writeString(callingPackage); |
| 3038 | intent.writeToParcel(data, 0); |
| 3039 | data.writeString(resolvedType); |
| 3040 | data.writeStrongBinder(resultTo); |
| 3041 | data.writeString(resultWho); |
| 3042 | data.writeInt(requestCode); |
| 3043 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3044 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3045 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3046 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3047 | } else { |
| 3048 | data.writeInt(0); |
| 3049 | } |
| 3050 | if (options != null) { |
| 3051 | data.writeInt(1); |
| 3052 | options.writeToParcel(data, 0); |
| 3053 | } else { |
| 3054 | data.writeInt(0); |
| 3055 | } |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3056 | data.writeInt(ignoreTargetSecurity ? 1 : 0); |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 3057 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3058 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 3059 | reply.readException(); |
| 3060 | int result = reply.readInt(); |
| 3061 | reply.recycle(); |
| 3062 | data.recycle(); |
| 3063 | return result; |
| 3064 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3065 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 3066 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3067 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3068 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3069 | Parcel data = Parcel.obtain(); |
| 3070 | Parcel reply = Parcel.obtain(); |
| 3071 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3072 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3073 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3074 | intent.writeToParcel(data, 0); |
| 3075 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3076 | data.writeStrongBinder(resultTo); |
| 3077 | data.writeString(resultWho); |
| 3078 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3079 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3080 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3081 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3082 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3083 | } else { |
| 3084 | data.writeInt(0); |
| 3085 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3086 | if (options != null) { |
| 3087 | data.writeInt(1); |
| 3088 | options.writeToParcel(data, 0); |
| 3089 | } else { |
| 3090 | data.writeInt(0); |
| 3091 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3092 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3093 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 3094 | reply.readException(); |
| 3095 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 3096 | reply.recycle(); |
| 3097 | data.recycle(); |
| 3098 | return result; |
| 3099 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3100 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 3101 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3102 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3103 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3104 | Parcel data = Parcel.obtain(); |
| 3105 | Parcel reply = Parcel.obtain(); |
| 3106 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3107 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3108 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3109 | intent.writeToParcel(data, 0); |
| 3110 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3111 | data.writeStrongBinder(resultTo); |
| 3112 | data.writeString(resultWho); |
| 3113 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3114 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3115 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3116 | if (options != null) { |
| 3117 | data.writeInt(1); |
| 3118 | options.writeToParcel(data, 0); |
| 3119 | } else { |
| 3120 | data.writeInt(0); |
| 3121 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3122 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3123 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3124 | reply.readException(); |
| 3125 | int result = reply.readInt(); |
| 3126 | reply.recycle(); |
| 3127 | data.recycle(); |
| 3128 | return result; |
| 3129 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3130 | public int startActivityIntentSender(IApplicationThread caller, |
| 3131 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3132 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3133 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3134 | Parcel data = Parcel.obtain(); |
| 3135 | Parcel reply = Parcel.obtain(); |
| 3136 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3137 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3138 | intent.writeToParcel(data, 0); |
| 3139 | if (fillInIntent != null) { |
| 3140 | data.writeInt(1); |
| 3141 | fillInIntent.writeToParcel(data, 0); |
| 3142 | } else { |
| 3143 | data.writeInt(0); |
| 3144 | } |
| 3145 | data.writeString(resolvedType); |
| 3146 | data.writeStrongBinder(resultTo); |
| 3147 | data.writeString(resultWho); |
| 3148 | data.writeInt(requestCode); |
| 3149 | data.writeInt(flagsMask); |
| 3150 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3151 | if (options != null) { |
| 3152 | data.writeInt(1); |
| 3153 | options.writeToParcel(data, 0); |
| 3154 | } else { |
| 3155 | data.writeInt(0); |
| 3156 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3157 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3158 | reply.readException(); |
| 3159 | int result = reply.readInt(); |
| 3160 | reply.recycle(); |
| 3161 | data.recycle(); |
| 3162 | return result; |
| 3163 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3164 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 3165 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3166 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 3167 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3168 | Parcel data = Parcel.obtain(); |
| 3169 | Parcel reply = Parcel.obtain(); |
| 3170 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3171 | data.writeString(callingPackage); |
| 3172 | data.writeInt(callingPid); |
| 3173 | data.writeInt(callingUid); |
| 3174 | intent.writeToParcel(data, 0); |
| 3175 | data.writeString(resolvedType); |
| 3176 | data.writeStrongBinder(session.asBinder()); |
| 3177 | data.writeStrongBinder(interactor.asBinder()); |
| 3178 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3179 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3180 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3181 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3182 | } else { |
| 3183 | data.writeInt(0); |
| 3184 | } |
| 3185 | if (options != null) { |
| 3186 | data.writeInt(1); |
| 3187 | options.writeToParcel(data, 0); |
| 3188 | } else { |
| 3189 | data.writeInt(0); |
| 3190 | } |
| 3191 | data.writeInt(userId); |
| 3192 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3193 | reply.readException(); |
| 3194 | int result = reply.readInt(); |
| 3195 | reply.recycle(); |
| 3196 | data.recycle(); |
| 3197 | return result; |
| 3198 | } |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 3199 | |
| 3200 | public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options) |
| 3201 | throws RemoteException { |
| 3202 | Parcel data = Parcel.obtain(); |
| 3203 | Parcel reply = Parcel.obtain(); |
| 3204 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3205 | data.writeStrongBinder(callingActivity); |
| 3206 | data.writeBundle(options); |
| 3207 | mRemote.transact(START_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3208 | reply.readException(); |
| 3209 | reply.recycle(); |
| 3210 | data.recycle(); |
| 3211 | } |
| 3212 | |
| 3213 | public void stopLocalVoiceInteraction(IBinder callingActivity) throws RemoteException { |
| 3214 | Parcel data = Parcel.obtain(); |
| 3215 | Parcel reply = Parcel.obtain(); |
| 3216 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3217 | data.writeStrongBinder(callingActivity); |
| 3218 | mRemote.transact(STOP_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3219 | reply.readException(); |
| 3220 | reply.recycle(); |
| 3221 | data.recycle(); |
| 3222 | } |
| 3223 | |
| 3224 | public boolean supportsLocalVoiceInteraction() throws RemoteException { |
| 3225 | Parcel data = Parcel.obtain(); |
| 3226 | Parcel reply = Parcel.obtain(); |
| 3227 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3228 | mRemote.transact(SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3229 | reply.readException(); |
| 3230 | int result = reply.readInt(); |
| 3231 | reply.recycle(); |
| 3232 | data.recycle(); |
| 3233 | return result != 0; |
| 3234 | } |
| 3235 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3236 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3237 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3238 | Parcel data = Parcel.obtain(); |
| 3239 | Parcel reply = Parcel.obtain(); |
| 3240 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3241 | data.writeStrongBinder(callingActivity); |
| 3242 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3243 | if (options != null) { |
| 3244 | data.writeInt(1); |
| 3245 | options.writeToParcel(data, 0); |
| 3246 | } else { |
| 3247 | data.writeInt(0); |
| 3248 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3249 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3250 | reply.readException(); |
| 3251 | int result = reply.readInt(); |
| 3252 | reply.recycle(); |
| 3253 | data.recycle(); |
| 3254 | return result != 0; |
| 3255 | } |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 3256 | public int startActivityFromRecents(int taskId, Bundle options) |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3257 | throws RemoteException { |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3258 | Parcel data = Parcel.obtain(); |
| 3259 | Parcel reply = Parcel.obtain(); |
| 3260 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3261 | data.writeInt(taskId); |
| 3262 | if (options == null) { |
| 3263 | data.writeInt(0); |
| 3264 | } else { |
| 3265 | data.writeInt(1); |
| 3266 | options.writeToParcel(data, 0); |
| 3267 | } |
| 3268 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 3269 | reply.readException(); |
| 3270 | int result = reply.readInt(); |
| 3271 | reply.recycle(); |
| 3272 | data.recycle(); |
| 3273 | return result; |
| 3274 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3275 | 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] | 3276 | throws RemoteException { |
| 3277 | Parcel data = Parcel.obtain(); |
| 3278 | Parcel reply = Parcel.obtain(); |
| 3279 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3280 | data.writeStrongBinder(token); |
| 3281 | data.writeInt(resultCode); |
| 3282 | if (resultData != null) { |
| 3283 | data.writeInt(1); |
| 3284 | resultData.writeToParcel(data, 0); |
| 3285 | } else { |
| 3286 | data.writeInt(0); |
| 3287 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3288 | data.writeInt(finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3289 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3290 | reply.readException(); |
| 3291 | boolean res = reply.readInt() != 0; |
| 3292 | data.recycle(); |
| 3293 | reply.recycle(); |
| 3294 | return res; |
| 3295 | } |
| 3296 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 3297 | { |
| 3298 | Parcel data = Parcel.obtain(); |
| 3299 | Parcel reply = Parcel.obtain(); |
| 3300 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3301 | data.writeStrongBinder(token); |
| 3302 | data.writeString(resultWho); |
| 3303 | data.writeInt(requestCode); |
| 3304 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3305 | reply.readException(); |
| 3306 | data.recycle(); |
| 3307 | reply.recycle(); |
| 3308 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 3309 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 3310 | Parcel data = Parcel.obtain(); |
| 3311 | Parcel reply = Parcel.obtain(); |
| 3312 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3313 | data.writeStrongBinder(token); |
| 3314 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 3315 | reply.readException(); |
| 3316 | boolean res = reply.readInt() != 0; |
| 3317 | data.recycle(); |
| 3318 | reply.recycle(); |
| 3319 | return res; |
| 3320 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 3321 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 3322 | Parcel data = Parcel.obtain(); |
| 3323 | Parcel reply = Parcel.obtain(); |
| 3324 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3325 | data.writeStrongBinder(session.asBinder()); |
| 3326 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 3327 | reply.readException(); |
| 3328 | data.recycle(); |
| 3329 | reply.recycle(); |
| 3330 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 3331 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 3332 | Parcel data = Parcel.obtain(); |
| 3333 | Parcel reply = Parcel.obtain(); |
| 3334 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3335 | data.writeStrongBinder(token); |
| 3336 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 3337 | reply.readException(); |
| 3338 | boolean res = reply.readInt() != 0; |
| 3339 | data.recycle(); |
| 3340 | reply.recycle(); |
| 3341 | return res; |
| 3342 | } |
| 3343 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 3344 | Parcel data = Parcel.obtain(); |
| 3345 | Parcel reply = Parcel.obtain(); |
| 3346 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3347 | data.writeStrongBinder(app.asBinder()); |
| 3348 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 3349 | reply.readException(); |
| 3350 | data.recycle(); |
| 3351 | reply.recycle(); |
| 3352 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 3353 | public boolean willActivityBeVisible(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(WILL_ACTIVITY_BE_VISIBLE_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 | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3365 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3366 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3367 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3368 | { |
| 3369 | Parcel data = Parcel.obtain(); |
| 3370 | Parcel reply = Parcel.obtain(); |
| 3371 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3372 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3373 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3374 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 3375 | filter.writeToParcel(data, 0); |
| 3376 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3377 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3378 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3379 | reply.readException(); |
| 3380 | Intent intent = null; |
| 3381 | int haveIntent = reply.readInt(); |
| 3382 | if (haveIntent != 0) { |
| 3383 | intent = Intent.CREATOR.createFromParcel(reply); |
| 3384 | } |
| 3385 | reply.recycle(); |
| 3386 | data.recycle(); |
| 3387 | return intent; |
| 3388 | } |
| 3389 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 3390 | { |
| 3391 | Parcel data = Parcel.obtain(); |
| 3392 | Parcel reply = Parcel.obtain(); |
| 3393 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3394 | data.writeStrongBinder(receiver.asBinder()); |
| 3395 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3396 | reply.readException(); |
| 3397 | data.recycle(); |
| 3398 | reply.recycle(); |
| 3399 | } |
| 3400 | public int broadcastIntent(IApplicationThread caller, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3401 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3402 | int resultCode, String resultData, Bundle map, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3403 | String[] requiredPermissions, int appOp, Bundle options, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3404 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3405 | { |
| 3406 | Parcel data = Parcel.obtain(); |
| 3407 | Parcel reply = Parcel.obtain(); |
| 3408 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3409 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3410 | intent.writeToParcel(data, 0); |
| 3411 | data.writeString(resolvedType); |
| 3412 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 3413 | data.writeInt(resultCode); |
| 3414 | data.writeString(resultData); |
| 3415 | data.writeBundle(map); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3416 | data.writeStringArray(requiredPermissions); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 3417 | data.writeInt(appOp); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3418 | data.writeBundle(options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3419 | data.writeInt(serialized ? 1 : 0); |
| 3420 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -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(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3423 | reply.readException(); |
| 3424 | int res = reply.readInt(); |
| 3425 | reply.recycle(); |
| 3426 | data.recycle(); |
| 3427 | return res; |
| 3428 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3429 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 3430 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3431 | { |
| 3432 | Parcel data = Parcel.obtain(); |
| 3433 | Parcel reply = Parcel.obtain(); |
| 3434 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3435 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3436 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3437 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3438 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3439 | reply.readException(); |
| 3440 | data.recycle(); |
| 3441 | reply.recycle(); |
| 3442 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3443 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 3444 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3445 | { |
| 3446 | Parcel data = Parcel.obtain(); |
| 3447 | Parcel reply = Parcel.obtain(); |
| 3448 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3449 | data.writeStrongBinder(who); |
| 3450 | data.writeInt(resultCode); |
| 3451 | data.writeString(resultData); |
| 3452 | data.writeBundle(map); |
| 3453 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3454 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3455 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3456 | reply.readException(); |
| 3457 | data.recycle(); |
| 3458 | reply.recycle(); |
| 3459 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3460 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3461 | { |
| 3462 | Parcel data = Parcel.obtain(); |
| 3463 | Parcel reply = Parcel.obtain(); |
| 3464 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3465 | data.writeStrongBinder(app.asBinder()); |
| 3466 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3467 | reply.readException(); |
| 3468 | data.recycle(); |
| 3469 | reply.recycle(); |
| 3470 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3471 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3472 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3473 | { |
| 3474 | Parcel data = Parcel.obtain(); |
| 3475 | Parcel reply = Parcel.obtain(); |
| 3476 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3477 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3478 | if (config != null) { |
| 3479 | data.writeInt(1); |
| 3480 | config.writeToParcel(data, 0); |
| 3481 | } else { |
| 3482 | data.writeInt(0); |
| 3483 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3484 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3485 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3486 | reply.readException(); |
| 3487 | data.recycle(); |
| 3488 | reply.recycle(); |
| 3489 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3490 | public void activityResumed(IBinder token) throws RemoteException |
| 3491 | { |
| 3492 | Parcel data = Parcel.obtain(); |
| 3493 | Parcel reply = Parcel.obtain(); |
| 3494 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3495 | data.writeStrongBinder(token); |
| 3496 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3497 | reply.readException(); |
| 3498 | data.recycle(); |
| 3499 | reply.recycle(); |
| 3500 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3501 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3502 | { |
| 3503 | Parcel data = Parcel.obtain(); |
| 3504 | Parcel reply = Parcel.obtain(); |
| 3505 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3506 | data.writeStrongBinder(token); |
| 3507 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3508 | reply.readException(); |
| 3509 | data.recycle(); |
| 3510 | reply.recycle(); |
| 3511 | } |
| 3512 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3513 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3514 | { |
| 3515 | Parcel data = Parcel.obtain(); |
| 3516 | Parcel reply = Parcel.obtain(); |
| 3517 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3518 | data.writeStrongBinder(token); |
| 3519 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3520 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3521 | TextUtils.writeToParcel(description, data, 0); |
| 3522 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3523 | reply.readException(); |
| 3524 | data.recycle(); |
| 3525 | reply.recycle(); |
| 3526 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3527 | public void activitySlept(IBinder token) throws RemoteException |
| 3528 | { |
| 3529 | Parcel data = Parcel.obtain(); |
| 3530 | Parcel reply = Parcel.obtain(); |
| 3531 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3532 | data.writeStrongBinder(token); |
| 3533 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3534 | reply.readException(); |
| 3535 | data.recycle(); |
| 3536 | reply.recycle(); |
| 3537 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3538 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3539 | { |
| 3540 | Parcel data = Parcel.obtain(); |
| 3541 | Parcel reply = Parcel.obtain(); |
| 3542 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3543 | data.writeStrongBinder(token); |
| 3544 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3545 | reply.readException(); |
| 3546 | data.recycle(); |
| 3547 | reply.recycle(); |
| 3548 | } |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 3549 | public void activityRelaunched(IBinder token) throws RemoteException |
| 3550 | { |
| 3551 | Parcel data = Parcel.obtain(); |
| 3552 | Parcel reply = Parcel.obtain(); |
| 3553 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3554 | data.writeStrongBinder(token); |
| 3555 | mRemote.transact(ACTIVITY_RELAUNCHED_TRANSACTION, data, reply, 0); |
| 3556 | reply.readException(); |
| 3557 | data.recycle(); |
| 3558 | reply.recycle(); |
| 3559 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3560 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3561 | { |
| 3562 | Parcel data = Parcel.obtain(); |
| 3563 | Parcel reply = Parcel.obtain(); |
| 3564 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3565 | data.writeStrongBinder(token); |
| 3566 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3567 | reply.readException(); |
| 3568 | String res = reply.readString(); |
| 3569 | data.recycle(); |
| 3570 | reply.recycle(); |
| 3571 | return res; |
| 3572 | } |
| 3573 | public ComponentName getCallingActivity(IBinder token) |
| 3574 | throws RemoteException { |
| 3575 | Parcel data = Parcel.obtain(); |
| 3576 | Parcel reply = Parcel.obtain(); |
| 3577 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3578 | data.writeStrongBinder(token); |
| 3579 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3580 | reply.readException(); |
| 3581 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3582 | data.recycle(); |
| 3583 | reply.recycle(); |
| 3584 | return res; |
| 3585 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3586 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3587 | Parcel data = Parcel.obtain(); |
| 3588 | Parcel reply = Parcel.obtain(); |
| 3589 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3590 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3591 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3592 | reply.readException(); |
| 3593 | ArrayList<IAppTask> list = null; |
| 3594 | int N = reply.readInt(); |
| 3595 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3596 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3597 | while (N > 0) { |
| 3598 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3599 | list.add(task); |
| 3600 | N--; |
| 3601 | } |
| 3602 | } |
| 3603 | data.recycle(); |
| 3604 | reply.recycle(); |
| 3605 | return list; |
| 3606 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3607 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3608 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3609 | Parcel data = Parcel.obtain(); |
| 3610 | Parcel reply = Parcel.obtain(); |
| 3611 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3612 | data.writeStrongBinder(activityToken); |
| 3613 | intent.writeToParcel(data, 0); |
| 3614 | description.writeToParcel(data, 0); |
| 3615 | thumbnail.writeToParcel(data, 0); |
| 3616 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3617 | reply.readException(); |
| 3618 | int res = reply.readInt(); |
| 3619 | data.recycle(); |
| 3620 | reply.recycle(); |
| 3621 | return res; |
| 3622 | } |
| 3623 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3624 | Parcel data = Parcel.obtain(); |
| 3625 | Parcel reply = Parcel.obtain(); |
| 3626 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3627 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3628 | reply.readException(); |
| 3629 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3630 | data.recycle(); |
| 3631 | reply.recycle(); |
| 3632 | return size; |
| 3633 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3634 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3635 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3636 | Parcel data = Parcel.obtain(); |
| 3637 | Parcel reply = Parcel.obtain(); |
| 3638 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3639 | data.writeInt(maxNum); |
| 3640 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3641 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3642 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3643 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3644 | int N = reply.readInt(); |
| 3645 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3646 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3647 | while (N > 0) { |
| 3648 | ActivityManager.RunningTaskInfo info = |
| 3649 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3650 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3651 | list.add(info); |
| 3652 | N--; |
| 3653 | } |
| 3654 | } |
| 3655 | data.recycle(); |
| 3656 | reply.recycle(); |
| 3657 | return list; |
| 3658 | } |
| 3659 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3660 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3661 | Parcel data = Parcel.obtain(); |
| 3662 | Parcel reply = Parcel.obtain(); |
| 3663 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3664 | data.writeInt(maxNum); |
| 3665 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3666 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3667 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3668 | reply.readException(); |
| 3669 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3670 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3671 | data.recycle(); |
| 3672 | reply.recycle(); |
| 3673 | return list; |
| 3674 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3675 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3676 | Parcel data = Parcel.obtain(); |
| 3677 | Parcel reply = Parcel.obtain(); |
| 3678 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3679 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3680 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3681 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3682 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3683 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3684 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3685 | } |
| 3686 | data.recycle(); |
| 3687 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3688 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3689 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3690 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3691 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3692 | Parcel data = Parcel.obtain(); |
| 3693 | Parcel reply = Parcel.obtain(); |
| 3694 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3695 | data.writeInt(maxNum); |
| 3696 | data.writeInt(flags); |
| 3697 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3698 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3699 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3700 | int N = reply.readInt(); |
| 3701 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3702 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3703 | while (N > 0) { |
| 3704 | ActivityManager.RunningServiceInfo info = |
| 3705 | ActivityManager.RunningServiceInfo.CREATOR |
| 3706 | .createFromParcel(reply); |
| 3707 | list.add(info); |
| 3708 | N--; |
| 3709 | } |
| 3710 | } |
| 3711 | data.recycle(); |
| 3712 | reply.recycle(); |
| 3713 | return list; |
| 3714 | } |
| 3715 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3716 | throws RemoteException { |
| 3717 | Parcel data = Parcel.obtain(); |
| 3718 | Parcel reply = Parcel.obtain(); |
| 3719 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3720 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3721 | reply.readException(); |
| 3722 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3723 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3724 | data.recycle(); |
| 3725 | reply.recycle(); |
| 3726 | return list; |
| 3727 | } |
| 3728 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3729 | throws RemoteException { |
| 3730 | Parcel data = Parcel.obtain(); |
| 3731 | Parcel reply = Parcel.obtain(); |
| 3732 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3733 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3734 | reply.readException(); |
| 3735 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3736 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3737 | data.recycle(); |
| 3738 | reply.recycle(); |
| 3739 | return list; |
| 3740 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3741 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3742 | throws RemoteException { |
| 3743 | Parcel data = Parcel.obtain(); |
| 3744 | Parcel reply = Parcel.obtain(); |
| 3745 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3746 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3747 | reply.readException(); |
| 3748 | ArrayList<ApplicationInfo> list |
| 3749 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3750 | data.recycle(); |
| 3751 | reply.recycle(); |
| 3752 | return list; |
| 3753 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3754 | 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] | 3755 | { |
| 3756 | Parcel data = Parcel.obtain(); |
| 3757 | Parcel reply = Parcel.obtain(); |
| 3758 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3759 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3760 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3761 | if (options != null) { |
| 3762 | data.writeInt(1); |
| 3763 | options.writeToParcel(data, 0); |
| 3764 | } else { |
| 3765 | data.writeInt(0); |
| 3766 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3767 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3768 | reply.readException(); |
| 3769 | data.recycle(); |
| 3770 | reply.recycle(); |
| 3771 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3772 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3773 | throws RemoteException { |
| 3774 | Parcel data = Parcel.obtain(); |
| 3775 | Parcel reply = Parcel.obtain(); |
| 3776 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3777 | data.writeStrongBinder(token); |
| 3778 | data.writeInt(nonRoot ? 1 : 0); |
| 3779 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3780 | reply.readException(); |
| 3781 | boolean res = reply.readInt() != 0; |
| 3782 | data.recycle(); |
| 3783 | reply.recycle(); |
| 3784 | return res; |
| 3785 | } |
| 3786 | public void moveTaskBackwards(int task) throws RemoteException |
| 3787 | { |
| 3788 | Parcel data = Parcel.obtain(); |
| 3789 | Parcel reply = Parcel.obtain(); |
| 3790 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3791 | data.writeInt(task); |
| 3792 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3793 | reply.readException(); |
| 3794 | data.recycle(); |
| 3795 | reply.recycle(); |
| 3796 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3797 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3798 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3799 | { |
| 3800 | Parcel data = Parcel.obtain(); |
| 3801 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3802 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3803 | data.writeInt(taskId); |
| 3804 | data.writeInt(stackId); |
| 3805 | data.writeInt(toTop ? 1 : 0); |
| 3806 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3807 | reply.readException(); |
| 3808 | data.recycle(); |
| 3809 | reply.recycle(); |
| 3810 | } |
| 3811 | @Override |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3812 | public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, |
| 3813 | Rect initialBounds) throws RemoteException |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3814 | { |
| 3815 | Parcel data = Parcel.obtain(); |
| 3816 | Parcel reply = Parcel.obtain(); |
| 3817 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3818 | data.writeInt(taskId); |
| 3819 | data.writeInt(createMode); |
| 3820 | data.writeInt(toTop ? 1 : 0); |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 3821 | data.writeInt(animate ? 1 : 0); |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3822 | if (initialBounds != null) { |
| 3823 | data.writeInt(1); |
| 3824 | initialBounds.writeToParcel(data, 0); |
| 3825 | } else { |
| 3826 | data.writeInt(0); |
| 3827 | } |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3828 | mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3829 | reply.readException(); |
| 3830 | data.recycle(); |
| 3831 | reply.recycle(); |
| 3832 | } |
| 3833 | @Override |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3834 | public boolean moveTopActivityToPinnedStack(int stackId, Rect r) |
| 3835 | throws RemoteException |
| 3836 | { |
| 3837 | Parcel data = Parcel.obtain(); |
| 3838 | Parcel reply = Parcel.obtain(); |
| 3839 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3840 | data.writeInt(stackId); |
| 3841 | r.writeToParcel(data, 0); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 3842 | mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3843 | reply.readException(); |
| 3844 | final boolean res = reply.readInt() != 0; |
| 3845 | data.recycle(); |
| 3846 | reply.recycle(); |
| 3847 | return res; |
| 3848 | } |
| 3849 | @Override |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3850 | public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode, |
| 3851 | boolean preserveWindows, boolean animate) throws RemoteException { |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3852 | Parcel data = Parcel.obtain(); |
| 3853 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3854 | data.writeInterfaceToken(IActivityManager.descriptor); |
Wale Ogunwale | b34a7ad | 2015-08-14 11:05:30 -0700 | [diff] [blame] | 3855 | data.writeInt(stackId); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 3856 | if (r != null) { |
| 3857 | data.writeInt(1); |
| 3858 | r.writeToParcel(data, 0); |
| 3859 | } else { |
| 3860 | data.writeInt(0); |
| 3861 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3862 | data.writeInt(allowResizeInDockedMode ? 1 : 0); |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3863 | data.writeInt(preserveWindows ? 1 : 0); |
| 3864 | data.writeInt(animate ? 1 : 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3865 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3866 | reply.readException(); |
| 3867 | data.recycle(); |
| 3868 | reply.recycle(); |
| 3869 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3870 | @Override |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 3871 | public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds, |
| 3872 | Rect tempDockedTaskInsetBounds, |
| 3873 | Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds) |
| 3874 | throws RemoteException |
| 3875 | { |
| 3876 | Parcel data = Parcel.obtain(); |
| 3877 | Parcel reply = Parcel.obtain(); |
| 3878 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3879 | if (dockedBounds != null) { |
| 3880 | data.writeInt(1); |
| 3881 | dockedBounds.writeToParcel(data, 0); |
| 3882 | } else { |
| 3883 | data.writeInt(0); |
| 3884 | } |
| 3885 | if (tempDockedTaskBounds != null) { |
| 3886 | data.writeInt(1); |
| 3887 | tempDockedTaskBounds.writeToParcel(data, 0); |
| 3888 | } else { |
| 3889 | data.writeInt(0); |
| 3890 | } |
| 3891 | if (tempDockedTaskInsetBounds != null) { |
| 3892 | data.writeInt(1); |
| 3893 | tempDockedTaskInsetBounds.writeToParcel(data, 0); |
| 3894 | } else { |
| 3895 | data.writeInt(0); |
| 3896 | } |
| 3897 | if (tempOtherTaskBounds != null) { |
| 3898 | data.writeInt(1); |
| 3899 | tempOtherTaskBounds.writeToParcel(data, 0); |
| 3900 | } else { |
| 3901 | data.writeInt(0); |
| 3902 | } |
| 3903 | if (tempOtherTaskInsetBounds != null) { |
| 3904 | data.writeInt(1); |
| 3905 | tempOtherTaskInsetBounds.writeToParcel(data, 0); |
| 3906 | } else { |
| 3907 | data.writeInt(0); |
| 3908 | } |
| 3909 | mRemote.transact(RESIZE_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3910 | reply.readException(); |
| 3911 | data.recycle(); |
| 3912 | reply.recycle(); |
| 3913 | } |
| 3914 | @Override |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 3915 | public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException |
| 3916 | { |
| 3917 | Parcel data = Parcel.obtain(); |
| 3918 | Parcel reply = Parcel.obtain(); |
| 3919 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3920 | data.writeInt(taskId); |
| 3921 | data.writeInt(stackId); |
| 3922 | data.writeInt(position); |
| 3923 | mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0); |
| 3924 | reply.readException(); |
| 3925 | data.recycle(); |
| 3926 | reply.recycle(); |
| 3927 | } |
| 3928 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3929 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3930 | { |
| 3931 | Parcel data = Parcel.obtain(); |
| 3932 | Parcel reply = Parcel.obtain(); |
| 3933 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3934 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3935 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3936 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3937 | data.recycle(); |
| 3938 | reply.recycle(); |
| 3939 | return list; |
| 3940 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3941 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3942 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3943 | { |
| 3944 | Parcel data = Parcel.obtain(); |
| 3945 | Parcel reply = Parcel.obtain(); |
| 3946 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3947 | data.writeInt(stackId); |
| 3948 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3949 | reply.readException(); |
| 3950 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3951 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3952 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3953 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3954 | } |
| 3955 | data.recycle(); |
| 3956 | reply.recycle(); |
| 3957 | return info; |
| 3958 | } |
| 3959 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 3960 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 3961 | Parcel data = Parcel.obtain(); |
| 3962 | Parcel reply = Parcel.obtain(); |
| 3963 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3964 | data.writeInt(taskId); |
| 3965 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 3966 | reply.readException(); |
| 3967 | boolean isInHomeStack = reply.readInt() > 0; |
| 3968 | data.recycle(); |
| 3969 | reply.recycle(); |
| 3970 | return isInHomeStack; |
| 3971 | } |
| 3972 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3973 | public void setFocusedStack(int stackId) throws RemoteException |
| 3974 | { |
| 3975 | Parcel data = Parcel.obtain(); |
| 3976 | Parcel reply = Parcel.obtain(); |
| 3977 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3978 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3979 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3980 | reply.readException(); |
| 3981 | data.recycle(); |
| 3982 | reply.recycle(); |
| 3983 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3984 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 3985 | public int getFocusedStackId() throws RemoteException { |
| 3986 | Parcel data = Parcel.obtain(); |
| 3987 | Parcel reply = Parcel.obtain(); |
| 3988 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3989 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 3990 | reply.readException(); |
| 3991 | int focusedStackId = reply.readInt(); |
| 3992 | data.recycle(); |
| 3993 | reply.recycle(); |
| 3994 | return focusedStackId; |
| 3995 | } |
| 3996 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 3997 | public void setFocusedTask(int taskId) throws RemoteException |
| 3998 | { |
| 3999 | Parcel data = Parcel.obtain(); |
| 4000 | Parcel reply = Parcel.obtain(); |
| 4001 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4002 | data.writeInt(taskId); |
| 4003 | mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0); |
| 4004 | reply.readException(); |
| 4005 | data.recycle(); |
| 4006 | reply.recycle(); |
| 4007 | } |
| 4008 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4009 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 4010 | { |
| 4011 | Parcel data = Parcel.obtain(); |
| 4012 | Parcel reply = Parcel.obtain(); |
| 4013 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4014 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4015 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4016 | reply.readException(); |
| 4017 | data.recycle(); |
| 4018 | reply.recycle(); |
| 4019 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4020 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 4021 | { |
| 4022 | Parcel data = Parcel.obtain(); |
| 4023 | Parcel reply = Parcel.obtain(); |
| 4024 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4025 | data.writeStrongBinder(token); |
| 4026 | data.writeInt(onlyRoot ? 1 : 0); |
| 4027 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4028 | reply.readException(); |
| 4029 | int res = reply.readInt(); |
| 4030 | data.recycle(); |
| 4031 | reply.recycle(); |
| 4032 | return res; |
| 4033 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4034 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4035 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4036 | Parcel data = Parcel.obtain(); |
| 4037 | Parcel reply = Parcel.obtain(); |
| 4038 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4039 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4040 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4041 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4042 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4043 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4044 | reply.readException(); |
| 4045 | int res = reply.readInt(); |
| 4046 | ContentProviderHolder cph = null; |
| 4047 | if (res != 0) { |
| 4048 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4049 | } |
| 4050 | data.recycle(); |
| 4051 | reply.recycle(); |
| 4052 | return cph; |
| 4053 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4054 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 4055 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4056 | Parcel data = Parcel.obtain(); |
| 4057 | Parcel reply = Parcel.obtain(); |
| 4058 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4059 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4060 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4061 | data.writeStrongBinder(token); |
| 4062 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4063 | reply.readException(); |
| 4064 | int res = reply.readInt(); |
| 4065 | ContentProviderHolder cph = null; |
| 4066 | if (res != 0) { |
| 4067 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4068 | } |
| 4069 | data.recycle(); |
| 4070 | reply.recycle(); |
| 4071 | return cph; |
| 4072 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4073 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4074 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4075 | { |
| 4076 | Parcel data = Parcel.obtain(); |
| 4077 | Parcel reply = Parcel.obtain(); |
| 4078 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4079 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4080 | data.writeTypedList(providers); |
| 4081 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 4082 | reply.readException(); |
| 4083 | data.recycle(); |
| 4084 | reply.recycle(); |
| 4085 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4086 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 4087 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4088 | Parcel data = Parcel.obtain(); |
| 4089 | Parcel reply = Parcel.obtain(); |
| 4090 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4091 | data.writeStrongBinder(connection); |
| 4092 | data.writeInt(stable); |
| 4093 | data.writeInt(unstable); |
| 4094 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4095 | reply.readException(); |
| 4096 | boolean res = reply.readInt() != 0; |
| 4097 | data.recycle(); |
| 4098 | reply.recycle(); |
| 4099 | return res; |
| 4100 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4101 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4102 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 4103 | Parcel data = Parcel.obtain(); |
| 4104 | Parcel reply = Parcel.obtain(); |
| 4105 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4106 | data.writeStrongBinder(connection); |
| 4107 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 4108 | reply.readException(); |
| 4109 | data.recycle(); |
| 4110 | reply.recycle(); |
| 4111 | } |
| 4112 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4113 | @Override |
| 4114 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 4115 | Parcel data = Parcel.obtain(); |
| 4116 | Parcel reply = Parcel.obtain(); |
| 4117 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4118 | data.writeStrongBinder(connection); |
| 4119 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 4120 | reply.readException(); |
| 4121 | data.recycle(); |
| 4122 | reply.recycle(); |
| 4123 | } |
| 4124 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4125 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 4126 | Parcel data = Parcel.obtain(); |
| 4127 | Parcel reply = Parcel.obtain(); |
| 4128 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4129 | data.writeStrongBinder(connection); |
| 4130 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4131 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4132 | reply.readException(); |
| 4133 | data.recycle(); |
| 4134 | reply.recycle(); |
| 4135 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4136 | |
| 4137 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 4138 | Parcel data = Parcel.obtain(); |
| 4139 | Parcel reply = Parcel.obtain(); |
| 4140 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4141 | data.writeString(name); |
| 4142 | data.writeStrongBinder(token); |
| 4143 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4144 | reply.readException(); |
| 4145 | data.recycle(); |
| 4146 | reply.recycle(); |
| 4147 | } |
| 4148 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 4149 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 4150 | throws RemoteException |
| 4151 | { |
| 4152 | Parcel data = Parcel.obtain(); |
| 4153 | Parcel reply = Parcel.obtain(); |
| 4154 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4155 | service.writeToParcel(data, 0); |
| 4156 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 4157 | reply.readException(); |
| 4158 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 4159 | data.recycle(); |
| 4160 | reply.recycle(); |
| 4161 | return res; |
| 4162 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4163 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4164 | public ComponentName startService(IApplicationThread caller, Intent service, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4165 | String resolvedType, String callingPackage, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4166 | { |
| 4167 | Parcel data = Parcel.obtain(); |
| 4168 | Parcel reply = Parcel.obtain(); |
| 4169 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4170 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4171 | service.writeToParcel(data, 0); |
| 4172 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4173 | data.writeString(callingPackage); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4174 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4175 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 4176 | reply.readException(); |
| 4177 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4178 | data.recycle(); |
| 4179 | reply.recycle(); |
| 4180 | return res; |
| 4181 | } |
| 4182 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4183 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4184 | { |
| 4185 | Parcel data = Parcel.obtain(); |
| 4186 | Parcel reply = Parcel.obtain(); |
| 4187 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4188 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4189 | service.writeToParcel(data, 0); |
| 4190 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4191 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4192 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 4193 | reply.readException(); |
| 4194 | int res = reply.readInt(); |
| 4195 | reply.recycle(); |
| 4196 | data.recycle(); |
| 4197 | return res; |
| 4198 | } |
| 4199 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 4200 | int startId) throws RemoteException { |
| 4201 | Parcel data = Parcel.obtain(); |
| 4202 | Parcel reply = Parcel.obtain(); |
| 4203 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4204 | ComponentName.writeToParcel(className, data); |
| 4205 | data.writeStrongBinder(token); |
| 4206 | data.writeInt(startId); |
| 4207 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 4208 | reply.readException(); |
| 4209 | boolean res = reply.readInt() != 0; |
| 4210 | data.recycle(); |
| 4211 | reply.recycle(); |
| 4212 | return res; |
| 4213 | } |
| 4214 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4215 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4216 | Parcel data = Parcel.obtain(); |
| 4217 | Parcel reply = Parcel.obtain(); |
| 4218 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4219 | ComponentName.writeToParcel(className, data); |
| 4220 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4221 | data.writeInt(id); |
| 4222 | if (notification != null) { |
| 4223 | data.writeInt(1); |
| 4224 | notification.writeToParcel(data, 0); |
| 4225 | } else { |
| 4226 | data.writeInt(0); |
| 4227 | } |
| 4228 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4229 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4230 | reply.readException(); |
| 4231 | data.recycle(); |
| 4232 | reply.recycle(); |
| 4233 | } |
| 4234 | public int bindService(IApplicationThread caller, IBinder token, |
| 4235 | Intent service, String resolvedType, IServiceConnection connection, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4236 | int flags, String callingPackage, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4237 | Parcel data = Parcel.obtain(); |
| 4238 | Parcel reply = Parcel.obtain(); |
| 4239 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4240 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4241 | data.writeStrongBinder(token); |
| 4242 | service.writeToParcel(data, 0); |
| 4243 | data.writeString(resolvedType); |
| 4244 | data.writeStrongBinder(connection.asBinder()); |
| 4245 | data.writeInt(flags); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4246 | data.writeString(callingPackage); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 4247 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4248 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4249 | reply.readException(); |
| 4250 | int res = reply.readInt(); |
| 4251 | data.recycle(); |
| 4252 | reply.recycle(); |
| 4253 | return res; |
| 4254 | } |
| 4255 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 4256 | { |
| 4257 | Parcel data = Parcel.obtain(); |
| 4258 | Parcel reply = Parcel.obtain(); |
| 4259 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4260 | data.writeStrongBinder(connection.asBinder()); |
| 4261 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4262 | reply.readException(); |
| 4263 | boolean res = reply.readInt() != 0; |
| 4264 | data.recycle(); |
| 4265 | reply.recycle(); |
| 4266 | return res; |
| 4267 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4268 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4269 | public void publishService(IBinder token, |
| 4270 | Intent intent, IBinder service) throws RemoteException { |
| 4271 | Parcel data = Parcel.obtain(); |
| 4272 | Parcel reply = Parcel.obtain(); |
| 4273 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4274 | data.writeStrongBinder(token); |
| 4275 | intent.writeToParcel(data, 0); |
| 4276 | data.writeStrongBinder(service); |
| 4277 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 4278 | reply.readException(); |
| 4279 | data.recycle(); |
| 4280 | reply.recycle(); |
| 4281 | } |
| 4282 | |
| 4283 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 4284 | throws RemoteException { |
| 4285 | Parcel data = Parcel.obtain(); |
| 4286 | Parcel reply = Parcel.obtain(); |
| 4287 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4288 | data.writeStrongBinder(token); |
| 4289 | intent.writeToParcel(data, 0); |
| 4290 | data.writeInt(doRebind ? 1 : 0); |
| 4291 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 4292 | reply.readException(); |
| 4293 | data.recycle(); |
| 4294 | reply.recycle(); |
| 4295 | } |
| 4296 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4297 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 4298 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4299 | Parcel data = Parcel.obtain(); |
| 4300 | Parcel reply = Parcel.obtain(); |
| 4301 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4302 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4303 | data.writeInt(type); |
| 4304 | data.writeInt(startId); |
| 4305 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4306 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 4307 | reply.readException(); |
| 4308 | data.recycle(); |
| 4309 | reply.recycle(); |
| 4310 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4311 | |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4312 | public IBinder peekService(Intent service, String resolvedType, String callingPackage) |
| 4313 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4314 | Parcel data = Parcel.obtain(); |
| 4315 | Parcel reply = Parcel.obtain(); |
| 4316 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4317 | service.writeToParcel(data, 0); |
| 4318 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4319 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4320 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 4321 | reply.readException(); |
| 4322 | IBinder binder = reply.readStrongBinder(); |
| 4323 | reply.recycle(); |
| 4324 | data.recycle(); |
| 4325 | return binder; |
| 4326 | } |
| 4327 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4328 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 4329 | throws RemoteException { |
| 4330 | Parcel data = Parcel.obtain(); |
| 4331 | Parcel reply = Parcel.obtain(); |
| 4332 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4333 | app.writeToParcel(data, 0); |
| 4334 | data.writeInt(backupRestoreMode); |
| 4335 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4336 | reply.readException(); |
| 4337 | boolean success = reply.readInt() != 0; |
| 4338 | reply.recycle(); |
| 4339 | data.recycle(); |
| 4340 | return success; |
| 4341 | } |
| 4342 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 4343 | public void clearPendingBackup() throws RemoteException { |
| 4344 | Parcel data = Parcel.obtain(); |
| 4345 | Parcel reply = Parcel.obtain(); |
| 4346 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4347 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 4348 | reply.recycle(); |
| 4349 | data.recycle(); |
| 4350 | } |
| 4351 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4352 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 4353 | Parcel data = Parcel.obtain(); |
| 4354 | Parcel reply = Parcel.obtain(); |
| 4355 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4356 | data.writeString(packageName); |
| 4357 | data.writeStrongBinder(agent); |
| 4358 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 4359 | reply.recycle(); |
| 4360 | data.recycle(); |
| 4361 | } |
| 4362 | |
| 4363 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 4364 | Parcel data = Parcel.obtain(); |
| 4365 | Parcel reply = Parcel.obtain(); |
| 4366 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4367 | app.writeToParcel(data, 0); |
| 4368 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4369 | reply.readException(); |
| 4370 | reply.recycle(); |
| 4371 | data.recycle(); |
| 4372 | } |
| 4373 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4374 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4375 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4376 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 4377 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4378 | Parcel data = Parcel.obtain(); |
| 4379 | Parcel reply = Parcel.obtain(); |
| 4380 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4381 | ComponentName.writeToParcel(className, data); |
| 4382 | data.writeString(profileFile); |
| 4383 | data.writeInt(flags); |
| 4384 | data.writeBundle(arguments); |
| 4385 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4386 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4387 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4388 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4389 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4390 | reply.readException(); |
| 4391 | boolean res = reply.readInt() != 0; |
| 4392 | reply.recycle(); |
| 4393 | data.recycle(); |
| 4394 | return res; |
| 4395 | } |
| 4396 | |
| 4397 | public void finishInstrumentation(IApplicationThread target, |
| 4398 | int resultCode, Bundle results) throws RemoteException { |
| 4399 | Parcel data = Parcel.obtain(); |
| 4400 | Parcel reply = Parcel.obtain(); |
| 4401 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4402 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 4403 | data.writeInt(resultCode); |
| 4404 | data.writeBundle(results); |
| 4405 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4406 | reply.readException(); |
| 4407 | data.recycle(); |
| 4408 | reply.recycle(); |
| 4409 | } |
| 4410 | public Configuration getConfiguration() throws RemoteException |
| 4411 | { |
| 4412 | Parcel data = Parcel.obtain(); |
| 4413 | Parcel reply = Parcel.obtain(); |
| 4414 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4415 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4416 | reply.readException(); |
| 4417 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 4418 | reply.recycle(); |
| 4419 | data.recycle(); |
| 4420 | return res; |
| 4421 | } |
| 4422 | public void updateConfiguration(Configuration values) throws RemoteException |
| 4423 | { |
| 4424 | Parcel data = Parcel.obtain(); |
| 4425 | Parcel reply = Parcel.obtain(); |
| 4426 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4427 | values.writeToParcel(data, 0); |
| 4428 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4429 | reply.readException(); |
| 4430 | data.recycle(); |
| 4431 | reply.recycle(); |
| 4432 | } |
| 4433 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 4434 | throws RemoteException { |
| 4435 | Parcel data = Parcel.obtain(); |
| 4436 | Parcel reply = Parcel.obtain(); |
| 4437 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4438 | data.writeStrongBinder(token); |
| 4439 | data.writeInt(requestedOrientation); |
| 4440 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4441 | reply.readException(); |
| 4442 | data.recycle(); |
| 4443 | reply.recycle(); |
| 4444 | } |
| 4445 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 4446 | Parcel data = Parcel.obtain(); |
| 4447 | Parcel reply = Parcel.obtain(); |
| 4448 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4449 | data.writeStrongBinder(token); |
| 4450 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4451 | reply.readException(); |
| 4452 | int res = reply.readInt(); |
| 4453 | data.recycle(); |
| 4454 | reply.recycle(); |
| 4455 | return res; |
| 4456 | } |
| 4457 | public ComponentName getActivityClassForToken(IBinder token) |
| 4458 | throws RemoteException { |
| 4459 | Parcel data = Parcel.obtain(); |
| 4460 | Parcel reply = Parcel.obtain(); |
| 4461 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4462 | data.writeStrongBinder(token); |
| 4463 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4464 | reply.readException(); |
| 4465 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4466 | data.recycle(); |
| 4467 | reply.recycle(); |
| 4468 | return res; |
| 4469 | } |
| 4470 | public String getPackageForToken(IBinder token) throws RemoteException |
| 4471 | { |
| 4472 | Parcel data = Parcel.obtain(); |
| 4473 | Parcel reply = Parcel.obtain(); |
| 4474 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4475 | data.writeStrongBinder(token); |
| 4476 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4477 | reply.readException(); |
| 4478 | String res = reply.readString(); |
| 4479 | data.recycle(); |
| 4480 | reply.recycle(); |
| 4481 | return res; |
| 4482 | } |
| 4483 | public IIntentSender getIntentSender(int type, |
| 4484 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4485 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4486 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4487 | Parcel data = Parcel.obtain(); |
| 4488 | Parcel reply = Parcel.obtain(); |
| 4489 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4490 | data.writeInt(type); |
| 4491 | data.writeString(packageName); |
| 4492 | data.writeStrongBinder(token); |
| 4493 | data.writeString(resultWho); |
| 4494 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4495 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4496 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4497 | data.writeTypedArray(intents, 0); |
| 4498 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4499 | } else { |
| 4500 | data.writeInt(0); |
| 4501 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4502 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4503 | if (options != null) { |
| 4504 | data.writeInt(1); |
| 4505 | options.writeToParcel(data, 0); |
| 4506 | } else { |
| 4507 | data.writeInt(0); |
| 4508 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4509 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4510 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4511 | reply.readException(); |
| 4512 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4513 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4514 | data.recycle(); |
| 4515 | reply.recycle(); |
| 4516 | return res; |
| 4517 | } |
| 4518 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 4519 | Parcel data = Parcel.obtain(); |
| 4520 | Parcel reply = Parcel.obtain(); |
| 4521 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4522 | data.writeStrongBinder(sender.asBinder()); |
| 4523 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4524 | reply.readException(); |
| 4525 | data.recycle(); |
| 4526 | reply.recycle(); |
| 4527 | } |
| 4528 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 4529 | Parcel data = Parcel.obtain(); |
| 4530 | Parcel reply = Parcel.obtain(); |
| 4531 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4532 | data.writeStrongBinder(sender.asBinder()); |
| 4533 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4534 | reply.readException(); |
| 4535 | String res = reply.readString(); |
| 4536 | data.recycle(); |
| 4537 | reply.recycle(); |
| 4538 | return res; |
| 4539 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 4540 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 4541 | Parcel data = Parcel.obtain(); |
| 4542 | Parcel reply = Parcel.obtain(); |
| 4543 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4544 | data.writeStrongBinder(sender.asBinder()); |
| 4545 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4546 | reply.readException(); |
| 4547 | int res = reply.readInt(); |
| 4548 | data.recycle(); |
| 4549 | reply.recycle(); |
| 4550 | return res; |
| 4551 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4552 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 4553 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 4554 | Parcel data = Parcel.obtain(); |
| 4555 | Parcel reply = Parcel.obtain(); |
| 4556 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4557 | data.writeInt(callingPid); |
| 4558 | data.writeInt(callingUid); |
| 4559 | data.writeInt(userId); |
| 4560 | data.writeInt(allowAll ? 1 : 0); |
| 4561 | data.writeInt(requireFull ? 1 : 0); |
| 4562 | data.writeString(name); |
| 4563 | data.writeString(callerPackage); |
| 4564 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 4565 | reply.readException(); |
| 4566 | int res = reply.readInt(); |
| 4567 | data.recycle(); |
| 4568 | reply.recycle(); |
| 4569 | return res; |
| 4570 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4571 | public void setProcessLimit(int max) throws RemoteException |
| 4572 | { |
| 4573 | Parcel data = Parcel.obtain(); |
| 4574 | Parcel reply = Parcel.obtain(); |
| 4575 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4576 | data.writeInt(max); |
| 4577 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4578 | reply.readException(); |
| 4579 | data.recycle(); |
| 4580 | reply.recycle(); |
| 4581 | } |
| 4582 | public int getProcessLimit() throws RemoteException |
| 4583 | { |
| 4584 | Parcel data = Parcel.obtain(); |
| 4585 | Parcel reply = Parcel.obtain(); |
| 4586 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4587 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4588 | reply.readException(); |
| 4589 | int res = reply.readInt(); |
| 4590 | data.recycle(); |
| 4591 | reply.recycle(); |
| 4592 | return res; |
| 4593 | } |
| 4594 | public void setProcessForeground(IBinder token, int pid, |
| 4595 | boolean isForeground) throws RemoteException { |
| 4596 | Parcel data = Parcel.obtain(); |
| 4597 | Parcel reply = Parcel.obtain(); |
| 4598 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4599 | data.writeStrongBinder(token); |
| 4600 | data.writeInt(pid); |
| 4601 | data.writeInt(isForeground ? 1 : 0); |
| 4602 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4603 | reply.readException(); |
| 4604 | data.recycle(); |
| 4605 | reply.recycle(); |
| 4606 | } |
| 4607 | public int checkPermission(String permission, int pid, int uid) |
| 4608 | throws RemoteException { |
| 4609 | Parcel data = Parcel.obtain(); |
| 4610 | Parcel reply = Parcel.obtain(); |
| 4611 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4612 | data.writeString(permission); |
| 4613 | data.writeInt(pid); |
| 4614 | data.writeInt(uid); |
| 4615 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4616 | reply.readException(); |
| 4617 | int res = reply.readInt(); |
| 4618 | data.recycle(); |
| 4619 | reply.recycle(); |
| 4620 | return res; |
| 4621 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4622 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4623 | throws RemoteException { |
| 4624 | Parcel data = Parcel.obtain(); |
| 4625 | Parcel reply = Parcel.obtain(); |
| 4626 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4627 | data.writeString(permission); |
| 4628 | data.writeInt(pid); |
| 4629 | data.writeInt(uid); |
| 4630 | data.writeStrongBinder(callerToken); |
| 4631 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4632 | reply.readException(); |
| 4633 | int res = reply.readInt(); |
| 4634 | data.recycle(); |
| 4635 | reply.recycle(); |
| 4636 | return res; |
| 4637 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4638 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4639 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4640 | Parcel data = Parcel.obtain(); |
| 4641 | Parcel reply = Parcel.obtain(); |
| 4642 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4643 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4644 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4645 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4646 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4647 | reply.readException(); |
| 4648 | boolean res = reply.readInt() != 0; |
| 4649 | data.recycle(); |
| 4650 | reply.recycle(); |
| 4651 | return res; |
| 4652 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4653 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4654 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4655 | Parcel data = Parcel.obtain(); |
| 4656 | Parcel reply = Parcel.obtain(); |
| 4657 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4658 | uri.writeToParcel(data, 0); |
| 4659 | data.writeInt(pid); |
| 4660 | data.writeInt(uid); |
| 4661 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4662 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4663 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4664 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4665 | reply.readException(); |
| 4666 | int res = reply.readInt(); |
| 4667 | data.recycle(); |
| 4668 | reply.recycle(); |
| 4669 | return res; |
| 4670 | } |
| 4671 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4672 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4673 | Parcel data = Parcel.obtain(); |
| 4674 | Parcel reply = Parcel.obtain(); |
| 4675 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4676 | data.writeStrongBinder(caller.asBinder()); |
| 4677 | data.writeString(targetPkg); |
| 4678 | uri.writeToParcel(data, 0); |
| 4679 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4680 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4681 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4682 | reply.readException(); |
| 4683 | data.recycle(); |
| 4684 | reply.recycle(); |
| 4685 | } |
| 4686 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4687 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4688 | Parcel data = Parcel.obtain(); |
| 4689 | Parcel reply = Parcel.obtain(); |
| 4690 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4691 | data.writeStrongBinder(caller.asBinder()); |
| 4692 | uri.writeToParcel(data, 0); |
| 4693 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4694 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4695 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4696 | reply.readException(); |
| 4697 | data.recycle(); |
| 4698 | reply.recycle(); |
| 4699 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4700 | |
| 4701 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4702 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4703 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4704 | Parcel data = Parcel.obtain(); |
| 4705 | Parcel reply = Parcel.obtain(); |
| 4706 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4707 | uri.writeToParcel(data, 0); |
| 4708 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4709 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4710 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4711 | reply.readException(); |
| 4712 | data.recycle(); |
| 4713 | reply.recycle(); |
| 4714 | } |
| 4715 | |
| 4716 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4717 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4718 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4719 | Parcel data = Parcel.obtain(); |
| 4720 | Parcel reply = Parcel.obtain(); |
| 4721 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4722 | uri.writeToParcel(data, 0); |
| 4723 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4724 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4725 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4726 | reply.readException(); |
| 4727 | data.recycle(); |
| 4728 | reply.recycle(); |
| 4729 | } |
| 4730 | |
| 4731 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4732 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4733 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4734 | Parcel data = Parcel.obtain(); |
| 4735 | Parcel reply = Parcel.obtain(); |
| 4736 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4737 | data.writeString(packageName); |
| 4738 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4739 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4740 | reply.readException(); |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4741 | @SuppressWarnings("unchecked") |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4742 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4743 | reply); |
| 4744 | data.recycle(); |
| 4745 | reply.recycle(); |
| 4746 | return perms; |
| 4747 | } |
| 4748 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4749 | @Override |
| 4750 | public ParceledListSlice<UriPermission> getGrantedUriPermissions(String packageName, int userId) |
| 4751 | throws RemoteException { |
| 4752 | Parcel data = Parcel.obtain(); |
| 4753 | Parcel reply = Parcel.obtain(); |
| 4754 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4755 | data.writeString(packageName); |
| 4756 | data.writeInt(userId); |
| 4757 | mRemote.transact(GET_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4758 | reply.readException(); |
| 4759 | @SuppressWarnings("unchecked") |
| 4760 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4761 | reply); |
| 4762 | data.recycle(); |
| 4763 | reply.recycle(); |
| 4764 | return perms; |
| 4765 | } |
| 4766 | |
| 4767 | @Override |
| 4768 | public void clearGrantedUriPermissions(String packageName, int userId) throws RemoteException { |
| 4769 | Parcel data = Parcel.obtain(); |
| 4770 | Parcel reply = Parcel.obtain(); |
| 4771 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4772 | data.writeString(packageName); |
| 4773 | data.writeInt(userId); |
| 4774 | mRemote.transact(CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4775 | reply.readException(); |
| 4776 | data.recycle(); |
| 4777 | reply.recycle(); |
| 4778 | } |
| 4779 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4780 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4781 | throws RemoteException { |
| 4782 | Parcel data = Parcel.obtain(); |
| 4783 | Parcel reply = Parcel.obtain(); |
| 4784 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4785 | data.writeStrongBinder(who.asBinder()); |
| 4786 | data.writeInt(waiting ? 1 : 0); |
| 4787 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4788 | reply.readException(); |
| 4789 | data.recycle(); |
| 4790 | reply.recycle(); |
| 4791 | } |
| 4792 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4793 | Parcel data = Parcel.obtain(); |
| 4794 | Parcel reply = Parcel.obtain(); |
| 4795 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4796 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4797 | reply.readException(); |
| 4798 | outInfo.readFromParcel(reply); |
| 4799 | data.recycle(); |
| 4800 | reply.recycle(); |
| 4801 | } |
| 4802 | public void unhandledBack() throws RemoteException |
| 4803 | { |
| 4804 | Parcel data = Parcel.obtain(); |
| 4805 | Parcel reply = Parcel.obtain(); |
| 4806 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4807 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4808 | reply.readException(); |
| 4809 | data.recycle(); |
| 4810 | reply.recycle(); |
| 4811 | } |
| 4812 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4813 | { |
| 4814 | Parcel data = Parcel.obtain(); |
| 4815 | Parcel reply = Parcel.obtain(); |
| 4816 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4817 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4818 | reply.readException(); |
| 4819 | ParcelFileDescriptor pfd = null; |
| 4820 | if (reply.readInt() != 0) { |
| 4821 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4822 | } |
| 4823 | data.recycle(); |
| 4824 | reply.recycle(); |
| 4825 | return pfd; |
| 4826 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4827 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4828 | { |
| 4829 | Parcel data = Parcel.obtain(); |
| 4830 | Parcel reply = Parcel.obtain(); |
| 4831 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4832 | data.writeInt(shown ? 1 : 0); |
| 4833 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4834 | reply.readException(); |
| 4835 | data.recycle(); |
| 4836 | reply.recycle(); |
| 4837 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4838 | public void setDebugApp( |
| 4839 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4840 | throws RemoteException |
| 4841 | { |
| 4842 | Parcel data = Parcel.obtain(); |
| 4843 | Parcel reply = Parcel.obtain(); |
| 4844 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4845 | data.writeString(packageName); |
| 4846 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4847 | data.writeInt(persistent ? 1 : 0); |
| 4848 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4849 | reply.readException(); |
| 4850 | data.recycle(); |
| 4851 | reply.recycle(); |
| 4852 | } |
| 4853 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4854 | { |
| 4855 | Parcel data = Parcel.obtain(); |
| 4856 | Parcel reply = Parcel.obtain(); |
| 4857 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4858 | data.writeInt(enabled ? 1 : 0); |
| 4859 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4860 | reply.readException(); |
| 4861 | data.recycle(); |
| 4862 | reply.recycle(); |
| 4863 | } |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 4864 | public void setActivityController(IActivityController watcher, boolean imAMonkey) |
| 4865 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4866 | { |
| 4867 | Parcel data = Parcel.obtain(); |
| 4868 | Parcel reply = Parcel.obtain(); |
| 4869 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4870 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 4871 | data.writeInt(imAMonkey ? 1 : 0); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4872 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4873 | reply.readException(); |
| 4874 | data.recycle(); |
| 4875 | reply.recycle(); |
| 4876 | } |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 4877 | public void setLenientBackgroundCheck(boolean enabled) throws RemoteException |
| 4878 | { |
| 4879 | Parcel data = Parcel.obtain(); |
| 4880 | Parcel reply = Parcel.obtain(); |
| 4881 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4882 | data.writeInt(enabled ? 1 : 0); |
| 4883 | mRemote.transact(SET_LENIENT_BACKGROUND_CHECK_TRANSACTION, data, reply, 0); |
| 4884 | reply.readException(); |
| 4885 | data.recycle(); |
| 4886 | reply.recycle(); |
| 4887 | } |
Dianne Hackborn | 970510b | 2016-02-24 16:56:42 -0800 | [diff] [blame] | 4888 | public int getMemoryTrimLevel() throws RemoteException |
| 4889 | { |
| 4890 | Parcel data = Parcel.obtain(); |
| 4891 | Parcel reply = Parcel.obtain(); |
| 4892 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4893 | mRemote.transact(GET_MEMORY_TRIM_LEVEL_TRANSACTION, data, reply, 0); |
| 4894 | reply.readException(); |
| 4895 | int level = reply.readInt(); |
| 4896 | data.recycle(); |
| 4897 | reply.recycle(); |
| 4898 | return level; |
| 4899 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4900 | public void enterSafeMode() throws RemoteException { |
| 4901 | Parcel data = Parcel.obtain(); |
| 4902 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4903 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4904 | data.recycle(); |
| 4905 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4906 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4907 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4908 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4909 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4910 | data.writeStrongBinder(sender.asBinder()); |
| 4911 | data.writeInt(sourceUid); |
| 4912 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4913 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4914 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4915 | data.recycle(); |
| 4916 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4917 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 4918 | throws RemoteException { |
| 4919 | Parcel data = Parcel.obtain(); |
| 4920 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4921 | data.writeStrongBinder(sender.asBinder()); |
| 4922 | data.writeInt(sourceUid); |
| 4923 | data.writeString(tag); |
| 4924 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 4925 | data.recycle(); |
| 4926 | } |
| 4927 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 4928 | throws RemoteException { |
| 4929 | Parcel data = Parcel.obtain(); |
| 4930 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4931 | data.writeStrongBinder(sender.asBinder()); |
| 4932 | data.writeInt(sourceUid); |
| 4933 | data.writeString(tag); |
| 4934 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 4935 | data.recycle(); |
| 4936 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4937 | 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] | 4938 | Parcel data = Parcel.obtain(); |
| 4939 | Parcel reply = Parcel.obtain(); |
| 4940 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4941 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4942 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4943 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4944 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 4945 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4946 | boolean res = reply.readInt() != 0; |
| 4947 | data.recycle(); |
| 4948 | reply.recycle(); |
| 4949 | return res; |
| 4950 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 4951 | @Override |
| 4952 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 4953 | Parcel data = Parcel.obtain(); |
| 4954 | Parcel reply = Parcel.obtain(); |
| 4955 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4956 | data.writeString(reason); |
| 4957 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4958 | boolean res = reply.readInt() != 0; |
| 4959 | data.recycle(); |
| 4960 | reply.recycle(); |
| 4961 | return res; |
| 4962 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4963 | public boolean testIsSystemReady() |
| 4964 | { |
| 4965 | /* this base class version is never called */ |
| 4966 | return true; |
| 4967 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4968 | public void handleApplicationCrash(IBinder app, |
| 4969 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 4970 | { |
| 4971 | Parcel data = Parcel.obtain(); |
| 4972 | Parcel reply = Parcel.obtain(); |
| 4973 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4974 | data.writeStrongBinder(app); |
| 4975 | crashInfo.writeToParcel(data, 0); |
| 4976 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 4977 | reply.readException(); |
| 4978 | reply.recycle(); |
| 4979 | data.recycle(); |
| 4980 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4981 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4982 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4983 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4984 | { |
| 4985 | Parcel data = Parcel.obtain(); |
| 4986 | Parcel reply = Parcel.obtain(); |
| 4987 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4988 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4989 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4990 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4991 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4992 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4993 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4994 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4995 | reply.recycle(); |
| 4996 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4997 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4998 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4999 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5000 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 5001 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 5002 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5003 | { |
| 5004 | Parcel data = Parcel.obtain(); |
| 5005 | Parcel reply = Parcel.obtain(); |
| 5006 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5007 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 5008 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 5009 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5010 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 5011 | reply.readException(); |
| 5012 | reply.recycle(); |
| 5013 | data.recycle(); |
| 5014 | } |
| 5015 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5016 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 5017 | Parcel data = Parcel.obtain(); |
| 5018 | Parcel reply = Parcel.obtain(); |
| 5019 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5020 | data.writeInt(sig); |
| 5021 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 5022 | reply.readException(); |
| 5023 | data.recycle(); |
| 5024 | reply.recycle(); |
| 5025 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5026 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5027 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5028 | Parcel data = Parcel.obtain(); |
| 5029 | Parcel reply = Parcel.obtain(); |
| 5030 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5031 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5032 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5033 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5034 | reply.readException(); |
| 5035 | data.recycle(); |
| 5036 | reply.recycle(); |
| 5037 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5038 | |
| 5039 | public void killAllBackgroundProcesses() throws RemoteException { |
| 5040 | Parcel data = Parcel.obtain(); |
| 5041 | Parcel reply = Parcel.obtain(); |
| 5042 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5043 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5044 | reply.readException(); |
| 5045 | data.recycle(); |
| 5046 | reply.recycle(); |
| 5047 | } |
| 5048 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 5049 | public void killPackageDependents(String packageName, int userId) throws RemoteException { |
| 5050 | Parcel data = Parcel.obtain(); |
| 5051 | Parcel reply = Parcel.obtain(); |
| 5052 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5053 | data.writeString(packageName); |
| 5054 | data.writeInt(userId); |
| 5055 | mRemote.transact(KILL_PACKAGE_DEPENDENTS_TRANSACTION, data, reply, 0); |
| 5056 | reply.readException(); |
| 5057 | data.recycle(); |
| 5058 | reply.recycle(); |
| 5059 | } |
| 5060 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5061 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5062 | Parcel data = Parcel.obtain(); |
| 5063 | Parcel reply = Parcel.obtain(); |
| 5064 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5065 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5066 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5067 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5068 | reply.readException(); |
| 5069 | data.recycle(); |
| 5070 | reply.recycle(); |
| 5071 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5072 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 5073 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 5074 | throws RemoteException |
| 5075 | { |
| 5076 | Parcel data = Parcel.obtain(); |
| 5077 | Parcel reply = Parcel.obtain(); |
| 5078 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5079 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 5080 | reply.readException(); |
| 5081 | outInfo.readFromParcel(reply); |
| 5082 | reply.recycle(); |
| 5083 | data.recycle(); |
| 5084 | } |
| 5085 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5086 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 5087 | { |
| 5088 | Parcel data = Parcel.obtain(); |
| 5089 | Parcel reply = Parcel.obtain(); |
| 5090 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5091 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5092 | reply.readException(); |
| 5093 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 5094 | reply.recycle(); |
| 5095 | data.recycle(); |
| 5096 | return res; |
| 5097 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5098 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5099 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5100 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5101 | { |
| 5102 | Parcel data = Parcel.obtain(); |
| 5103 | Parcel reply = Parcel.obtain(); |
| 5104 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5105 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5106 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5107 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 5108 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5109 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5110 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5111 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5112 | } else { |
| 5113 | data.writeInt(0); |
| 5114 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5115 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 5116 | reply.readException(); |
| 5117 | boolean res = reply.readInt() != 0; |
| 5118 | reply.recycle(); |
| 5119 | data.recycle(); |
| 5120 | return res; |
| 5121 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5122 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 5123 | public boolean shutdown(int timeout) throws RemoteException |
| 5124 | { |
| 5125 | Parcel data = Parcel.obtain(); |
| 5126 | Parcel reply = Parcel.obtain(); |
| 5127 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5128 | data.writeInt(timeout); |
| 5129 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 5130 | reply.readException(); |
| 5131 | boolean res = reply.readInt() != 0; |
| 5132 | reply.recycle(); |
| 5133 | data.recycle(); |
| 5134 | return res; |
| 5135 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5136 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5137 | public void stopAppSwitches() throws RemoteException { |
| 5138 | Parcel data = Parcel.obtain(); |
| 5139 | Parcel reply = Parcel.obtain(); |
| 5140 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5141 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5142 | reply.readException(); |
| 5143 | reply.recycle(); |
| 5144 | data.recycle(); |
| 5145 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5146 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5147 | public void resumeAppSwitches() throws RemoteException { |
| 5148 | Parcel data = Parcel.obtain(); |
| 5149 | Parcel reply = Parcel.obtain(); |
| 5150 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5151 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5152 | reply.readException(); |
| 5153 | reply.recycle(); |
| 5154 | data.recycle(); |
| 5155 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 5156 | |
| 5157 | public void addPackageDependency(String packageName) throws RemoteException { |
| 5158 | Parcel data = Parcel.obtain(); |
| 5159 | Parcel reply = Parcel.obtain(); |
| 5160 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5161 | data.writeString(packageName); |
| 5162 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 5163 | reply.readException(); |
| 5164 | data.recycle(); |
| 5165 | reply.recycle(); |
| 5166 | } |
| 5167 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5168 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 5169 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5170 | Parcel data = Parcel.obtain(); |
| 5171 | Parcel reply = Parcel.obtain(); |
| 5172 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5173 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5174 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5175 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5176 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5177 | reply.readException(); |
| 5178 | data.recycle(); |
| 5179 | reply.recycle(); |
| 5180 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5181 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 5182 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 5183 | Parcel data = Parcel.obtain(); |
| 5184 | Parcel reply = Parcel.obtain(); |
| 5185 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5186 | data.writeString(reason); |
| 5187 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 5188 | reply.readException(); |
| 5189 | data.recycle(); |
| 5190 | reply.recycle(); |
| 5191 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5192 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5193 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5194 | throws RemoteException { |
| 5195 | Parcel data = Parcel.obtain(); |
| 5196 | Parcel reply = Parcel.obtain(); |
| 5197 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5198 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5199 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 5200 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5201 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5202 | data.recycle(); |
| 5203 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5204 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5205 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 5206 | |
| 5207 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 5208 | Parcel data = Parcel.obtain(); |
| 5209 | Parcel reply = Parcel.obtain(); |
| 5210 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5211 | data.writeString(processName); |
| 5212 | data.writeInt(uid); |
| 5213 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 5214 | reply.readException(); |
| 5215 | data.recycle(); |
| 5216 | reply.recycle(); |
| 5217 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5218 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 5219 | public void overridePendingTransition(IBinder token, String packageName, |
| 5220 | int enterAnim, int exitAnim) throws RemoteException { |
| 5221 | Parcel data = Parcel.obtain(); |
| 5222 | Parcel reply = Parcel.obtain(); |
| 5223 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5224 | data.writeStrongBinder(token); |
| 5225 | data.writeString(packageName); |
| 5226 | data.writeInt(enterAnim); |
| 5227 | data.writeInt(exitAnim); |
| 5228 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 5229 | reply.readException(); |
| 5230 | data.recycle(); |
| 5231 | reply.recycle(); |
| 5232 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5233 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 5234 | public boolean isUserAMonkey() throws RemoteException { |
| 5235 | Parcel data = Parcel.obtain(); |
| 5236 | Parcel reply = Parcel.obtain(); |
| 5237 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5238 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 5239 | reply.readException(); |
| 5240 | boolean res = reply.readInt() != 0; |
| 5241 | data.recycle(); |
| 5242 | reply.recycle(); |
| 5243 | return res; |
| 5244 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 5245 | |
| 5246 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 5247 | Parcel data = Parcel.obtain(); |
| 5248 | Parcel reply = Parcel.obtain(); |
| 5249 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5250 | data.writeInt(monkey ? 1 : 0); |
| 5251 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 5252 | reply.readException(); |
| 5253 | data.recycle(); |
| 5254 | reply.recycle(); |
| 5255 | } |
| 5256 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 5257 | public void finishHeavyWeightApp() throws RemoteException { |
| 5258 | Parcel data = Parcel.obtain(); |
| 5259 | Parcel reply = Parcel.obtain(); |
| 5260 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5261 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 5262 | reply.readException(); |
| 5263 | data.recycle(); |
| 5264 | reply.recycle(); |
| 5265 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5266 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5267 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5268 | throws RemoteException { |
| 5269 | Parcel data = Parcel.obtain(); |
| 5270 | Parcel reply = Parcel.obtain(); |
| 5271 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5272 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5273 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 5274 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5275 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5276 | data.recycle(); |
| 5277 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5278 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5279 | } |
| 5280 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5281 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5282 | throws RemoteException { |
| 5283 | Parcel data = Parcel.obtain(); |
| 5284 | Parcel reply = Parcel.obtain(); |
| 5285 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5286 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5287 | if (options == null) { |
| 5288 | data.writeInt(0); |
| 5289 | } else { |
| 5290 | data.writeInt(1); |
| 5291 | data.writeBundle(options.toBundle()); |
| 5292 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5293 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5294 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5295 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5296 | data.recycle(); |
| 5297 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5298 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5299 | } |
| 5300 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5301 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 5302 | Parcel data = Parcel.obtain(); |
| 5303 | Parcel reply = Parcel.obtain(); |
| 5304 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5305 | data.writeStrongBinder(token); |
| 5306 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 5307 | reply.readException(); |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 5308 | ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle()); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5309 | data.recycle(); |
| 5310 | reply.recycle(); |
| 5311 | return options; |
| 5312 | } |
| 5313 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5314 | public void setImmersive(IBinder token, boolean immersive) |
| 5315 | throws RemoteException { |
| 5316 | Parcel data = Parcel.obtain(); |
| 5317 | Parcel reply = Parcel.obtain(); |
| 5318 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5319 | data.writeStrongBinder(token); |
| 5320 | data.writeInt(immersive ? 1 : 0); |
| 5321 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 5322 | reply.readException(); |
| 5323 | data.recycle(); |
| 5324 | reply.recycle(); |
| 5325 | } |
| 5326 | |
| 5327 | public boolean isImmersive(IBinder token) |
| 5328 | throws RemoteException { |
| 5329 | Parcel data = Parcel.obtain(); |
| 5330 | Parcel reply = Parcel.obtain(); |
| 5331 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5332 | data.writeStrongBinder(token); |
| 5333 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5334 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5335 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5336 | data.recycle(); |
| 5337 | reply.recycle(); |
| 5338 | return res; |
| 5339 | } |
| 5340 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5341 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 5342 | Parcel data = Parcel.obtain(); |
| 5343 | Parcel reply = Parcel.obtain(); |
| 5344 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5345 | data.writeStrongBinder(token); |
| 5346 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 5347 | reply.readException(); |
| 5348 | boolean res = reply.readInt() == 1; |
| 5349 | data.recycle(); |
| 5350 | reply.recycle(); |
| 5351 | return res; |
| 5352 | } |
| 5353 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5354 | public boolean isTopActivityImmersive() |
| 5355 | throws RemoteException { |
| 5356 | Parcel data = Parcel.obtain(); |
| 5357 | Parcel reply = Parcel.obtain(); |
| 5358 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5359 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5360 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5361 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5362 | data.recycle(); |
| 5363 | reply.recycle(); |
| 5364 | return res; |
| 5365 | } |
| 5366 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 5367 | public void crashApplication(int uid, int initialPid, String packageName, |
| 5368 | String message) throws RemoteException { |
| 5369 | Parcel data = Parcel.obtain(); |
| 5370 | Parcel reply = Parcel.obtain(); |
| 5371 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5372 | data.writeInt(uid); |
| 5373 | data.writeInt(initialPid); |
| 5374 | data.writeString(packageName); |
| 5375 | data.writeString(message); |
| 5376 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 5377 | reply.readException(); |
| 5378 | data.recycle(); |
| 5379 | reply.recycle(); |
| 5380 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5381 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5382 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5383 | Parcel data = Parcel.obtain(); |
| 5384 | Parcel reply = Parcel.obtain(); |
| 5385 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5386 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5387 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5388 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 5389 | reply.readException(); |
| 5390 | String res = reply.readString(); |
| 5391 | data.recycle(); |
| 5392 | reply.recycle(); |
| 5393 | return res; |
| 5394 | } |
| 5395 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5396 | public IBinder newUriPermissionOwner(String name) |
| 5397 | throws RemoteException { |
| 5398 | Parcel data = Parcel.obtain(); |
| 5399 | Parcel reply = Parcel.obtain(); |
| 5400 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5401 | data.writeString(name); |
| 5402 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 5403 | reply.readException(); |
| 5404 | IBinder res = reply.readStrongBinder(); |
| 5405 | data.recycle(); |
| 5406 | reply.recycle(); |
| 5407 | return res; |
| 5408 | } |
| 5409 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 5410 | public IBinder getUriPermissionOwnerForActivity(IBinder activityToken) throws RemoteException { |
| 5411 | Parcel data = Parcel.obtain(); |
| 5412 | Parcel reply = Parcel.obtain(); |
| 5413 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5414 | data.writeStrongBinder(activityToken); |
| 5415 | mRemote.transact(GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5416 | reply.readException(); |
| 5417 | IBinder res = reply.readStrongBinder(); |
| 5418 | data.recycle(); |
| 5419 | reply.recycle(); |
| 5420 | return res; |
| 5421 | } |
| 5422 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5423 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5424 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5425 | Parcel data = Parcel.obtain(); |
| 5426 | Parcel reply = Parcel.obtain(); |
| 5427 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5428 | data.writeStrongBinder(owner); |
| 5429 | data.writeInt(fromUid); |
| 5430 | data.writeString(targetPkg); |
| 5431 | uri.writeToParcel(data, 0); |
| 5432 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5433 | data.writeInt(sourceUserId); |
| 5434 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5435 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5436 | reply.readException(); |
| 5437 | data.recycle(); |
| 5438 | reply.recycle(); |
| 5439 | } |
| 5440 | |
| 5441 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5442 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5443 | Parcel data = Parcel.obtain(); |
| 5444 | Parcel reply = Parcel.obtain(); |
| 5445 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5446 | data.writeStrongBinder(owner); |
| 5447 | if (uri != null) { |
| 5448 | data.writeInt(1); |
| 5449 | uri.writeToParcel(data, 0); |
| 5450 | } else { |
| 5451 | data.writeInt(0); |
| 5452 | } |
| 5453 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5454 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5455 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5456 | reply.readException(); |
| 5457 | data.recycle(); |
| 5458 | reply.recycle(); |
| 5459 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 5460 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5461 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5462 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5463 | Parcel data = Parcel.obtain(); |
| 5464 | Parcel reply = Parcel.obtain(); |
| 5465 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5466 | data.writeInt(callingUid); |
| 5467 | data.writeString(targetPkg); |
| 5468 | uri.writeToParcel(data, 0); |
| 5469 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5470 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5471 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5472 | reply.readException(); |
| 5473 | int res = reply.readInt(); |
| 5474 | data.recycle(); |
| 5475 | reply.recycle(); |
| 5476 | return res; |
| 5477 | } |
| 5478 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5479 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5480 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 5481 | Parcel data = Parcel.obtain(); |
| 5482 | Parcel reply = Parcel.obtain(); |
| 5483 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5484 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5485 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5486 | data.writeInt(managed ? 1 : 0); |
| 5487 | data.writeString(path); |
| 5488 | if (fd != null) { |
| 5489 | data.writeInt(1); |
| 5490 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5491 | } else { |
| 5492 | data.writeInt(0); |
| 5493 | } |
| 5494 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 5495 | reply.readException(); |
| 5496 | boolean res = reply.readInt() != 0; |
| 5497 | reply.recycle(); |
| 5498 | data.recycle(); |
| 5499 | return res; |
| 5500 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5501 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5502 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5503 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5504 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5505 | Parcel data = Parcel.obtain(); |
| 5506 | Parcel reply = Parcel.obtain(); |
| 5507 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5508 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5509 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5510 | data.writeTypedArray(intents, 0); |
| 5511 | data.writeStringArray(resolvedTypes); |
| 5512 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5513 | if (options != null) { |
| 5514 | data.writeInt(1); |
| 5515 | options.writeToParcel(data, 0); |
| 5516 | } else { |
| 5517 | data.writeInt(0); |
| 5518 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5519 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5520 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 5521 | reply.readException(); |
| 5522 | int result = reply.readInt(); |
| 5523 | reply.recycle(); |
| 5524 | data.recycle(); |
| 5525 | return result; |
| 5526 | } |
| 5527 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5528 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 5529 | Parcel data = Parcel.obtain(); |
| 5530 | Parcel reply = Parcel.obtain(); |
| 5531 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5532 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5533 | reply.readException(); |
| 5534 | int mode = reply.readInt(); |
| 5535 | reply.recycle(); |
| 5536 | data.recycle(); |
| 5537 | return mode; |
| 5538 | } |
| 5539 | |
| 5540 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 5541 | Parcel data = Parcel.obtain(); |
| 5542 | Parcel reply = Parcel.obtain(); |
| 5543 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5544 | data.writeInt(mode); |
| 5545 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5546 | reply.readException(); |
| 5547 | reply.recycle(); |
| 5548 | data.recycle(); |
| 5549 | } |
| 5550 | |
| 5551 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 5552 | Parcel data = Parcel.obtain(); |
| 5553 | Parcel reply = Parcel.obtain(); |
| 5554 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5555 | data.writeString(packageName); |
| 5556 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5557 | reply.readException(); |
| 5558 | int mode = reply.readInt(); |
| 5559 | reply.recycle(); |
| 5560 | data.recycle(); |
| 5561 | return mode; |
| 5562 | } |
| 5563 | |
| 5564 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5565 | throws RemoteException { |
| 5566 | Parcel data = Parcel.obtain(); |
| 5567 | Parcel reply = Parcel.obtain(); |
| 5568 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5569 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5570 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5571 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5572 | reply.readException(); |
| 5573 | reply.recycle(); |
| 5574 | data.recycle(); |
| 5575 | } |
| 5576 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5577 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 5578 | Parcel data = Parcel.obtain(); |
| 5579 | Parcel reply = Parcel.obtain(); |
| 5580 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5581 | data.writeString(packageName); |
| 5582 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5583 | reply.readException(); |
| 5584 | boolean ask = reply.readInt() != 0; |
| 5585 | reply.recycle(); |
| 5586 | data.recycle(); |
| 5587 | return ask; |
| 5588 | } |
| 5589 | |
| 5590 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 5591 | throws RemoteException { |
| 5592 | Parcel data = Parcel.obtain(); |
| 5593 | Parcel reply = Parcel.obtain(); |
| 5594 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5595 | data.writeString(packageName); |
| 5596 | data.writeInt(ask ? 1 : 0); |
| 5597 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5598 | reply.readException(); |
| 5599 | reply.recycle(); |
| 5600 | data.recycle(); |
| 5601 | } |
| 5602 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5603 | public boolean switchUser(int userid) throws RemoteException { |
| 5604 | Parcel data = Parcel.obtain(); |
| 5605 | Parcel reply = Parcel.obtain(); |
| 5606 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5607 | data.writeInt(userid); |
| 5608 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 5609 | reply.readException(); |
| 5610 | boolean result = reply.readInt() != 0; |
| 5611 | reply.recycle(); |
| 5612 | data.recycle(); |
| 5613 | return result; |
| 5614 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5615 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 5616 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 5617 | Parcel data = Parcel.obtain(); |
| 5618 | Parcel reply = Parcel.obtain(); |
| 5619 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5620 | data.writeInt(userid); |
| 5621 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 5622 | reply.readException(); |
| 5623 | boolean result = reply.readInt() != 0; |
| 5624 | reply.recycle(); |
| 5625 | data.recycle(); |
| 5626 | return result; |
| 5627 | } |
| 5628 | |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5629 | public boolean unlockUser(int userId, byte[] token, byte[] secret) throws RemoteException { |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5630 | Parcel data = Parcel.obtain(); |
| 5631 | Parcel reply = Parcel.obtain(); |
| 5632 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5633 | data.writeInt(userId); |
| 5634 | data.writeByteArray(token); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5635 | data.writeByteArray(secret); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5636 | mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0); |
| 5637 | reply.readException(); |
| 5638 | boolean result = reply.readInt() != 0; |
| 5639 | reply.recycle(); |
| 5640 | data.recycle(); |
| 5641 | return result; |
| 5642 | } |
| 5643 | |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5644 | public int stopUser(int userid, boolean force, IStopUserCallback callback) |
| 5645 | throws RemoteException { |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5646 | Parcel data = Parcel.obtain(); |
| 5647 | Parcel reply = Parcel.obtain(); |
| 5648 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5649 | data.writeInt(userid); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5650 | data.writeInt(force ? 1 : 0); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5651 | data.writeStrongInterface(callback); |
| 5652 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 5653 | reply.readException(); |
| 5654 | int result = reply.readInt(); |
| 5655 | reply.recycle(); |
| 5656 | data.recycle(); |
| 5657 | return result; |
| 5658 | } |
| 5659 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5660 | public UserInfo getCurrentUser() throws RemoteException { |
| 5661 | Parcel data = Parcel.obtain(); |
| 5662 | Parcel reply = Parcel.obtain(); |
| 5663 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5664 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5665 | reply.readException(); |
| 5666 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 5667 | reply.recycle(); |
| 5668 | data.recycle(); |
| 5669 | return userInfo; |
| 5670 | } |
| 5671 | |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5672 | public boolean isUserRunning(int userid, int flags) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5673 | Parcel data = Parcel.obtain(); |
| 5674 | Parcel reply = Parcel.obtain(); |
| 5675 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5676 | data.writeInt(userid); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5677 | data.writeInt(flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5678 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5679 | reply.readException(); |
| 5680 | boolean result = reply.readInt() != 0; |
| 5681 | reply.recycle(); |
| 5682 | data.recycle(); |
| 5683 | return result; |
| 5684 | } |
| 5685 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5686 | public int[] getRunningUserIds() throws RemoteException { |
| 5687 | Parcel data = Parcel.obtain(); |
| 5688 | Parcel reply = Parcel.obtain(); |
| 5689 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5690 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5691 | reply.readException(); |
| 5692 | int[] result = reply.createIntArray(); |
| 5693 | reply.recycle(); |
| 5694 | data.recycle(); |
| 5695 | return result; |
| 5696 | } |
| 5697 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5698 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5699 | Parcel data = Parcel.obtain(); |
| 5700 | Parcel reply = Parcel.obtain(); |
| 5701 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5702 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5703 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5704 | reply.readException(); |
| 5705 | boolean result = reply.readInt() != 0; |
| 5706 | reply.recycle(); |
| 5707 | data.recycle(); |
| 5708 | return result; |
| 5709 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5710 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5711 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5712 | Parcel data = Parcel.obtain(); |
| 5713 | Parcel reply = Parcel.obtain(); |
| 5714 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5715 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5716 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5717 | reply.readException(); |
| 5718 | data.recycle(); |
| 5719 | reply.recycle(); |
| 5720 | } |
| 5721 | |
| 5722 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5723 | Parcel data = Parcel.obtain(); |
| 5724 | Parcel reply = Parcel.obtain(); |
| 5725 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5726 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5727 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5728 | reply.readException(); |
| 5729 | data.recycle(); |
| 5730 | reply.recycle(); |
| 5731 | } |
| 5732 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5733 | public void registerUidObserver(IUidObserver observer, int which) throws RemoteException { |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5734 | Parcel data = Parcel.obtain(); |
| 5735 | Parcel reply = Parcel.obtain(); |
| 5736 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5737 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5738 | data.writeInt(which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5739 | mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5740 | reply.readException(); |
| 5741 | data.recycle(); |
| 5742 | reply.recycle(); |
| 5743 | } |
| 5744 | |
| 5745 | public void unregisterUidObserver(IUidObserver observer) throws RemoteException { |
| 5746 | Parcel data = Parcel.obtain(); |
| 5747 | Parcel reply = Parcel.obtain(); |
| 5748 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5749 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5750 | mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5751 | reply.readException(); |
| 5752 | data.recycle(); |
| 5753 | reply.recycle(); |
| 5754 | } |
| 5755 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5756 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5757 | Parcel data = Parcel.obtain(); |
| 5758 | Parcel reply = Parcel.obtain(); |
| 5759 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5760 | data.writeStrongBinder(sender.asBinder()); |
| 5761 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5762 | reply.readException(); |
| 5763 | boolean res = reply.readInt() != 0; |
| 5764 | data.recycle(); |
| 5765 | reply.recycle(); |
| 5766 | return res; |
| 5767 | } |
| 5768 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5769 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5770 | Parcel data = Parcel.obtain(); |
| 5771 | Parcel reply = Parcel.obtain(); |
| 5772 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5773 | data.writeStrongBinder(sender.asBinder()); |
| 5774 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5775 | reply.readException(); |
| 5776 | boolean res = reply.readInt() != 0; |
| 5777 | data.recycle(); |
| 5778 | reply.recycle(); |
| 5779 | return res; |
| 5780 | } |
| 5781 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5782 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5783 | Parcel data = Parcel.obtain(); |
| 5784 | Parcel reply = Parcel.obtain(); |
| 5785 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5786 | data.writeStrongBinder(sender.asBinder()); |
| 5787 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5788 | reply.readException(); |
| 5789 | Intent res = reply.readInt() != 0 |
| 5790 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5791 | data.recycle(); |
| 5792 | reply.recycle(); |
| 5793 | return res; |
| 5794 | } |
| 5795 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5796 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5797 | throws RemoteException { |
| 5798 | Parcel data = Parcel.obtain(); |
| 5799 | Parcel reply = Parcel.obtain(); |
| 5800 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5801 | data.writeStrongBinder(sender.asBinder()); |
| 5802 | data.writeString(prefix); |
| 5803 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5804 | reply.readException(); |
| 5805 | String res = reply.readString(); |
| 5806 | data.recycle(); |
| 5807 | reply.recycle(); |
| 5808 | return res; |
| 5809 | } |
| 5810 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5811 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5812 | { |
| 5813 | Parcel data = Parcel.obtain(); |
| 5814 | Parcel reply = Parcel.obtain(); |
| 5815 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5816 | values.writeToParcel(data, 0); |
| 5817 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5818 | reply.readException(); |
| 5819 | data.recycle(); |
| 5820 | reply.recycle(); |
| 5821 | } |
| 5822 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 5823 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 5824 | Parcel data = Parcel.obtain(); |
| 5825 | Parcel reply = Parcel.obtain(); |
| 5826 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5827 | data.writeIntArray(pids); |
| 5828 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 5829 | reply.readException(); |
| 5830 | long[] res = reply.createLongArray(); |
| 5831 | data.recycle(); |
| 5832 | reply.recycle(); |
| 5833 | return res; |
| 5834 | } |
| 5835 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5836 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5837 | Parcel data = Parcel.obtain(); |
| 5838 | Parcel reply = Parcel.obtain(); |
| 5839 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5840 | TextUtils.writeToParcel(msg, data, 0); |
| 5841 | data.writeInt(always ? 1 : 0); |
| 5842 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5843 | reply.readException(); |
| 5844 | data.recycle(); |
| 5845 | reply.recycle(); |
| 5846 | } |
| 5847 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5848 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5849 | Parcel data = Parcel.obtain(); |
| 5850 | Parcel reply = Parcel.obtain(); |
| 5851 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5852 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5853 | reply.readException(); |
| 5854 | data.recycle(); |
| 5855 | reply.recycle(); |
| 5856 | } |
| 5857 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5858 | public void keyguardGoingAway(boolean disableWindowAnimations, |
| 5859 | boolean keyguardGoingToNotificationShade) throws RemoteException { |
| 5860 | Parcel data = Parcel.obtain(); |
| 5861 | Parcel reply = Parcel.obtain(); |
| 5862 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5863 | data.writeInt(disableWindowAnimations ? 1 : 0); |
| 5864 | data.writeInt(keyguardGoingToNotificationShade ? 1 : 0); |
| 5865 | mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0); |
| 5866 | reply.readException(); |
| 5867 | data.recycle(); |
| 5868 | reply.recycle(); |
| 5869 | } |
| 5870 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5871 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5872 | throws RemoteException { |
| 5873 | Parcel data = Parcel.obtain(); |
| 5874 | Parcel reply = Parcel.obtain(); |
| 5875 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5876 | data.writeStrongBinder(token); |
| 5877 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5878 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5879 | reply.readException(); |
| 5880 | boolean result = reply.readInt() != 0; |
| 5881 | data.recycle(); |
| 5882 | reply.recycle(); |
| 5883 | return result; |
| 5884 | } |
| 5885 | |
| 5886 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5887 | throws RemoteException { |
| 5888 | Parcel data = Parcel.obtain(); |
| 5889 | Parcel reply = Parcel.obtain(); |
| 5890 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5891 | data.writeStrongBinder(token); |
| 5892 | target.writeToParcel(data, 0); |
| 5893 | data.writeInt(resultCode); |
| 5894 | if (resultData != null) { |
| 5895 | data.writeInt(1); |
| 5896 | resultData.writeToParcel(data, 0); |
| 5897 | } else { |
| 5898 | data.writeInt(0); |
| 5899 | } |
| 5900 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5901 | reply.readException(); |
| 5902 | boolean result = reply.readInt() != 0; |
| 5903 | data.recycle(); |
| 5904 | reply.recycle(); |
| 5905 | return result; |
| 5906 | } |
| 5907 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5908 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5909 | Parcel data = Parcel.obtain(); |
| 5910 | Parcel reply = Parcel.obtain(); |
| 5911 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5912 | data.writeStrongBinder(activityToken); |
| 5913 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5914 | reply.readException(); |
| 5915 | int result = reply.readInt(); |
| 5916 | data.recycle(); |
| 5917 | reply.recycle(); |
| 5918 | return result; |
| 5919 | } |
| 5920 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5921 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 5922 | Parcel data = Parcel.obtain(); |
| 5923 | Parcel reply = Parcel.obtain(); |
| 5924 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5925 | data.writeStrongBinder(activityToken); |
| 5926 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 5927 | reply.readException(); |
| 5928 | String result = reply.readString(); |
| 5929 | data.recycle(); |
| 5930 | reply.recycle(); |
| 5931 | return result; |
| 5932 | } |
| 5933 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 5934 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5935 | Parcel data = Parcel.obtain(); |
| 5936 | Parcel reply = Parcel.obtain(); |
| 5937 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5938 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5939 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5940 | reply.readException(); |
| 5941 | data.recycle(); |
| 5942 | reply.recycle(); |
| 5943 | } |
| 5944 | |
| 5945 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5946 | Parcel data = Parcel.obtain(); |
| 5947 | Parcel reply = Parcel.obtain(); |
| 5948 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5949 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5950 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5951 | reply.readException(); |
| 5952 | data.recycle(); |
| 5953 | reply.recycle(); |
| 5954 | } |
| 5955 | |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 5956 | public void requestBugReport(@ActivityManager.BugreportMode int bugreportType) |
| 5957 | throws RemoteException { |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5958 | Parcel data = Parcel.obtain(); |
| 5959 | Parcel reply = Parcel.obtain(); |
| 5960 | data.writeInterfaceToken(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 5961 | data.writeInt(bugreportType); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5962 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 5963 | reply.readException(); |
| 5964 | data.recycle(); |
| 5965 | reply.recycle(); |
| 5966 | } |
| 5967 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5968 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 5969 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5970 | Parcel data = Parcel.obtain(); |
| 5971 | Parcel reply = Parcel.obtain(); |
| 5972 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5973 | data.writeInt(pid); |
| 5974 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5975 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5976 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 5977 | reply.readException(); |
| 5978 | long res = reply.readInt(); |
| 5979 | data.recycle(); |
| 5980 | reply.recycle(); |
| 5981 | return res; |
| 5982 | } |
| 5983 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5984 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5985 | Parcel data = Parcel.obtain(); |
| 5986 | Parcel reply = Parcel.obtain(); |
| 5987 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5988 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5989 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5990 | reply.readException(); |
| 5991 | Bundle res = reply.readBundle(); |
| 5992 | data.recycle(); |
| 5993 | reply.recycle(); |
| 5994 | return res; |
| 5995 | } |
| 5996 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5997 | public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, |
| 5998 | IBinder activityToken) throws RemoteException { |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5999 | Parcel data = Parcel.obtain(); |
| 6000 | Parcel reply = Parcel.obtain(); |
| 6001 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6002 | data.writeInt(requestType); |
| 6003 | data.writeStrongBinder(receiver.asBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6004 | data.writeStrongBinder(activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6005 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 6006 | reply.readException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6007 | boolean res = reply.readInt() != 0; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6008 | data.recycle(); |
| 6009 | reply.recycle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6010 | return res; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6011 | } |
| 6012 | |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 6013 | public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 6014 | AssistContent content, Uri referrer) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6015 | Parcel data = Parcel.obtain(); |
| 6016 | Parcel reply = Parcel.obtain(); |
| 6017 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6018 | data.writeStrongBinder(token); |
| 6019 | data.writeBundle(extras); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 6020 | structure.writeToParcel(data, 0); |
| 6021 | content.writeToParcel(data, 0); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 6022 | if (referrer != null) { |
| 6023 | data.writeInt(1); |
| 6024 | referrer.writeToParcel(data, 0); |
| 6025 | } else { |
| 6026 | data.writeInt(0); |
| 6027 | } |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6028 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6029 | reply.readException(); |
| 6030 | data.recycle(); |
| 6031 | reply.recycle(); |
| 6032 | } |
| 6033 | |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6034 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, |
| 6035 | Bundle args) throws RemoteException { |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6036 | Parcel data = Parcel.obtain(); |
| 6037 | Parcel reply = Parcel.obtain(); |
| 6038 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6039 | intent.writeToParcel(data, 0); |
| 6040 | data.writeInt(requestType); |
| 6041 | data.writeString(hint); |
| 6042 | data.writeInt(userHandle); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6043 | data.writeBundle(args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6044 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 6045 | reply.readException(); |
| 6046 | boolean res = reply.readInt() != 0; |
| 6047 | data.recycle(); |
| 6048 | reply.recycle(); |
| 6049 | return res; |
| 6050 | } |
| 6051 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6052 | public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException { |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 6053 | Parcel data = Parcel.obtain(); |
| 6054 | Parcel reply = Parcel.obtain(); |
| 6055 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6056 | mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6057 | reply.readException(); |
| 6058 | boolean res = reply.readInt() != 0; |
| 6059 | data.recycle(); |
| 6060 | reply.recycle(); |
| 6061 | return res; |
| 6062 | } |
| 6063 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6064 | public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException { |
| 6065 | Parcel data = Parcel.obtain(); |
| 6066 | Parcel reply = Parcel.obtain(); |
| 6067 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6068 | data.writeStrongBinder(token); |
| 6069 | data.writeBundle(args); |
| 6070 | mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6071 | reply.readException(); |
| 6072 | boolean res = reply.readInt() != 0; |
| 6073 | data.recycle(); |
| 6074 | reply.recycle(); |
| 6075 | return res; |
| 6076 | } |
| 6077 | |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6078 | public void killUid(int appId, int userId, String reason) throws RemoteException { |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6079 | Parcel data = Parcel.obtain(); |
| 6080 | Parcel reply = Parcel.obtain(); |
| 6081 | data.writeInterfaceToken(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6082 | data.writeInt(appId); |
| 6083 | data.writeInt(userId); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6084 | data.writeString(reason); |
| 6085 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 6086 | reply.readException(); |
| 6087 | data.recycle(); |
| 6088 | reply.recycle(); |
| 6089 | } |
| 6090 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 6091 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 6092 | Parcel data = Parcel.obtain(); |
| 6093 | Parcel reply = Parcel.obtain(); |
| 6094 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6095 | data.writeStrongBinder(who); |
| 6096 | data.writeInt(allowRestart ? 1 : 0); |
| 6097 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 6098 | reply.readException(); |
| 6099 | data.recycle(); |
| 6100 | reply.recycle(); |
| 6101 | } |
| 6102 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 6103 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 6104 | Parcel data = Parcel.obtain(); |
| 6105 | Parcel reply = Parcel.obtain(); |
| 6106 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6107 | data.writeStrongBinder(token); |
| 6108 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 6109 | reply.readException(); |
| 6110 | data.recycle(); |
| 6111 | reply.recycle(); |
| 6112 | } |
| 6113 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 6114 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 6115 | Parcel data = Parcel.obtain(); |
| 6116 | Parcel reply = Parcel.obtain(); |
| 6117 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6118 | data.writeStrongBinder(token); |
| 6119 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 6120 | reply.readException(); |
| 6121 | data.recycle(); |
| 6122 | reply.recycle(); |
| 6123 | } |
| 6124 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 6125 | public void restart() throws RemoteException { |
| 6126 | Parcel data = Parcel.obtain(); |
| 6127 | Parcel reply = Parcel.obtain(); |
| 6128 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6129 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 6130 | reply.readException(); |
| 6131 | data.recycle(); |
| 6132 | reply.recycle(); |
| 6133 | } |
| 6134 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 6135 | public void performIdleMaintenance() throws RemoteException { |
| 6136 | Parcel data = Parcel.obtain(); |
| 6137 | Parcel reply = Parcel.obtain(); |
| 6138 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6139 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 6140 | reply.readException(); |
| 6141 | data.recycle(); |
| 6142 | reply.recycle(); |
| 6143 | } |
| 6144 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6145 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6146 | IActivityContainerCallback callback) throws RemoteException { |
| 6147 | Parcel data = Parcel.obtain(); |
| 6148 | Parcel reply = Parcel.obtain(); |
| 6149 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6150 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 6151 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6152 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6153 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 6154 | final int result = reply.readInt(); |
| 6155 | final IActivityContainer res; |
| 6156 | if (result == 1) { |
| 6157 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6158 | } else { |
| 6159 | res = null; |
| 6160 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6161 | data.recycle(); |
| 6162 | reply.recycle(); |
| 6163 | return res; |
| 6164 | } |
| 6165 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 6166 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 6167 | throws RemoteException { |
| 6168 | Parcel data = Parcel.obtain(); |
| 6169 | Parcel reply = Parcel.obtain(); |
| 6170 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6171 | data.writeStrongBinder(activityContainer.asBinder()); |
| 6172 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 6173 | reply.readException(); |
| 6174 | data.recycle(); |
| 6175 | reply.recycle(); |
| 6176 | } |
| 6177 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 6178 | public boolean startBinderTracking() throws RemoteException { |
| 6179 | Parcel data = Parcel.obtain(); |
| 6180 | Parcel reply = Parcel.obtain(); |
| 6181 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6182 | mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0); |
| 6183 | reply.readException(); |
| 6184 | boolean res = reply.readInt() != 0; |
| 6185 | reply.recycle(); |
| 6186 | data.recycle(); |
| 6187 | return res; |
| 6188 | } |
| 6189 | |
| 6190 | public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException { |
| 6191 | Parcel data = Parcel.obtain(); |
| 6192 | Parcel reply = Parcel.obtain(); |
| 6193 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6194 | if (fd != null) { |
| 6195 | data.writeInt(1); |
| 6196 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 6197 | } else { |
| 6198 | data.writeInt(0); |
| 6199 | } |
| 6200 | mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0); |
| 6201 | reply.readException(); |
| 6202 | boolean res = reply.readInt() != 0; |
| 6203 | reply.recycle(); |
| 6204 | data.recycle(); |
| 6205 | return res; |
| 6206 | } |
| 6207 | |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6208 | public void setVrMode(IBinder token, boolean enabled) throws RemoteException { |
| 6209 | Parcel data = Parcel.obtain(); |
| 6210 | Parcel reply = Parcel.obtain(); |
| 6211 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6212 | data.writeStrongBinder(token); |
| 6213 | data.writeInt(enabled ? 1 : 0); |
| 6214 | mRemote.transact(SET_VR_MODE_TRANSACTION, data, reply, 0); |
| 6215 | reply.readException(); |
| 6216 | data.recycle(); |
| 6217 | reply.recycle(); |
| 6218 | } |
| 6219 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6220 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 6221 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 6222 | Parcel data = Parcel.obtain(); |
| 6223 | Parcel reply = Parcel.obtain(); |
| 6224 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6225 | data.writeInt(displayId); |
| 6226 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 6227 | reply.readException(); |
| 6228 | final int result = reply.readInt(); |
| 6229 | final IActivityContainer res; |
| 6230 | if (result == 1) { |
| 6231 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6232 | } else { |
| 6233 | res = null; |
| 6234 | } |
| 6235 | data.recycle(); |
| 6236 | reply.recycle(); |
| 6237 | return res; |
| 6238 | } |
| 6239 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6240 | @Override |
| 6241 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6242 | throws RemoteException { |
| 6243 | Parcel data = Parcel.obtain(); |
| 6244 | Parcel reply = Parcel.obtain(); |
| 6245 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6246 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6247 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6248 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6249 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6250 | data.recycle(); |
| 6251 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6252 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6253 | } |
| 6254 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6255 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6256 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 6257 | Parcel data = Parcel.obtain(); |
| 6258 | Parcel reply = Parcel.obtain(); |
| 6259 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6260 | data.writeInt(taskId); |
| 6261 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 6262 | reply.readException(); |
| 6263 | data.recycle(); |
| 6264 | reply.recycle(); |
| 6265 | } |
| 6266 | |
| 6267 | @Override |
| 6268 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 6269 | Parcel data = Parcel.obtain(); |
| 6270 | Parcel reply = Parcel.obtain(); |
| 6271 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6272 | data.writeStrongBinder(token); |
| 6273 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 6274 | reply.readException(); |
| 6275 | data.recycle(); |
| 6276 | reply.recycle(); |
| 6277 | } |
| 6278 | |
| 6279 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6280 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 6281 | Parcel data = Parcel.obtain(); |
| 6282 | Parcel reply = Parcel.obtain(); |
| 6283 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6284 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6285 | reply.readException(); |
| 6286 | data.recycle(); |
| 6287 | reply.recycle(); |
| 6288 | } |
| 6289 | |
| 6290 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6291 | public void stopLockTaskMode() throws RemoteException { |
| 6292 | Parcel data = Parcel.obtain(); |
| 6293 | Parcel reply = Parcel.obtain(); |
| 6294 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6295 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6296 | reply.readException(); |
| 6297 | data.recycle(); |
| 6298 | reply.recycle(); |
| 6299 | } |
| 6300 | |
| 6301 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6302 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 6303 | Parcel data = Parcel.obtain(); |
| 6304 | Parcel reply = Parcel.obtain(); |
| 6305 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6306 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6307 | reply.readException(); |
| 6308 | data.recycle(); |
| 6309 | reply.recycle(); |
| 6310 | } |
| 6311 | |
| 6312 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6313 | public boolean isInLockTaskMode() throws RemoteException { |
| 6314 | Parcel data = Parcel.obtain(); |
| 6315 | Parcel reply = Parcel.obtain(); |
| 6316 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6317 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6318 | reply.readException(); |
| 6319 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 6320 | data.recycle(); |
| 6321 | reply.recycle(); |
| 6322 | return isInLockTaskMode; |
| 6323 | } |
| 6324 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 6325 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 6326 | public int getLockTaskModeState() throws RemoteException { |
| 6327 | Parcel data = Parcel.obtain(); |
| 6328 | Parcel reply = Parcel.obtain(); |
| 6329 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6330 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 6331 | reply.readException(); |
| 6332 | int lockTaskModeState = reply.readInt(); |
| 6333 | data.recycle(); |
| 6334 | reply.recycle(); |
| 6335 | return lockTaskModeState; |
| 6336 | } |
| 6337 | |
| 6338 | @Override |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 6339 | public void showLockTaskEscapeMessage(IBinder token) throws RemoteException { |
| 6340 | Parcel data = Parcel.obtain(); |
| 6341 | Parcel reply = Parcel.obtain(); |
| 6342 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6343 | data.writeStrongBinder(token); |
| 6344 | mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply, |
| 6345 | IBinder.FLAG_ONEWAY); |
| 6346 | reply.readException(); |
| 6347 | data.recycle(); |
| 6348 | reply.recycle(); |
| 6349 | } |
| 6350 | |
| 6351 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 6352 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6353 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6354 | Parcel data = Parcel.obtain(); |
| 6355 | Parcel reply = Parcel.obtain(); |
| 6356 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6357 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6358 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6359 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6360 | reply.readException(); |
| 6361 | data.recycle(); |
| 6362 | reply.recycle(); |
| 6363 | } |
| 6364 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6365 | @Override |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6366 | public void setTaskResizeable(int taskId, int resizeableMode) throws RemoteException { |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6367 | Parcel data = Parcel.obtain(); |
| 6368 | Parcel reply = Parcel.obtain(); |
| 6369 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6370 | data.writeInt(taskId); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6371 | data.writeInt(resizeableMode); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6372 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6373 | reply.readException(); |
| 6374 | data.recycle(); |
| 6375 | reply.recycle(); |
| 6376 | } |
| 6377 | |
| 6378 | @Override |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6379 | public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6380 | { |
| 6381 | Parcel data = Parcel.obtain(); |
| 6382 | Parcel reply = Parcel.obtain(); |
| 6383 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6384 | data.writeInt(taskId); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6385 | data.writeInt(resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6386 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6387 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6388 | reply.readException(); |
| 6389 | data.recycle(); |
| 6390 | reply.recycle(); |
| 6391 | } |
| 6392 | |
| 6393 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 6394 | public Rect getTaskBounds(int taskId) throws RemoteException |
| 6395 | { |
| 6396 | Parcel data = Parcel.obtain(); |
| 6397 | Parcel reply = Parcel.obtain(); |
| 6398 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6399 | data.writeInt(taskId); |
| 6400 | mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0); |
| 6401 | reply.readException(); |
| 6402 | Rect rect = Rect.CREATOR.createFromParcel(reply); |
| 6403 | data.recycle(); |
| 6404 | reply.recycle(); |
| 6405 | return rect; |
| 6406 | } |
| 6407 | |
| 6408 | @Override |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6409 | public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException { |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6410 | Parcel data = Parcel.obtain(); |
| 6411 | Parcel reply = Parcel.obtain(); |
| 6412 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6413 | data.writeString(filename); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6414 | data.writeInt(userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6415 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 6416 | reply.readException(); |
| 6417 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 6418 | data.recycle(); |
| 6419 | reply.recycle(); |
| 6420 | return icon; |
| 6421 | } |
| 6422 | |
| 6423 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6424 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 6425 | throws RemoteException { |
| 6426 | Parcel data = Parcel.obtain(); |
| 6427 | Parcel reply = Parcel.obtain(); |
| 6428 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6429 | if (options == null) { |
| 6430 | data.writeInt(0); |
| 6431 | } else { |
| 6432 | data.writeInt(1); |
| 6433 | data.writeBundle(options.toBundle()); |
| 6434 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6435 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6436 | reply.readException(); |
| 6437 | data.recycle(); |
| 6438 | reply.recycle(); |
| 6439 | } |
| 6440 | |
| 6441 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6442 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6443 | Parcel data = Parcel.obtain(); |
| 6444 | Parcel reply = Parcel.obtain(); |
| 6445 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6446 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6447 | data.writeInt(visible ? 1 : 0); |
| 6448 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6449 | reply.readException(); |
| 6450 | boolean success = reply.readInt() > 0; |
| 6451 | data.recycle(); |
| 6452 | reply.recycle(); |
| 6453 | return success; |
| 6454 | } |
| 6455 | |
| 6456 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6457 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6458 | Parcel data = Parcel.obtain(); |
| 6459 | Parcel reply = Parcel.obtain(); |
| 6460 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6461 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6462 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6463 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6464 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6465 | data.recycle(); |
| 6466 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6467 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6468 | } |
| 6469 | |
| 6470 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6471 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6472 | Parcel data = Parcel.obtain(); |
| 6473 | Parcel reply = Parcel.obtain(); |
| 6474 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6475 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6476 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 6477 | reply.readException(); |
| 6478 | data.recycle(); |
| 6479 | reply.recycle(); |
| 6480 | } |
| 6481 | |
| 6482 | @Override |
| 6483 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 6484 | Parcel data = Parcel.obtain(); |
| 6485 | Parcel reply = Parcel.obtain(); |
| 6486 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6487 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6488 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6489 | reply.readException(); |
| 6490 | data.recycle(); |
| 6491 | reply.recycle(); |
| 6492 | } |
| 6493 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6494 | @Override |
| 6495 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 6496 | Parcel data = Parcel.obtain(); |
| 6497 | Parcel reply = Parcel.obtain(); |
| 6498 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6499 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6500 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6501 | reply.readException(); |
| 6502 | data.recycle(); |
| 6503 | reply.recycle(); |
| 6504 | } |
| 6505 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 6506 | @Override |
| 6507 | public void bootAnimationComplete() throws RemoteException { |
| 6508 | Parcel data = Parcel.obtain(); |
| 6509 | Parcel reply = Parcel.obtain(); |
| 6510 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6511 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 6512 | reply.readException(); |
| 6513 | data.recycle(); |
| 6514 | reply.recycle(); |
| 6515 | } |
| 6516 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 6517 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 6518 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 6519 | Parcel data = Parcel.obtain(); |
| 6520 | Parcel reply = Parcel.obtain(); |
| 6521 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6522 | data.writeInt(uid); |
| 6523 | data.writeByteArray(firstPacket); |
| 6524 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 6525 | reply.readException(); |
| 6526 | data.recycle(); |
| 6527 | reply.recycle(); |
| 6528 | } |
| 6529 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6530 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6531 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 6532 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6533 | Parcel data = Parcel.obtain(); |
| 6534 | Parcel reply = Parcel.obtain(); |
| 6535 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6536 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6537 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6538 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6539 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6540 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 6541 | reply.readException(); |
| 6542 | data.recycle(); |
| 6543 | reply.recycle(); |
| 6544 | } |
| 6545 | |
| 6546 | @Override |
| 6547 | public void dumpHeapFinished(String path) throws RemoteException { |
| 6548 | Parcel data = Parcel.obtain(); |
| 6549 | Parcel reply = Parcel.obtain(); |
| 6550 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6551 | data.writeString(path); |
| 6552 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 6553 | reply.readException(); |
| 6554 | data.recycle(); |
| 6555 | reply.recycle(); |
| 6556 | } |
| 6557 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 6558 | @Override |
| 6559 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 6560 | throws RemoteException { |
| 6561 | Parcel data = Parcel.obtain(); |
| 6562 | Parcel reply = Parcel.obtain(); |
| 6563 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6564 | data.writeStrongBinder(session.asBinder()); |
| 6565 | data.writeInt(keepAwake ? 1 : 0); |
| 6566 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 6567 | reply.readException(); |
| 6568 | data.recycle(); |
| 6569 | reply.recycle(); |
| 6570 | } |
| 6571 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6572 | @Override |
| 6573 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 6574 | Parcel data = Parcel.obtain(); |
| 6575 | Parcel reply = Parcel.obtain(); |
| 6576 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6577 | data.writeInt(userId); |
| 6578 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6579 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6580 | reply.readException(); |
| 6581 | data.recycle(); |
| 6582 | reply.recycle(); |
| 6583 | } |
| 6584 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6585 | @Override |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 6586 | public void updateDeviceOwner(String packageName) throws RemoteException { |
| 6587 | Parcel data = Parcel.obtain(); |
| 6588 | Parcel reply = Parcel.obtain(); |
| 6589 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6590 | data.writeString(packageName); |
| 6591 | mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0); |
| 6592 | reply.readException(); |
| 6593 | data.recycle(); |
| 6594 | reply.recycle(); |
| 6595 | } |
| 6596 | |
| 6597 | @Override |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6598 | public int getPackageProcessState(String packageName, String callingPackage) |
| 6599 | throws RemoteException { |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6600 | Parcel data = Parcel.obtain(); |
| 6601 | Parcel reply = Parcel.obtain(); |
| 6602 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6603 | data.writeString(packageName); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6604 | data.writeString(callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6605 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 6606 | reply.readException(); |
| 6607 | int res = reply.readInt(); |
| 6608 | data.recycle(); |
| 6609 | reply.recycle(); |
| 6610 | return res; |
| 6611 | } |
| 6612 | |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 6613 | @Override |
| 6614 | public boolean setProcessMemoryTrimLevel(String process, int userId, int level) |
| 6615 | throws RemoteException { |
| 6616 | Parcel data = Parcel.obtain(); |
| 6617 | Parcel reply = Parcel.obtain(); |
| 6618 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6619 | data.writeString(process); |
| 6620 | data.writeInt(userId); |
| 6621 | data.writeInt(level); |
| 6622 | mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0); |
| 6623 | reply.readException(); |
| 6624 | int res = reply.readInt(); |
| 6625 | data.recycle(); |
| 6626 | reply.recycle(); |
| 6627 | return res != 0; |
| 6628 | } |
| 6629 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 6630 | @Override |
| 6631 | public boolean isRootVoiceInteraction(IBinder token) throws RemoteException { |
| 6632 | Parcel data = Parcel.obtain(); |
| 6633 | Parcel reply = Parcel.obtain(); |
| 6634 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6635 | data.writeStrongBinder(token); |
| 6636 | mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 6637 | reply.readException(); |
| 6638 | int res = reply.readInt(); |
| 6639 | data.recycle(); |
| 6640 | reply.recycle(); |
| 6641 | return res != 0; |
| 6642 | } |
| 6643 | |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6644 | @Override |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6645 | public void exitFreeformMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6646 | Parcel data = Parcel.obtain(); |
| 6647 | Parcel reply = Parcel.obtain(); |
| 6648 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6649 | data.writeStrongBinder(token); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6650 | mRemote.transact(EXIT_FREEFORM_MODE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6651 | reply.readException(); |
| 6652 | data.recycle(); |
| 6653 | reply.recycle(); |
| 6654 | } |
| 6655 | |
| 6656 | @Override |
| 6657 | public int getActivityStackId(IBinder token) throws RemoteException { |
| 6658 | Parcel data = Parcel.obtain(); |
| 6659 | Parcel reply = Parcel.obtain(); |
| 6660 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6661 | data.writeStrongBinder(token); |
| 6662 | mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0); |
| 6663 | reply.readException(); |
| 6664 | int stackId = reply.readInt(); |
| 6665 | data.recycle(); |
| 6666 | reply.recycle(); |
| 6667 | return stackId; |
| 6668 | } |
| 6669 | |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6670 | @Override |
| 6671 | public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration, |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6672 | int[] verticalSizeConfigurations, int[] smallestSizeConfigurations) |
| 6673 | throws RemoteException { |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6674 | Parcel data = Parcel.obtain(); |
| 6675 | Parcel reply = Parcel.obtain(); |
| 6676 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6677 | data.writeStrongBinder(token); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6678 | writeIntArray(horizontalSizeConfiguration, data); |
| 6679 | writeIntArray(verticalSizeConfigurations, data); |
| 6680 | writeIntArray(smallestSizeConfigurations, data); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6681 | mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0); |
| 6682 | reply.readException(); |
| 6683 | data.recycle(); |
| 6684 | reply.recycle(); |
| 6685 | } |
| 6686 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6687 | private static void writeIntArray(int[] array, Parcel data) { |
| 6688 | if (array == null) { |
| 6689 | data.writeInt(0); |
| 6690 | } else { |
| 6691 | data.writeInt(array.length); |
| 6692 | data.writeIntArray(array); |
| 6693 | } |
| 6694 | } |
| 6695 | |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 6696 | @Override |
| 6697 | public void suppressResizeConfigChanges(boolean suppress) throws RemoteException { |
| 6698 | Parcel data = Parcel.obtain(); |
| 6699 | Parcel reply = Parcel.obtain(); |
| 6700 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6701 | data.writeInt(suppress ? 1 : 0); |
| 6702 | mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0); |
| 6703 | reply.readException(); |
| 6704 | data.recycle(); |
| 6705 | reply.recycle(); |
| 6706 | } |
| 6707 | |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6708 | @Override |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6709 | public void moveTasksToFullscreenStack(int fromStackId, boolean onTop) throws RemoteException { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6710 | Parcel data = Parcel.obtain(); |
| 6711 | Parcel reply = Parcel.obtain(); |
| 6712 | data.writeInterfaceToken(IActivityManager.descriptor); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6713 | data.writeInt(fromStackId); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6714 | data.writeInt(onTop ? 1 : 0); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6715 | mRemote.transact(MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION, data, reply, 0); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6716 | reply.readException(); |
| 6717 | data.recycle(); |
| 6718 | reply.recycle(); |
| 6719 | } |
| 6720 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6721 | @Override |
| 6722 | public int getAppStartMode(int uid, String packageName) throws RemoteException { |
| 6723 | Parcel data = Parcel.obtain(); |
| 6724 | Parcel reply = Parcel.obtain(); |
| 6725 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6726 | data.writeInt(uid); |
| 6727 | data.writeString(packageName); |
| 6728 | mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0); |
| 6729 | reply.readException(); |
| 6730 | int res = reply.readInt(); |
| 6731 | data.recycle(); |
| 6732 | reply.recycle(); |
| 6733 | return res; |
| 6734 | } |
| 6735 | |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6736 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6737 | public boolean inMultiWindow(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6738 | Parcel data = Parcel.obtain(); |
| 6739 | Parcel reply = Parcel.obtain(); |
| 6740 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6741 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6742 | mRemote.transact(IN_MULTI_WINDOW_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6743 | reply.readException(); |
| 6744 | final boolean multiWindowMode = reply.readInt() == 1 ? true : false; |
| 6745 | data.recycle(); |
| 6746 | reply.recycle(); |
| 6747 | return multiWindowMode; |
| 6748 | } |
| 6749 | |
| 6750 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6751 | public boolean inPictureInPicture(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6752 | Parcel data = Parcel.obtain(); |
| 6753 | Parcel reply = Parcel.obtain(); |
| 6754 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6755 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6756 | mRemote.transact(IN_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6757 | reply.readException(); |
| 6758 | final boolean pipMode = reply.readInt() == 1 ? true : false; |
| 6759 | data.recycle(); |
| 6760 | reply.recycle(); |
| 6761 | return pipMode; |
| 6762 | } |
| 6763 | |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6764 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6765 | public void enterPictureInPicture(IBinder token) throws RemoteException { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6766 | Parcel data = Parcel.obtain(); |
| 6767 | Parcel reply = Parcel.obtain(); |
| 6768 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6769 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6770 | mRemote.transact(ENTER_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6771 | reply.readException(); |
| 6772 | data.recycle(); |
| 6773 | reply.recycle(); |
| 6774 | } |
| 6775 | |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 6776 | @Override |
| 6777 | public boolean isAppForeground(int uid) throws RemoteException { |
| 6778 | Parcel data = Parcel.obtain(); |
| 6779 | Parcel reply = Parcel.obtain(); |
| 6780 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6781 | data.writeInt(uid); |
| 6782 | mRemote.transact(IS_APP_FOREGROUND_TRANSACTION, data, reply, 0); |
| 6783 | final boolean isForeground = reply.readInt() == 1 ? true : false; |
| 6784 | data.recycle(); |
| 6785 | reply.recycle(); |
| 6786 | return isForeground; |
| 6787 | }; |
| 6788 | |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 6789 | @Override |
| 6790 | public void notifyPinnedStackAnimationEnded() throws RemoteException { |
| 6791 | Parcel data = Parcel.obtain(); |
| 6792 | Parcel reply = Parcel.obtain(); |
| 6793 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6794 | mRemote.transact(NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION, data, reply, 0); |
| 6795 | data.recycle(); |
| 6796 | reply.recycle(); |
| 6797 | }; |
| 6798 | |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 6799 | @Override |
| 6800 | public void removeStack(int stackId) throws RemoteException { |
| 6801 | Parcel data = Parcel.obtain(); |
| 6802 | Parcel reply = Parcel.obtain(); |
| 6803 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6804 | data.writeInt(stackId); |
| 6805 | mRemote.transact(REMOVE_STACK, data, reply, 0); |
| 6806 | reply.readException(); |
| 6807 | data.recycle(); |
| 6808 | reply.recycle(); |
| 6809 | } |
| 6810 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6811 | private IBinder mRemote; |
| 6812 | } |