The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.app; |
| 18 | |
Tony Mak | 9c6e8ce | 2016-03-21 12:07:16 +0000 | [diff] [blame] | 19 | import android.annotation.UserIdInt; |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 20 | import android.app.ActivityManager.StackInfo; |
Dianne Hackborn | 69c6adc | 2015-06-02 10:52:59 -0700 | [diff] [blame] | 21 | import android.app.assist.AssistContent; |
| 22 | import android.app.assist.AssistStructure; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 23 | import android.content.ComponentName; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 24 | import android.content.IIntentReceiver; |
| 25 | import android.content.IIntentSender; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | import android.content.Intent; |
| 27 | import android.content.IntentFilter; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 28 | import android.content.IntentSender; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 29 | import android.content.UriPermission; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 30 | import android.content.pm.ApplicationInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | import android.content.pm.ConfigurationInfo; |
| 32 | import android.content.pm.IPackageDataObserver; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 33 | import android.content.pm.ParceledListSlice; |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 34 | import android.content.pm.UserInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 35 | import android.content.res.Configuration; |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 36 | import android.graphics.Bitmap; |
| 37 | import android.graphics.Point; |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 38 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | import android.net.Uri; |
| 40 | import android.os.Binder; |
| 41 | import android.os.Bundle; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 42 | import android.os.Debug; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | import android.os.IBinder; |
| 44 | import android.os.Parcel; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 45 | import android.os.ParcelFileDescriptor; |
| 46 | import android.os.Parcelable; |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 47 | import android.os.PersistableBundle; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 48 | import android.os.RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 49 | import android.os.ServiceManager; |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 50 | import android.os.StrictMode; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 51 | import android.service.voice.IVoiceInteractionSession; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | import android.text.TextUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | import android.util.Log; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 54 | import android.util.Singleton; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 55 | import com.android.internal.app.IVoiceInteractor; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 56 | import com.android.internal.os.IResultReceiver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | import java.util.ArrayList; |
| 59 | import java.util.List; |
| 60 | |
| 61 | /** {@hide} */ |
| 62 | public abstract class ActivityManagerNative extends Binder implements IActivityManager |
| 63 | { |
| 64 | /** |
| 65 | * Cast a Binder object into an activity manager interface, generating |
| 66 | * a proxy if needed. |
| 67 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 68 | static public IActivityManager asInterface(IBinder obj) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 69 | if (obj == null) { |
| 70 | return null; |
| 71 | } |
| 72 | IActivityManager in = |
| 73 | (IActivityManager)obj.queryLocalInterface(descriptor); |
| 74 | if (in != null) { |
| 75 | return in; |
| 76 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 77 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 78 | return new ActivityManagerProxy(obj); |
| 79 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 80 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 81 | /** |
| 82 | * Retrieve the system's default/global activity manager. |
| 83 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 84 | static public IActivityManager getDefault() { |
| 85 | return gDefault.get(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Convenience for checking whether the system is ready. For internal use only. |
| 90 | */ |
| 91 | static public boolean isSystemReady() { |
| 92 | if (!sSystemReady) { |
| 93 | sSystemReady = getDefault().testIsSystemReady(); |
| 94 | } |
| 95 | return sSystemReady; |
| 96 | } |
| 97 | static boolean sSystemReady = false; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 98 | |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 99 | static public void broadcastStickyIntent(Intent intent, String permission, int userId) { |
| 100 | broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId); |
| 101 | } |
| 102 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 103 | /** |
| 104 | * Convenience for sending a sticky broadcast. For internal use only. |
| 105 | * If you don't care about permission, use null. |
| 106 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 107 | static public void broadcastStickyIntent(Intent intent, String permission, int appOp, |
| 108 | int userId) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 109 | try { |
| 110 | getDefault().broadcastIntent( |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 111 | null, intent, null, null, Activity.RESULT_OK, null, null, |
| 112 | null /*permission*/, appOp, null, false, true, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 113 | } catch (RemoteException ex) { |
| 114 | } |
| 115 | } |
| 116 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 117 | static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg, |
| 118 | String tag) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 119 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 120 | getDefault().noteWakeupAlarm((ps != null) ? ps.getTarget() : null, |
| 121 | sourceUid, sourcePkg, tag); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 122 | } catch (RemoteException ex) { |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) { |
| 127 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 128 | getDefault().noteAlarmStart((ps != null) ? ps.getTarget() : null, sourceUid, tag); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 129 | } catch (RemoteException ex) { |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) { |
| 134 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 135 | getDefault().noteAlarmFinish((ps != null) ? ps.getTarget() : null, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 136 | } catch (RemoteException ex) { |
| 137 | } |
| 138 | } |
| 139 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 140 | public ActivityManagerNative() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 141 | attachInterface(this, descriptor); |
| 142 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 143 | |
| 144 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 145 | public boolean onTransact(int code, Parcel data, Parcel reply, int flags) |
| 146 | throws RemoteException { |
| 147 | switch (code) { |
| 148 | case START_ACTIVITY_TRANSACTION: |
| 149 | { |
| 150 | data.enforceInterface(IActivityManager.descriptor); |
| 151 | IBinder b = data.readStrongBinder(); |
| 152 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 153 | String callingPackage = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 154 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 155 | String resolvedType = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 156 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 157 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 158 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 159 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 160 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 161 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 162 | Bundle options = data.readInt() != 0 |
| 163 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 164 | int result = startActivity(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 165 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 166 | reply.writeNoException(); |
| 167 | reply.writeInt(result); |
| 168 | return true; |
| 169 | } |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 170 | |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 171 | case START_ACTIVITY_AS_USER_TRANSACTION: |
| 172 | { |
| 173 | data.enforceInterface(IActivityManager.descriptor); |
| 174 | IBinder b = data.readStrongBinder(); |
| 175 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 176 | String callingPackage = data.readString(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 177 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 178 | String resolvedType = data.readString(); |
| 179 | IBinder resultTo = data.readStrongBinder(); |
| 180 | String resultWho = data.readString(); |
| 181 | int requestCode = data.readInt(); |
| 182 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 183 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 184 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 185 | Bundle options = data.readInt() != 0 |
| 186 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 187 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 188 | int result = startActivityAsUser(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 189 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 190 | reply.writeNoException(); |
| 191 | reply.writeInt(result); |
| 192 | return true; |
| 193 | } |
| 194 | |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 195 | case START_ACTIVITY_AS_CALLER_TRANSACTION: |
| 196 | { |
| 197 | data.enforceInterface(IActivityManager.descriptor); |
| 198 | IBinder b = data.readStrongBinder(); |
| 199 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 200 | String callingPackage = data.readString(); |
| 201 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 202 | String resolvedType = data.readString(); |
| 203 | IBinder resultTo = data.readStrongBinder(); |
| 204 | String resultWho = data.readString(); |
| 205 | int requestCode = data.readInt(); |
| 206 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 207 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 208 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 209 | Bundle options = data.readInt() != 0 |
| 210 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 211 | boolean ignoreTargetSecurity = data.readInt() != 0; |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 212 | int userId = data.readInt(); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 213 | int result = startActivityAsCaller(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 214 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, |
| 215 | ignoreTargetSecurity, userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 216 | reply.writeNoException(); |
| 217 | reply.writeInt(result); |
| 218 | return true; |
| 219 | } |
| 220 | |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 221 | case START_ACTIVITY_AND_WAIT_TRANSACTION: |
| 222 | { |
| 223 | data.enforceInterface(IActivityManager.descriptor); |
| 224 | IBinder b = data.readStrongBinder(); |
| 225 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 226 | String callingPackage = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 227 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 228 | String resolvedType = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 229 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 230 | String resultWho = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 231 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 232 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 233 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 234 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 235 | Bundle options = data.readInt() != 0 |
| 236 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 237 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 238 | WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 239 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 240 | reply.writeNoException(); |
| 241 | result.writeToParcel(reply, 0); |
| 242 | return true; |
| 243 | } |
| 244 | |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 245 | case START_ACTIVITY_WITH_CONFIG_TRANSACTION: |
| 246 | { |
| 247 | data.enforceInterface(IActivityManager.descriptor); |
| 248 | IBinder b = data.readStrongBinder(); |
| 249 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 250 | String callingPackage = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 251 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 252 | String resolvedType = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 253 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 254 | String resultWho = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 255 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 256 | int startFlags = data.readInt(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 257 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 258 | Bundle options = data.readInt() != 0 |
| 259 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 260 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 261 | int result = startActivityWithConfig(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 262 | resultTo, resultWho, requestCode, startFlags, config, options, userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 263 | reply.writeNoException(); |
| 264 | reply.writeInt(result); |
| 265 | return true; |
| 266 | } |
| 267 | |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 268 | case START_ACTIVITY_INTENT_SENDER_TRANSACTION: |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 269 | { |
| 270 | data.enforceInterface(IActivityManager.descriptor); |
| 271 | IBinder b = data.readStrongBinder(); |
| 272 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 273 | IntentSender intent = IntentSender.CREATOR.createFromParcel(data); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 274 | Intent fillInIntent = null; |
| 275 | if (data.readInt() != 0) { |
| 276 | fillInIntent = Intent.CREATOR.createFromParcel(data); |
| 277 | } |
| 278 | String resolvedType = data.readString(); |
| 279 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 280 | String resultWho = data.readString(); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 281 | int requestCode = data.readInt(); |
| 282 | int flagsMask = data.readInt(); |
| 283 | int flagsValues = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 284 | Bundle options = data.readInt() != 0 |
| 285 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 286 | int result = startActivityIntentSender(app, intent, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 287 | fillInIntent, resolvedType, resultTo, resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 288 | requestCode, flagsMask, flagsValues, options); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 289 | reply.writeNoException(); |
| 290 | reply.writeInt(result); |
| 291 | return true; |
| 292 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 293 | |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 294 | case START_VOICE_ACTIVITY_TRANSACTION: |
| 295 | { |
| 296 | data.enforceInterface(IActivityManager.descriptor); |
| 297 | String callingPackage = data.readString(); |
| 298 | int callingPid = data.readInt(); |
| 299 | int callingUid = data.readInt(); |
| 300 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 301 | String resolvedType = data.readString(); |
| 302 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 303 | data.readStrongBinder()); |
| 304 | IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface( |
| 305 | data.readStrongBinder()); |
| 306 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 307 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 308 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 309 | Bundle options = data.readInt() != 0 |
| 310 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 311 | int userId = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 312 | int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent, |
| 313 | resolvedType, session, interactor, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 314 | reply.writeNoException(); |
| 315 | reply.writeInt(result); |
| 316 | return true; |
| 317 | } |
| 318 | |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 319 | case START_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 320 | { |
| 321 | data.enforceInterface(IActivityManager.descriptor); |
| 322 | IBinder token = data.readStrongBinder(); |
| 323 | Bundle options = data.readBundle(); |
| 324 | startLocalVoiceInteraction(token, options); |
| 325 | reply.writeNoException(); |
| 326 | return true; |
| 327 | } |
| 328 | |
| 329 | case STOP_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 330 | { |
| 331 | data.enforceInterface(IActivityManager.descriptor); |
| 332 | IBinder token = data.readStrongBinder(); |
| 333 | stopLocalVoiceInteraction(token); |
| 334 | reply.writeNoException(); |
| 335 | return true; |
| 336 | } |
| 337 | |
| 338 | case SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 339 | { |
| 340 | data.enforceInterface(IActivityManager.descriptor); |
| 341 | boolean result = supportsLocalVoiceInteraction(); |
| 342 | reply.writeNoException(); |
| 343 | reply.writeInt(result? 1 : 0); |
| 344 | return true; |
| 345 | } |
| 346 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 347 | case START_NEXT_MATCHING_ACTIVITY_TRANSACTION: |
| 348 | { |
| 349 | data.enforceInterface(IActivityManager.descriptor); |
| 350 | IBinder callingActivity = data.readStrongBinder(); |
| 351 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 352 | Bundle options = data.readInt() != 0 |
| 353 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 354 | boolean result = startNextMatchingActivity(callingActivity, intent, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 355 | reply.writeNoException(); |
| 356 | reply.writeInt(result ? 1 : 0); |
| 357 | return true; |
| 358 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 359 | |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 360 | case START_ACTIVITY_FROM_RECENTS_TRANSACTION: |
| 361 | { |
| 362 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 363 | final int taskId = data.readInt(); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 364 | final Bundle options = |
| 365 | data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data); |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 366 | final int result = startActivityFromRecents(taskId, options); |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 367 | reply.writeNoException(); |
| 368 | reply.writeInt(result); |
| 369 | return true; |
| 370 | } |
| 371 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 372 | case FINISH_ACTIVITY_TRANSACTION: { |
| 373 | data.enforceInterface(IActivityManager.descriptor); |
| 374 | IBinder token = data.readStrongBinder(); |
| 375 | Intent resultData = null; |
| 376 | int resultCode = data.readInt(); |
| 377 | if (data.readInt() != 0) { |
| 378 | resultData = Intent.CREATOR.createFromParcel(data); |
| 379 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 380 | int finishTask = data.readInt(); |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 381 | boolean res = finishActivity(token, resultCode, resultData, finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 382 | reply.writeNoException(); |
| 383 | reply.writeInt(res ? 1 : 0); |
| 384 | return true; |
| 385 | } |
| 386 | |
| 387 | case FINISH_SUB_ACTIVITY_TRANSACTION: { |
| 388 | data.enforceInterface(IActivityManager.descriptor); |
| 389 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 390 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 391 | int requestCode = data.readInt(); |
| 392 | finishSubActivity(token, resultWho, requestCode); |
| 393 | reply.writeNoException(); |
| 394 | return true; |
| 395 | } |
| 396 | |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 397 | case FINISH_ACTIVITY_AFFINITY_TRANSACTION: { |
| 398 | data.enforceInterface(IActivityManager.descriptor); |
| 399 | IBinder token = data.readStrongBinder(); |
| 400 | boolean res = finishActivityAffinity(token); |
| 401 | reply.writeNoException(); |
| 402 | reply.writeInt(res ? 1 : 0); |
| 403 | return true; |
| 404 | } |
| 405 | |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 406 | case FINISH_VOICE_TASK_TRANSACTION: { |
| 407 | data.enforceInterface(IActivityManager.descriptor); |
| 408 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 409 | data.readStrongBinder()); |
| 410 | finishVoiceTask(session); |
| 411 | reply.writeNoException(); |
| 412 | return true; |
| 413 | } |
| 414 | |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 415 | case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: { |
| 416 | data.enforceInterface(IActivityManager.descriptor); |
| 417 | IBinder token = data.readStrongBinder(); |
| 418 | boolean res = releaseActivityInstance(token); |
| 419 | reply.writeNoException(); |
| 420 | reply.writeInt(res ? 1 : 0); |
| 421 | return true; |
| 422 | } |
| 423 | |
| 424 | case RELEASE_SOME_ACTIVITIES_TRANSACTION: { |
| 425 | data.enforceInterface(IActivityManager.descriptor); |
| 426 | IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder()); |
| 427 | releaseSomeActivities(app); |
| 428 | reply.writeNoException(); |
| 429 | return true; |
| 430 | } |
| 431 | |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 432 | case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: { |
| 433 | data.enforceInterface(IActivityManager.descriptor); |
| 434 | IBinder token = data.readStrongBinder(); |
| 435 | boolean res = willActivityBeVisible(token); |
| 436 | reply.writeNoException(); |
| 437 | reply.writeInt(res ? 1 : 0); |
| 438 | return true; |
| 439 | } |
| 440 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 441 | case REGISTER_RECEIVER_TRANSACTION: |
| 442 | { |
| 443 | data.enforceInterface(IActivityManager.descriptor); |
| 444 | IBinder b = data.readStrongBinder(); |
| 445 | IApplicationThread app = |
| 446 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 447 | String packageName = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 448 | b = data.readStrongBinder(); |
| 449 | IIntentReceiver rec |
| 450 | = b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 451 | IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data); |
| 452 | String perm = data.readString(); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 453 | int userId = data.readInt(); |
| 454 | Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 455 | reply.writeNoException(); |
| 456 | if (intent != null) { |
| 457 | reply.writeInt(1); |
| 458 | intent.writeToParcel(reply, 0); |
| 459 | } else { |
| 460 | reply.writeInt(0); |
| 461 | } |
| 462 | return true; |
| 463 | } |
| 464 | |
| 465 | case UNREGISTER_RECEIVER_TRANSACTION: |
| 466 | { |
| 467 | data.enforceInterface(IActivityManager.descriptor); |
| 468 | IBinder b = data.readStrongBinder(); |
| 469 | if (b == null) { |
| 470 | return true; |
| 471 | } |
| 472 | IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b); |
| 473 | unregisterReceiver(rec); |
| 474 | reply.writeNoException(); |
| 475 | return true; |
| 476 | } |
| 477 | |
| 478 | case BROADCAST_INTENT_TRANSACTION: |
| 479 | { |
| 480 | data.enforceInterface(IActivityManager.descriptor); |
| 481 | IBinder b = data.readStrongBinder(); |
| 482 | IApplicationThread app = |
| 483 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 484 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 485 | String resolvedType = data.readString(); |
| 486 | b = data.readStrongBinder(); |
| 487 | IIntentReceiver resultTo = |
| 488 | b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 489 | int resultCode = data.readInt(); |
| 490 | String resultData = data.readString(); |
| 491 | Bundle resultExtras = data.readBundle(); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 492 | String[] perms = data.readStringArray(); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 493 | int appOp = data.readInt(); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 494 | Bundle options = data.readBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 495 | boolean serialized = data.readInt() != 0; |
| 496 | boolean sticky = data.readInt() != 0; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 497 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 498 | int res = broadcastIntent(app, intent, resolvedType, resultTo, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 499 | resultCode, resultData, resultExtras, perms, appOp, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 500 | options, serialized, sticky, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 501 | reply.writeNoException(); |
| 502 | reply.writeInt(res); |
| 503 | return true; |
| 504 | } |
| 505 | |
| 506 | case UNBROADCAST_INTENT_TRANSACTION: |
| 507 | { |
| 508 | data.enforceInterface(IActivityManager.descriptor); |
| 509 | IBinder b = data.readStrongBinder(); |
| 510 | IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 511 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 512 | int userId = data.readInt(); |
| 513 | unbroadcastIntent(app, intent, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 514 | reply.writeNoException(); |
| 515 | return true; |
| 516 | } |
| 517 | |
| 518 | case FINISH_RECEIVER_TRANSACTION: { |
| 519 | data.enforceInterface(IActivityManager.descriptor); |
| 520 | IBinder who = data.readStrongBinder(); |
| 521 | int resultCode = data.readInt(); |
| 522 | String resultData = data.readString(); |
| 523 | Bundle resultExtras = data.readBundle(); |
| 524 | boolean resultAbort = data.readInt() != 0; |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 525 | int intentFlags = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 526 | if (who != null) { |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 527 | finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 528 | } |
| 529 | reply.writeNoException(); |
| 530 | return true; |
| 531 | } |
| 532 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 533 | case ATTACH_APPLICATION_TRANSACTION: { |
| 534 | data.enforceInterface(IActivityManager.descriptor); |
| 535 | IApplicationThread app = ApplicationThreadNative.asInterface( |
| 536 | data.readStrongBinder()); |
| 537 | if (app != null) { |
| 538 | attachApplication(app); |
| 539 | } |
| 540 | reply.writeNoException(); |
| 541 | return true; |
| 542 | } |
| 543 | |
| 544 | case ACTIVITY_IDLE_TRANSACTION: { |
| 545 | data.enforceInterface(IActivityManager.descriptor); |
| 546 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 547 | Configuration config = null; |
| 548 | if (data.readInt() != 0) { |
| 549 | config = Configuration.CREATOR.createFromParcel(data); |
| 550 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 551 | boolean stopProfiling = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 552 | if (token != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 553 | activityIdle(token, config, stopProfiling); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 554 | } |
| 555 | reply.writeNoException(); |
| 556 | return true; |
| 557 | } |
| 558 | |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 559 | case ACTIVITY_RESUMED_TRANSACTION: { |
| 560 | data.enforceInterface(IActivityManager.descriptor); |
| 561 | IBinder token = data.readStrongBinder(); |
| 562 | activityResumed(token); |
| 563 | reply.writeNoException(); |
| 564 | return true; |
| 565 | } |
| 566 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 567 | case ACTIVITY_PAUSED_TRANSACTION: { |
| 568 | data.enforceInterface(IActivityManager.descriptor); |
| 569 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 570 | activityPaused(token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 571 | reply.writeNoException(); |
| 572 | return true; |
| 573 | } |
| 574 | |
| 575 | case ACTIVITY_STOPPED_TRANSACTION: { |
| 576 | data.enforceInterface(IActivityManager.descriptor); |
| 577 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 578 | Bundle map = data.readBundle(); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 579 | PersistableBundle persistentState = data.readPersistableBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 580 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 581 | activityStopped(token, map, persistentState, description); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 582 | reply.writeNoException(); |
| 583 | return true; |
| 584 | } |
| 585 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 586 | case ACTIVITY_SLEPT_TRANSACTION: { |
| 587 | data.enforceInterface(IActivityManager.descriptor); |
| 588 | IBinder token = data.readStrongBinder(); |
| 589 | activitySlept(token); |
| 590 | reply.writeNoException(); |
| 591 | return true; |
| 592 | } |
| 593 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 594 | case ACTIVITY_DESTROYED_TRANSACTION: { |
| 595 | data.enforceInterface(IActivityManager.descriptor); |
| 596 | IBinder token = data.readStrongBinder(); |
| 597 | activityDestroyed(token); |
| 598 | reply.writeNoException(); |
| 599 | return true; |
| 600 | } |
| 601 | |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 602 | case ACTIVITY_RELAUNCHED_TRANSACTION: { |
| 603 | data.enforceInterface(IActivityManager.descriptor); |
| 604 | IBinder token = data.readStrongBinder(); |
| 605 | activityRelaunched(token); |
| 606 | reply.writeNoException(); |
| 607 | return true; |
| 608 | } |
| 609 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 610 | case GET_CALLING_PACKAGE_TRANSACTION: { |
| 611 | data.enforceInterface(IActivityManager.descriptor); |
| 612 | IBinder token = data.readStrongBinder(); |
| 613 | String res = token != null ? getCallingPackage(token) : null; |
| 614 | reply.writeNoException(); |
| 615 | reply.writeString(res); |
| 616 | return true; |
| 617 | } |
| 618 | |
| 619 | case GET_CALLING_ACTIVITY_TRANSACTION: { |
| 620 | data.enforceInterface(IActivityManager.descriptor); |
| 621 | IBinder token = data.readStrongBinder(); |
| 622 | ComponentName cn = getCallingActivity(token); |
| 623 | reply.writeNoException(); |
| 624 | ComponentName.writeToParcel(cn, reply); |
| 625 | return true; |
| 626 | } |
| 627 | |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 628 | case GET_APP_TASKS_TRANSACTION: { |
| 629 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 630 | String callingPackage = data.readString(); |
| 631 | List<IAppTask> list = getAppTasks(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 632 | reply.writeNoException(); |
| 633 | int N = list != null ? list.size() : -1; |
| 634 | reply.writeInt(N); |
| 635 | int i; |
| 636 | for (i=0; i<N; i++) { |
| 637 | IAppTask task = list.get(i); |
| 638 | reply.writeStrongBinder(task.asBinder()); |
| 639 | } |
| 640 | return true; |
| 641 | } |
| 642 | |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 643 | case ADD_APP_TASK_TRANSACTION: { |
| 644 | data.enforceInterface(IActivityManager.descriptor); |
| 645 | IBinder activityToken = data.readStrongBinder(); |
| 646 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 647 | ActivityManager.TaskDescription descr |
| 648 | = ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 649 | Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data); |
| 650 | int res = addAppTask(activityToken, intent, descr, thumbnail); |
| 651 | reply.writeNoException(); |
| 652 | reply.writeInt(res); |
| 653 | return true; |
| 654 | } |
| 655 | |
| 656 | case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: { |
| 657 | data.enforceInterface(IActivityManager.descriptor); |
| 658 | Point size = getAppTaskThumbnailSize(); |
| 659 | reply.writeNoException(); |
| 660 | size.writeToParcel(reply, 0); |
| 661 | return true; |
| 662 | } |
| 663 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 664 | case GET_TASKS_TRANSACTION: { |
| 665 | data.enforceInterface(IActivityManager.descriptor); |
| 666 | int maxNum = data.readInt(); |
| 667 | int fl = data.readInt(); |
Dianne Hackborn | 0923328 | 2014-04-30 11:33:59 -0700 | [diff] [blame] | 668 | List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 669 | reply.writeNoException(); |
| 670 | int N = list != null ? list.size() : -1; |
| 671 | reply.writeInt(N); |
| 672 | int i; |
| 673 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 674 | ActivityManager.RunningTaskInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 675 | info.writeToParcel(reply, 0); |
| 676 | } |
| 677 | return true; |
| 678 | } |
| 679 | |
| 680 | case GET_RECENT_TASKS_TRANSACTION: { |
| 681 | data.enforceInterface(IActivityManager.descriptor); |
| 682 | int maxNum = data.readInt(); |
| 683 | int fl = data.readInt(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 684 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 685 | List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 686 | fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 687 | reply.writeNoException(); |
| 688 | reply.writeTypedList(list); |
| 689 | return true; |
| 690 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 691 | |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 692 | case GET_TASK_THUMBNAIL_TRANSACTION: { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 693 | data.enforceInterface(IActivityManager.descriptor); |
| 694 | int id = data.readInt(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 695 | ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 696 | reply.writeNoException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 697 | if (taskThumbnail != null) { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 698 | reply.writeInt(1); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 699 | taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 700 | } else { |
| 701 | reply.writeInt(0); |
| 702 | } |
| 703 | return true; |
| 704 | } |
| 705 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 706 | case GET_SERVICES_TRANSACTION: { |
| 707 | data.enforceInterface(IActivityManager.descriptor); |
| 708 | int maxNum = data.readInt(); |
| 709 | int fl = data.readInt(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 710 | List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 711 | reply.writeNoException(); |
| 712 | int N = list != null ? list.size() : -1; |
| 713 | reply.writeInt(N); |
| 714 | int i; |
| 715 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 716 | ActivityManager.RunningServiceInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 717 | info.writeToParcel(reply, 0); |
| 718 | } |
| 719 | return true; |
| 720 | } |
| 721 | |
| 722 | case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: { |
| 723 | data.enforceInterface(IActivityManager.descriptor); |
| 724 | List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState(); |
| 725 | reply.writeNoException(); |
| 726 | reply.writeTypedList(list); |
| 727 | return true; |
| 728 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 729 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 730 | case GET_RUNNING_APP_PROCESSES_TRANSACTION: { |
| 731 | data.enforceInterface(IActivityManager.descriptor); |
| 732 | List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses(); |
| 733 | reply.writeNoException(); |
| 734 | reply.writeTypedList(list); |
| 735 | return true; |
| 736 | } |
| 737 | |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 738 | case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: { |
| 739 | data.enforceInterface(IActivityManager.descriptor); |
| 740 | List<ApplicationInfo> list = getRunningExternalApplications(); |
| 741 | reply.writeNoException(); |
| 742 | reply.writeTypedList(list); |
| 743 | return true; |
| 744 | } |
| 745 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 746 | case MOVE_TASK_TO_FRONT_TRANSACTION: { |
| 747 | data.enforceInterface(IActivityManager.descriptor); |
| 748 | int task = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 749 | int fl = data.readInt(); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 750 | Bundle options = data.readInt() != 0 |
| 751 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 752 | moveTaskToFront(task, fl, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 753 | reply.writeNoException(); |
| 754 | return true; |
| 755 | } |
| 756 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 757 | case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: { |
| 758 | data.enforceInterface(IActivityManager.descriptor); |
| 759 | IBinder token = data.readStrongBinder(); |
| 760 | boolean nonRoot = data.readInt() != 0; |
| 761 | boolean res = moveActivityTaskToBack(token, nonRoot); |
| 762 | reply.writeNoException(); |
| 763 | reply.writeInt(res ? 1 : 0); |
| 764 | return true; |
| 765 | } |
| 766 | |
| 767 | case MOVE_TASK_BACKWARDS_TRANSACTION: { |
| 768 | data.enforceInterface(IActivityManager.descriptor); |
| 769 | int task = data.readInt(); |
| 770 | moveTaskBackwards(task); |
| 771 | reply.writeNoException(); |
| 772 | return true; |
| 773 | } |
| 774 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 775 | case MOVE_TASK_TO_STACK_TRANSACTION: { |
| 776 | data.enforceInterface(IActivityManager.descriptor); |
| 777 | int taskId = data.readInt(); |
| 778 | int stackId = data.readInt(); |
| 779 | boolean toTop = data.readInt() != 0; |
| 780 | moveTaskToStack(taskId, stackId, toTop); |
| 781 | reply.writeNoException(); |
| 782 | return true; |
| 783 | } |
| 784 | |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 785 | case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: { |
| 786 | data.enforceInterface(IActivityManager.descriptor); |
| 787 | int taskId = data.readInt(); |
| 788 | int createMode = data.readInt(); |
| 789 | boolean toTop = data.readInt() != 0; |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 790 | boolean animate = data.readInt() != 0; |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 791 | Rect bounds = null; |
| 792 | boolean hasBounds = data.readInt() != 0; |
| 793 | if (hasBounds) { |
| 794 | bounds = Rect.CREATOR.createFromParcel(data); |
| 795 | } |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 796 | boolean res = moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 797 | reply.writeNoException(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 798 | reply.writeInt(res ? 1 : 0); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 799 | return true; |
| 800 | } |
| 801 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 802 | case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: { |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 803 | data.enforceInterface(IActivityManager.descriptor); |
| 804 | final int stackId = data.readInt(); |
| 805 | final Rect r = Rect.CREATOR.createFromParcel(data); |
| 806 | final boolean res = moveTopActivityToPinnedStack(stackId, r); |
| 807 | reply.writeNoException(); |
| 808 | reply.writeInt(res ? 1 : 0); |
| 809 | return true; |
| 810 | } |
| 811 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 812 | case RESIZE_STACK_TRANSACTION: { |
| 813 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 814 | final int stackId = data.readInt(); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 815 | final boolean hasRect = data.readInt() != 0; |
| 816 | Rect r = null; |
| 817 | if (hasRect) { |
| 818 | r = Rect.CREATOR.createFromParcel(data); |
| 819 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 820 | final boolean allowResizeInDockedMode = data.readInt() == 1; |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 821 | final boolean preserveWindows = data.readInt() == 1; |
| 822 | final boolean animate = data.readInt() == 1; |
Wale Ogunwale | e75a9ad | 2016-03-18 20:43:49 -0700 | [diff] [blame] | 823 | final int animationDuration = data.readInt(); |
| 824 | resizeStack(stackId, |
| 825 | r, allowResizeInDockedMode, preserveWindows, animate, animationDuration); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 826 | reply.writeNoException(); |
| 827 | return true; |
| 828 | } |
Robert Carr | 0d00c2e | 2016-02-29 17:45:02 -0800 | [diff] [blame] | 829 | case RESIZE_PINNED_STACK_TRANSACTION: { |
| 830 | data.enforceInterface(IActivityManager.descriptor); |
| 831 | final boolean hasBounds = data.readInt() != 0; |
| 832 | Rect bounds = null; |
| 833 | if (hasBounds) { |
| 834 | bounds = Rect.CREATOR.createFromParcel(data); |
| 835 | } |
| 836 | final boolean hasTempPinnedTaskBounds = data.readInt() != 0; |
| 837 | Rect tempPinnedTaskBounds = null; |
| 838 | if (hasTempPinnedTaskBounds) { |
| 839 | tempPinnedTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 840 | } |
| 841 | resizePinnedStack(bounds, tempPinnedTaskBounds); |
| 842 | return true; |
| 843 | } |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 844 | case SWAP_DOCKED_AND_FULLSCREEN_STACK: { |
| 845 | data.enforceInterface(IActivityManager.descriptor); |
| 846 | swapDockedAndFullscreenStack(); |
| 847 | reply.writeNoException(); |
| 848 | return true; |
| 849 | } |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 850 | case RESIZE_DOCKED_STACK_TRANSACTION: { |
| 851 | data.enforceInterface(IActivityManager.descriptor); |
| 852 | final boolean hasBounds = data.readInt() != 0; |
| 853 | Rect bounds = null; |
| 854 | if (hasBounds) { |
| 855 | bounds = Rect.CREATOR.createFromParcel(data); |
| 856 | } |
| 857 | final boolean hasTempDockedTaskBounds = data.readInt() != 0; |
| 858 | Rect tempDockedTaskBounds = null; |
| 859 | if (hasTempDockedTaskBounds) { |
| 860 | tempDockedTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 861 | } |
| 862 | final boolean hasTempDockedTaskInsetBounds = data.readInt() != 0; |
| 863 | Rect tempDockedTaskInsetBounds = null; |
| 864 | if (hasTempDockedTaskInsetBounds) { |
| 865 | tempDockedTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 866 | } |
| 867 | final boolean hasTempOtherTaskBounds = data.readInt() != 0; |
| 868 | Rect tempOtherTaskBounds = null; |
| 869 | if (hasTempOtherTaskBounds) { |
| 870 | tempOtherTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 871 | } |
| 872 | final boolean hasTempOtherTaskInsetBounds = data.readInt() != 0; |
| 873 | Rect tempOtherTaskInsetBounds = null; |
| 874 | if (hasTempOtherTaskInsetBounds) { |
| 875 | tempOtherTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 876 | } |
| 877 | resizeDockedStack(bounds, tempDockedTaskBounds, tempDockedTaskInsetBounds, |
| 878 | tempOtherTaskBounds, tempOtherTaskInsetBounds); |
| 879 | reply.writeNoException(); |
| 880 | return true; |
| 881 | } |
| 882 | |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 883 | case POSITION_TASK_IN_STACK_TRANSACTION: { |
| 884 | data.enforceInterface(IActivityManager.descriptor); |
| 885 | int taskId = data.readInt(); |
| 886 | int stackId = data.readInt(); |
| 887 | int position = data.readInt(); |
| 888 | positionTaskInStack(taskId, stackId, position); |
| 889 | reply.writeNoException(); |
| 890 | return true; |
| 891 | } |
| 892 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 893 | case GET_ALL_STACK_INFOS_TRANSACTION: { |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 894 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 895 | List<StackInfo> list = getAllStackInfos(); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 896 | reply.writeNoException(); |
| 897 | reply.writeTypedList(list); |
| 898 | return true; |
| 899 | } |
| 900 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 901 | case GET_STACK_INFO_TRANSACTION: { |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 902 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 903 | int stackId = data.readInt(); |
| 904 | StackInfo info = getStackInfo(stackId); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 905 | reply.writeNoException(); |
| 906 | if (info != null) { |
| 907 | reply.writeInt(1); |
| 908 | info.writeToParcel(reply, 0); |
| 909 | } else { |
| 910 | reply.writeInt(0); |
| 911 | } |
| 912 | return true; |
| 913 | } |
| 914 | |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 915 | case IS_IN_HOME_STACK_TRANSACTION: { |
| 916 | data.enforceInterface(IActivityManager.descriptor); |
| 917 | int taskId = data.readInt(); |
| 918 | boolean isInHomeStack = isInHomeStack(taskId); |
| 919 | reply.writeNoException(); |
| 920 | reply.writeInt(isInHomeStack ? 1 : 0); |
| 921 | return true; |
| 922 | } |
| 923 | |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 924 | case SET_FOCUSED_STACK_TRANSACTION: { |
| 925 | data.enforceInterface(IActivityManager.descriptor); |
| 926 | int stackId = data.readInt(); |
| 927 | setFocusedStack(stackId); |
| 928 | reply.writeNoException(); |
| 929 | return true; |
| 930 | } |
| 931 | |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 932 | case GET_FOCUSED_STACK_ID_TRANSACTION: { |
| 933 | data.enforceInterface(IActivityManager.descriptor); |
| 934 | int focusedStackId = getFocusedStackId(); |
| 935 | reply.writeNoException(); |
| 936 | reply.writeInt(focusedStackId); |
| 937 | return true; |
| 938 | } |
| 939 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 940 | case SET_FOCUSED_TASK_TRANSACTION: { |
| 941 | data.enforceInterface(IActivityManager.descriptor); |
| 942 | int taskId = data.readInt(); |
Skuhne | f36bb0c | 2015-08-26 14:26:17 -0700 | [diff] [blame] | 943 | setFocusedTask(taskId); |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 944 | reply.writeNoException(); |
| 945 | return true; |
| 946 | } |
| 947 | |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 948 | case REGISTER_TASK_STACK_LISTENER_TRANSACTION: { |
| 949 | data.enforceInterface(IActivityManager.descriptor); |
| 950 | IBinder token = data.readStrongBinder(); |
| 951 | registerTaskStackListener(ITaskStackListener.Stub.asInterface(token)); |
| 952 | reply.writeNoException(); |
| 953 | return true; |
| 954 | } |
| 955 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 956 | case GET_TASK_FOR_ACTIVITY_TRANSACTION: { |
| 957 | data.enforceInterface(IActivityManager.descriptor); |
| 958 | IBinder token = data.readStrongBinder(); |
| 959 | boolean onlyRoot = data.readInt() != 0; |
| 960 | int res = token != null |
| 961 | ? getTaskForActivity(token, onlyRoot) : -1; |
| 962 | reply.writeNoException(); |
| 963 | reply.writeInt(res); |
| 964 | return true; |
| 965 | } |
| 966 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 967 | case GET_CONTENT_PROVIDER_TRANSACTION: { |
| 968 | data.enforceInterface(IActivityManager.descriptor); |
| 969 | IBinder b = data.readStrongBinder(); |
| 970 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 971 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 972 | int userId = data.readInt(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 973 | boolean stable = data.readInt() != 0; |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 974 | ContentProviderHolder cph = getContentProvider(app, name, userId, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 975 | reply.writeNoException(); |
| 976 | if (cph != null) { |
| 977 | reply.writeInt(1); |
| 978 | cph.writeToParcel(reply, 0); |
| 979 | } else { |
| 980 | reply.writeInt(0); |
| 981 | } |
| 982 | return true; |
| 983 | } |
| 984 | |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 985 | case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 986 | data.enforceInterface(IActivityManager.descriptor); |
| 987 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 988 | int userId = data.readInt(); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 989 | IBinder token = data.readStrongBinder(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 990 | ContentProviderHolder cph = getContentProviderExternal(name, userId, token); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 991 | reply.writeNoException(); |
| 992 | if (cph != null) { |
| 993 | reply.writeInt(1); |
| 994 | cph.writeToParcel(reply, 0); |
| 995 | } else { |
| 996 | reply.writeInt(0); |
| 997 | } |
| 998 | return true; |
| 999 | } |
| 1000 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1001 | case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: { |
| 1002 | data.enforceInterface(IActivityManager.descriptor); |
| 1003 | IBinder b = data.readStrongBinder(); |
| 1004 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1005 | ArrayList<ContentProviderHolder> providers = |
| 1006 | data.createTypedArrayList(ContentProviderHolder.CREATOR); |
| 1007 | publishContentProviders(app, providers); |
| 1008 | reply.writeNoException(); |
| 1009 | return true; |
| 1010 | } |
| 1011 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1012 | case REF_CONTENT_PROVIDER_TRANSACTION: { |
| 1013 | data.enforceInterface(IActivityManager.descriptor); |
| 1014 | IBinder b = data.readStrongBinder(); |
| 1015 | int stable = data.readInt(); |
| 1016 | int unstable = data.readInt(); |
| 1017 | boolean res = refContentProvider(b, stable, unstable); |
| 1018 | reply.writeNoException(); |
| 1019 | reply.writeInt(res ? 1 : 0); |
| 1020 | return true; |
| 1021 | } |
| 1022 | |
| 1023 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: { |
| 1024 | data.enforceInterface(IActivityManager.descriptor); |
| 1025 | IBinder b = data.readStrongBinder(); |
| 1026 | unstableProviderDied(b); |
| 1027 | reply.writeNoException(); |
| 1028 | return true; |
| 1029 | } |
| 1030 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 1031 | case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: { |
| 1032 | data.enforceInterface(IActivityManager.descriptor); |
| 1033 | IBinder b = data.readStrongBinder(); |
| 1034 | appNotRespondingViaProvider(b); |
| 1035 | reply.writeNoException(); |
| 1036 | return true; |
| 1037 | } |
| 1038 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1039 | case REMOVE_CONTENT_PROVIDER_TRANSACTION: { |
| 1040 | data.enforceInterface(IActivityManager.descriptor); |
| 1041 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1042 | boolean stable = data.readInt() != 0; |
| 1043 | removeContentProvider(b, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1044 | reply.writeNoException(); |
| 1045 | return true; |
| 1046 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 1047 | |
| 1048 | case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 1049 | data.enforceInterface(IActivityManager.descriptor); |
| 1050 | String name = data.readString(); |
| 1051 | IBinder token = data.readStrongBinder(); |
| 1052 | removeContentProviderExternal(name, token); |
| 1053 | reply.writeNoException(); |
| 1054 | return true; |
| 1055 | } |
| 1056 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 1057 | case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: { |
| 1058 | data.enforceInterface(IActivityManager.descriptor); |
| 1059 | ComponentName comp = ComponentName.CREATOR.createFromParcel(data); |
| 1060 | PendingIntent pi = getRunningServiceControlPanel(comp); |
| 1061 | reply.writeNoException(); |
| 1062 | PendingIntent.writePendingIntentOrNullToParcel(pi, reply); |
| 1063 | return true; |
| 1064 | } |
| 1065 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1066 | case START_SERVICE_TRANSACTION: { |
| 1067 | data.enforceInterface(IActivityManager.descriptor); |
| 1068 | IBinder b = data.readStrongBinder(); |
| 1069 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1070 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1071 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1072 | String callingPackage = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1073 | int userId = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1074 | ComponentName cn = startService(app, service, resolvedType, callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1075 | reply.writeNoException(); |
| 1076 | ComponentName.writeToParcel(cn, reply); |
| 1077 | return true; |
| 1078 | } |
| 1079 | |
| 1080 | case STOP_SERVICE_TRANSACTION: { |
| 1081 | data.enforceInterface(IActivityManager.descriptor); |
| 1082 | IBinder b = data.readStrongBinder(); |
| 1083 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1084 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1085 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1086 | int userId = data.readInt(); |
| 1087 | int res = stopService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1088 | reply.writeNoException(); |
| 1089 | reply.writeInt(res); |
| 1090 | return true; |
| 1091 | } |
| 1092 | |
| 1093 | case STOP_SERVICE_TOKEN_TRANSACTION: { |
| 1094 | data.enforceInterface(IActivityManager.descriptor); |
| 1095 | ComponentName className = ComponentName.readFromParcel(data); |
| 1096 | IBinder token = data.readStrongBinder(); |
| 1097 | int startId = data.readInt(); |
| 1098 | boolean res = stopServiceToken(className, token, startId); |
| 1099 | reply.writeNoException(); |
| 1100 | reply.writeInt(res ? 1 : 0); |
| 1101 | return true; |
| 1102 | } |
| 1103 | |
| 1104 | case SET_SERVICE_FOREGROUND_TRANSACTION: { |
| 1105 | data.enforceInterface(IActivityManager.descriptor); |
| 1106 | ComponentName className = ComponentName.readFromParcel(data); |
| 1107 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 1108 | int id = data.readInt(); |
| 1109 | Notification notification = null; |
| 1110 | if (data.readInt() != 0) { |
| 1111 | notification = Notification.CREATOR.createFromParcel(data); |
| 1112 | } |
| 1113 | boolean removeNotification = data.readInt() != 0; |
| 1114 | setServiceForeground(className, token, id, notification, removeNotification); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1115 | reply.writeNoException(); |
| 1116 | return true; |
| 1117 | } |
| 1118 | |
| 1119 | case BIND_SERVICE_TRANSACTION: { |
| 1120 | data.enforceInterface(IActivityManager.descriptor); |
| 1121 | IBinder b = data.readStrongBinder(); |
| 1122 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1123 | IBinder token = data.readStrongBinder(); |
| 1124 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1125 | String resolvedType = data.readString(); |
| 1126 | b = data.readStrongBinder(); |
| 1127 | int fl = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1128 | String callingPackage = data.readString(); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 1129 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1130 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1131 | int res = bindService(app, token, service, resolvedType, conn, fl, |
| 1132 | callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1133 | reply.writeNoException(); |
| 1134 | reply.writeInt(res); |
| 1135 | return true; |
| 1136 | } |
| 1137 | |
| 1138 | case UNBIND_SERVICE_TRANSACTION: { |
| 1139 | data.enforceInterface(IActivityManager.descriptor); |
| 1140 | IBinder b = data.readStrongBinder(); |
| 1141 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
| 1142 | boolean res = unbindService(conn); |
| 1143 | reply.writeNoException(); |
| 1144 | reply.writeInt(res ? 1 : 0); |
| 1145 | return true; |
| 1146 | } |
| 1147 | |
| 1148 | case PUBLISH_SERVICE_TRANSACTION: { |
| 1149 | data.enforceInterface(IActivityManager.descriptor); |
| 1150 | IBinder token = data.readStrongBinder(); |
| 1151 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1152 | IBinder service = data.readStrongBinder(); |
| 1153 | publishService(token, intent, service); |
| 1154 | reply.writeNoException(); |
| 1155 | return true; |
| 1156 | } |
| 1157 | |
| 1158 | case UNBIND_FINISHED_TRANSACTION: { |
| 1159 | data.enforceInterface(IActivityManager.descriptor); |
| 1160 | IBinder token = data.readStrongBinder(); |
| 1161 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1162 | boolean doRebind = data.readInt() != 0; |
| 1163 | unbindFinished(token, intent, doRebind); |
| 1164 | reply.writeNoException(); |
| 1165 | return true; |
| 1166 | } |
| 1167 | |
| 1168 | case SERVICE_DONE_EXECUTING_TRANSACTION: { |
| 1169 | data.enforceInterface(IActivityManager.descriptor); |
| 1170 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 1171 | int type = data.readInt(); |
| 1172 | int startId = data.readInt(); |
| 1173 | int res = data.readInt(); |
| 1174 | serviceDoneExecuting(token, type, startId, res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1175 | reply.writeNoException(); |
| 1176 | return true; |
| 1177 | } |
| 1178 | |
| 1179 | case START_INSTRUMENTATION_TRANSACTION: { |
| 1180 | data.enforceInterface(IActivityManager.descriptor); |
| 1181 | ComponentName className = ComponentName.readFromParcel(data); |
| 1182 | String profileFile = data.readString(); |
| 1183 | int fl = data.readInt(); |
| 1184 | Bundle arguments = data.readBundle(); |
| 1185 | IBinder b = data.readStrongBinder(); |
| 1186 | IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 1187 | b = data.readStrongBinder(); |
| 1188 | IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1189 | int userId = data.readInt(); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 1190 | String abiOverride = data.readString(); |
| 1191 | boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId, |
| 1192 | abiOverride); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1193 | reply.writeNoException(); |
| 1194 | reply.writeInt(res ? 1 : 0); |
| 1195 | return true; |
| 1196 | } |
| 1197 | |
| 1198 | |
| 1199 | case FINISH_INSTRUMENTATION_TRANSACTION: { |
| 1200 | data.enforceInterface(IActivityManager.descriptor); |
| 1201 | IBinder b = data.readStrongBinder(); |
| 1202 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1203 | int resultCode = data.readInt(); |
| 1204 | Bundle results = data.readBundle(); |
| 1205 | finishInstrumentation(app, resultCode, results); |
| 1206 | reply.writeNoException(); |
| 1207 | return true; |
| 1208 | } |
| 1209 | |
| 1210 | case GET_CONFIGURATION_TRANSACTION: { |
| 1211 | data.enforceInterface(IActivityManager.descriptor); |
| 1212 | Configuration config = getConfiguration(); |
| 1213 | reply.writeNoException(); |
| 1214 | config.writeToParcel(reply, 0); |
| 1215 | return true; |
| 1216 | } |
| 1217 | |
| 1218 | case UPDATE_CONFIGURATION_TRANSACTION: { |
| 1219 | data.enforceInterface(IActivityManager.descriptor); |
| 1220 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 1221 | updateConfiguration(config); |
| 1222 | reply.writeNoException(); |
| 1223 | return true; |
| 1224 | } |
| 1225 | |
| 1226 | case SET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1227 | data.enforceInterface(IActivityManager.descriptor); |
| 1228 | IBinder token = data.readStrongBinder(); |
| 1229 | int requestedOrientation = data.readInt(); |
| 1230 | setRequestedOrientation(token, requestedOrientation); |
| 1231 | reply.writeNoException(); |
| 1232 | return true; |
| 1233 | } |
| 1234 | |
| 1235 | case GET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1236 | data.enforceInterface(IActivityManager.descriptor); |
| 1237 | IBinder token = data.readStrongBinder(); |
| 1238 | int req = getRequestedOrientation(token); |
| 1239 | reply.writeNoException(); |
| 1240 | reply.writeInt(req); |
| 1241 | return true; |
| 1242 | } |
| 1243 | |
| 1244 | case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: { |
| 1245 | data.enforceInterface(IActivityManager.descriptor); |
| 1246 | IBinder token = data.readStrongBinder(); |
| 1247 | ComponentName cn = getActivityClassForToken(token); |
| 1248 | reply.writeNoException(); |
| 1249 | ComponentName.writeToParcel(cn, reply); |
| 1250 | return true; |
| 1251 | } |
| 1252 | |
| 1253 | case GET_PACKAGE_FOR_TOKEN_TRANSACTION: { |
| 1254 | data.enforceInterface(IActivityManager.descriptor); |
| 1255 | IBinder token = data.readStrongBinder(); |
| 1256 | reply.writeNoException(); |
| 1257 | reply.writeString(getPackageForToken(token)); |
| 1258 | return true; |
| 1259 | } |
| 1260 | |
| 1261 | case GET_INTENT_SENDER_TRANSACTION: { |
| 1262 | data.enforceInterface(IActivityManager.descriptor); |
| 1263 | int type = data.readInt(); |
| 1264 | String packageName = data.readString(); |
| 1265 | IBinder token = data.readStrongBinder(); |
| 1266 | String resultWho = data.readString(); |
| 1267 | int requestCode = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1268 | Intent[] requestIntents; |
| 1269 | String[] requestResolvedTypes; |
| 1270 | if (data.readInt() != 0) { |
| 1271 | requestIntents = data.createTypedArray(Intent.CREATOR); |
| 1272 | requestResolvedTypes = data.createStringArray(); |
| 1273 | } else { |
| 1274 | requestIntents = null; |
| 1275 | requestResolvedTypes = null; |
| 1276 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1277 | int fl = data.readInt(); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 1278 | Bundle options = data.readInt() != 0 |
| 1279 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1280 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1281 | IIntentSender res = getIntentSender(type, packageName, token, |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1282 | resultWho, requestCode, requestIntents, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1283 | requestResolvedTypes, fl, options, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1284 | reply.writeNoException(); |
| 1285 | reply.writeStrongBinder(res != null ? res.asBinder() : null); |
| 1286 | return true; |
| 1287 | } |
| 1288 | |
| 1289 | case CANCEL_INTENT_SENDER_TRANSACTION: { |
| 1290 | data.enforceInterface(IActivityManager.descriptor); |
| 1291 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1292 | data.readStrongBinder()); |
| 1293 | cancelIntentSender(r); |
| 1294 | reply.writeNoException(); |
| 1295 | return true; |
| 1296 | } |
| 1297 | |
| 1298 | case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: { |
| 1299 | data.enforceInterface(IActivityManager.descriptor); |
| 1300 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1301 | data.readStrongBinder()); |
| 1302 | String res = getPackageForIntentSender(r); |
| 1303 | reply.writeNoException(); |
| 1304 | reply.writeString(res); |
| 1305 | return true; |
| 1306 | } |
| 1307 | |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 1308 | case GET_UID_FOR_INTENT_SENDER_TRANSACTION: { |
| 1309 | data.enforceInterface(IActivityManager.descriptor); |
| 1310 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1311 | data.readStrongBinder()); |
| 1312 | int res = getUidForIntentSender(r); |
| 1313 | reply.writeNoException(); |
| 1314 | reply.writeInt(res); |
| 1315 | return true; |
| 1316 | } |
| 1317 | |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1318 | case HANDLE_INCOMING_USER_TRANSACTION: { |
| 1319 | data.enforceInterface(IActivityManager.descriptor); |
| 1320 | int callingPid = data.readInt(); |
| 1321 | int callingUid = data.readInt(); |
| 1322 | int userId = data.readInt(); |
| 1323 | boolean allowAll = data.readInt() != 0 ; |
| 1324 | boolean requireFull = data.readInt() != 0; |
| 1325 | String name = data.readString(); |
| 1326 | String callerPackage = data.readString(); |
| 1327 | int res = handleIncomingUser(callingPid, callingUid, userId, allowAll, |
| 1328 | requireFull, name, callerPackage); |
| 1329 | reply.writeNoException(); |
| 1330 | reply.writeInt(res); |
| 1331 | return true; |
| 1332 | } |
| 1333 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1334 | case SET_PROCESS_LIMIT_TRANSACTION: { |
| 1335 | data.enforceInterface(IActivityManager.descriptor); |
| 1336 | int max = data.readInt(); |
| 1337 | setProcessLimit(max); |
| 1338 | reply.writeNoException(); |
| 1339 | return true; |
| 1340 | } |
| 1341 | |
| 1342 | case GET_PROCESS_LIMIT_TRANSACTION: { |
| 1343 | data.enforceInterface(IActivityManager.descriptor); |
| 1344 | int limit = getProcessLimit(); |
| 1345 | reply.writeNoException(); |
| 1346 | reply.writeInt(limit); |
| 1347 | return true; |
| 1348 | } |
| 1349 | |
| 1350 | case SET_PROCESS_FOREGROUND_TRANSACTION: { |
| 1351 | data.enforceInterface(IActivityManager.descriptor); |
| 1352 | IBinder token = data.readStrongBinder(); |
| 1353 | int pid = data.readInt(); |
| 1354 | boolean isForeground = data.readInt() != 0; |
| 1355 | setProcessForeground(token, pid, isForeground); |
| 1356 | reply.writeNoException(); |
| 1357 | return true; |
| 1358 | } |
| 1359 | |
| 1360 | case CHECK_PERMISSION_TRANSACTION: { |
| 1361 | data.enforceInterface(IActivityManager.descriptor); |
| 1362 | String perm = data.readString(); |
| 1363 | int pid = data.readInt(); |
| 1364 | int uid = data.readInt(); |
| 1365 | int res = checkPermission(perm, pid, uid); |
| 1366 | reply.writeNoException(); |
| 1367 | reply.writeInt(res); |
| 1368 | return true; |
| 1369 | } |
| 1370 | |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1371 | case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: { |
| 1372 | data.enforceInterface(IActivityManager.descriptor); |
| 1373 | String perm = data.readString(); |
| 1374 | int pid = data.readInt(); |
| 1375 | int uid = data.readInt(); |
| 1376 | IBinder token = data.readStrongBinder(); |
| 1377 | int res = checkPermissionWithToken(perm, pid, uid, token); |
| 1378 | reply.writeNoException(); |
| 1379 | reply.writeInt(res); |
| 1380 | return true; |
| 1381 | } |
| 1382 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1383 | case CHECK_URI_PERMISSION_TRANSACTION: { |
| 1384 | data.enforceInterface(IActivityManager.descriptor); |
| 1385 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1386 | int pid = data.readInt(); |
| 1387 | int uid = data.readInt(); |
| 1388 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1389 | int userId = data.readInt(); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1390 | IBinder callerToken = data.readStrongBinder(); |
| 1391 | int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1392 | reply.writeNoException(); |
| 1393 | reply.writeInt(res); |
| 1394 | return true; |
| 1395 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1396 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1397 | case CLEAR_APP_DATA_TRANSACTION: { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1398 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1399 | String packageName = data.readString(); |
| 1400 | IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface( |
| 1401 | data.readStrongBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 1402 | int userId = data.readInt(); |
| 1403 | boolean res = clearApplicationUserData(packageName, observer, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1404 | reply.writeNoException(); |
| 1405 | reply.writeInt(res ? 1 : 0); |
| 1406 | return true; |
| 1407 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1408 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1409 | case GRANT_URI_PERMISSION_TRANSACTION: { |
| 1410 | data.enforceInterface(IActivityManager.descriptor); |
| 1411 | IBinder b = data.readStrongBinder(); |
| 1412 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1413 | String targetPkg = data.readString(); |
| 1414 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1415 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1416 | int userId = data.readInt(); |
| 1417 | grantUriPermission(app, targetPkg, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1418 | reply.writeNoException(); |
| 1419 | return true; |
| 1420 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1421 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1422 | case REVOKE_URI_PERMISSION_TRANSACTION: { |
| 1423 | data.enforceInterface(IActivityManager.descriptor); |
| 1424 | IBinder b = data.readStrongBinder(); |
| 1425 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1426 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1427 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1428 | int userId = data.readInt(); |
| 1429 | revokeUriPermission(app, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1430 | reply.writeNoException(); |
| 1431 | return true; |
| 1432 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1433 | |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1434 | case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1435 | data.enforceInterface(IActivityManager.descriptor); |
| 1436 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1437 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1438 | int userId = data.readInt(); |
| 1439 | takePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1440 | reply.writeNoException(); |
| 1441 | return true; |
| 1442 | } |
| 1443 | |
| 1444 | case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1445 | data.enforceInterface(IActivityManager.descriptor); |
| 1446 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1447 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1448 | int userId = data.readInt(); |
| 1449 | releasePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1450 | reply.writeNoException(); |
| 1451 | return true; |
| 1452 | } |
| 1453 | |
| 1454 | case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: { |
| 1455 | data.enforceInterface(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 1456 | final String packageName = data.readString(); |
| 1457 | final boolean incoming = data.readInt() != 0; |
| 1458 | final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions( |
| 1459 | packageName, incoming); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1460 | reply.writeNoException(); |
| 1461 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1462 | return true; |
| 1463 | } |
| 1464 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 1465 | case GET_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1466 | data.enforceInterface(IActivityManager.descriptor); |
| 1467 | final String packageName = data.readString(); |
| 1468 | final int userId = data.readInt(); |
| 1469 | final ParceledListSlice<UriPermission> perms = getGrantedUriPermissions(packageName, |
| 1470 | userId); |
| 1471 | reply.writeNoException(); |
| 1472 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1473 | return true; |
| 1474 | } |
| 1475 | |
| 1476 | case CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1477 | data.enforceInterface(IActivityManager.descriptor); |
| 1478 | final String packageName = data.readString(); |
| 1479 | final int userId = data.readInt(); |
| 1480 | clearGrantedUriPermissions(packageName, userId); |
| 1481 | reply.writeNoException(); |
| 1482 | return true; |
| 1483 | } |
| 1484 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1485 | case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: { |
| 1486 | data.enforceInterface(IActivityManager.descriptor); |
| 1487 | IBinder b = data.readStrongBinder(); |
| 1488 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1489 | boolean waiting = data.readInt() != 0; |
| 1490 | showWaitingForDebugger(app, waiting); |
| 1491 | reply.writeNoException(); |
| 1492 | return true; |
| 1493 | } |
| 1494 | |
| 1495 | case GET_MEMORY_INFO_TRANSACTION: { |
| 1496 | data.enforceInterface(IActivityManager.descriptor); |
| 1497 | ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); |
| 1498 | getMemoryInfo(mi); |
| 1499 | reply.writeNoException(); |
| 1500 | mi.writeToParcel(reply, 0); |
| 1501 | return true; |
| 1502 | } |
| 1503 | |
| 1504 | case UNHANDLED_BACK_TRANSACTION: { |
| 1505 | data.enforceInterface(IActivityManager.descriptor); |
| 1506 | unhandledBack(); |
| 1507 | reply.writeNoException(); |
| 1508 | return true; |
| 1509 | } |
| 1510 | |
| 1511 | case OPEN_CONTENT_URI_TRANSACTION: { |
| 1512 | data.enforceInterface(IActivityManager.descriptor); |
| 1513 | Uri uri = Uri.parse(data.readString()); |
| 1514 | ParcelFileDescriptor pfd = openContentUri(uri); |
| 1515 | reply.writeNoException(); |
| 1516 | if (pfd != null) { |
| 1517 | reply.writeInt(1); |
| 1518 | pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1519 | } else { |
| 1520 | reply.writeInt(0); |
| 1521 | } |
| 1522 | return true; |
| 1523 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1524 | |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1525 | case SET_LOCK_SCREEN_SHOWN_TRANSACTION: { |
| 1526 | data.enforceInterface(IActivityManager.descriptor); |
| 1527 | setLockScreenShown(data.readInt() != 0); |
| 1528 | reply.writeNoException(); |
| 1529 | return true; |
| 1530 | } |
| 1531 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1532 | case SET_DEBUG_APP_TRANSACTION: { |
| 1533 | data.enforceInterface(IActivityManager.descriptor); |
| 1534 | String pn = data.readString(); |
| 1535 | boolean wfd = data.readInt() != 0; |
| 1536 | boolean per = data.readInt() != 0; |
| 1537 | setDebugApp(pn, wfd, per); |
| 1538 | reply.writeNoException(); |
| 1539 | return true; |
| 1540 | } |
| 1541 | |
| 1542 | case SET_ALWAYS_FINISH_TRANSACTION: { |
| 1543 | data.enforceInterface(IActivityManager.descriptor); |
| 1544 | boolean enabled = data.readInt() != 0; |
| 1545 | setAlwaysFinish(enabled); |
| 1546 | reply.writeNoException(); |
| 1547 | return true; |
| 1548 | } |
| 1549 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1550 | case SET_ACTIVITY_CONTROLLER_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1551 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1552 | IActivityController watcher = IActivityController.Stub.asInterface( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1553 | data.readStrongBinder()); |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 1554 | boolean imAMonkey = data.readInt() != 0; |
| 1555 | setActivityController(watcher, imAMonkey); |
Sungmin Choi | cdb86bb | 2012-12-20 14:08:59 +0900 | [diff] [blame] | 1556 | reply.writeNoException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1557 | return true; |
| 1558 | } |
| 1559 | |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 1560 | case SET_LENIENT_BACKGROUND_CHECK_TRANSACTION: { |
| 1561 | data.enforceInterface(IActivityManager.descriptor); |
| 1562 | boolean enabled = data.readInt() != 0; |
| 1563 | setLenientBackgroundCheck(enabled); |
| 1564 | reply.writeNoException(); |
| 1565 | return true; |
| 1566 | } |
| 1567 | |
Dianne Hackborn | 970510b | 2016-02-24 16:56:42 -0800 | [diff] [blame] | 1568 | case GET_MEMORY_TRIM_LEVEL_TRANSACTION: { |
| 1569 | data.enforceInterface(IActivityManager.descriptor); |
| 1570 | int level = getMemoryTrimLevel(); |
| 1571 | reply.writeNoException(); |
| 1572 | reply.writeInt(level); |
| 1573 | return true; |
| 1574 | } |
| 1575 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1576 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1577 | data.enforceInterface(IActivityManager.descriptor); |
| 1578 | enterSafeMode(); |
| 1579 | reply.writeNoException(); |
| 1580 | return true; |
| 1581 | } |
| 1582 | |
| 1583 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1584 | data.enforceInterface(IActivityManager.descriptor); |
| 1585 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1586 | data.readStrongBinder()); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 1587 | int sourceUid = data.readInt(); |
| 1588 | String sourcePkg = data.readString(); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 1589 | String tag = data.readString(); |
| 1590 | noteWakeupAlarm(is, sourceUid, sourcePkg, tag); |
| 1591 | reply.writeNoException(); |
| 1592 | return true; |
| 1593 | } |
| 1594 | |
| 1595 | case NOTE_ALARM_START_TRANSACTION: { |
| 1596 | data.enforceInterface(IActivityManager.descriptor); |
| 1597 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1598 | data.readStrongBinder()); |
| 1599 | int sourceUid = data.readInt(); |
| 1600 | String tag = data.readString(); |
| 1601 | noteAlarmStart(is, sourceUid, tag); |
| 1602 | reply.writeNoException(); |
| 1603 | return true; |
| 1604 | } |
| 1605 | |
| 1606 | case NOTE_ALARM_FINISH_TRANSACTION: { |
| 1607 | data.enforceInterface(IActivityManager.descriptor); |
| 1608 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1609 | data.readStrongBinder()); |
| 1610 | int sourceUid = data.readInt(); |
| 1611 | String tag = data.readString(); |
| 1612 | noteAlarmFinish(is, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1613 | reply.writeNoException(); |
| 1614 | return true; |
| 1615 | } |
| 1616 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1617 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1618 | data.enforceInterface(IActivityManager.descriptor); |
| 1619 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1620 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1621 | boolean secure = data.readInt() != 0; |
| 1622 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1623 | reply.writeNoException(); |
| 1624 | reply.writeInt(res ? 1 : 0); |
| 1625 | return true; |
| 1626 | } |
| 1627 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1628 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1629 | data.enforceInterface(IActivityManager.descriptor); |
| 1630 | String reason = data.readString(); |
| 1631 | boolean res = killProcessesBelowForeground(reason); |
| 1632 | reply.writeNoException(); |
| 1633 | reply.writeInt(res ? 1 : 0); |
| 1634 | return true; |
| 1635 | } |
| 1636 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1637 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1638 | data.enforceInterface(IActivityManager.descriptor); |
| 1639 | IBinder app = data.readStrongBinder(); |
| 1640 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1641 | handleApplicationCrash(app, ci); |
| 1642 | reply.writeNoException(); |
| 1643 | return true; |
| 1644 | } |
| 1645 | |
| 1646 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1647 | data.enforceInterface(IActivityManager.descriptor); |
| 1648 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1649 | String tag = data.readString(); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1650 | boolean system = data.readInt() != 0; |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1651 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1652 | boolean res = handleApplicationWtf(app, tag, system, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1653 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1654 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1655 | return true; |
| 1656 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1657 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1658 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1659 | data.enforceInterface(IActivityManager.descriptor); |
| 1660 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1661 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1662 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1663 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1664 | reply.writeNoException(); |
| 1665 | return true; |
| 1666 | } |
| 1667 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1668 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1669 | data.enforceInterface(IActivityManager.descriptor); |
| 1670 | int sig = data.readInt(); |
| 1671 | signalPersistentProcesses(sig); |
| 1672 | reply.writeNoException(); |
| 1673 | return true; |
| 1674 | } |
| 1675 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1676 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1677 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1678 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1679 | int userId = data.readInt(); |
| 1680 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1681 | reply.writeNoException(); |
| 1682 | return true; |
| 1683 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1684 | |
| 1685 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1686 | data.enforceInterface(IActivityManager.descriptor); |
| 1687 | killAllBackgroundProcesses(); |
| 1688 | reply.writeNoException(); |
| 1689 | return true; |
| 1690 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1691 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 1692 | case KILL_PACKAGE_DEPENDENTS_TRANSACTION: { |
| 1693 | data.enforceInterface(IActivityManager.descriptor); |
| 1694 | String packageName = data.readString(); |
| 1695 | int userId = data.readInt(); |
| 1696 | killPackageDependents(packageName, userId); |
| 1697 | reply.writeNoException(); |
| 1698 | return true; |
| 1699 | } |
| 1700 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1701 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1702 | data.enforceInterface(IActivityManager.descriptor); |
| 1703 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1704 | int userId = data.readInt(); |
| 1705 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1706 | reply.writeNoException(); |
| 1707 | return true; |
| 1708 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1709 | |
| 1710 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1711 | data.enforceInterface(IActivityManager.descriptor); |
| 1712 | ActivityManager.RunningAppProcessInfo info = |
| 1713 | new ActivityManager.RunningAppProcessInfo(); |
| 1714 | getMyMemoryState(info); |
| 1715 | reply.writeNoException(); |
| 1716 | info.writeToParcel(reply, 0); |
| 1717 | return true; |
| 1718 | } |
| 1719 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1720 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1721 | data.enforceInterface(IActivityManager.descriptor); |
| 1722 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1723 | reply.writeNoException(); |
| 1724 | config.writeToParcel(reply, 0); |
| 1725 | return true; |
| 1726 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1727 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1728 | case PROFILE_CONTROL_TRANSACTION: { |
| 1729 | data.enforceInterface(IActivityManager.descriptor); |
| 1730 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1731 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1732 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1733 | int profileType = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1734 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 1735 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
| 1736 | boolean res = profileControl(process, userId, start, profilerInfo, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1737 | reply.writeNoException(); |
| 1738 | reply.writeInt(res ? 1 : 0); |
| 1739 | return true; |
| 1740 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1741 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1742 | case SHUTDOWN_TRANSACTION: { |
| 1743 | data.enforceInterface(IActivityManager.descriptor); |
| 1744 | boolean res = shutdown(data.readInt()); |
| 1745 | reply.writeNoException(); |
| 1746 | reply.writeInt(res ? 1 : 0); |
| 1747 | return true; |
| 1748 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1749 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1750 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1751 | data.enforceInterface(IActivityManager.descriptor); |
| 1752 | stopAppSwitches(); |
| 1753 | reply.writeNoException(); |
| 1754 | return true; |
| 1755 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1756 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1757 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1758 | data.enforceInterface(IActivityManager.descriptor); |
| 1759 | resumeAppSwitches(); |
| 1760 | reply.writeNoException(); |
| 1761 | return true; |
| 1762 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1763 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1764 | case PEEK_SERVICE_TRANSACTION: { |
| 1765 | data.enforceInterface(IActivityManager.descriptor); |
| 1766 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1767 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1768 | String callingPackage = data.readString(); |
| 1769 | IBinder binder = peekService(service, resolvedType, callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1770 | reply.writeNoException(); |
| 1771 | reply.writeStrongBinder(binder); |
| 1772 | return true; |
| 1773 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1774 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1775 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1776 | data.enforceInterface(IActivityManager.descriptor); |
| 1777 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1778 | int backupRestoreMode = data.readInt(); |
| 1779 | boolean success = bindBackupAgent(info, backupRestoreMode); |
| 1780 | reply.writeNoException(); |
| 1781 | reply.writeInt(success ? 1 : 0); |
| 1782 | return true; |
| 1783 | } |
| 1784 | |
| 1785 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1786 | data.enforceInterface(IActivityManager.descriptor); |
| 1787 | String packageName = data.readString(); |
| 1788 | IBinder agent = data.readStrongBinder(); |
| 1789 | backupAgentCreated(packageName, agent); |
| 1790 | reply.writeNoException(); |
| 1791 | return true; |
| 1792 | } |
| 1793 | |
| 1794 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1795 | data.enforceInterface(IActivityManager.descriptor); |
| 1796 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1797 | unbindBackupAgent(info); |
| 1798 | reply.writeNoException(); |
| 1799 | return true; |
| 1800 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1801 | |
| 1802 | case ADD_PACKAGE_DEPENDENCY_TRANSACTION: { |
| 1803 | data.enforceInterface(IActivityManager.descriptor); |
| 1804 | String packageName = data.readString(); |
| 1805 | addPackageDependency(packageName); |
| 1806 | reply.writeNoException(); |
| 1807 | return true; |
| 1808 | } |
| 1809 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1810 | case KILL_APPLICATION_WITH_APPID_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1811 | data.enforceInterface(IActivityManager.descriptor); |
| 1812 | String pkg = data.readString(); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1813 | int appid = data.readInt(); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 1814 | String reason = data.readString(); |
| 1815 | killApplicationWithAppId(pkg, appid, reason); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1816 | reply.writeNoException(); |
| 1817 | return true; |
| 1818 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1819 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1820 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1821 | data.enforceInterface(IActivityManager.descriptor); |
| 1822 | String reason = data.readString(); |
| 1823 | closeSystemDialogs(reason); |
| 1824 | reply.writeNoException(); |
| 1825 | return true; |
| 1826 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1827 | |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1828 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1829 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1830 | int[] pids = data.createIntArray(); |
| 1831 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1832 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1833 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1834 | return true; |
| 1835 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1836 | |
| 1837 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1838 | data.enforceInterface(IActivityManager.descriptor); |
| 1839 | String processName = data.readString(); |
| 1840 | int uid = data.readInt(); |
| 1841 | killApplicationProcess(processName, uid); |
| 1842 | reply.writeNoException(); |
| 1843 | return true; |
| 1844 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1845 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1846 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1847 | data.enforceInterface(IActivityManager.descriptor); |
| 1848 | IBinder token = data.readStrongBinder(); |
| 1849 | String packageName = data.readString(); |
| 1850 | int enterAnim = data.readInt(); |
| 1851 | int exitAnim = data.readInt(); |
| 1852 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1853 | reply.writeNoException(); |
| 1854 | return true; |
| 1855 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1856 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1857 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1858 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1859 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1860 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1861 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1862 | return true; |
| 1863 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1864 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1865 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1866 | data.enforceInterface(IActivityManager.descriptor); |
| 1867 | final boolean monkey = (data.readInt() == 1); |
| 1868 | setUserIsMonkey(monkey); |
| 1869 | reply.writeNoException(); |
| 1870 | return true; |
| 1871 | } |
| 1872 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1873 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1874 | data.enforceInterface(IActivityManager.descriptor); |
| 1875 | finishHeavyWeightApp(); |
| 1876 | reply.writeNoException(); |
| 1877 | return true; |
| 1878 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1879 | |
| 1880 | case IS_IMMERSIVE_TRANSACTION: { |
| 1881 | data.enforceInterface(IActivityManager.descriptor); |
| 1882 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1883 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1884 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1885 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1886 | return true; |
| 1887 | } |
| 1888 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 1889 | case IS_TOP_OF_TASK_TRANSACTION: { |
| 1890 | data.enforceInterface(IActivityManager.descriptor); |
| 1891 | IBinder token = data.readStrongBinder(); |
| 1892 | final boolean isTopOfTask = isTopOfTask(token); |
| 1893 | reply.writeNoException(); |
| 1894 | reply.writeInt(isTopOfTask ? 1 : 0); |
| 1895 | return true; |
| 1896 | } |
| 1897 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1898 | case CONVERT_FROM_TRANSLUCENT_TRANSACTION: { |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1899 | data.enforceInterface(IActivityManager.descriptor); |
| 1900 | IBinder token = data.readStrongBinder(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1901 | boolean converted = convertFromTranslucent(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1902 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1903 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1904 | return true; |
| 1905 | } |
| 1906 | |
| 1907 | case CONVERT_TO_TRANSLUCENT_TRANSACTION: { |
| 1908 | data.enforceInterface(IActivityManager.descriptor); |
| 1909 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1910 | final Bundle bundle; |
| 1911 | if (data.readInt() == 0) { |
| 1912 | bundle = null; |
| 1913 | } else { |
| 1914 | bundle = data.readBundle(); |
| 1915 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 1916 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1917 | boolean converted = convertToTranslucent(token, options); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1918 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1919 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1920 | return true; |
| 1921 | } |
| 1922 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1923 | case GET_ACTIVITY_OPTIONS_TRANSACTION: { |
| 1924 | data.enforceInterface(IActivityManager.descriptor); |
| 1925 | IBinder token = data.readStrongBinder(); |
| 1926 | final ActivityOptions options = getActivityOptions(token); |
| 1927 | reply.writeNoException(); |
| 1928 | reply.writeBundle(options == null ? null : options.toBundle()); |
| 1929 | return true; |
| 1930 | } |
| 1931 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1932 | case SET_IMMERSIVE_TRANSACTION: { |
| 1933 | data.enforceInterface(IActivityManager.descriptor); |
| 1934 | IBinder token = data.readStrongBinder(); |
| 1935 | boolean imm = data.readInt() == 1; |
| 1936 | setImmersive(token, imm); |
| 1937 | reply.writeNoException(); |
| 1938 | return true; |
| 1939 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1940 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1941 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1942 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1943 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1944 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1945 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1946 | return true; |
| 1947 | } |
| 1948 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1949 | case CRASH_APPLICATION_TRANSACTION: { |
| 1950 | data.enforceInterface(IActivityManager.descriptor); |
| 1951 | int uid = data.readInt(); |
| 1952 | int initialPid = data.readInt(); |
| 1953 | String packageName = data.readString(); |
| 1954 | String message = data.readString(); |
| 1955 | crashApplication(uid, initialPid, packageName, message); |
| 1956 | reply.writeNoException(); |
| 1957 | return true; |
| 1958 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1959 | |
| 1960 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1961 | data.enforceInterface(IActivityManager.descriptor); |
| 1962 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1963 | int userId = data.readInt(); |
| 1964 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1965 | reply.writeNoException(); |
| 1966 | reply.writeString(type); |
| 1967 | return true; |
| 1968 | } |
| 1969 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1970 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1971 | data.enforceInterface(IActivityManager.descriptor); |
| 1972 | String name = data.readString(); |
| 1973 | IBinder perm = newUriPermissionOwner(name); |
| 1974 | reply.writeNoException(); |
| 1975 | reply.writeStrongBinder(perm); |
| 1976 | return true; |
| 1977 | } |
| 1978 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 1979 | case GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION: { |
| 1980 | data.enforceInterface(IActivityManager.descriptor); |
| 1981 | IBinder activityToken = data.readStrongBinder(); |
| 1982 | IBinder perm = getUriPermissionOwnerForActivity(activityToken); |
| 1983 | reply.writeNoException(); |
| 1984 | reply.writeStrongBinder(perm); |
| 1985 | return true; |
| 1986 | } |
| 1987 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1988 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1989 | data.enforceInterface(IActivityManager.descriptor); |
| 1990 | IBinder owner = data.readStrongBinder(); |
| 1991 | int fromUid = data.readInt(); |
| 1992 | String targetPkg = data.readString(); |
| 1993 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1994 | int mode = data.readInt(); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 1995 | int sourceUserId = data.readInt(); |
| 1996 | int targetUserId = data.readInt(); |
| 1997 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId, |
| 1998 | targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1999 | reply.writeNoException(); |
| 2000 | return true; |
| 2001 | } |
| 2002 | |
| 2003 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 2004 | data.enforceInterface(IActivityManager.descriptor); |
| 2005 | IBinder owner = data.readStrongBinder(); |
| 2006 | Uri uri = null; |
| 2007 | if (data.readInt() != 0) { |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2008 | uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2009 | } |
| 2010 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2011 | int userId = data.readInt(); |
| 2012 | revokeUriPermissionFromOwner(owner, uri, mode, userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2013 | reply.writeNoException(); |
| 2014 | return true; |
| 2015 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 2016 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 2017 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 2018 | data.enforceInterface(IActivityManager.descriptor); |
| 2019 | int callingUid = data.readInt(); |
| 2020 | String targetPkg = data.readString(); |
| 2021 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 2022 | int modeFlags = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2023 | int userId = data.readInt(); |
| 2024 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 2025 | reply.writeNoException(); |
| 2026 | reply.writeInt(res); |
| 2027 | return true; |
| 2028 | } |
| 2029 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2030 | case DUMP_HEAP_TRANSACTION: { |
| 2031 | data.enforceInterface(IActivityManager.descriptor); |
| 2032 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 2033 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2034 | boolean managed = data.readInt() != 0; |
| 2035 | String path = data.readString(); |
| 2036 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 2037 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 2038 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2039 | reply.writeNoException(); |
| 2040 | reply.writeInt(res ? 1 : 0); |
| 2041 | return true; |
| 2042 | } |
| 2043 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2044 | case START_ACTIVITIES_TRANSACTION: |
| 2045 | { |
| 2046 | data.enforceInterface(IActivityManager.descriptor); |
| 2047 | IBinder b = data.readStrongBinder(); |
| 2048 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2049 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2050 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 2051 | String[] resolvedTypes = data.createStringArray(); |
| 2052 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2053 | Bundle options = data.readInt() != 0 |
| 2054 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2055 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2056 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2057 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2058 | reply.writeNoException(); |
| 2059 | reply.writeInt(result); |
| 2060 | return true; |
| 2061 | } |
| 2062 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2063 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2064 | { |
| 2065 | data.enforceInterface(IActivityManager.descriptor); |
| 2066 | int mode = getFrontActivityScreenCompatMode(); |
| 2067 | reply.writeNoException(); |
| 2068 | reply.writeInt(mode); |
| 2069 | return true; |
| 2070 | } |
| 2071 | |
| 2072 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2073 | { |
| 2074 | data.enforceInterface(IActivityManager.descriptor); |
| 2075 | int mode = data.readInt(); |
| 2076 | setFrontActivityScreenCompatMode(mode); |
| 2077 | reply.writeNoException(); |
| 2078 | reply.writeInt(mode); |
| 2079 | return true; |
| 2080 | } |
| 2081 | |
| 2082 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2083 | { |
| 2084 | data.enforceInterface(IActivityManager.descriptor); |
| 2085 | String pkg = data.readString(); |
| 2086 | int mode = getPackageScreenCompatMode(pkg); |
| 2087 | reply.writeNoException(); |
| 2088 | reply.writeInt(mode); |
| 2089 | return true; |
| 2090 | } |
| 2091 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2092 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2093 | { |
| 2094 | data.enforceInterface(IActivityManager.descriptor); |
| 2095 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2096 | int mode = data.readInt(); |
| 2097 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2098 | reply.writeNoException(); |
| 2099 | return true; |
| 2100 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2101 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2102 | case SWITCH_USER_TRANSACTION: { |
| 2103 | data.enforceInterface(IActivityManager.descriptor); |
| 2104 | int userid = data.readInt(); |
| 2105 | boolean result = switchUser(userid); |
| 2106 | reply.writeNoException(); |
| 2107 | reply.writeInt(result ? 1 : 0); |
| 2108 | return true; |
| 2109 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2110 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 2111 | case START_USER_IN_BACKGROUND_TRANSACTION: { |
| 2112 | data.enforceInterface(IActivityManager.descriptor); |
| 2113 | int userid = data.readInt(); |
| 2114 | boolean result = startUserInBackground(userid); |
| 2115 | reply.writeNoException(); |
| 2116 | reply.writeInt(result ? 1 : 0); |
| 2117 | return true; |
| 2118 | } |
| 2119 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2120 | case UNLOCK_USER_TRANSACTION: { |
| 2121 | data.enforceInterface(IActivityManager.descriptor); |
| 2122 | int userId = data.readInt(); |
| 2123 | byte[] token = data.createByteArray(); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 2124 | byte[] secret = data.createByteArray(); |
| 2125 | boolean result = unlockUser(userId, token, secret); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2126 | reply.writeNoException(); |
| 2127 | reply.writeInt(result ? 1 : 0); |
| 2128 | return true; |
| 2129 | } |
| 2130 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2131 | case STOP_USER_TRANSACTION: { |
| 2132 | data.enforceInterface(IActivityManager.descriptor); |
| 2133 | int userid = data.readInt(); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2134 | boolean force = data.readInt() != 0; |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2135 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 2136 | data.readStrongBinder()); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2137 | int result = stopUser(userid, force, callback); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2138 | reply.writeNoException(); |
| 2139 | reply.writeInt(result); |
| 2140 | return true; |
| 2141 | } |
| 2142 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2143 | case GET_CURRENT_USER_TRANSACTION: { |
| 2144 | data.enforceInterface(IActivityManager.descriptor); |
| 2145 | UserInfo userInfo = getCurrentUser(); |
| 2146 | reply.writeNoException(); |
| 2147 | userInfo.writeToParcel(reply, 0); |
| 2148 | return true; |
| 2149 | } |
| 2150 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2151 | case IS_USER_RUNNING_TRANSACTION: { |
| 2152 | data.enforceInterface(IActivityManager.descriptor); |
| 2153 | int userid = data.readInt(); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 2154 | int _flags = data.readInt(); |
| 2155 | boolean result = isUserRunning(userid, _flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2156 | reply.writeNoException(); |
| 2157 | reply.writeInt(result ? 1 : 0); |
| 2158 | return true; |
| 2159 | } |
| 2160 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 2161 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 2162 | data.enforceInterface(IActivityManager.descriptor); |
| 2163 | int[] result = getRunningUserIds(); |
| 2164 | reply.writeNoException(); |
| 2165 | reply.writeIntArray(result); |
| 2166 | return true; |
| 2167 | } |
| 2168 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2169 | case REMOVE_TASK_TRANSACTION: |
| 2170 | { |
| 2171 | data.enforceInterface(IActivityManager.descriptor); |
| 2172 | int taskId = data.readInt(); |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 2173 | boolean result = removeTask(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2174 | reply.writeNoException(); |
| 2175 | reply.writeInt(result ? 1 : 0); |
| 2176 | return true; |
| 2177 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2178 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 2179 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2180 | data.enforceInterface(IActivityManager.descriptor); |
| 2181 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2182 | data.readStrongBinder()); |
| 2183 | registerProcessObserver(observer); |
| 2184 | return true; |
| 2185 | } |
| 2186 | |
| 2187 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2188 | data.enforceInterface(IActivityManager.descriptor); |
| 2189 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2190 | data.readStrongBinder()); |
| 2191 | unregisterProcessObserver(observer); |
| 2192 | return true; |
| 2193 | } |
| 2194 | |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2195 | case REGISTER_UID_OBSERVER_TRANSACTION: { |
| 2196 | data.enforceInterface(IActivityManager.descriptor); |
| 2197 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2198 | data.readStrongBinder()); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2199 | int which = data.readInt(); |
| 2200 | registerUidObserver(observer, which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2201 | return true; |
| 2202 | } |
| 2203 | |
| 2204 | case UNREGISTER_UID_OBSERVER_TRANSACTION: { |
| 2205 | data.enforceInterface(IActivityManager.descriptor); |
| 2206 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2207 | data.readStrongBinder()); |
| 2208 | unregisterUidObserver(observer); |
| 2209 | return true; |
| 2210 | } |
| 2211 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 2212 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2213 | { |
| 2214 | data.enforceInterface(IActivityManager.descriptor); |
| 2215 | String pkg = data.readString(); |
| 2216 | boolean ask = getPackageAskScreenCompat(pkg); |
| 2217 | reply.writeNoException(); |
| 2218 | reply.writeInt(ask ? 1 : 0); |
| 2219 | return true; |
| 2220 | } |
| 2221 | |
| 2222 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2223 | { |
| 2224 | data.enforceInterface(IActivityManager.descriptor); |
| 2225 | String pkg = data.readString(); |
| 2226 | boolean ask = data.readInt() != 0; |
| 2227 | setPackageAskScreenCompat(pkg, ask); |
| 2228 | reply.writeNoException(); |
| 2229 | return true; |
| 2230 | } |
| 2231 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2232 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 2233 | data.enforceInterface(IActivityManager.descriptor); |
| 2234 | IIntentSender r = IIntentSender.Stub.asInterface( |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2235 | data.readStrongBinder()); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2236 | boolean res = isIntentSenderTargetedToPackage(r); |
| 2237 | reply.writeNoException(); |
| 2238 | reply.writeInt(res ? 1 : 0); |
| 2239 | return true; |
| 2240 | } |
| 2241 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 2242 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 2243 | data.enforceInterface(IActivityManager.descriptor); |
| 2244 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2245 | data.readStrongBinder()); |
| 2246 | boolean res = isIntentSenderAnActivity(r); |
| 2247 | reply.writeNoException(); |
| 2248 | reply.writeInt(res ? 1 : 0); |
| 2249 | return true; |
| 2250 | } |
| 2251 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 2252 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 2253 | data.enforceInterface(IActivityManager.descriptor); |
| 2254 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2255 | data.readStrongBinder()); |
| 2256 | Intent intent = getIntentForIntentSender(r); |
| 2257 | reply.writeNoException(); |
| 2258 | if (intent != null) { |
| 2259 | reply.writeInt(1); |
| 2260 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2261 | } else { |
| 2262 | reply.writeInt(0); |
| 2263 | } |
| 2264 | return true; |
| 2265 | } |
| 2266 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 2267 | case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { |
| 2268 | data.enforceInterface(IActivityManager.descriptor); |
| 2269 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2270 | data.readStrongBinder()); |
| 2271 | String prefix = data.readString(); |
| 2272 | String tag = getTagForIntentSender(r, prefix); |
| 2273 | reply.writeNoException(); |
| 2274 | reply.writeString(tag); |
| 2275 | return true; |
| 2276 | } |
| 2277 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2278 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 2279 | data.enforceInterface(IActivityManager.descriptor); |
| 2280 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 2281 | updatePersistentConfiguration(config); |
| 2282 | reply.writeNoException(); |
| 2283 | return true; |
| 2284 | } |
| 2285 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 2286 | case GET_PROCESS_PSS_TRANSACTION: { |
| 2287 | data.enforceInterface(IActivityManager.descriptor); |
| 2288 | int[] pids = data.createIntArray(); |
| 2289 | long[] pss = getProcessPss(pids); |
| 2290 | reply.writeNoException(); |
| 2291 | reply.writeLongArray(pss); |
| 2292 | return true; |
| 2293 | } |
| 2294 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 2295 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 2296 | data.enforceInterface(IActivityManager.descriptor); |
| 2297 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 2298 | boolean always = data.readInt() != 0; |
| 2299 | showBootMessage(msg, always); |
| 2300 | reply.writeNoException(); |
| 2301 | return true; |
| 2302 | } |
| 2303 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2304 | case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2305 | data.enforceInterface(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2306 | keyguardWaitingForActivityDrawn(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2307 | reply.writeNoException(); |
| 2308 | return true; |
| 2309 | } |
| 2310 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2311 | case KEYGUARD_GOING_AWAY_TRANSACTION: { |
| 2312 | data.enforceInterface(IActivityManager.descriptor); |
Adrian Roos | d5c2db6 | 2016-03-08 16:11:31 -0800 | [diff] [blame] | 2313 | keyguardGoingAway(data.readInt()); |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2314 | reply.writeNoException(); |
| 2315 | return true; |
| 2316 | } |
| 2317 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2318 | case SHOULD_UP_RECREATE_TASK_TRANSACTION: { |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2319 | data.enforceInterface(IActivityManager.descriptor); |
| 2320 | IBinder token = data.readStrongBinder(); |
| 2321 | String destAffinity = data.readString(); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2322 | boolean res = shouldUpRecreateTask(token, destAffinity); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2323 | reply.writeNoException(); |
| 2324 | reply.writeInt(res ? 1 : 0); |
| 2325 | return true; |
| 2326 | } |
| 2327 | |
| 2328 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 2329 | data.enforceInterface(IActivityManager.descriptor); |
| 2330 | IBinder token = data.readStrongBinder(); |
| 2331 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 2332 | int resultCode = data.readInt(); |
| 2333 | Intent resultData = null; |
| 2334 | if (data.readInt() != 0) { |
| 2335 | resultData = Intent.CREATOR.createFromParcel(data); |
| 2336 | } |
| 2337 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 2338 | reply.writeNoException(); |
| 2339 | reply.writeInt(res ? 1 : 0); |
| 2340 | return true; |
| 2341 | } |
| 2342 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 2343 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 2344 | data.enforceInterface(IActivityManager.descriptor); |
| 2345 | IBinder token = data.readStrongBinder(); |
| 2346 | int res = getLaunchedFromUid(token); |
| 2347 | reply.writeNoException(); |
| 2348 | reply.writeInt(res); |
| 2349 | return true; |
| 2350 | } |
| 2351 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2352 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 2353 | data.enforceInterface(IActivityManager.descriptor); |
| 2354 | IBinder token = data.readStrongBinder(); |
| 2355 | String res = getLaunchedFromPackage(token); |
| 2356 | reply.writeNoException(); |
| 2357 | reply.writeString(res); |
| 2358 | return true; |
| 2359 | } |
| 2360 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2361 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2362 | data.enforceInterface(IActivityManager.descriptor); |
| 2363 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2364 | data.readStrongBinder()); |
| 2365 | registerUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2366 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2367 | return true; |
| 2368 | } |
| 2369 | |
| 2370 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2371 | data.enforceInterface(IActivityManager.descriptor); |
| 2372 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2373 | data.readStrongBinder()); |
| 2374 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2375 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2376 | return true; |
| 2377 | } |
| 2378 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2379 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 2380 | data.enforceInterface(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 2381 | int bugreportType = data.readInt(); |
| 2382 | requestBugReport(bugreportType); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2383 | reply.writeNoException(); |
| 2384 | return true; |
| 2385 | } |
| 2386 | |
| 2387 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 2388 | data.enforceInterface(IActivityManager.descriptor); |
| 2389 | int pid = data.readInt(); |
| 2390 | boolean aboveSystem = data.readInt() != 0; |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 2391 | String reason = data.readString(); |
| 2392 | long res = inputDispatchingTimedOut(pid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2393 | reply.writeNoException(); |
| 2394 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2395 | return true; |
| 2396 | } |
| 2397 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2398 | case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2399 | data.enforceInterface(IActivityManager.descriptor); |
| 2400 | int requestType = data.readInt(); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2401 | Bundle res = getAssistContextExtras(requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2402 | reply.writeNoException(); |
| 2403 | reply.writeBundle(res); |
| 2404 | return true; |
| 2405 | } |
| 2406 | |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2407 | case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
| 2408 | data.enforceInterface(IActivityManager.descriptor); |
| 2409 | int requestType = data.readInt(); |
| 2410 | IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2411 | IBinder activityToken = data.readStrongBinder(); |
| 2412 | boolean res = requestAssistContextExtras(requestType, receiver, activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2413 | reply.writeNoException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2414 | reply.writeInt(res ? 1 : 0); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2415 | return true; |
| 2416 | } |
| 2417 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2418 | case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2419 | data.enforceInterface(IActivityManager.descriptor); |
| 2420 | IBinder token = data.readStrongBinder(); |
| 2421 | Bundle extras = data.readBundle(); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 2422 | AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data); |
| 2423 | AssistContent content = AssistContent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 2424 | Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null; |
| 2425 | reportAssistContextExtras(token, extras, structure, content, referrer); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2426 | reply.writeNoException(); |
| 2427 | return true; |
| 2428 | } |
| 2429 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2430 | case LAUNCH_ASSIST_INTENT_TRANSACTION: { |
| 2431 | data.enforceInterface(IActivityManager.descriptor); |
| 2432 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2433 | int requestType = data.readInt(); |
| 2434 | String hint = data.readString(); |
| 2435 | int userHandle = data.readInt(); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 2436 | Bundle args = data.readBundle(); |
| 2437 | boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2438 | reply.writeNoException(); |
| 2439 | reply.writeInt(res ? 1 : 0); |
| 2440 | return true; |
| 2441 | } |
| 2442 | |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2443 | case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: { |
| 2444 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2445 | boolean res = isAssistDataAllowedOnCurrentActivity(); |
| 2446 | reply.writeNoException(); |
| 2447 | reply.writeInt(res ? 1 : 0); |
| 2448 | return true; |
| 2449 | } |
| 2450 | |
| 2451 | case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: { |
| 2452 | data.enforceInterface(IActivityManager.descriptor); |
| 2453 | IBinder token = data.readStrongBinder(); |
| 2454 | Bundle args = data.readBundle(); |
| 2455 | boolean res = showAssistFromActivity(token, args); |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2456 | reply.writeNoException(); |
| 2457 | reply.writeInt(res ? 1 : 0); |
| 2458 | return true; |
| 2459 | } |
| 2460 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2461 | case KILL_UID_TRANSACTION: { |
| 2462 | data.enforceInterface(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2463 | int appId = data.readInt(); |
| 2464 | int userId = data.readInt(); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2465 | String reason = data.readString(); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2466 | killUid(appId, userId, reason); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2467 | reply.writeNoException(); |
| 2468 | return true; |
| 2469 | } |
| 2470 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2471 | case HANG_TRANSACTION: { |
| 2472 | data.enforceInterface(IActivityManager.descriptor); |
| 2473 | IBinder who = data.readStrongBinder(); |
| 2474 | boolean allowRestart = data.readInt() != 0; |
| 2475 | hang(who, allowRestart); |
| 2476 | reply.writeNoException(); |
| 2477 | return true; |
| 2478 | } |
| 2479 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2480 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2481 | data.enforceInterface(IActivityManager.descriptor); |
| 2482 | IBinder token = data.readStrongBinder(); |
| 2483 | reportActivityFullyDrawn(token); |
| 2484 | reply.writeNoException(); |
| 2485 | return true; |
| 2486 | } |
| 2487 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2488 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2489 | data.enforceInterface(IActivityManager.descriptor); |
| 2490 | IBinder token = data.readStrongBinder(); |
| 2491 | notifyActivityDrawn(token); |
| 2492 | reply.writeNoException(); |
| 2493 | return true; |
| 2494 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2495 | |
| 2496 | case RESTART_TRANSACTION: { |
| 2497 | data.enforceInterface(IActivityManager.descriptor); |
| 2498 | restart(); |
| 2499 | reply.writeNoException(); |
| 2500 | return true; |
| 2501 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2502 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2503 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2504 | data.enforceInterface(IActivityManager.descriptor); |
| 2505 | performIdleMaintenance(); |
| 2506 | reply.writeNoException(); |
| 2507 | return true; |
| 2508 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2509 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2510 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2511 | data.enforceInterface(IActivityManager.descriptor); |
| 2512 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2513 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2514 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2515 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2516 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2517 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2518 | if (activityContainer != null) { |
| 2519 | reply.writeInt(1); |
| 2520 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2521 | } else { |
| 2522 | reply.writeInt(0); |
| 2523 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2524 | return true; |
| 2525 | } |
| 2526 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2527 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2528 | data.enforceInterface(IActivityManager.descriptor); |
| 2529 | IActivityContainer activityContainer = |
| 2530 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2531 | deleteActivityContainer(activityContainer); |
| 2532 | reply.writeNoException(); |
| 2533 | return true; |
| 2534 | } |
| 2535 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2536 | case CREATE_STACK_ON_DISPLAY: { |
| 2537 | data.enforceInterface(IActivityManager.descriptor); |
| 2538 | int displayId = data.readInt(); |
| 2539 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2540 | reply.writeNoException(); |
| 2541 | if (activityContainer != null) { |
| 2542 | reply.writeInt(1); |
| 2543 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2544 | } else { |
| 2545 | reply.writeInt(0); |
| 2546 | } |
| 2547 | return true; |
| 2548 | } |
| 2549 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2550 | case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: { |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2551 | data.enforceInterface(IActivityManager.descriptor); |
| 2552 | IBinder activityToken = data.readStrongBinder(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2553 | int displayId = getActivityDisplayId(activityToken); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2554 | reply.writeNoException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2555 | reply.writeInt(displayId); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2556 | return true; |
| 2557 | } |
| 2558 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2559 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2560 | data.enforceInterface(IActivityManager.descriptor); |
| 2561 | final int taskId = data.readInt(); |
| 2562 | startLockTaskMode(taskId); |
| 2563 | reply.writeNoException(); |
| 2564 | return true; |
| 2565 | } |
| 2566 | |
| 2567 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2568 | data.enforceInterface(IActivityManager.descriptor); |
| 2569 | IBinder token = data.readStrongBinder(); |
| 2570 | startLockTaskMode(token); |
| 2571 | reply.writeNoException(); |
| 2572 | return true; |
| 2573 | } |
| 2574 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2575 | case START_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2576 | data.enforceInterface(IActivityManager.descriptor); |
| 2577 | startLockTaskModeOnCurrent(); |
| 2578 | reply.writeNoException(); |
| 2579 | return true; |
| 2580 | } |
| 2581 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2582 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2583 | data.enforceInterface(IActivityManager.descriptor); |
| 2584 | stopLockTaskMode(); |
| 2585 | reply.writeNoException(); |
| 2586 | return true; |
| 2587 | } |
| 2588 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2589 | case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2590 | data.enforceInterface(IActivityManager.descriptor); |
| 2591 | stopLockTaskModeOnCurrent(); |
| 2592 | reply.writeNoException(); |
| 2593 | return true; |
| 2594 | } |
| 2595 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2596 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2597 | data.enforceInterface(IActivityManager.descriptor); |
| 2598 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2599 | reply.writeNoException(); |
| 2600 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2601 | return true; |
| 2602 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2603 | |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 2604 | case GET_LOCK_TASK_MODE_STATE_TRANSACTION: { |
| 2605 | data.enforceInterface(IActivityManager.descriptor); |
| 2606 | final int lockTaskModeState = getLockTaskModeState(); |
| 2607 | reply.writeNoException(); |
| 2608 | reply.writeInt(lockTaskModeState); |
| 2609 | return true; |
| 2610 | } |
| 2611 | |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 2612 | case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: { |
| 2613 | data.enforceInterface(IActivityManager.descriptor); |
| 2614 | final IBinder token = data.readStrongBinder(); |
| 2615 | showLockTaskEscapeMessage(token); |
| 2616 | reply.writeNoException(); |
| 2617 | return true; |
| 2618 | } |
| 2619 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2620 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2621 | data.enforceInterface(IActivityManager.descriptor); |
| 2622 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2623 | ActivityManager.TaskDescription values = |
| 2624 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2625 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2626 | reply.writeNoException(); |
| 2627 | return true; |
| 2628 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2629 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2630 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2631 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 2632 | final int taskId = data.readInt(); |
| 2633 | final int resizeableMode = data.readInt(); |
| 2634 | setTaskResizeable(taskId, resizeableMode); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2635 | reply.writeNoException(); |
| 2636 | return true; |
| 2637 | } |
| 2638 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2639 | case RESIZE_TASK_TRANSACTION: { |
| 2640 | data.enforceInterface(IActivityManager.descriptor); |
| 2641 | int taskId = data.readInt(); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2642 | int resizeMode = data.readInt(); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2643 | Rect r = Rect.CREATOR.createFromParcel(data); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2644 | resizeTask(taskId, r, resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2645 | reply.writeNoException(); |
| 2646 | return true; |
| 2647 | } |
| 2648 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 2649 | case GET_TASK_BOUNDS_TRANSACTION: { |
| 2650 | data.enforceInterface(IActivityManager.descriptor); |
| 2651 | int taskId = data.readInt(); |
| 2652 | Rect r = getTaskBounds(taskId); |
| 2653 | reply.writeNoException(); |
| 2654 | r.writeToParcel(reply, 0); |
| 2655 | return true; |
| 2656 | } |
| 2657 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2658 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2659 | data.enforceInterface(IActivityManager.descriptor); |
| 2660 | String filename = data.readString(); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 2661 | int userId = data.readInt(); |
| 2662 | Bitmap icon = getTaskDescriptionIcon(filename, userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2663 | reply.writeNoException(); |
| 2664 | if (icon == null) { |
| 2665 | reply.writeInt(0); |
| 2666 | } else { |
| 2667 | reply.writeInt(1); |
| 2668 | icon.writeToParcel(reply, 0); |
| 2669 | } |
| 2670 | return true; |
| 2671 | } |
| 2672 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2673 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2674 | data.enforceInterface(IActivityManager.descriptor); |
| 2675 | final Bundle bundle; |
| 2676 | if (data.readInt() == 0) { |
| 2677 | bundle = null; |
| 2678 | } else { |
| 2679 | bundle = data.readBundle(); |
| 2680 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 2681 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2682 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2683 | reply.writeNoException(); |
| 2684 | return true; |
| 2685 | } |
| 2686 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2687 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2688 | data.enforceInterface(IActivityManager.descriptor); |
| 2689 | IBinder token = data.readStrongBinder(); |
| 2690 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2691 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2692 | reply.writeNoException(); |
| 2693 | reply.writeInt(success ? 1 : 0); |
| 2694 | return true; |
| 2695 | } |
| 2696 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2697 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2698 | data.enforceInterface(IActivityManager.descriptor); |
| 2699 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2700 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2701 | reply.writeNoException(); |
| 2702 | reply.writeInt(enabled ? 1 : 0); |
| 2703 | return true; |
| 2704 | } |
| 2705 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2706 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2707 | data.enforceInterface(IActivityManager.descriptor); |
| 2708 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2709 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2710 | reply.writeNoException(); |
| 2711 | return true; |
| 2712 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2713 | |
| 2714 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2715 | data.enforceInterface(IActivityManager.descriptor); |
| 2716 | IBinder token = data.readStrongBinder(); |
| 2717 | notifyLaunchTaskBehindComplete(token); |
| 2718 | reply.writeNoException(); |
| 2719 | return true; |
| 2720 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2721 | |
| 2722 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2723 | data.enforceInterface(IActivityManager.descriptor); |
| 2724 | IBinder token = data.readStrongBinder(); |
| 2725 | notifyEnterAnimationComplete(token); |
| 2726 | reply.writeNoException(); |
| 2727 | return true; |
| 2728 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2729 | |
| 2730 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2731 | data.enforceInterface(IActivityManager.descriptor); |
| 2732 | bootAnimationComplete(); |
| 2733 | reply.writeNoException(); |
| 2734 | return true; |
| 2735 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2736 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2737 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2738 | data.enforceInterface(IActivityManager.descriptor); |
| 2739 | final int uid = data.readInt(); |
| 2740 | final byte[] firstPacket = data.createByteArray(); |
| 2741 | notifyCleartextNetwork(uid, firstPacket); |
| 2742 | reply.writeNoException(); |
| 2743 | return true; |
| 2744 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2745 | |
| 2746 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2747 | data.enforceInterface(IActivityManager.descriptor); |
| 2748 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2749 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2750 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2751 | String reportPackage = data.readString(); |
| 2752 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2753 | reply.writeNoException(); |
| 2754 | return true; |
| 2755 | } |
| 2756 | |
| 2757 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2758 | data.enforceInterface(IActivityManager.descriptor); |
| 2759 | String path = data.readString(); |
| 2760 | dumpHeapFinished(path); |
| 2761 | reply.writeNoException(); |
| 2762 | return true; |
| 2763 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2764 | |
| 2765 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2766 | data.enforceInterface(IActivityManager.descriptor); |
| 2767 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2768 | data.readStrongBinder()); |
| 2769 | boolean keepAwake = data.readInt() != 0; |
| 2770 | setVoiceKeepAwake(session, keepAwake); |
| 2771 | reply.writeNoException(); |
| 2772 | return true; |
| 2773 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2774 | |
| 2775 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2776 | data.enforceInterface(IActivityManager.descriptor); |
| 2777 | int userId = data.readInt(); |
| 2778 | String[] packages = data.readStringArray(); |
| 2779 | updateLockTaskPackages(userId, packages); |
| 2780 | reply.writeNoException(); |
| 2781 | return true; |
| 2782 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2783 | |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 2784 | case UPDATE_DEVICE_OWNER_TRANSACTION: { |
| 2785 | data.enforceInterface(IActivityManager.descriptor); |
| 2786 | String packageName = data.readString(); |
| 2787 | updateDeviceOwner(packageName); |
| 2788 | reply.writeNoException(); |
| 2789 | return true; |
| 2790 | } |
| 2791 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2792 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2793 | data.enforceInterface(IActivityManager.descriptor); |
| 2794 | String pkg = data.readString(); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 2795 | String callingPackage = data.readString(); |
| 2796 | int res = getPackageProcessState(pkg, callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2797 | reply.writeNoException(); |
| 2798 | reply.writeInt(res); |
| 2799 | return true; |
| 2800 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2801 | |
| 2802 | case SET_PROCESS_MEMORY_TRIM_TRANSACTION: { |
| 2803 | data.enforceInterface(IActivityManager.descriptor); |
| 2804 | String process = data.readString(); |
| 2805 | int userId = data.readInt(); |
| 2806 | int level = data.readInt(); |
| 2807 | boolean res = setProcessMemoryTrimLevel(process, userId, level); |
| 2808 | reply.writeNoException(); |
| 2809 | reply.writeInt(res ? 1 : 0); |
| 2810 | return true; |
| 2811 | } |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2812 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 2813 | case IS_ROOT_VOICE_INTERACTION_TRANSACTION: { |
| 2814 | data.enforceInterface(IActivityManager.descriptor); |
| 2815 | IBinder token = data.readStrongBinder(); |
| 2816 | boolean res = isRootVoiceInteraction(token); |
| 2817 | reply.writeNoException(); |
| 2818 | reply.writeInt(res ? 1 : 0); |
| 2819 | return true; |
| 2820 | } |
Ian Pedowitz | a371084 | 2015-08-03 23:36:15 -0700 | [diff] [blame] | 2821 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2822 | case START_BINDER_TRACKING_TRANSACTION: { |
| 2823 | data.enforceInterface(IActivityManager.descriptor); |
| 2824 | boolean res = startBinderTracking(); |
| 2825 | reply.writeNoException(); |
| 2826 | reply.writeInt(res ? 1 : 0); |
| 2827 | return true; |
| 2828 | } |
| 2829 | |
| 2830 | case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: { |
| 2831 | data.enforceInterface(IActivityManager.descriptor); |
| 2832 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 2833 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
| 2834 | boolean res = stopBinderTrackingAndDump(fd); |
| 2835 | reply.writeNoException(); |
| 2836 | reply.writeInt(res ? 1 : 0); |
| 2837 | return true; |
| 2838 | } |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2839 | case GET_ACTIVITY_STACK_ID_TRANSACTION: { |
| 2840 | data.enforceInterface(IActivityManager.descriptor); |
| 2841 | IBinder token = data.readStrongBinder(); |
| 2842 | int stackId = getActivityStackId(token); |
| 2843 | reply.writeNoException(); |
| 2844 | reply.writeInt(stackId); |
| 2845 | return true; |
| 2846 | } |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2847 | case EXIT_FREEFORM_MODE_TRANSACTION: { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2848 | data.enforceInterface(IActivityManager.descriptor); |
| 2849 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2850 | exitFreeformMode(token); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2851 | reply.writeNoException(); |
| 2852 | return true; |
| 2853 | } |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2854 | case REPORT_SIZE_CONFIGURATIONS: { |
| 2855 | data.enforceInterface(IActivityManager.descriptor); |
| 2856 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2857 | int[] horizontal = readIntArray(data); |
| 2858 | int[] vertical = readIntArray(data); |
| 2859 | int[] smallest = readIntArray(data); |
| 2860 | reportSizeConfigurations(token, horizontal, vertical, smallest); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2861 | return true; |
| 2862 | } |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 2863 | case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: { |
| 2864 | data.enforceInterface(IActivityManager.descriptor); |
| 2865 | final boolean suppress = data.readInt() == 1; |
| 2866 | suppressResizeConfigChanges(suppress); |
| 2867 | reply.writeNoException(); |
| 2868 | return true; |
| 2869 | } |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 2870 | case MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION: { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2871 | data.enforceInterface(IActivityManager.descriptor); |
| 2872 | final int stackId = data.readInt(); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 2873 | final boolean onTop = data.readInt() == 1; |
| 2874 | moveTasksToFullscreenStack(stackId, onTop); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2875 | reply.writeNoException(); |
| 2876 | return true; |
| 2877 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2878 | case GET_APP_START_MODE_TRANSACTION: { |
| 2879 | data.enforceInterface(IActivityManager.descriptor); |
| 2880 | final int uid = data.readInt(); |
| 2881 | final String pkg = data.readString(); |
| 2882 | int res = getAppStartMode(uid, pkg); |
| 2883 | reply.writeNoException(); |
| 2884 | reply.writeInt(res); |
| 2885 | return true; |
| 2886 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2887 | case IN_MULTI_WINDOW_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2888 | data.enforceInterface(IActivityManager.descriptor); |
| 2889 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2890 | final boolean inMultiWindow = inMultiWindow(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2891 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2892 | reply.writeInt(inMultiWindow ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2893 | return true; |
| 2894 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2895 | case IN_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2896 | data.enforceInterface(IActivityManager.descriptor); |
| 2897 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2898 | final boolean inPip = inPictureInPicture(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2899 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2900 | reply.writeInt(inPip ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2901 | return true; |
| 2902 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2903 | case ENTER_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2904 | data.enforceInterface(IActivityManager.descriptor); |
| 2905 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2906 | enterPictureInPicture(token); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2907 | reply.writeNoException(); |
| 2908 | return true; |
| 2909 | } |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2910 | case SET_VR_MODE_TRANSACTION: { |
| 2911 | data.enforceInterface(IActivityManager.descriptor); |
| 2912 | final IBinder token = data.readStrongBinder(); |
| 2913 | final boolean enable = data.readInt() == 1; |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 2914 | final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data); |
| 2915 | int res = setVrMode(token, enable, packageName); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2916 | reply.writeNoException(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 2917 | reply.writeInt(res); |
| 2918 | return true; |
| 2919 | } |
| 2920 | case IS_VR_PACKAGE_ENABLED_TRANSACTION: { |
| 2921 | data.enforceInterface(IActivityManager.descriptor); |
| 2922 | final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data); |
| 2923 | boolean res = isVrModePackageEnabled(packageName); |
| 2924 | reply.writeNoException(); |
| 2925 | reply.writeInt(res ? 1 : 0); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2926 | return true; |
| 2927 | } |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 2928 | case IS_APP_FOREGROUND_TRANSACTION: { |
| 2929 | data.enforceInterface(IActivityManager.descriptor); |
| 2930 | final int userHandle = data.readInt(); |
| 2931 | final boolean isForeground = isAppForeground(userHandle); |
| 2932 | reply.writeNoException(); |
| 2933 | reply.writeInt(isForeground ? 1 : 0); |
| 2934 | return true; |
| 2935 | } |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 2936 | case NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION: { |
| 2937 | data.enforceInterface(IActivityManager.descriptor); |
| 2938 | reply.writeNoException(); |
| 2939 | return true; |
| 2940 | } |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 2941 | case REMOVE_STACK: { |
| 2942 | data.enforceInterface(IActivityManager.descriptor); |
| 2943 | final int stackId = data.readInt(); |
| 2944 | removeStack(stackId); |
| 2945 | reply.writeNoException(); |
| 2946 | return true; |
| 2947 | } |
Tony Mak | 9c6e8ce | 2016-03-21 12:07:16 +0000 | [diff] [blame] | 2948 | case NOTIFY_LOCKED_PROFILE: { |
| 2949 | data.enforceInterface(IActivityManager.descriptor); |
| 2950 | final int userId = data.readInt(); |
| 2951 | notifyLockedProfile(userId); |
| 2952 | reply.writeNoException(); |
| 2953 | return true; |
| 2954 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2955 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2956 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2957 | return super.onTransact(code, data, reply, flags); |
| 2958 | } |
| 2959 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2960 | private int[] readIntArray(Parcel data) { |
| 2961 | int[] smallest = null; |
| 2962 | int smallestSize = data.readInt(); |
| 2963 | if (smallestSize > 0) { |
| 2964 | smallest = new int[smallestSize]; |
| 2965 | data.readIntArray(smallest); |
| 2966 | } |
| 2967 | return smallest; |
| 2968 | } |
| 2969 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2970 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2971 | return this; |
| 2972 | } |
| 2973 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2974 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2975 | protected IActivityManager create() { |
| 2976 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2977 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2978 | Log.v("ActivityManager", "default service binder = " + b); |
| 2979 | } |
| 2980 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2981 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2982 | Log.v("ActivityManager", "default service = " + am); |
| 2983 | } |
| 2984 | return am; |
| 2985 | } |
| 2986 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2987 | } |
| 2988 | |
| 2989 | class ActivityManagerProxy implements IActivityManager |
| 2990 | { |
| 2991 | public ActivityManagerProxy(IBinder remote) |
| 2992 | { |
| 2993 | mRemote = remote; |
| 2994 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2995 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2996 | public IBinder asBinder() |
| 2997 | { |
| 2998 | return mRemote; |
| 2999 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 3000 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3001 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3002 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3003 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3004 | Parcel data = Parcel.obtain(); |
| 3005 | Parcel reply = Parcel.obtain(); |
| 3006 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3007 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3008 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3009 | intent.writeToParcel(data, 0); |
| 3010 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3011 | data.writeStrongBinder(resultTo); |
| 3012 | data.writeString(resultWho); |
| 3013 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3014 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3015 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3016 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3017 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3018 | } else { |
| 3019 | data.writeInt(0); |
| 3020 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3021 | if (options != null) { |
| 3022 | data.writeInt(1); |
| 3023 | options.writeToParcel(data, 0); |
| 3024 | } else { |
| 3025 | data.writeInt(0); |
| 3026 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3027 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3028 | reply.readException(); |
| 3029 | int result = reply.readInt(); |
| 3030 | reply.recycle(); |
| 3031 | data.recycle(); |
| 3032 | return result; |
| 3033 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3034 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3035 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3036 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3037 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3038 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3039 | Parcel data = Parcel.obtain(); |
| 3040 | Parcel reply = Parcel.obtain(); |
| 3041 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3042 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3043 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3044 | intent.writeToParcel(data, 0); |
| 3045 | data.writeString(resolvedType); |
| 3046 | data.writeStrongBinder(resultTo); |
| 3047 | data.writeString(resultWho); |
| 3048 | data.writeInt(requestCode); |
| 3049 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3050 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3051 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3052 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3053 | } else { |
| 3054 | data.writeInt(0); |
| 3055 | } |
| 3056 | if (options != null) { |
| 3057 | data.writeInt(1); |
| 3058 | options.writeToParcel(data, 0); |
| 3059 | } else { |
| 3060 | data.writeInt(0); |
| 3061 | } |
| 3062 | data.writeInt(userId); |
| 3063 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 3064 | reply.readException(); |
| 3065 | int result = reply.readInt(); |
| 3066 | reply.recycle(); |
| 3067 | data.recycle(); |
| 3068 | return result; |
| 3069 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3070 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 3071 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3072 | int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, |
| 3073 | int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3074 | Parcel data = Parcel.obtain(); |
| 3075 | Parcel reply = Parcel.obtain(); |
| 3076 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3077 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3078 | data.writeString(callingPackage); |
| 3079 | intent.writeToParcel(data, 0); |
| 3080 | data.writeString(resolvedType); |
| 3081 | data.writeStrongBinder(resultTo); |
| 3082 | data.writeString(resultWho); |
| 3083 | data.writeInt(requestCode); |
| 3084 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3085 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3086 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3087 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3088 | } else { |
| 3089 | data.writeInt(0); |
| 3090 | } |
| 3091 | if (options != null) { |
| 3092 | data.writeInt(1); |
| 3093 | options.writeToParcel(data, 0); |
| 3094 | } else { |
| 3095 | data.writeInt(0); |
| 3096 | } |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3097 | data.writeInt(ignoreTargetSecurity ? 1 : 0); |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 3098 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3099 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 3100 | reply.readException(); |
| 3101 | int result = reply.readInt(); |
| 3102 | reply.recycle(); |
| 3103 | data.recycle(); |
| 3104 | return result; |
| 3105 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3106 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 3107 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3108 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3109 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3110 | Parcel data = Parcel.obtain(); |
| 3111 | Parcel reply = Parcel.obtain(); |
| 3112 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3113 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3114 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3115 | intent.writeToParcel(data, 0); |
| 3116 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3117 | data.writeStrongBinder(resultTo); |
| 3118 | data.writeString(resultWho); |
| 3119 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3120 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3121 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3122 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3123 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3124 | } else { |
| 3125 | data.writeInt(0); |
| 3126 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3127 | if (options != null) { |
| 3128 | data.writeInt(1); |
| 3129 | options.writeToParcel(data, 0); |
| 3130 | } else { |
| 3131 | data.writeInt(0); |
| 3132 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3133 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3134 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 3135 | reply.readException(); |
| 3136 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 3137 | reply.recycle(); |
| 3138 | data.recycle(); |
| 3139 | return result; |
| 3140 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3141 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 3142 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3143 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3144 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3145 | Parcel data = Parcel.obtain(); |
| 3146 | Parcel reply = Parcel.obtain(); |
| 3147 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3148 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3149 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3150 | intent.writeToParcel(data, 0); |
| 3151 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3152 | data.writeStrongBinder(resultTo); |
| 3153 | data.writeString(resultWho); |
| 3154 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3155 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3156 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3157 | if (options != null) { |
| 3158 | data.writeInt(1); |
| 3159 | options.writeToParcel(data, 0); |
| 3160 | } else { |
| 3161 | data.writeInt(0); |
| 3162 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3163 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3164 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3165 | reply.readException(); |
| 3166 | int result = reply.readInt(); |
| 3167 | reply.recycle(); |
| 3168 | data.recycle(); |
| 3169 | return result; |
| 3170 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3171 | public int startActivityIntentSender(IApplicationThread caller, |
| 3172 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3173 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3174 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3175 | Parcel data = Parcel.obtain(); |
| 3176 | Parcel reply = Parcel.obtain(); |
| 3177 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3178 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3179 | intent.writeToParcel(data, 0); |
| 3180 | if (fillInIntent != null) { |
| 3181 | data.writeInt(1); |
| 3182 | fillInIntent.writeToParcel(data, 0); |
| 3183 | } else { |
| 3184 | data.writeInt(0); |
| 3185 | } |
| 3186 | data.writeString(resolvedType); |
| 3187 | data.writeStrongBinder(resultTo); |
| 3188 | data.writeString(resultWho); |
| 3189 | data.writeInt(requestCode); |
| 3190 | data.writeInt(flagsMask); |
| 3191 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3192 | if (options != null) { |
| 3193 | data.writeInt(1); |
| 3194 | options.writeToParcel(data, 0); |
| 3195 | } else { |
| 3196 | data.writeInt(0); |
| 3197 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3198 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3199 | reply.readException(); |
| 3200 | int result = reply.readInt(); |
| 3201 | reply.recycle(); |
| 3202 | data.recycle(); |
| 3203 | return result; |
| 3204 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3205 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 3206 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3207 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 3208 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3209 | Parcel data = Parcel.obtain(); |
| 3210 | Parcel reply = Parcel.obtain(); |
| 3211 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3212 | data.writeString(callingPackage); |
| 3213 | data.writeInt(callingPid); |
| 3214 | data.writeInt(callingUid); |
| 3215 | intent.writeToParcel(data, 0); |
| 3216 | data.writeString(resolvedType); |
| 3217 | data.writeStrongBinder(session.asBinder()); |
| 3218 | data.writeStrongBinder(interactor.asBinder()); |
| 3219 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3220 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3221 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3222 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3223 | } else { |
| 3224 | data.writeInt(0); |
| 3225 | } |
| 3226 | if (options != null) { |
| 3227 | data.writeInt(1); |
| 3228 | options.writeToParcel(data, 0); |
| 3229 | } else { |
| 3230 | data.writeInt(0); |
| 3231 | } |
| 3232 | data.writeInt(userId); |
| 3233 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3234 | reply.readException(); |
| 3235 | int result = reply.readInt(); |
| 3236 | reply.recycle(); |
| 3237 | data.recycle(); |
| 3238 | return result; |
| 3239 | } |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 3240 | |
| 3241 | public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options) |
| 3242 | throws RemoteException { |
| 3243 | Parcel data = Parcel.obtain(); |
| 3244 | Parcel reply = Parcel.obtain(); |
| 3245 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3246 | data.writeStrongBinder(callingActivity); |
| 3247 | data.writeBundle(options); |
| 3248 | mRemote.transact(START_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3249 | reply.readException(); |
| 3250 | reply.recycle(); |
| 3251 | data.recycle(); |
| 3252 | } |
| 3253 | |
| 3254 | public void stopLocalVoiceInteraction(IBinder callingActivity) throws RemoteException { |
| 3255 | Parcel data = Parcel.obtain(); |
| 3256 | Parcel reply = Parcel.obtain(); |
| 3257 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3258 | data.writeStrongBinder(callingActivity); |
| 3259 | mRemote.transact(STOP_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3260 | reply.readException(); |
| 3261 | reply.recycle(); |
| 3262 | data.recycle(); |
| 3263 | } |
| 3264 | |
| 3265 | public boolean supportsLocalVoiceInteraction() throws RemoteException { |
| 3266 | Parcel data = Parcel.obtain(); |
| 3267 | Parcel reply = Parcel.obtain(); |
| 3268 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3269 | mRemote.transact(SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3270 | reply.readException(); |
| 3271 | int result = reply.readInt(); |
| 3272 | reply.recycle(); |
| 3273 | data.recycle(); |
| 3274 | return result != 0; |
| 3275 | } |
| 3276 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3277 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3278 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3279 | Parcel data = Parcel.obtain(); |
| 3280 | Parcel reply = Parcel.obtain(); |
| 3281 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3282 | data.writeStrongBinder(callingActivity); |
| 3283 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3284 | if (options != null) { |
| 3285 | data.writeInt(1); |
| 3286 | options.writeToParcel(data, 0); |
| 3287 | } else { |
| 3288 | data.writeInt(0); |
| 3289 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3290 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3291 | reply.readException(); |
| 3292 | int result = reply.readInt(); |
| 3293 | reply.recycle(); |
| 3294 | data.recycle(); |
| 3295 | return result != 0; |
| 3296 | } |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 3297 | public int startActivityFromRecents(int taskId, Bundle options) |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3298 | throws RemoteException { |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3299 | Parcel data = Parcel.obtain(); |
| 3300 | Parcel reply = Parcel.obtain(); |
| 3301 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3302 | data.writeInt(taskId); |
| 3303 | if (options == null) { |
| 3304 | data.writeInt(0); |
| 3305 | } else { |
| 3306 | data.writeInt(1); |
| 3307 | options.writeToParcel(data, 0); |
| 3308 | } |
| 3309 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 3310 | reply.readException(); |
| 3311 | int result = reply.readInt(); |
| 3312 | reply.recycle(); |
| 3313 | data.recycle(); |
| 3314 | return result; |
| 3315 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3316 | 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] | 3317 | throws RemoteException { |
| 3318 | Parcel data = Parcel.obtain(); |
| 3319 | Parcel reply = Parcel.obtain(); |
| 3320 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3321 | data.writeStrongBinder(token); |
| 3322 | data.writeInt(resultCode); |
| 3323 | if (resultData != null) { |
| 3324 | data.writeInt(1); |
| 3325 | resultData.writeToParcel(data, 0); |
| 3326 | } else { |
| 3327 | data.writeInt(0); |
| 3328 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3329 | data.writeInt(finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3330 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3331 | reply.readException(); |
| 3332 | boolean res = reply.readInt() != 0; |
| 3333 | data.recycle(); |
| 3334 | reply.recycle(); |
| 3335 | return res; |
| 3336 | } |
| 3337 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 3338 | { |
| 3339 | Parcel data = Parcel.obtain(); |
| 3340 | Parcel reply = Parcel.obtain(); |
| 3341 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3342 | data.writeStrongBinder(token); |
| 3343 | data.writeString(resultWho); |
| 3344 | data.writeInt(requestCode); |
| 3345 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3346 | reply.readException(); |
| 3347 | data.recycle(); |
| 3348 | reply.recycle(); |
| 3349 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 3350 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 3351 | Parcel data = Parcel.obtain(); |
| 3352 | Parcel reply = Parcel.obtain(); |
| 3353 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3354 | data.writeStrongBinder(token); |
| 3355 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 3356 | reply.readException(); |
| 3357 | boolean res = reply.readInt() != 0; |
| 3358 | data.recycle(); |
| 3359 | reply.recycle(); |
| 3360 | return res; |
| 3361 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 3362 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 3363 | Parcel data = Parcel.obtain(); |
| 3364 | Parcel reply = Parcel.obtain(); |
| 3365 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3366 | data.writeStrongBinder(session.asBinder()); |
| 3367 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 3368 | reply.readException(); |
| 3369 | data.recycle(); |
| 3370 | reply.recycle(); |
| 3371 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 3372 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 3373 | Parcel data = Parcel.obtain(); |
| 3374 | Parcel reply = Parcel.obtain(); |
| 3375 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3376 | data.writeStrongBinder(token); |
| 3377 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 3378 | reply.readException(); |
| 3379 | boolean res = reply.readInt() != 0; |
| 3380 | data.recycle(); |
| 3381 | reply.recycle(); |
| 3382 | return res; |
| 3383 | } |
| 3384 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 3385 | Parcel data = Parcel.obtain(); |
| 3386 | Parcel reply = Parcel.obtain(); |
| 3387 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3388 | data.writeStrongBinder(app.asBinder()); |
| 3389 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 3390 | reply.readException(); |
| 3391 | data.recycle(); |
| 3392 | reply.recycle(); |
| 3393 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 3394 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 3395 | Parcel data = Parcel.obtain(); |
| 3396 | Parcel reply = Parcel.obtain(); |
| 3397 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3398 | data.writeStrongBinder(token); |
| 3399 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 3400 | reply.readException(); |
| 3401 | boolean res = reply.readInt() != 0; |
| 3402 | data.recycle(); |
| 3403 | reply.recycle(); |
| 3404 | return res; |
| 3405 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3406 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3407 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3408 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3409 | { |
| 3410 | Parcel data = Parcel.obtain(); |
| 3411 | Parcel reply = Parcel.obtain(); |
| 3412 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3413 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3414 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3415 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 3416 | filter.writeToParcel(data, 0); |
| 3417 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3418 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3419 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3420 | reply.readException(); |
| 3421 | Intent intent = null; |
| 3422 | int haveIntent = reply.readInt(); |
| 3423 | if (haveIntent != 0) { |
| 3424 | intent = Intent.CREATOR.createFromParcel(reply); |
| 3425 | } |
| 3426 | reply.recycle(); |
| 3427 | data.recycle(); |
| 3428 | return intent; |
| 3429 | } |
| 3430 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 3431 | { |
| 3432 | Parcel data = Parcel.obtain(); |
| 3433 | Parcel reply = Parcel.obtain(); |
| 3434 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3435 | data.writeStrongBinder(receiver.asBinder()); |
| 3436 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3437 | reply.readException(); |
| 3438 | data.recycle(); |
| 3439 | reply.recycle(); |
| 3440 | } |
| 3441 | public int broadcastIntent(IApplicationThread caller, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3442 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3443 | int resultCode, String resultData, Bundle map, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3444 | String[] requiredPermissions, int appOp, Bundle options, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3445 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3446 | { |
| 3447 | Parcel data = Parcel.obtain(); |
| 3448 | Parcel reply = Parcel.obtain(); |
| 3449 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3450 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3451 | intent.writeToParcel(data, 0); |
| 3452 | data.writeString(resolvedType); |
| 3453 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 3454 | data.writeInt(resultCode); |
| 3455 | data.writeString(resultData); |
| 3456 | data.writeBundle(map); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3457 | data.writeStringArray(requiredPermissions); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 3458 | data.writeInt(appOp); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3459 | data.writeBundle(options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3460 | data.writeInt(serialized ? 1 : 0); |
| 3461 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3462 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3463 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3464 | reply.readException(); |
| 3465 | int res = reply.readInt(); |
| 3466 | reply.recycle(); |
| 3467 | data.recycle(); |
| 3468 | return res; |
| 3469 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3470 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 3471 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3472 | { |
| 3473 | Parcel data = Parcel.obtain(); |
| 3474 | Parcel reply = Parcel.obtain(); |
| 3475 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3476 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3477 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3478 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3479 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3480 | reply.readException(); |
| 3481 | data.recycle(); |
| 3482 | reply.recycle(); |
| 3483 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3484 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 3485 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3486 | { |
| 3487 | Parcel data = Parcel.obtain(); |
| 3488 | Parcel reply = Parcel.obtain(); |
| 3489 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3490 | data.writeStrongBinder(who); |
| 3491 | data.writeInt(resultCode); |
| 3492 | data.writeString(resultData); |
| 3493 | data.writeBundle(map); |
| 3494 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3495 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3496 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3497 | reply.readException(); |
| 3498 | data.recycle(); |
| 3499 | reply.recycle(); |
| 3500 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3501 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3502 | { |
| 3503 | Parcel data = Parcel.obtain(); |
| 3504 | Parcel reply = Parcel.obtain(); |
| 3505 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3506 | data.writeStrongBinder(app.asBinder()); |
| 3507 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3508 | reply.readException(); |
| 3509 | data.recycle(); |
| 3510 | reply.recycle(); |
| 3511 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3512 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3513 | 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); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3519 | if (config != null) { |
| 3520 | data.writeInt(1); |
| 3521 | config.writeToParcel(data, 0); |
| 3522 | } else { |
| 3523 | data.writeInt(0); |
| 3524 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3525 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3526 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3527 | reply.readException(); |
| 3528 | data.recycle(); |
| 3529 | reply.recycle(); |
| 3530 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3531 | public void activityResumed(IBinder token) throws RemoteException |
| 3532 | { |
| 3533 | Parcel data = Parcel.obtain(); |
| 3534 | Parcel reply = Parcel.obtain(); |
| 3535 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3536 | data.writeStrongBinder(token); |
| 3537 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3538 | reply.readException(); |
| 3539 | data.recycle(); |
| 3540 | reply.recycle(); |
| 3541 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3542 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3543 | { |
| 3544 | Parcel data = Parcel.obtain(); |
| 3545 | Parcel reply = Parcel.obtain(); |
| 3546 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3547 | data.writeStrongBinder(token); |
| 3548 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3549 | reply.readException(); |
| 3550 | data.recycle(); |
| 3551 | reply.recycle(); |
| 3552 | } |
| 3553 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3554 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3555 | { |
| 3556 | Parcel data = Parcel.obtain(); |
| 3557 | Parcel reply = Parcel.obtain(); |
| 3558 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3559 | data.writeStrongBinder(token); |
| 3560 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3561 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3562 | TextUtils.writeToParcel(description, data, 0); |
| 3563 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3564 | reply.readException(); |
| 3565 | data.recycle(); |
| 3566 | reply.recycle(); |
| 3567 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3568 | public void activitySlept(IBinder token) throws RemoteException |
| 3569 | { |
| 3570 | Parcel data = Parcel.obtain(); |
| 3571 | Parcel reply = Parcel.obtain(); |
| 3572 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3573 | data.writeStrongBinder(token); |
| 3574 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3575 | reply.readException(); |
| 3576 | data.recycle(); |
| 3577 | reply.recycle(); |
| 3578 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3579 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3580 | { |
| 3581 | Parcel data = Parcel.obtain(); |
| 3582 | Parcel reply = Parcel.obtain(); |
| 3583 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3584 | data.writeStrongBinder(token); |
| 3585 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3586 | reply.readException(); |
| 3587 | data.recycle(); |
| 3588 | reply.recycle(); |
| 3589 | } |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 3590 | public void activityRelaunched(IBinder token) throws RemoteException |
| 3591 | { |
| 3592 | Parcel data = Parcel.obtain(); |
| 3593 | Parcel reply = Parcel.obtain(); |
| 3594 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3595 | data.writeStrongBinder(token); |
| 3596 | mRemote.transact(ACTIVITY_RELAUNCHED_TRANSACTION, data, reply, 0); |
| 3597 | reply.readException(); |
| 3598 | data.recycle(); |
| 3599 | reply.recycle(); |
| 3600 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3601 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3602 | { |
| 3603 | Parcel data = Parcel.obtain(); |
| 3604 | Parcel reply = Parcel.obtain(); |
| 3605 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3606 | data.writeStrongBinder(token); |
| 3607 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3608 | reply.readException(); |
| 3609 | String res = reply.readString(); |
| 3610 | data.recycle(); |
| 3611 | reply.recycle(); |
| 3612 | return res; |
| 3613 | } |
| 3614 | public ComponentName getCallingActivity(IBinder token) |
| 3615 | throws RemoteException { |
| 3616 | Parcel data = Parcel.obtain(); |
| 3617 | Parcel reply = Parcel.obtain(); |
| 3618 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3619 | data.writeStrongBinder(token); |
| 3620 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3621 | reply.readException(); |
| 3622 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3623 | data.recycle(); |
| 3624 | reply.recycle(); |
| 3625 | return res; |
| 3626 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3627 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3628 | Parcel data = Parcel.obtain(); |
| 3629 | Parcel reply = Parcel.obtain(); |
| 3630 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3631 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3632 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3633 | reply.readException(); |
| 3634 | ArrayList<IAppTask> list = null; |
| 3635 | int N = reply.readInt(); |
| 3636 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3637 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3638 | while (N > 0) { |
| 3639 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3640 | list.add(task); |
| 3641 | N--; |
| 3642 | } |
| 3643 | } |
| 3644 | data.recycle(); |
| 3645 | reply.recycle(); |
| 3646 | return list; |
| 3647 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3648 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3649 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3650 | Parcel data = Parcel.obtain(); |
| 3651 | Parcel reply = Parcel.obtain(); |
| 3652 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3653 | data.writeStrongBinder(activityToken); |
| 3654 | intent.writeToParcel(data, 0); |
| 3655 | description.writeToParcel(data, 0); |
| 3656 | thumbnail.writeToParcel(data, 0); |
| 3657 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3658 | reply.readException(); |
| 3659 | int res = reply.readInt(); |
| 3660 | data.recycle(); |
| 3661 | reply.recycle(); |
| 3662 | return res; |
| 3663 | } |
| 3664 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3665 | Parcel data = Parcel.obtain(); |
| 3666 | Parcel reply = Parcel.obtain(); |
| 3667 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3668 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3669 | reply.readException(); |
| 3670 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3671 | data.recycle(); |
| 3672 | reply.recycle(); |
| 3673 | return size; |
| 3674 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3675 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3676 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3677 | Parcel data = Parcel.obtain(); |
| 3678 | Parcel reply = Parcel.obtain(); |
| 3679 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3680 | data.writeInt(maxNum); |
| 3681 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3682 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3683 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3684 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3685 | int N = reply.readInt(); |
| 3686 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3687 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3688 | while (N > 0) { |
| 3689 | ActivityManager.RunningTaskInfo info = |
| 3690 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3691 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3692 | list.add(info); |
| 3693 | N--; |
| 3694 | } |
| 3695 | } |
| 3696 | data.recycle(); |
| 3697 | reply.recycle(); |
| 3698 | return list; |
| 3699 | } |
| 3700 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3701 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3702 | Parcel data = Parcel.obtain(); |
| 3703 | Parcel reply = Parcel.obtain(); |
| 3704 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3705 | data.writeInt(maxNum); |
| 3706 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3707 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3708 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3709 | reply.readException(); |
| 3710 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3711 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3712 | data.recycle(); |
| 3713 | reply.recycle(); |
| 3714 | return list; |
| 3715 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3716 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3717 | Parcel data = Parcel.obtain(); |
| 3718 | Parcel reply = Parcel.obtain(); |
| 3719 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3720 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3721 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3722 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3723 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3724 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3725 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3726 | } |
| 3727 | data.recycle(); |
| 3728 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3729 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3730 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3731 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3732 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3733 | Parcel data = Parcel.obtain(); |
| 3734 | Parcel reply = Parcel.obtain(); |
| 3735 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3736 | data.writeInt(maxNum); |
| 3737 | data.writeInt(flags); |
| 3738 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3739 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3740 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3741 | int N = reply.readInt(); |
| 3742 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3743 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3744 | while (N > 0) { |
| 3745 | ActivityManager.RunningServiceInfo info = |
| 3746 | ActivityManager.RunningServiceInfo.CREATOR |
| 3747 | .createFromParcel(reply); |
| 3748 | list.add(info); |
| 3749 | N--; |
| 3750 | } |
| 3751 | } |
| 3752 | data.recycle(); |
| 3753 | reply.recycle(); |
| 3754 | return list; |
| 3755 | } |
| 3756 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3757 | throws RemoteException { |
| 3758 | Parcel data = Parcel.obtain(); |
| 3759 | Parcel reply = Parcel.obtain(); |
| 3760 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3761 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3762 | reply.readException(); |
| 3763 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3764 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3765 | data.recycle(); |
| 3766 | reply.recycle(); |
| 3767 | return list; |
| 3768 | } |
| 3769 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3770 | throws RemoteException { |
| 3771 | Parcel data = Parcel.obtain(); |
| 3772 | Parcel reply = Parcel.obtain(); |
| 3773 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3774 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3775 | reply.readException(); |
| 3776 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3777 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3778 | data.recycle(); |
| 3779 | reply.recycle(); |
| 3780 | return list; |
| 3781 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3782 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3783 | throws RemoteException { |
| 3784 | Parcel data = Parcel.obtain(); |
| 3785 | Parcel reply = Parcel.obtain(); |
| 3786 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3787 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3788 | reply.readException(); |
| 3789 | ArrayList<ApplicationInfo> list |
| 3790 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3791 | data.recycle(); |
| 3792 | reply.recycle(); |
| 3793 | return list; |
| 3794 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3795 | 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] | 3796 | { |
| 3797 | Parcel data = Parcel.obtain(); |
| 3798 | Parcel reply = Parcel.obtain(); |
| 3799 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3800 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3801 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3802 | if (options != null) { |
| 3803 | data.writeInt(1); |
| 3804 | options.writeToParcel(data, 0); |
| 3805 | } else { |
| 3806 | data.writeInt(0); |
| 3807 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3808 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3809 | reply.readException(); |
| 3810 | data.recycle(); |
| 3811 | reply.recycle(); |
| 3812 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3813 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3814 | throws RemoteException { |
| 3815 | Parcel data = Parcel.obtain(); |
| 3816 | Parcel reply = Parcel.obtain(); |
| 3817 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3818 | data.writeStrongBinder(token); |
| 3819 | data.writeInt(nonRoot ? 1 : 0); |
| 3820 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3821 | reply.readException(); |
| 3822 | boolean res = reply.readInt() != 0; |
| 3823 | data.recycle(); |
| 3824 | reply.recycle(); |
| 3825 | return res; |
| 3826 | } |
| 3827 | public void moveTaskBackwards(int task) throws RemoteException |
| 3828 | { |
| 3829 | Parcel data = Parcel.obtain(); |
| 3830 | Parcel reply = Parcel.obtain(); |
| 3831 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3832 | data.writeInt(task); |
| 3833 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3834 | reply.readException(); |
| 3835 | data.recycle(); |
| 3836 | reply.recycle(); |
| 3837 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3838 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3839 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3840 | { |
| 3841 | Parcel data = Parcel.obtain(); |
| 3842 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3843 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3844 | data.writeInt(taskId); |
| 3845 | data.writeInt(stackId); |
| 3846 | data.writeInt(toTop ? 1 : 0); |
| 3847 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3848 | reply.readException(); |
| 3849 | data.recycle(); |
| 3850 | reply.recycle(); |
| 3851 | } |
| 3852 | @Override |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3853 | public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3854 | Rect initialBounds) throws RemoteException |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3855 | { |
| 3856 | Parcel data = Parcel.obtain(); |
| 3857 | Parcel reply = Parcel.obtain(); |
| 3858 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3859 | data.writeInt(taskId); |
| 3860 | data.writeInt(createMode); |
| 3861 | data.writeInt(toTop ? 1 : 0); |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 3862 | data.writeInt(animate ? 1 : 0); |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3863 | if (initialBounds != null) { |
| 3864 | data.writeInt(1); |
| 3865 | initialBounds.writeToParcel(data, 0); |
| 3866 | } else { |
| 3867 | data.writeInt(0); |
| 3868 | } |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3869 | mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3870 | reply.readException(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3871 | boolean res = reply.readInt() > 0; |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3872 | data.recycle(); |
| 3873 | reply.recycle(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3874 | return res; |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3875 | } |
| 3876 | @Override |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3877 | public boolean moveTopActivityToPinnedStack(int stackId, Rect r) |
| 3878 | throws RemoteException |
| 3879 | { |
| 3880 | Parcel data = Parcel.obtain(); |
| 3881 | Parcel reply = Parcel.obtain(); |
| 3882 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3883 | data.writeInt(stackId); |
| 3884 | r.writeToParcel(data, 0); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 3885 | mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3886 | reply.readException(); |
| 3887 | final boolean res = reply.readInt() != 0; |
| 3888 | data.recycle(); |
| 3889 | reply.recycle(); |
| 3890 | return res; |
| 3891 | } |
| 3892 | @Override |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3893 | public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode, |
Wale Ogunwale | e75a9ad | 2016-03-18 20:43:49 -0700 | [diff] [blame] | 3894 | boolean preserveWindows, boolean animate, int animationDuration) |
| 3895 | throws RemoteException { |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3896 | Parcel data = Parcel.obtain(); |
| 3897 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3898 | data.writeInterfaceToken(IActivityManager.descriptor); |
Wale Ogunwale | b34a7ad | 2015-08-14 11:05:30 -0700 | [diff] [blame] | 3899 | data.writeInt(stackId); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 3900 | if (r != null) { |
| 3901 | data.writeInt(1); |
| 3902 | r.writeToParcel(data, 0); |
| 3903 | } else { |
| 3904 | data.writeInt(0); |
| 3905 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3906 | data.writeInt(allowResizeInDockedMode ? 1 : 0); |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3907 | data.writeInt(preserveWindows ? 1 : 0); |
| 3908 | data.writeInt(animate ? 1 : 0); |
Wale Ogunwale | e75a9ad | 2016-03-18 20:43:49 -0700 | [diff] [blame] | 3909 | data.writeInt(animationDuration); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3910 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3911 | reply.readException(); |
| 3912 | data.recycle(); |
| 3913 | reply.recycle(); |
| 3914 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3915 | @Override |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 3916 | public void swapDockedAndFullscreenStack() throws RemoteException |
| 3917 | { |
| 3918 | Parcel data = Parcel.obtain(); |
| 3919 | Parcel reply = Parcel.obtain(); |
| 3920 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3921 | mRemote.transact(SWAP_DOCKED_AND_FULLSCREEN_STACK, data, reply, 0); |
| 3922 | reply.readException(); |
| 3923 | data.recycle(); |
| 3924 | reply.recycle(); |
| 3925 | } |
| 3926 | @Override |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 3927 | public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds, |
| 3928 | Rect tempDockedTaskInsetBounds, |
| 3929 | Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds) |
| 3930 | throws RemoteException |
| 3931 | { |
| 3932 | Parcel data = Parcel.obtain(); |
| 3933 | Parcel reply = Parcel.obtain(); |
| 3934 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3935 | if (dockedBounds != null) { |
| 3936 | data.writeInt(1); |
| 3937 | dockedBounds.writeToParcel(data, 0); |
| 3938 | } else { |
| 3939 | data.writeInt(0); |
| 3940 | } |
| 3941 | if (tempDockedTaskBounds != null) { |
| 3942 | data.writeInt(1); |
| 3943 | tempDockedTaskBounds.writeToParcel(data, 0); |
| 3944 | } else { |
| 3945 | data.writeInt(0); |
| 3946 | } |
| 3947 | if (tempDockedTaskInsetBounds != null) { |
| 3948 | data.writeInt(1); |
| 3949 | tempDockedTaskInsetBounds.writeToParcel(data, 0); |
| 3950 | } else { |
| 3951 | data.writeInt(0); |
| 3952 | } |
| 3953 | if (tempOtherTaskBounds != null) { |
| 3954 | data.writeInt(1); |
| 3955 | tempOtherTaskBounds.writeToParcel(data, 0); |
| 3956 | } else { |
| 3957 | data.writeInt(0); |
| 3958 | } |
| 3959 | if (tempOtherTaskInsetBounds != null) { |
| 3960 | data.writeInt(1); |
| 3961 | tempOtherTaskInsetBounds.writeToParcel(data, 0); |
| 3962 | } else { |
| 3963 | data.writeInt(0); |
| 3964 | } |
| 3965 | mRemote.transact(RESIZE_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3966 | reply.readException(); |
| 3967 | data.recycle(); |
| 3968 | reply.recycle(); |
| 3969 | } |
Robert Carr | 0d00c2e | 2016-02-29 17:45:02 -0800 | [diff] [blame] | 3970 | |
| 3971 | @Override |
| 3972 | public void resizePinnedStack(Rect pinnedBounds, Rect tempPinnedTaskBounds) throws RemoteException |
| 3973 | { |
| 3974 | Parcel data = Parcel.obtain(); |
| 3975 | Parcel reply = Parcel.obtain(); |
| 3976 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3977 | if (pinnedBounds != null) { |
| 3978 | data.writeInt(1); |
| 3979 | pinnedBounds.writeToParcel(data, 0); |
| 3980 | } else { |
| 3981 | data.writeInt(0); |
| 3982 | } |
| 3983 | if (tempPinnedTaskBounds != null) { |
| 3984 | data.writeInt(1); |
| 3985 | tempPinnedTaskBounds.writeToParcel(data, 0); |
| 3986 | } else { |
| 3987 | data.writeInt(0); |
| 3988 | } |
| 3989 | mRemote.transact(RESIZE_PINNED_STACK_TRANSACTION, data, reply, 0); |
| 3990 | reply.readException(); |
| 3991 | data.recycle(); |
| 3992 | reply.recycle(); |
| 3993 | } |
| 3994 | |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 3995 | @Override |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 3996 | public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException |
| 3997 | { |
| 3998 | Parcel data = Parcel.obtain(); |
| 3999 | Parcel reply = Parcel.obtain(); |
| 4000 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4001 | data.writeInt(taskId); |
| 4002 | data.writeInt(stackId); |
| 4003 | data.writeInt(position); |
| 4004 | mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0); |
| 4005 | reply.readException(); |
| 4006 | data.recycle(); |
| 4007 | reply.recycle(); |
| 4008 | } |
| 4009 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4010 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 4011 | { |
| 4012 | Parcel data = Parcel.obtain(); |
| 4013 | Parcel reply = Parcel.obtain(); |
| 4014 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4015 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 4016 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4017 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 4018 | data.recycle(); |
| 4019 | reply.recycle(); |
| 4020 | return list; |
| 4021 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4022 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4023 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4024 | { |
| 4025 | Parcel data = Parcel.obtain(); |
| 4026 | Parcel reply = Parcel.obtain(); |
| 4027 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4028 | data.writeInt(stackId); |
| 4029 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4030 | reply.readException(); |
| 4031 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4032 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4033 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4034 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4035 | } |
| 4036 | data.recycle(); |
| 4037 | reply.recycle(); |
| 4038 | return info; |
| 4039 | } |
| 4040 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 4041 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 4042 | Parcel data = Parcel.obtain(); |
| 4043 | Parcel reply = Parcel.obtain(); |
| 4044 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4045 | data.writeInt(taskId); |
| 4046 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 4047 | reply.readException(); |
| 4048 | boolean isInHomeStack = reply.readInt() > 0; |
| 4049 | data.recycle(); |
| 4050 | reply.recycle(); |
| 4051 | return isInHomeStack; |
| 4052 | } |
| 4053 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4054 | public void setFocusedStack(int stackId) throws RemoteException |
| 4055 | { |
| 4056 | Parcel data = Parcel.obtain(); |
| 4057 | Parcel reply = Parcel.obtain(); |
| 4058 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4059 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4060 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4061 | reply.readException(); |
| 4062 | data.recycle(); |
| 4063 | reply.recycle(); |
| 4064 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4065 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 4066 | public int getFocusedStackId() throws RemoteException { |
| 4067 | Parcel data = Parcel.obtain(); |
| 4068 | Parcel reply = Parcel.obtain(); |
| 4069 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4070 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 4071 | reply.readException(); |
| 4072 | int focusedStackId = reply.readInt(); |
| 4073 | data.recycle(); |
| 4074 | reply.recycle(); |
| 4075 | return focusedStackId; |
| 4076 | } |
| 4077 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 4078 | public void setFocusedTask(int taskId) throws RemoteException |
| 4079 | { |
| 4080 | Parcel data = Parcel.obtain(); |
| 4081 | Parcel reply = Parcel.obtain(); |
| 4082 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4083 | data.writeInt(taskId); |
| 4084 | mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0); |
| 4085 | reply.readException(); |
| 4086 | data.recycle(); |
| 4087 | reply.recycle(); |
| 4088 | } |
| 4089 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4090 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 4091 | { |
| 4092 | Parcel data = Parcel.obtain(); |
| 4093 | Parcel reply = Parcel.obtain(); |
| 4094 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4095 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4096 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4097 | reply.readException(); |
| 4098 | data.recycle(); |
| 4099 | reply.recycle(); |
| 4100 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4101 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 4102 | { |
| 4103 | Parcel data = Parcel.obtain(); |
| 4104 | Parcel reply = Parcel.obtain(); |
| 4105 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4106 | data.writeStrongBinder(token); |
| 4107 | data.writeInt(onlyRoot ? 1 : 0); |
| 4108 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4109 | reply.readException(); |
| 4110 | int res = reply.readInt(); |
| 4111 | data.recycle(); |
| 4112 | reply.recycle(); |
| 4113 | return res; |
| 4114 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4115 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4116 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4117 | Parcel data = Parcel.obtain(); |
| 4118 | Parcel reply = Parcel.obtain(); |
| 4119 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4120 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4121 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4122 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4123 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4124 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4125 | reply.readException(); |
| 4126 | int res = reply.readInt(); |
| 4127 | ContentProviderHolder cph = null; |
| 4128 | if (res != 0) { |
| 4129 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4130 | } |
| 4131 | data.recycle(); |
| 4132 | reply.recycle(); |
| 4133 | return cph; |
| 4134 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4135 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 4136 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4137 | Parcel data = Parcel.obtain(); |
| 4138 | Parcel reply = Parcel.obtain(); |
| 4139 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4140 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4141 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4142 | data.writeStrongBinder(token); |
| 4143 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4144 | reply.readException(); |
| 4145 | int res = reply.readInt(); |
| 4146 | ContentProviderHolder cph = null; |
| 4147 | if (res != 0) { |
| 4148 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4149 | } |
| 4150 | data.recycle(); |
| 4151 | reply.recycle(); |
| 4152 | return cph; |
| 4153 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4154 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4155 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4156 | { |
| 4157 | Parcel data = Parcel.obtain(); |
| 4158 | Parcel reply = Parcel.obtain(); |
| 4159 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4160 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4161 | data.writeTypedList(providers); |
| 4162 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 4163 | reply.readException(); |
| 4164 | data.recycle(); |
| 4165 | reply.recycle(); |
| 4166 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4167 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 4168 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4169 | Parcel data = Parcel.obtain(); |
| 4170 | Parcel reply = Parcel.obtain(); |
| 4171 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4172 | data.writeStrongBinder(connection); |
| 4173 | data.writeInt(stable); |
| 4174 | data.writeInt(unstable); |
| 4175 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4176 | reply.readException(); |
| 4177 | boolean res = reply.readInt() != 0; |
| 4178 | data.recycle(); |
| 4179 | reply.recycle(); |
| 4180 | return res; |
| 4181 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4182 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4183 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 4184 | Parcel data = Parcel.obtain(); |
| 4185 | Parcel reply = Parcel.obtain(); |
| 4186 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4187 | data.writeStrongBinder(connection); |
| 4188 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 4189 | reply.readException(); |
| 4190 | data.recycle(); |
| 4191 | reply.recycle(); |
| 4192 | } |
| 4193 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4194 | @Override |
| 4195 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 4196 | Parcel data = Parcel.obtain(); |
| 4197 | Parcel reply = Parcel.obtain(); |
| 4198 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4199 | data.writeStrongBinder(connection); |
| 4200 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 4201 | reply.readException(); |
| 4202 | data.recycle(); |
| 4203 | reply.recycle(); |
| 4204 | } |
| 4205 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4206 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 4207 | Parcel data = Parcel.obtain(); |
| 4208 | Parcel reply = Parcel.obtain(); |
| 4209 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4210 | data.writeStrongBinder(connection); |
| 4211 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4212 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4213 | reply.readException(); |
| 4214 | data.recycle(); |
| 4215 | reply.recycle(); |
| 4216 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4217 | |
| 4218 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 4219 | Parcel data = Parcel.obtain(); |
| 4220 | Parcel reply = Parcel.obtain(); |
| 4221 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4222 | data.writeString(name); |
| 4223 | data.writeStrongBinder(token); |
| 4224 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4225 | reply.readException(); |
| 4226 | data.recycle(); |
| 4227 | reply.recycle(); |
| 4228 | } |
| 4229 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 4230 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 4231 | throws RemoteException |
| 4232 | { |
| 4233 | Parcel data = Parcel.obtain(); |
| 4234 | Parcel reply = Parcel.obtain(); |
| 4235 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4236 | service.writeToParcel(data, 0); |
| 4237 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 4238 | reply.readException(); |
| 4239 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 4240 | data.recycle(); |
| 4241 | reply.recycle(); |
| 4242 | return res; |
| 4243 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4244 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4245 | public ComponentName startService(IApplicationThread caller, Intent service, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4246 | String resolvedType, String callingPackage, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4247 | { |
| 4248 | Parcel data = Parcel.obtain(); |
| 4249 | Parcel reply = Parcel.obtain(); |
| 4250 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4251 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4252 | service.writeToParcel(data, 0); |
| 4253 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4254 | data.writeString(callingPackage); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4255 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4256 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 4257 | reply.readException(); |
| 4258 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4259 | data.recycle(); |
| 4260 | reply.recycle(); |
| 4261 | return res; |
| 4262 | } |
| 4263 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4264 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4265 | { |
| 4266 | Parcel data = Parcel.obtain(); |
| 4267 | Parcel reply = Parcel.obtain(); |
| 4268 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4269 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4270 | service.writeToParcel(data, 0); |
| 4271 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4272 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4273 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 4274 | reply.readException(); |
| 4275 | int res = reply.readInt(); |
| 4276 | reply.recycle(); |
| 4277 | data.recycle(); |
| 4278 | return res; |
| 4279 | } |
| 4280 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 4281 | int startId) throws RemoteException { |
| 4282 | Parcel data = Parcel.obtain(); |
| 4283 | Parcel reply = Parcel.obtain(); |
| 4284 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4285 | ComponentName.writeToParcel(className, data); |
| 4286 | data.writeStrongBinder(token); |
| 4287 | data.writeInt(startId); |
| 4288 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 4289 | reply.readException(); |
| 4290 | boolean res = reply.readInt() != 0; |
| 4291 | data.recycle(); |
| 4292 | reply.recycle(); |
| 4293 | return res; |
| 4294 | } |
| 4295 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4296 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4297 | Parcel data = Parcel.obtain(); |
| 4298 | Parcel reply = Parcel.obtain(); |
| 4299 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4300 | ComponentName.writeToParcel(className, data); |
| 4301 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4302 | data.writeInt(id); |
| 4303 | if (notification != null) { |
| 4304 | data.writeInt(1); |
| 4305 | notification.writeToParcel(data, 0); |
| 4306 | } else { |
| 4307 | data.writeInt(0); |
| 4308 | } |
| 4309 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4310 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4311 | reply.readException(); |
| 4312 | data.recycle(); |
| 4313 | reply.recycle(); |
| 4314 | } |
| 4315 | public int bindService(IApplicationThread caller, IBinder token, |
| 4316 | Intent service, String resolvedType, IServiceConnection connection, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4317 | int flags, String callingPackage, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4318 | Parcel data = Parcel.obtain(); |
| 4319 | Parcel reply = Parcel.obtain(); |
| 4320 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4321 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4322 | data.writeStrongBinder(token); |
| 4323 | service.writeToParcel(data, 0); |
| 4324 | data.writeString(resolvedType); |
| 4325 | data.writeStrongBinder(connection.asBinder()); |
| 4326 | data.writeInt(flags); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4327 | data.writeString(callingPackage); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 4328 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4329 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4330 | reply.readException(); |
| 4331 | int res = reply.readInt(); |
| 4332 | data.recycle(); |
| 4333 | reply.recycle(); |
| 4334 | return res; |
| 4335 | } |
| 4336 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 4337 | { |
| 4338 | Parcel data = Parcel.obtain(); |
| 4339 | Parcel reply = Parcel.obtain(); |
| 4340 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4341 | data.writeStrongBinder(connection.asBinder()); |
| 4342 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4343 | reply.readException(); |
| 4344 | boolean res = reply.readInt() != 0; |
| 4345 | data.recycle(); |
| 4346 | reply.recycle(); |
| 4347 | return res; |
| 4348 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4349 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4350 | public void publishService(IBinder token, |
| 4351 | Intent intent, IBinder service) throws RemoteException { |
| 4352 | Parcel data = Parcel.obtain(); |
| 4353 | Parcel reply = Parcel.obtain(); |
| 4354 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4355 | data.writeStrongBinder(token); |
| 4356 | intent.writeToParcel(data, 0); |
| 4357 | data.writeStrongBinder(service); |
| 4358 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 4359 | reply.readException(); |
| 4360 | data.recycle(); |
| 4361 | reply.recycle(); |
| 4362 | } |
| 4363 | |
| 4364 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 4365 | throws RemoteException { |
| 4366 | Parcel data = Parcel.obtain(); |
| 4367 | Parcel reply = Parcel.obtain(); |
| 4368 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4369 | data.writeStrongBinder(token); |
| 4370 | intent.writeToParcel(data, 0); |
| 4371 | data.writeInt(doRebind ? 1 : 0); |
| 4372 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 4373 | reply.readException(); |
| 4374 | data.recycle(); |
| 4375 | reply.recycle(); |
| 4376 | } |
| 4377 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4378 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 4379 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4380 | Parcel data = Parcel.obtain(); |
| 4381 | Parcel reply = Parcel.obtain(); |
| 4382 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4383 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4384 | data.writeInt(type); |
| 4385 | data.writeInt(startId); |
| 4386 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4387 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 4388 | reply.readException(); |
| 4389 | data.recycle(); |
| 4390 | reply.recycle(); |
| 4391 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4392 | |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4393 | public IBinder peekService(Intent service, String resolvedType, String callingPackage) |
| 4394 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4395 | Parcel data = Parcel.obtain(); |
| 4396 | Parcel reply = Parcel.obtain(); |
| 4397 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4398 | service.writeToParcel(data, 0); |
| 4399 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4400 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4401 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 4402 | reply.readException(); |
| 4403 | IBinder binder = reply.readStrongBinder(); |
| 4404 | reply.recycle(); |
| 4405 | data.recycle(); |
| 4406 | return binder; |
| 4407 | } |
| 4408 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4409 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 4410 | throws RemoteException { |
| 4411 | Parcel data = Parcel.obtain(); |
| 4412 | Parcel reply = Parcel.obtain(); |
| 4413 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4414 | app.writeToParcel(data, 0); |
| 4415 | data.writeInt(backupRestoreMode); |
| 4416 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4417 | reply.readException(); |
| 4418 | boolean success = reply.readInt() != 0; |
| 4419 | reply.recycle(); |
| 4420 | data.recycle(); |
| 4421 | return success; |
| 4422 | } |
| 4423 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 4424 | public void clearPendingBackup() throws RemoteException { |
| 4425 | Parcel data = Parcel.obtain(); |
| 4426 | Parcel reply = Parcel.obtain(); |
| 4427 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4428 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 4429 | reply.recycle(); |
| 4430 | data.recycle(); |
| 4431 | } |
| 4432 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4433 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 4434 | Parcel data = Parcel.obtain(); |
| 4435 | Parcel reply = Parcel.obtain(); |
| 4436 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4437 | data.writeString(packageName); |
| 4438 | data.writeStrongBinder(agent); |
| 4439 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 4440 | reply.recycle(); |
| 4441 | data.recycle(); |
| 4442 | } |
| 4443 | |
| 4444 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 4445 | Parcel data = Parcel.obtain(); |
| 4446 | Parcel reply = Parcel.obtain(); |
| 4447 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4448 | app.writeToParcel(data, 0); |
| 4449 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4450 | reply.readException(); |
| 4451 | reply.recycle(); |
| 4452 | data.recycle(); |
| 4453 | } |
| 4454 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4455 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4456 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4457 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 4458 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4459 | Parcel data = Parcel.obtain(); |
| 4460 | Parcel reply = Parcel.obtain(); |
| 4461 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4462 | ComponentName.writeToParcel(className, data); |
| 4463 | data.writeString(profileFile); |
| 4464 | data.writeInt(flags); |
| 4465 | data.writeBundle(arguments); |
| 4466 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4467 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4468 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4469 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4470 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4471 | reply.readException(); |
| 4472 | boolean res = reply.readInt() != 0; |
| 4473 | reply.recycle(); |
| 4474 | data.recycle(); |
| 4475 | return res; |
| 4476 | } |
| 4477 | |
| 4478 | public void finishInstrumentation(IApplicationThread target, |
| 4479 | int resultCode, Bundle results) throws RemoteException { |
| 4480 | Parcel data = Parcel.obtain(); |
| 4481 | Parcel reply = Parcel.obtain(); |
| 4482 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4483 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 4484 | data.writeInt(resultCode); |
| 4485 | data.writeBundle(results); |
| 4486 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4487 | reply.readException(); |
| 4488 | data.recycle(); |
| 4489 | reply.recycle(); |
| 4490 | } |
| 4491 | public Configuration getConfiguration() throws RemoteException |
| 4492 | { |
| 4493 | Parcel data = Parcel.obtain(); |
| 4494 | Parcel reply = Parcel.obtain(); |
| 4495 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4496 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4497 | reply.readException(); |
| 4498 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 4499 | reply.recycle(); |
| 4500 | data.recycle(); |
| 4501 | return res; |
| 4502 | } |
| 4503 | public void updateConfiguration(Configuration values) throws RemoteException |
| 4504 | { |
| 4505 | Parcel data = Parcel.obtain(); |
| 4506 | Parcel reply = Parcel.obtain(); |
| 4507 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4508 | values.writeToParcel(data, 0); |
| 4509 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4510 | reply.readException(); |
| 4511 | data.recycle(); |
| 4512 | reply.recycle(); |
| 4513 | } |
| 4514 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 4515 | throws RemoteException { |
| 4516 | Parcel data = Parcel.obtain(); |
| 4517 | Parcel reply = Parcel.obtain(); |
| 4518 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4519 | data.writeStrongBinder(token); |
| 4520 | data.writeInt(requestedOrientation); |
| 4521 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4522 | reply.readException(); |
| 4523 | data.recycle(); |
| 4524 | reply.recycle(); |
| 4525 | } |
| 4526 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 4527 | Parcel data = Parcel.obtain(); |
| 4528 | Parcel reply = Parcel.obtain(); |
| 4529 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4530 | data.writeStrongBinder(token); |
| 4531 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4532 | reply.readException(); |
| 4533 | int res = reply.readInt(); |
| 4534 | data.recycle(); |
| 4535 | reply.recycle(); |
| 4536 | return res; |
| 4537 | } |
| 4538 | public ComponentName getActivityClassForToken(IBinder token) |
| 4539 | throws RemoteException { |
| 4540 | Parcel data = Parcel.obtain(); |
| 4541 | Parcel reply = Parcel.obtain(); |
| 4542 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4543 | data.writeStrongBinder(token); |
| 4544 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4545 | reply.readException(); |
| 4546 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4547 | data.recycle(); |
| 4548 | reply.recycle(); |
| 4549 | return res; |
| 4550 | } |
| 4551 | public String getPackageForToken(IBinder token) throws RemoteException |
| 4552 | { |
| 4553 | Parcel data = Parcel.obtain(); |
| 4554 | Parcel reply = Parcel.obtain(); |
| 4555 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4556 | data.writeStrongBinder(token); |
| 4557 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4558 | reply.readException(); |
| 4559 | String res = reply.readString(); |
| 4560 | data.recycle(); |
| 4561 | reply.recycle(); |
| 4562 | return res; |
| 4563 | } |
| 4564 | public IIntentSender getIntentSender(int type, |
| 4565 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4566 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4567 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4568 | Parcel data = Parcel.obtain(); |
| 4569 | Parcel reply = Parcel.obtain(); |
| 4570 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4571 | data.writeInt(type); |
| 4572 | data.writeString(packageName); |
| 4573 | data.writeStrongBinder(token); |
| 4574 | data.writeString(resultWho); |
| 4575 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4576 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4577 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4578 | data.writeTypedArray(intents, 0); |
| 4579 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4580 | } else { |
| 4581 | data.writeInt(0); |
| 4582 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4583 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4584 | if (options != null) { |
| 4585 | data.writeInt(1); |
| 4586 | options.writeToParcel(data, 0); |
| 4587 | } else { |
| 4588 | data.writeInt(0); |
| 4589 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4590 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4591 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4592 | reply.readException(); |
| 4593 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4594 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4595 | data.recycle(); |
| 4596 | reply.recycle(); |
| 4597 | return res; |
| 4598 | } |
| 4599 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 4600 | Parcel data = Parcel.obtain(); |
| 4601 | Parcel reply = Parcel.obtain(); |
| 4602 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4603 | data.writeStrongBinder(sender.asBinder()); |
| 4604 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4605 | reply.readException(); |
| 4606 | data.recycle(); |
| 4607 | reply.recycle(); |
| 4608 | } |
| 4609 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 4610 | Parcel data = Parcel.obtain(); |
| 4611 | Parcel reply = Parcel.obtain(); |
| 4612 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4613 | data.writeStrongBinder(sender.asBinder()); |
| 4614 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4615 | reply.readException(); |
| 4616 | String res = reply.readString(); |
| 4617 | data.recycle(); |
| 4618 | reply.recycle(); |
| 4619 | return res; |
| 4620 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 4621 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 4622 | Parcel data = Parcel.obtain(); |
| 4623 | Parcel reply = Parcel.obtain(); |
| 4624 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4625 | data.writeStrongBinder(sender.asBinder()); |
| 4626 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4627 | reply.readException(); |
| 4628 | int res = reply.readInt(); |
| 4629 | data.recycle(); |
| 4630 | reply.recycle(); |
| 4631 | return res; |
| 4632 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4633 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 4634 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 4635 | Parcel data = Parcel.obtain(); |
| 4636 | Parcel reply = Parcel.obtain(); |
| 4637 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4638 | data.writeInt(callingPid); |
| 4639 | data.writeInt(callingUid); |
| 4640 | data.writeInt(userId); |
| 4641 | data.writeInt(allowAll ? 1 : 0); |
| 4642 | data.writeInt(requireFull ? 1 : 0); |
| 4643 | data.writeString(name); |
| 4644 | data.writeString(callerPackage); |
| 4645 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 4646 | reply.readException(); |
| 4647 | int res = reply.readInt(); |
| 4648 | data.recycle(); |
| 4649 | reply.recycle(); |
| 4650 | return res; |
| 4651 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4652 | public void setProcessLimit(int max) throws RemoteException |
| 4653 | { |
| 4654 | Parcel data = Parcel.obtain(); |
| 4655 | Parcel reply = Parcel.obtain(); |
| 4656 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4657 | data.writeInt(max); |
| 4658 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4659 | reply.readException(); |
| 4660 | data.recycle(); |
| 4661 | reply.recycle(); |
| 4662 | } |
| 4663 | public int getProcessLimit() throws RemoteException |
| 4664 | { |
| 4665 | Parcel data = Parcel.obtain(); |
| 4666 | Parcel reply = Parcel.obtain(); |
| 4667 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4668 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4669 | reply.readException(); |
| 4670 | int res = reply.readInt(); |
| 4671 | data.recycle(); |
| 4672 | reply.recycle(); |
| 4673 | return res; |
| 4674 | } |
| 4675 | public void setProcessForeground(IBinder token, int pid, |
| 4676 | boolean isForeground) throws RemoteException { |
| 4677 | Parcel data = Parcel.obtain(); |
| 4678 | Parcel reply = Parcel.obtain(); |
| 4679 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4680 | data.writeStrongBinder(token); |
| 4681 | data.writeInt(pid); |
| 4682 | data.writeInt(isForeground ? 1 : 0); |
| 4683 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4684 | reply.readException(); |
| 4685 | data.recycle(); |
| 4686 | reply.recycle(); |
| 4687 | } |
| 4688 | public int checkPermission(String permission, int pid, int uid) |
| 4689 | throws RemoteException { |
| 4690 | Parcel data = Parcel.obtain(); |
| 4691 | Parcel reply = Parcel.obtain(); |
| 4692 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4693 | data.writeString(permission); |
| 4694 | data.writeInt(pid); |
| 4695 | data.writeInt(uid); |
| 4696 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4697 | reply.readException(); |
| 4698 | int res = reply.readInt(); |
| 4699 | data.recycle(); |
| 4700 | reply.recycle(); |
| 4701 | return res; |
| 4702 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4703 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4704 | throws RemoteException { |
| 4705 | Parcel data = Parcel.obtain(); |
| 4706 | Parcel reply = Parcel.obtain(); |
| 4707 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4708 | data.writeString(permission); |
| 4709 | data.writeInt(pid); |
| 4710 | data.writeInt(uid); |
| 4711 | data.writeStrongBinder(callerToken); |
| 4712 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4713 | reply.readException(); |
| 4714 | int res = reply.readInt(); |
| 4715 | data.recycle(); |
| 4716 | reply.recycle(); |
| 4717 | return res; |
| 4718 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4719 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4720 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4721 | Parcel data = Parcel.obtain(); |
| 4722 | Parcel reply = Parcel.obtain(); |
| 4723 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4724 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4725 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4726 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4727 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4728 | reply.readException(); |
| 4729 | boolean res = reply.readInt() != 0; |
| 4730 | data.recycle(); |
| 4731 | reply.recycle(); |
| 4732 | return res; |
| 4733 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4734 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4735 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4736 | Parcel data = Parcel.obtain(); |
| 4737 | Parcel reply = Parcel.obtain(); |
| 4738 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4739 | uri.writeToParcel(data, 0); |
| 4740 | data.writeInt(pid); |
| 4741 | data.writeInt(uid); |
| 4742 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4743 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4744 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4745 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4746 | reply.readException(); |
| 4747 | int res = reply.readInt(); |
| 4748 | data.recycle(); |
| 4749 | reply.recycle(); |
| 4750 | return res; |
| 4751 | } |
| 4752 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4753 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4754 | Parcel data = Parcel.obtain(); |
| 4755 | Parcel reply = Parcel.obtain(); |
| 4756 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4757 | data.writeStrongBinder(caller.asBinder()); |
| 4758 | data.writeString(targetPkg); |
| 4759 | uri.writeToParcel(data, 0); |
| 4760 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4761 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4762 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4763 | reply.readException(); |
| 4764 | data.recycle(); |
| 4765 | reply.recycle(); |
| 4766 | } |
| 4767 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4768 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4769 | Parcel data = Parcel.obtain(); |
| 4770 | Parcel reply = Parcel.obtain(); |
| 4771 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4772 | data.writeStrongBinder(caller.asBinder()); |
| 4773 | uri.writeToParcel(data, 0); |
| 4774 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4775 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4776 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4777 | reply.readException(); |
| 4778 | data.recycle(); |
| 4779 | reply.recycle(); |
| 4780 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4781 | |
| 4782 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4783 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4784 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4785 | Parcel data = Parcel.obtain(); |
| 4786 | Parcel reply = Parcel.obtain(); |
| 4787 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4788 | uri.writeToParcel(data, 0); |
| 4789 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4790 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4791 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4792 | reply.readException(); |
| 4793 | data.recycle(); |
| 4794 | reply.recycle(); |
| 4795 | } |
| 4796 | |
| 4797 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4798 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4799 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4800 | Parcel data = Parcel.obtain(); |
| 4801 | Parcel reply = Parcel.obtain(); |
| 4802 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4803 | uri.writeToParcel(data, 0); |
| 4804 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4805 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4806 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4807 | reply.readException(); |
| 4808 | data.recycle(); |
| 4809 | reply.recycle(); |
| 4810 | } |
| 4811 | |
| 4812 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4813 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4814 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4815 | Parcel data = Parcel.obtain(); |
| 4816 | Parcel reply = Parcel.obtain(); |
| 4817 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4818 | data.writeString(packageName); |
| 4819 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4820 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4821 | reply.readException(); |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4822 | @SuppressWarnings("unchecked") |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4823 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4824 | reply); |
| 4825 | data.recycle(); |
| 4826 | reply.recycle(); |
| 4827 | return perms; |
| 4828 | } |
| 4829 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4830 | @Override |
| 4831 | public ParceledListSlice<UriPermission> getGrantedUriPermissions(String packageName, int userId) |
| 4832 | throws RemoteException { |
| 4833 | Parcel data = Parcel.obtain(); |
| 4834 | Parcel reply = Parcel.obtain(); |
| 4835 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4836 | data.writeString(packageName); |
| 4837 | data.writeInt(userId); |
| 4838 | mRemote.transact(GET_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4839 | reply.readException(); |
| 4840 | @SuppressWarnings("unchecked") |
| 4841 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4842 | reply); |
| 4843 | data.recycle(); |
| 4844 | reply.recycle(); |
| 4845 | return perms; |
| 4846 | } |
| 4847 | |
| 4848 | @Override |
| 4849 | public void clearGrantedUriPermissions(String packageName, int userId) throws RemoteException { |
| 4850 | Parcel data = Parcel.obtain(); |
| 4851 | Parcel reply = Parcel.obtain(); |
| 4852 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4853 | data.writeString(packageName); |
| 4854 | data.writeInt(userId); |
| 4855 | mRemote.transact(CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4856 | reply.readException(); |
| 4857 | data.recycle(); |
| 4858 | reply.recycle(); |
| 4859 | } |
| 4860 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4861 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4862 | throws RemoteException { |
| 4863 | Parcel data = Parcel.obtain(); |
| 4864 | Parcel reply = Parcel.obtain(); |
| 4865 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4866 | data.writeStrongBinder(who.asBinder()); |
| 4867 | data.writeInt(waiting ? 1 : 0); |
| 4868 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4869 | reply.readException(); |
| 4870 | data.recycle(); |
| 4871 | reply.recycle(); |
| 4872 | } |
| 4873 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4874 | Parcel data = Parcel.obtain(); |
| 4875 | Parcel reply = Parcel.obtain(); |
| 4876 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4877 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4878 | reply.readException(); |
| 4879 | outInfo.readFromParcel(reply); |
| 4880 | data.recycle(); |
| 4881 | reply.recycle(); |
| 4882 | } |
| 4883 | public void unhandledBack() throws RemoteException |
| 4884 | { |
| 4885 | Parcel data = Parcel.obtain(); |
| 4886 | Parcel reply = Parcel.obtain(); |
| 4887 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4888 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4889 | reply.readException(); |
| 4890 | data.recycle(); |
| 4891 | reply.recycle(); |
| 4892 | } |
| 4893 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4894 | { |
| 4895 | Parcel data = Parcel.obtain(); |
| 4896 | Parcel reply = Parcel.obtain(); |
| 4897 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4898 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4899 | reply.readException(); |
| 4900 | ParcelFileDescriptor pfd = null; |
| 4901 | if (reply.readInt() != 0) { |
| 4902 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4903 | } |
| 4904 | data.recycle(); |
| 4905 | reply.recycle(); |
| 4906 | return pfd; |
| 4907 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4908 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4909 | { |
| 4910 | Parcel data = Parcel.obtain(); |
| 4911 | Parcel reply = Parcel.obtain(); |
| 4912 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4913 | data.writeInt(shown ? 1 : 0); |
| 4914 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4915 | reply.readException(); |
| 4916 | data.recycle(); |
| 4917 | reply.recycle(); |
| 4918 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4919 | public void setDebugApp( |
| 4920 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4921 | throws RemoteException |
| 4922 | { |
| 4923 | Parcel data = Parcel.obtain(); |
| 4924 | Parcel reply = Parcel.obtain(); |
| 4925 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4926 | data.writeString(packageName); |
| 4927 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4928 | data.writeInt(persistent ? 1 : 0); |
| 4929 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4930 | reply.readException(); |
| 4931 | data.recycle(); |
| 4932 | reply.recycle(); |
| 4933 | } |
| 4934 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4935 | { |
| 4936 | Parcel data = Parcel.obtain(); |
| 4937 | Parcel reply = Parcel.obtain(); |
| 4938 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4939 | data.writeInt(enabled ? 1 : 0); |
| 4940 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4941 | reply.readException(); |
| 4942 | data.recycle(); |
| 4943 | reply.recycle(); |
| 4944 | } |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 4945 | public void setActivityController(IActivityController watcher, boolean imAMonkey) |
| 4946 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4947 | { |
| 4948 | Parcel data = Parcel.obtain(); |
| 4949 | Parcel reply = Parcel.obtain(); |
| 4950 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4951 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 4952 | data.writeInt(imAMonkey ? 1 : 0); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4953 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4954 | reply.readException(); |
| 4955 | data.recycle(); |
| 4956 | reply.recycle(); |
| 4957 | } |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 4958 | public void setLenientBackgroundCheck(boolean enabled) throws RemoteException |
| 4959 | { |
| 4960 | Parcel data = Parcel.obtain(); |
| 4961 | Parcel reply = Parcel.obtain(); |
| 4962 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4963 | data.writeInt(enabled ? 1 : 0); |
| 4964 | mRemote.transact(SET_LENIENT_BACKGROUND_CHECK_TRANSACTION, data, reply, 0); |
| 4965 | reply.readException(); |
| 4966 | data.recycle(); |
| 4967 | reply.recycle(); |
| 4968 | } |
Dianne Hackborn | 970510b | 2016-02-24 16:56:42 -0800 | [diff] [blame] | 4969 | public int getMemoryTrimLevel() throws RemoteException |
| 4970 | { |
| 4971 | Parcel data = Parcel.obtain(); |
| 4972 | Parcel reply = Parcel.obtain(); |
| 4973 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4974 | mRemote.transact(GET_MEMORY_TRIM_LEVEL_TRANSACTION, data, reply, 0); |
| 4975 | reply.readException(); |
| 4976 | int level = reply.readInt(); |
| 4977 | data.recycle(); |
| 4978 | reply.recycle(); |
| 4979 | return level; |
| 4980 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4981 | public void enterSafeMode() throws RemoteException { |
| 4982 | Parcel data = Parcel.obtain(); |
| 4983 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4984 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4985 | data.recycle(); |
| 4986 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4987 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4988 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4989 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4990 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4991 | data.writeStrongBinder(sender.asBinder()); |
| 4992 | data.writeInt(sourceUid); |
| 4993 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4994 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4995 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4996 | data.recycle(); |
| 4997 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4998 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 4999 | throws RemoteException { |
| 5000 | Parcel data = Parcel.obtain(); |
| 5001 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5002 | data.writeStrongBinder(sender.asBinder()); |
| 5003 | data.writeInt(sourceUid); |
| 5004 | data.writeString(tag); |
| 5005 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 5006 | data.recycle(); |
| 5007 | } |
| 5008 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 5009 | throws RemoteException { |
| 5010 | Parcel data = Parcel.obtain(); |
| 5011 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5012 | data.writeStrongBinder(sender.asBinder()); |
| 5013 | data.writeInt(sourceUid); |
| 5014 | data.writeString(tag); |
| 5015 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 5016 | data.recycle(); |
| 5017 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 5018 | 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] | 5019 | Parcel data = Parcel.obtain(); |
| 5020 | Parcel reply = Parcel.obtain(); |
| 5021 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5022 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 5023 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 5024 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 5025 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5026 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5027 | boolean res = reply.readInt() != 0; |
| 5028 | data.recycle(); |
| 5029 | reply.recycle(); |
| 5030 | return res; |
| 5031 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 5032 | @Override |
| 5033 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 5034 | Parcel data = Parcel.obtain(); |
| 5035 | Parcel reply = Parcel.obtain(); |
| 5036 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5037 | data.writeString(reason); |
| 5038 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 5039 | boolean res = reply.readInt() != 0; |
| 5040 | data.recycle(); |
| 5041 | reply.recycle(); |
| 5042 | return res; |
| 5043 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5044 | public boolean testIsSystemReady() |
| 5045 | { |
| 5046 | /* this base class version is never called */ |
| 5047 | return true; |
| 5048 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5049 | public void handleApplicationCrash(IBinder app, |
| 5050 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 5051 | { |
| 5052 | Parcel data = Parcel.obtain(); |
| 5053 | Parcel reply = Parcel.obtain(); |
| 5054 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5055 | data.writeStrongBinder(app); |
| 5056 | crashInfo.writeToParcel(data, 0); |
| 5057 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 5058 | reply.readException(); |
| 5059 | reply.recycle(); |
| 5060 | data.recycle(); |
| 5061 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5062 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 5063 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5064 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5065 | { |
| 5066 | Parcel data = Parcel.obtain(); |
| 5067 | Parcel reply = Parcel.obtain(); |
| 5068 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5069 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5070 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 5071 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5072 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5073 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5074 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5075 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5076 | reply.recycle(); |
| 5077 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5078 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5079 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5080 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5081 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 5082 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 5083 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5084 | { |
| 5085 | Parcel data = Parcel.obtain(); |
| 5086 | Parcel reply = Parcel.obtain(); |
| 5087 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5088 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 5089 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 5090 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5091 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 5092 | reply.readException(); |
| 5093 | reply.recycle(); |
| 5094 | data.recycle(); |
| 5095 | } |
| 5096 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5097 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 5098 | Parcel data = Parcel.obtain(); |
| 5099 | Parcel reply = Parcel.obtain(); |
| 5100 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5101 | data.writeInt(sig); |
| 5102 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 5103 | reply.readException(); |
| 5104 | data.recycle(); |
| 5105 | reply.recycle(); |
| 5106 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5107 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5108 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5109 | Parcel data = Parcel.obtain(); |
| 5110 | Parcel reply = Parcel.obtain(); |
| 5111 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5112 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5113 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5114 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5115 | reply.readException(); |
| 5116 | data.recycle(); |
| 5117 | reply.recycle(); |
| 5118 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5119 | |
| 5120 | public void killAllBackgroundProcesses() throws RemoteException { |
| 5121 | Parcel data = Parcel.obtain(); |
| 5122 | Parcel reply = Parcel.obtain(); |
| 5123 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5124 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5125 | reply.readException(); |
| 5126 | data.recycle(); |
| 5127 | reply.recycle(); |
| 5128 | } |
| 5129 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 5130 | public void killPackageDependents(String packageName, int userId) throws RemoteException { |
| 5131 | Parcel data = Parcel.obtain(); |
| 5132 | Parcel reply = Parcel.obtain(); |
| 5133 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5134 | data.writeString(packageName); |
| 5135 | data.writeInt(userId); |
| 5136 | mRemote.transact(KILL_PACKAGE_DEPENDENTS_TRANSACTION, data, reply, 0); |
| 5137 | reply.readException(); |
| 5138 | data.recycle(); |
| 5139 | reply.recycle(); |
| 5140 | } |
| 5141 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5142 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5143 | Parcel data = Parcel.obtain(); |
| 5144 | Parcel reply = Parcel.obtain(); |
| 5145 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5146 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5147 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5148 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5149 | reply.readException(); |
| 5150 | data.recycle(); |
| 5151 | reply.recycle(); |
| 5152 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5153 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 5154 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 5155 | throws RemoteException |
| 5156 | { |
| 5157 | Parcel data = Parcel.obtain(); |
| 5158 | Parcel reply = Parcel.obtain(); |
| 5159 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5160 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 5161 | reply.readException(); |
| 5162 | outInfo.readFromParcel(reply); |
| 5163 | reply.recycle(); |
| 5164 | data.recycle(); |
| 5165 | } |
| 5166 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5167 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 5168 | { |
| 5169 | Parcel data = Parcel.obtain(); |
| 5170 | Parcel reply = Parcel.obtain(); |
| 5171 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5172 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5173 | reply.readException(); |
| 5174 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 5175 | reply.recycle(); |
| 5176 | data.recycle(); |
| 5177 | return res; |
| 5178 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5179 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5180 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5181 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5182 | { |
| 5183 | Parcel data = Parcel.obtain(); |
| 5184 | Parcel reply = Parcel.obtain(); |
| 5185 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5186 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5187 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5188 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 5189 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5190 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5191 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5192 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5193 | } else { |
| 5194 | data.writeInt(0); |
| 5195 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5196 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 5197 | reply.readException(); |
| 5198 | boolean res = reply.readInt() != 0; |
| 5199 | reply.recycle(); |
| 5200 | data.recycle(); |
| 5201 | return res; |
| 5202 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5203 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 5204 | public boolean shutdown(int timeout) throws RemoteException |
| 5205 | { |
| 5206 | Parcel data = Parcel.obtain(); |
| 5207 | Parcel reply = Parcel.obtain(); |
| 5208 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5209 | data.writeInt(timeout); |
| 5210 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 5211 | reply.readException(); |
| 5212 | boolean res = reply.readInt() != 0; |
| 5213 | reply.recycle(); |
| 5214 | data.recycle(); |
| 5215 | return res; |
| 5216 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5217 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5218 | public void stopAppSwitches() throws RemoteException { |
| 5219 | Parcel data = Parcel.obtain(); |
| 5220 | Parcel reply = Parcel.obtain(); |
| 5221 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5222 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5223 | reply.readException(); |
| 5224 | reply.recycle(); |
| 5225 | data.recycle(); |
| 5226 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5227 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5228 | public void resumeAppSwitches() throws RemoteException { |
| 5229 | Parcel data = Parcel.obtain(); |
| 5230 | Parcel reply = Parcel.obtain(); |
| 5231 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5232 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5233 | reply.readException(); |
| 5234 | reply.recycle(); |
| 5235 | data.recycle(); |
| 5236 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 5237 | |
| 5238 | public void addPackageDependency(String packageName) throws RemoteException { |
| 5239 | Parcel data = Parcel.obtain(); |
| 5240 | Parcel reply = Parcel.obtain(); |
| 5241 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5242 | data.writeString(packageName); |
| 5243 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 5244 | reply.readException(); |
| 5245 | data.recycle(); |
| 5246 | reply.recycle(); |
| 5247 | } |
| 5248 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5249 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 5250 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5251 | Parcel data = Parcel.obtain(); |
| 5252 | Parcel reply = Parcel.obtain(); |
| 5253 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5254 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5255 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5256 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5257 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5258 | reply.readException(); |
| 5259 | data.recycle(); |
| 5260 | reply.recycle(); |
| 5261 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5262 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 5263 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 5264 | Parcel data = Parcel.obtain(); |
| 5265 | Parcel reply = Parcel.obtain(); |
| 5266 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5267 | data.writeString(reason); |
| 5268 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 5269 | reply.readException(); |
| 5270 | data.recycle(); |
| 5271 | reply.recycle(); |
| 5272 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5273 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5274 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5275 | throws RemoteException { |
| 5276 | Parcel data = Parcel.obtain(); |
| 5277 | Parcel reply = Parcel.obtain(); |
| 5278 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5279 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5280 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 5281 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5282 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5283 | data.recycle(); |
| 5284 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5285 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5286 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 5287 | |
| 5288 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 5289 | Parcel data = Parcel.obtain(); |
| 5290 | Parcel reply = Parcel.obtain(); |
| 5291 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5292 | data.writeString(processName); |
| 5293 | data.writeInt(uid); |
| 5294 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 5295 | reply.readException(); |
| 5296 | data.recycle(); |
| 5297 | reply.recycle(); |
| 5298 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5299 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 5300 | public void overridePendingTransition(IBinder token, String packageName, |
| 5301 | int enterAnim, int exitAnim) throws RemoteException { |
| 5302 | Parcel data = Parcel.obtain(); |
| 5303 | Parcel reply = Parcel.obtain(); |
| 5304 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5305 | data.writeStrongBinder(token); |
| 5306 | data.writeString(packageName); |
| 5307 | data.writeInt(enterAnim); |
| 5308 | data.writeInt(exitAnim); |
| 5309 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 5310 | reply.readException(); |
| 5311 | data.recycle(); |
| 5312 | reply.recycle(); |
| 5313 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5314 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 5315 | public boolean isUserAMonkey() throws RemoteException { |
| 5316 | Parcel data = Parcel.obtain(); |
| 5317 | Parcel reply = Parcel.obtain(); |
| 5318 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5319 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 5320 | reply.readException(); |
| 5321 | boolean res = reply.readInt() != 0; |
| 5322 | data.recycle(); |
| 5323 | reply.recycle(); |
| 5324 | return res; |
| 5325 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 5326 | |
| 5327 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 5328 | Parcel data = Parcel.obtain(); |
| 5329 | Parcel reply = Parcel.obtain(); |
| 5330 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5331 | data.writeInt(monkey ? 1 : 0); |
| 5332 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 5333 | reply.readException(); |
| 5334 | data.recycle(); |
| 5335 | reply.recycle(); |
| 5336 | } |
| 5337 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 5338 | public void finishHeavyWeightApp() throws RemoteException { |
| 5339 | Parcel data = Parcel.obtain(); |
| 5340 | Parcel reply = Parcel.obtain(); |
| 5341 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5342 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 5343 | reply.readException(); |
| 5344 | data.recycle(); |
| 5345 | reply.recycle(); |
| 5346 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5347 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5348 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5349 | throws RemoteException { |
| 5350 | Parcel data = Parcel.obtain(); |
| 5351 | Parcel reply = Parcel.obtain(); |
| 5352 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5353 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5354 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 5355 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5356 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5357 | data.recycle(); |
| 5358 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5359 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5360 | } |
| 5361 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5362 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5363 | throws RemoteException { |
| 5364 | Parcel data = Parcel.obtain(); |
| 5365 | Parcel reply = Parcel.obtain(); |
| 5366 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5367 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5368 | if (options == null) { |
| 5369 | data.writeInt(0); |
| 5370 | } else { |
| 5371 | data.writeInt(1); |
| 5372 | data.writeBundle(options.toBundle()); |
| 5373 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5374 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5375 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5376 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5377 | data.recycle(); |
| 5378 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5379 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5380 | } |
| 5381 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5382 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 5383 | Parcel data = Parcel.obtain(); |
| 5384 | Parcel reply = Parcel.obtain(); |
| 5385 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5386 | data.writeStrongBinder(token); |
| 5387 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 5388 | reply.readException(); |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 5389 | ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle()); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5390 | data.recycle(); |
| 5391 | reply.recycle(); |
| 5392 | return options; |
| 5393 | } |
| 5394 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5395 | public void setImmersive(IBinder token, boolean immersive) |
| 5396 | throws RemoteException { |
| 5397 | Parcel data = Parcel.obtain(); |
| 5398 | Parcel reply = Parcel.obtain(); |
| 5399 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5400 | data.writeStrongBinder(token); |
| 5401 | data.writeInt(immersive ? 1 : 0); |
| 5402 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 5403 | reply.readException(); |
| 5404 | data.recycle(); |
| 5405 | reply.recycle(); |
| 5406 | } |
| 5407 | |
| 5408 | public boolean isImmersive(IBinder token) |
| 5409 | throws RemoteException { |
| 5410 | Parcel data = Parcel.obtain(); |
| 5411 | Parcel reply = Parcel.obtain(); |
| 5412 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5413 | data.writeStrongBinder(token); |
| 5414 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5415 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5416 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5417 | data.recycle(); |
| 5418 | reply.recycle(); |
| 5419 | return res; |
| 5420 | } |
| 5421 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5422 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 5423 | Parcel data = Parcel.obtain(); |
| 5424 | Parcel reply = Parcel.obtain(); |
| 5425 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5426 | data.writeStrongBinder(token); |
| 5427 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 5428 | reply.readException(); |
| 5429 | boolean res = reply.readInt() == 1; |
| 5430 | data.recycle(); |
| 5431 | reply.recycle(); |
| 5432 | return res; |
| 5433 | } |
| 5434 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5435 | public boolean isTopActivityImmersive() |
| 5436 | throws RemoteException { |
| 5437 | Parcel data = Parcel.obtain(); |
| 5438 | Parcel reply = Parcel.obtain(); |
| 5439 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5440 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5441 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5442 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5443 | data.recycle(); |
| 5444 | reply.recycle(); |
| 5445 | return res; |
| 5446 | } |
| 5447 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 5448 | public void crashApplication(int uid, int initialPid, String packageName, |
| 5449 | String message) throws RemoteException { |
| 5450 | Parcel data = Parcel.obtain(); |
| 5451 | Parcel reply = Parcel.obtain(); |
| 5452 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5453 | data.writeInt(uid); |
| 5454 | data.writeInt(initialPid); |
| 5455 | data.writeString(packageName); |
| 5456 | data.writeString(message); |
| 5457 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 5458 | reply.readException(); |
| 5459 | data.recycle(); |
| 5460 | reply.recycle(); |
| 5461 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5462 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5463 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5464 | Parcel data = Parcel.obtain(); |
| 5465 | Parcel reply = Parcel.obtain(); |
| 5466 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5467 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5468 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5469 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 5470 | reply.readException(); |
| 5471 | String res = reply.readString(); |
| 5472 | data.recycle(); |
| 5473 | reply.recycle(); |
| 5474 | return res; |
| 5475 | } |
| 5476 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5477 | public IBinder newUriPermissionOwner(String name) |
| 5478 | throws RemoteException { |
| 5479 | Parcel data = Parcel.obtain(); |
| 5480 | Parcel reply = Parcel.obtain(); |
| 5481 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5482 | data.writeString(name); |
| 5483 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 5484 | reply.readException(); |
| 5485 | IBinder res = reply.readStrongBinder(); |
| 5486 | data.recycle(); |
| 5487 | reply.recycle(); |
| 5488 | return res; |
| 5489 | } |
| 5490 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 5491 | public IBinder getUriPermissionOwnerForActivity(IBinder activityToken) throws RemoteException { |
| 5492 | Parcel data = Parcel.obtain(); |
| 5493 | Parcel reply = Parcel.obtain(); |
| 5494 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5495 | data.writeStrongBinder(activityToken); |
| 5496 | mRemote.transact(GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5497 | reply.readException(); |
| 5498 | IBinder res = reply.readStrongBinder(); |
| 5499 | data.recycle(); |
| 5500 | reply.recycle(); |
| 5501 | return res; |
| 5502 | } |
| 5503 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5504 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5505 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5506 | Parcel data = Parcel.obtain(); |
| 5507 | Parcel reply = Parcel.obtain(); |
| 5508 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5509 | data.writeStrongBinder(owner); |
| 5510 | data.writeInt(fromUid); |
| 5511 | data.writeString(targetPkg); |
| 5512 | uri.writeToParcel(data, 0); |
| 5513 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5514 | data.writeInt(sourceUserId); |
| 5515 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5516 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5517 | reply.readException(); |
| 5518 | data.recycle(); |
| 5519 | reply.recycle(); |
| 5520 | } |
| 5521 | |
| 5522 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5523 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5524 | Parcel data = Parcel.obtain(); |
| 5525 | Parcel reply = Parcel.obtain(); |
| 5526 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5527 | data.writeStrongBinder(owner); |
| 5528 | if (uri != null) { |
| 5529 | data.writeInt(1); |
| 5530 | uri.writeToParcel(data, 0); |
| 5531 | } else { |
| 5532 | data.writeInt(0); |
| 5533 | } |
| 5534 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5535 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5536 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5537 | reply.readException(); |
| 5538 | data.recycle(); |
| 5539 | reply.recycle(); |
| 5540 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 5541 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5542 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5543 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5544 | Parcel data = Parcel.obtain(); |
| 5545 | Parcel reply = Parcel.obtain(); |
| 5546 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5547 | data.writeInt(callingUid); |
| 5548 | data.writeString(targetPkg); |
| 5549 | uri.writeToParcel(data, 0); |
| 5550 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5551 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5552 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5553 | reply.readException(); |
| 5554 | int res = reply.readInt(); |
| 5555 | data.recycle(); |
| 5556 | reply.recycle(); |
| 5557 | return res; |
| 5558 | } |
| 5559 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5560 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5561 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 5562 | Parcel data = Parcel.obtain(); |
| 5563 | Parcel reply = Parcel.obtain(); |
| 5564 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5565 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5566 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5567 | data.writeInt(managed ? 1 : 0); |
| 5568 | data.writeString(path); |
| 5569 | if (fd != null) { |
| 5570 | data.writeInt(1); |
| 5571 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5572 | } else { |
| 5573 | data.writeInt(0); |
| 5574 | } |
| 5575 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 5576 | reply.readException(); |
| 5577 | boolean res = reply.readInt() != 0; |
| 5578 | reply.recycle(); |
| 5579 | data.recycle(); |
| 5580 | return res; |
| 5581 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5582 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5583 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5584 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5585 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5586 | Parcel data = Parcel.obtain(); |
| 5587 | Parcel reply = Parcel.obtain(); |
| 5588 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5589 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5590 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5591 | data.writeTypedArray(intents, 0); |
| 5592 | data.writeStringArray(resolvedTypes); |
| 5593 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5594 | if (options != null) { |
| 5595 | data.writeInt(1); |
| 5596 | options.writeToParcel(data, 0); |
| 5597 | } else { |
| 5598 | data.writeInt(0); |
| 5599 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5600 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5601 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 5602 | reply.readException(); |
| 5603 | int result = reply.readInt(); |
| 5604 | reply.recycle(); |
| 5605 | data.recycle(); |
| 5606 | return result; |
| 5607 | } |
| 5608 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5609 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 5610 | Parcel data = Parcel.obtain(); |
| 5611 | Parcel reply = Parcel.obtain(); |
| 5612 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5613 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5614 | reply.readException(); |
| 5615 | int mode = reply.readInt(); |
| 5616 | reply.recycle(); |
| 5617 | data.recycle(); |
| 5618 | return mode; |
| 5619 | } |
| 5620 | |
| 5621 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 5622 | Parcel data = Parcel.obtain(); |
| 5623 | Parcel reply = Parcel.obtain(); |
| 5624 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5625 | data.writeInt(mode); |
| 5626 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5627 | reply.readException(); |
| 5628 | reply.recycle(); |
| 5629 | data.recycle(); |
| 5630 | } |
| 5631 | |
| 5632 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 5633 | Parcel data = Parcel.obtain(); |
| 5634 | Parcel reply = Parcel.obtain(); |
| 5635 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5636 | data.writeString(packageName); |
| 5637 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5638 | reply.readException(); |
| 5639 | int mode = reply.readInt(); |
| 5640 | reply.recycle(); |
| 5641 | data.recycle(); |
| 5642 | return mode; |
| 5643 | } |
| 5644 | |
| 5645 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5646 | throws RemoteException { |
| 5647 | Parcel data = Parcel.obtain(); |
| 5648 | Parcel reply = Parcel.obtain(); |
| 5649 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5650 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5651 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5652 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5653 | reply.readException(); |
| 5654 | reply.recycle(); |
| 5655 | data.recycle(); |
| 5656 | } |
| 5657 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5658 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 5659 | Parcel data = Parcel.obtain(); |
| 5660 | Parcel reply = Parcel.obtain(); |
| 5661 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5662 | data.writeString(packageName); |
| 5663 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5664 | reply.readException(); |
| 5665 | boolean ask = reply.readInt() != 0; |
| 5666 | reply.recycle(); |
| 5667 | data.recycle(); |
| 5668 | return ask; |
| 5669 | } |
| 5670 | |
| 5671 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 5672 | throws RemoteException { |
| 5673 | Parcel data = Parcel.obtain(); |
| 5674 | Parcel reply = Parcel.obtain(); |
| 5675 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5676 | data.writeString(packageName); |
| 5677 | data.writeInt(ask ? 1 : 0); |
| 5678 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5679 | reply.readException(); |
| 5680 | reply.recycle(); |
| 5681 | data.recycle(); |
| 5682 | } |
| 5683 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5684 | public boolean switchUser(int userid) throws RemoteException { |
| 5685 | Parcel data = Parcel.obtain(); |
| 5686 | Parcel reply = Parcel.obtain(); |
| 5687 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5688 | data.writeInt(userid); |
| 5689 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 5690 | reply.readException(); |
| 5691 | boolean result = reply.readInt() != 0; |
| 5692 | reply.recycle(); |
| 5693 | data.recycle(); |
| 5694 | return result; |
| 5695 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5696 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 5697 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 5698 | Parcel data = Parcel.obtain(); |
| 5699 | Parcel reply = Parcel.obtain(); |
| 5700 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5701 | data.writeInt(userid); |
| 5702 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 5703 | reply.readException(); |
| 5704 | boolean result = reply.readInt() != 0; |
| 5705 | reply.recycle(); |
| 5706 | data.recycle(); |
| 5707 | return result; |
| 5708 | } |
| 5709 | |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5710 | public boolean unlockUser(int userId, byte[] token, byte[] secret) throws RemoteException { |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5711 | Parcel data = Parcel.obtain(); |
| 5712 | Parcel reply = Parcel.obtain(); |
| 5713 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5714 | data.writeInt(userId); |
| 5715 | data.writeByteArray(token); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5716 | data.writeByteArray(secret); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5717 | mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0); |
| 5718 | reply.readException(); |
| 5719 | boolean result = reply.readInt() != 0; |
| 5720 | reply.recycle(); |
| 5721 | data.recycle(); |
| 5722 | return result; |
| 5723 | } |
| 5724 | |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5725 | public int stopUser(int userid, boolean force, IStopUserCallback callback) |
| 5726 | throws RemoteException { |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5727 | Parcel data = Parcel.obtain(); |
| 5728 | Parcel reply = Parcel.obtain(); |
| 5729 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5730 | data.writeInt(userid); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5731 | data.writeInt(force ? 1 : 0); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5732 | data.writeStrongInterface(callback); |
| 5733 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 5734 | reply.readException(); |
| 5735 | int result = reply.readInt(); |
| 5736 | reply.recycle(); |
| 5737 | data.recycle(); |
| 5738 | return result; |
| 5739 | } |
| 5740 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5741 | public UserInfo getCurrentUser() throws RemoteException { |
| 5742 | Parcel data = Parcel.obtain(); |
| 5743 | Parcel reply = Parcel.obtain(); |
| 5744 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5745 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5746 | reply.readException(); |
| 5747 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 5748 | reply.recycle(); |
| 5749 | data.recycle(); |
| 5750 | return userInfo; |
| 5751 | } |
| 5752 | |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5753 | public boolean isUserRunning(int userid, int flags) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5754 | Parcel data = Parcel.obtain(); |
| 5755 | Parcel reply = Parcel.obtain(); |
| 5756 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5757 | data.writeInt(userid); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5758 | data.writeInt(flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5759 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5760 | reply.readException(); |
| 5761 | boolean result = reply.readInt() != 0; |
| 5762 | reply.recycle(); |
| 5763 | data.recycle(); |
| 5764 | return result; |
| 5765 | } |
| 5766 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5767 | public int[] getRunningUserIds() throws RemoteException { |
| 5768 | Parcel data = Parcel.obtain(); |
| 5769 | Parcel reply = Parcel.obtain(); |
| 5770 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5771 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5772 | reply.readException(); |
| 5773 | int[] result = reply.createIntArray(); |
| 5774 | reply.recycle(); |
| 5775 | data.recycle(); |
| 5776 | return result; |
| 5777 | } |
| 5778 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5779 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5780 | Parcel data = Parcel.obtain(); |
| 5781 | Parcel reply = Parcel.obtain(); |
| 5782 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5783 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5784 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5785 | reply.readException(); |
| 5786 | boolean result = reply.readInt() != 0; |
| 5787 | reply.recycle(); |
| 5788 | data.recycle(); |
| 5789 | return result; |
| 5790 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5791 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5792 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5793 | Parcel data = Parcel.obtain(); |
| 5794 | Parcel reply = Parcel.obtain(); |
| 5795 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5796 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5797 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5798 | reply.readException(); |
| 5799 | data.recycle(); |
| 5800 | reply.recycle(); |
| 5801 | } |
| 5802 | |
| 5803 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5804 | Parcel data = Parcel.obtain(); |
| 5805 | Parcel reply = Parcel.obtain(); |
| 5806 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5807 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5808 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5809 | reply.readException(); |
| 5810 | data.recycle(); |
| 5811 | reply.recycle(); |
| 5812 | } |
| 5813 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5814 | public void registerUidObserver(IUidObserver observer, int which) throws RemoteException { |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5815 | Parcel data = Parcel.obtain(); |
| 5816 | Parcel reply = Parcel.obtain(); |
| 5817 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5818 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5819 | data.writeInt(which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5820 | mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5821 | reply.readException(); |
| 5822 | data.recycle(); |
| 5823 | reply.recycle(); |
| 5824 | } |
| 5825 | |
| 5826 | public void unregisterUidObserver(IUidObserver observer) throws RemoteException { |
| 5827 | Parcel data = Parcel.obtain(); |
| 5828 | Parcel reply = Parcel.obtain(); |
| 5829 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5830 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5831 | mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5832 | reply.readException(); |
| 5833 | data.recycle(); |
| 5834 | reply.recycle(); |
| 5835 | } |
| 5836 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5837 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5838 | Parcel data = Parcel.obtain(); |
| 5839 | Parcel reply = Parcel.obtain(); |
| 5840 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5841 | data.writeStrongBinder(sender.asBinder()); |
| 5842 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5843 | reply.readException(); |
| 5844 | boolean res = reply.readInt() != 0; |
| 5845 | data.recycle(); |
| 5846 | reply.recycle(); |
| 5847 | return res; |
| 5848 | } |
| 5849 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5850 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5851 | Parcel data = Parcel.obtain(); |
| 5852 | Parcel reply = Parcel.obtain(); |
| 5853 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5854 | data.writeStrongBinder(sender.asBinder()); |
| 5855 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5856 | reply.readException(); |
| 5857 | boolean res = reply.readInt() != 0; |
| 5858 | data.recycle(); |
| 5859 | reply.recycle(); |
| 5860 | return res; |
| 5861 | } |
| 5862 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5863 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5864 | Parcel data = Parcel.obtain(); |
| 5865 | Parcel reply = Parcel.obtain(); |
| 5866 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5867 | data.writeStrongBinder(sender.asBinder()); |
| 5868 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5869 | reply.readException(); |
| 5870 | Intent res = reply.readInt() != 0 |
| 5871 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5872 | data.recycle(); |
| 5873 | reply.recycle(); |
| 5874 | return res; |
| 5875 | } |
| 5876 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5877 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5878 | throws RemoteException { |
| 5879 | Parcel data = Parcel.obtain(); |
| 5880 | Parcel reply = Parcel.obtain(); |
| 5881 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5882 | data.writeStrongBinder(sender.asBinder()); |
| 5883 | data.writeString(prefix); |
| 5884 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5885 | reply.readException(); |
| 5886 | String res = reply.readString(); |
| 5887 | data.recycle(); |
| 5888 | reply.recycle(); |
| 5889 | return res; |
| 5890 | } |
| 5891 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5892 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5893 | { |
| 5894 | Parcel data = Parcel.obtain(); |
| 5895 | Parcel reply = Parcel.obtain(); |
| 5896 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5897 | values.writeToParcel(data, 0); |
| 5898 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5899 | reply.readException(); |
| 5900 | data.recycle(); |
| 5901 | reply.recycle(); |
| 5902 | } |
| 5903 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 5904 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 5905 | Parcel data = Parcel.obtain(); |
| 5906 | Parcel reply = Parcel.obtain(); |
| 5907 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5908 | data.writeIntArray(pids); |
| 5909 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 5910 | reply.readException(); |
| 5911 | long[] res = reply.createLongArray(); |
| 5912 | data.recycle(); |
| 5913 | reply.recycle(); |
| 5914 | return res; |
| 5915 | } |
| 5916 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5917 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5918 | Parcel data = Parcel.obtain(); |
| 5919 | Parcel reply = Parcel.obtain(); |
| 5920 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5921 | TextUtils.writeToParcel(msg, data, 0); |
| 5922 | data.writeInt(always ? 1 : 0); |
| 5923 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5924 | reply.readException(); |
| 5925 | data.recycle(); |
| 5926 | reply.recycle(); |
| 5927 | } |
| 5928 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5929 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5930 | Parcel data = Parcel.obtain(); |
| 5931 | Parcel reply = Parcel.obtain(); |
| 5932 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5933 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5934 | reply.readException(); |
| 5935 | data.recycle(); |
| 5936 | reply.recycle(); |
| 5937 | } |
| 5938 | |
Adrian Roos | d5c2db6 | 2016-03-08 16:11:31 -0800 | [diff] [blame] | 5939 | public void keyguardGoingAway(int flags) |
| 5940 | throws RemoteException { |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5941 | Parcel data = Parcel.obtain(); |
| 5942 | Parcel reply = Parcel.obtain(); |
| 5943 | data.writeInterfaceToken(IActivityManager.descriptor); |
Adrian Roos | d5c2db6 | 2016-03-08 16:11:31 -0800 | [diff] [blame] | 5944 | data.writeInt(flags); |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5945 | mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0); |
| 5946 | reply.readException(); |
| 5947 | data.recycle(); |
| 5948 | reply.recycle(); |
| 5949 | } |
| 5950 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5951 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5952 | throws RemoteException { |
| 5953 | Parcel data = Parcel.obtain(); |
| 5954 | Parcel reply = Parcel.obtain(); |
| 5955 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5956 | data.writeStrongBinder(token); |
| 5957 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5958 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5959 | reply.readException(); |
| 5960 | boolean result = reply.readInt() != 0; |
| 5961 | data.recycle(); |
| 5962 | reply.recycle(); |
| 5963 | return result; |
| 5964 | } |
| 5965 | |
| 5966 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5967 | throws RemoteException { |
| 5968 | Parcel data = Parcel.obtain(); |
| 5969 | Parcel reply = Parcel.obtain(); |
| 5970 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5971 | data.writeStrongBinder(token); |
| 5972 | target.writeToParcel(data, 0); |
| 5973 | data.writeInt(resultCode); |
| 5974 | if (resultData != null) { |
| 5975 | data.writeInt(1); |
| 5976 | resultData.writeToParcel(data, 0); |
| 5977 | } else { |
| 5978 | data.writeInt(0); |
| 5979 | } |
| 5980 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5981 | reply.readException(); |
| 5982 | boolean result = reply.readInt() != 0; |
| 5983 | data.recycle(); |
| 5984 | reply.recycle(); |
| 5985 | return result; |
| 5986 | } |
| 5987 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5988 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5989 | Parcel data = Parcel.obtain(); |
| 5990 | Parcel reply = Parcel.obtain(); |
| 5991 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5992 | data.writeStrongBinder(activityToken); |
| 5993 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5994 | reply.readException(); |
| 5995 | int result = reply.readInt(); |
| 5996 | data.recycle(); |
| 5997 | reply.recycle(); |
| 5998 | return result; |
| 5999 | } |
| 6000 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 6001 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 6002 | Parcel data = Parcel.obtain(); |
| 6003 | Parcel reply = Parcel.obtain(); |
| 6004 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6005 | data.writeStrongBinder(activityToken); |
| 6006 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 6007 | reply.readException(); |
| 6008 | String result = reply.readString(); |
| 6009 | data.recycle(); |
| 6010 | reply.recycle(); |
| 6011 | return result; |
| 6012 | } |
| 6013 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 6014 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 6015 | Parcel data = Parcel.obtain(); |
| 6016 | Parcel reply = Parcel.obtain(); |
| 6017 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6018 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 6019 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 6020 | reply.readException(); |
| 6021 | data.recycle(); |
| 6022 | reply.recycle(); |
| 6023 | } |
| 6024 | |
| 6025 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 6026 | Parcel data = Parcel.obtain(); |
| 6027 | Parcel reply = Parcel.obtain(); |
| 6028 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6029 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 6030 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 6031 | reply.readException(); |
| 6032 | data.recycle(); |
| 6033 | reply.recycle(); |
| 6034 | } |
| 6035 | |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 6036 | public void requestBugReport(@ActivityManager.BugreportMode int bugreportType) |
| 6037 | throws RemoteException { |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 6038 | Parcel data = Parcel.obtain(); |
| 6039 | Parcel reply = Parcel.obtain(); |
| 6040 | data.writeInterfaceToken(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 6041 | data.writeInt(bugreportType); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 6042 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 6043 | reply.readException(); |
| 6044 | data.recycle(); |
| 6045 | reply.recycle(); |
| 6046 | } |
| 6047 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 6048 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 6049 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 6050 | Parcel data = Parcel.obtain(); |
| 6051 | Parcel reply = Parcel.obtain(); |
| 6052 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6053 | data.writeInt(pid); |
| 6054 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 6055 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 6056 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 6057 | reply.readException(); |
| 6058 | long res = reply.readInt(); |
| 6059 | data.recycle(); |
| 6060 | reply.recycle(); |
| 6061 | return res; |
| 6062 | } |
| 6063 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6064 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6065 | Parcel data = Parcel.obtain(); |
| 6066 | Parcel reply = Parcel.obtain(); |
| 6067 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6068 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6069 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6070 | reply.readException(); |
| 6071 | Bundle res = reply.readBundle(); |
| 6072 | data.recycle(); |
| 6073 | reply.recycle(); |
| 6074 | return res; |
| 6075 | } |
| 6076 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6077 | public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, |
| 6078 | IBinder activityToken) throws RemoteException { |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6079 | Parcel data = Parcel.obtain(); |
| 6080 | Parcel reply = Parcel.obtain(); |
| 6081 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6082 | data.writeInt(requestType); |
| 6083 | data.writeStrongBinder(receiver.asBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6084 | data.writeStrongBinder(activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6085 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 6086 | reply.readException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6087 | boolean res = reply.readInt() != 0; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6088 | data.recycle(); |
| 6089 | reply.recycle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6090 | return res; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6091 | } |
| 6092 | |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 6093 | public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 6094 | AssistContent content, Uri referrer) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6095 | Parcel data = Parcel.obtain(); |
| 6096 | Parcel reply = Parcel.obtain(); |
| 6097 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6098 | data.writeStrongBinder(token); |
| 6099 | data.writeBundle(extras); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 6100 | structure.writeToParcel(data, 0); |
| 6101 | content.writeToParcel(data, 0); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 6102 | if (referrer != null) { |
| 6103 | data.writeInt(1); |
| 6104 | referrer.writeToParcel(data, 0); |
| 6105 | } else { |
| 6106 | data.writeInt(0); |
| 6107 | } |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6108 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6109 | reply.readException(); |
| 6110 | data.recycle(); |
| 6111 | reply.recycle(); |
| 6112 | } |
| 6113 | |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6114 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, |
| 6115 | Bundle args) throws RemoteException { |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6116 | Parcel data = Parcel.obtain(); |
| 6117 | Parcel reply = Parcel.obtain(); |
| 6118 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6119 | intent.writeToParcel(data, 0); |
| 6120 | data.writeInt(requestType); |
| 6121 | data.writeString(hint); |
| 6122 | data.writeInt(userHandle); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6123 | data.writeBundle(args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6124 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 6125 | reply.readException(); |
| 6126 | boolean res = reply.readInt() != 0; |
| 6127 | data.recycle(); |
| 6128 | reply.recycle(); |
| 6129 | return res; |
| 6130 | } |
| 6131 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6132 | public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException { |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 6133 | Parcel data = Parcel.obtain(); |
| 6134 | Parcel reply = Parcel.obtain(); |
| 6135 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6136 | mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6137 | reply.readException(); |
| 6138 | boolean res = reply.readInt() != 0; |
| 6139 | data.recycle(); |
| 6140 | reply.recycle(); |
| 6141 | return res; |
| 6142 | } |
| 6143 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6144 | public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException { |
| 6145 | Parcel data = Parcel.obtain(); |
| 6146 | Parcel reply = Parcel.obtain(); |
| 6147 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6148 | data.writeStrongBinder(token); |
| 6149 | data.writeBundle(args); |
| 6150 | mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6151 | reply.readException(); |
| 6152 | boolean res = reply.readInt() != 0; |
| 6153 | data.recycle(); |
| 6154 | reply.recycle(); |
| 6155 | return res; |
| 6156 | } |
| 6157 | |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6158 | public void killUid(int appId, int userId, String reason) throws RemoteException { |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6159 | Parcel data = Parcel.obtain(); |
| 6160 | Parcel reply = Parcel.obtain(); |
| 6161 | data.writeInterfaceToken(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6162 | data.writeInt(appId); |
| 6163 | data.writeInt(userId); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6164 | data.writeString(reason); |
| 6165 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 6166 | reply.readException(); |
| 6167 | data.recycle(); |
| 6168 | reply.recycle(); |
| 6169 | } |
| 6170 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 6171 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 6172 | Parcel data = Parcel.obtain(); |
| 6173 | Parcel reply = Parcel.obtain(); |
| 6174 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6175 | data.writeStrongBinder(who); |
| 6176 | data.writeInt(allowRestart ? 1 : 0); |
| 6177 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 6178 | reply.readException(); |
| 6179 | data.recycle(); |
| 6180 | reply.recycle(); |
| 6181 | } |
| 6182 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 6183 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 6184 | Parcel data = Parcel.obtain(); |
| 6185 | Parcel reply = Parcel.obtain(); |
| 6186 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6187 | data.writeStrongBinder(token); |
| 6188 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 6189 | reply.readException(); |
| 6190 | data.recycle(); |
| 6191 | reply.recycle(); |
| 6192 | } |
| 6193 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 6194 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 6195 | Parcel data = Parcel.obtain(); |
| 6196 | Parcel reply = Parcel.obtain(); |
| 6197 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6198 | data.writeStrongBinder(token); |
| 6199 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 6200 | reply.readException(); |
| 6201 | data.recycle(); |
| 6202 | reply.recycle(); |
| 6203 | } |
| 6204 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 6205 | public void restart() throws RemoteException { |
| 6206 | Parcel data = Parcel.obtain(); |
| 6207 | Parcel reply = Parcel.obtain(); |
| 6208 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6209 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 6210 | reply.readException(); |
| 6211 | data.recycle(); |
| 6212 | reply.recycle(); |
| 6213 | } |
| 6214 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 6215 | public void performIdleMaintenance() throws RemoteException { |
| 6216 | Parcel data = Parcel.obtain(); |
| 6217 | Parcel reply = Parcel.obtain(); |
| 6218 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6219 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 6220 | reply.readException(); |
| 6221 | data.recycle(); |
| 6222 | reply.recycle(); |
| 6223 | } |
| 6224 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6225 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6226 | IActivityContainerCallback callback) throws RemoteException { |
| 6227 | Parcel data = Parcel.obtain(); |
| 6228 | Parcel reply = Parcel.obtain(); |
| 6229 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6230 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 6231 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6232 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6233 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 6234 | final int result = reply.readInt(); |
| 6235 | final IActivityContainer res; |
| 6236 | if (result == 1) { |
| 6237 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6238 | } else { |
| 6239 | res = null; |
| 6240 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6241 | data.recycle(); |
| 6242 | reply.recycle(); |
| 6243 | return res; |
| 6244 | } |
| 6245 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 6246 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 6247 | throws RemoteException { |
| 6248 | Parcel data = Parcel.obtain(); |
| 6249 | Parcel reply = Parcel.obtain(); |
| 6250 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6251 | data.writeStrongBinder(activityContainer.asBinder()); |
| 6252 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 6253 | reply.readException(); |
| 6254 | data.recycle(); |
| 6255 | reply.recycle(); |
| 6256 | } |
| 6257 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 6258 | public boolean startBinderTracking() throws RemoteException { |
| 6259 | Parcel data = Parcel.obtain(); |
| 6260 | Parcel reply = Parcel.obtain(); |
| 6261 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6262 | mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0); |
| 6263 | reply.readException(); |
| 6264 | boolean res = reply.readInt() != 0; |
| 6265 | reply.recycle(); |
| 6266 | data.recycle(); |
| 6267 | return res; |
| 6268 | } |
| 6269 | |
| 6270 | public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException { |
| 6271 | Parcel data = Parcel.obtain(); |
| 6272 | Parcel reply = Parcel.obtain(); |
| 6273 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6274 | if (fd != null) { |
| 6275 | data.writeInt(1); |
| 6276 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 6277 | } else { |
| 6278 | data.writeInt(0); |
| 6279 | } |
| 6280 | mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0); |
| 6281 | reply.readException(); |
| 6282 | boolean res = reply.readInt() != 0; |
| 6283 | reply.recycle(); |
| 6284 | data.recycle(); |
| 6285 | return res; |
| 6286 | } |
| 6287 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6288 | public int setVrMode(IBinder token, boolean enabled, ComponentName packageName) |
| 6289 | throws RemoteException { |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6290 | Parcel data = Parcel.obtain(); |
| 6291 | Parcel reply = Parcel.obtain(); |
| 6292 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6293 | data.writeStrongBinder(token); |
| 6294 | data.writeInt(enabled ? 1 : 0); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6295 | packageName.writeToParcel(data, 0); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6296 | mRemote.transact(SET_VR_MODE_TRANSACTION, data, reply, 0); |
| 6297 | reply.readException(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6298 | int res = reply.readInt(); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6299 | data.recycle(); |
| 6300 | reply.recycle(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6301 | return res; |
| 6302 | } |
| 6303 | |
| 6304 | public boolean isVrModePackageEnabled(ComponentName packageName) |
| 6305 | throws RemoteException { |
| 6306 | Parcel data = Parcel.obtain(); |
| 6307 | Parcel reply = Parcel.obtain(); |
| 6308 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6309 | packageName.writeToParcel(data, 0); |
| 6310 | mRemote.transact(IS_VR_PACKAGE_ENABLED_TRANSACTION, data, reply, 0); |
| 6311 | reply.readException(); |
| 6312 | int res = reply.readInt(); |
| 6313 | data.recycle(); |
| 6314 | reply.recycle(); |
| 6315 | return res == 1; |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6316 | } |
| 6317 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6318 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 6319 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 6320 | Parcel data = Parcel.obtain(); |
| 6321 | Parcel reply = Parcel.obtain(); |
| 6322 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6323 | data.writeInt(displayId); |
| 6324 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 6325 | reply.readException(); |
| 6326 | final int result = reply.readInt(); |
| 6327 | final IActivityContainer res; |
| 6328 | if (result == 1) { |
| 6329 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6330 | } else { |
| 6331 | res = null; |
| 6332 | } |
| 6333 | data.recycle(); |
| 6334 | reply.recycle(); |
| 6335 | return res; |
| 6336 | } |
| 6337 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6338 | @Override |
| 6339 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6340 | throws RemoteException { |
| 6341 | Parcel data = Parcel.obtain(); |
| 6342 | Parcel reply = Parcel.obtain(); |
| 6343 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6344 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6345 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6346 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6347 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6348 | data.recycle(); |
| 6349 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6350 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6351 | } |
| 6352 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6353 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6354 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 6355 | Parcel data = Parcel.obtain(); |
| 6356 | Parcel reply = Parcel.obtain(); |
| 6357 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6358 | data.writeInt(taskId); |
| 6359 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 6360 | reply.readException(); |
| 6361 | data.recycle(); |
| 6362 | reply.recycle(); |
| 6363 | } |
| 6364 | |
| 6365 | @Override |
| 6366 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 6367 | Parcel data = Parcel.obtain(); |
| 6368 | Parcel reply = Parcel.obtain(); |
| 6369 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6370 | data.writeStrongBinder(token); |
| 6371 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 6372 | reply.readException(); |
| 6373 | data.recycle(); |
| 6374 | reply.recycle(); |
| 6375 | } |
| 6376 | |
| 6377 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6378 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 6379 | Parcel data = Parcel.obtain(); |
| 6380 | Parcel reply = Parcel.obtain(); |
| 6381 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6382 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6383 | reply.readException(); |
| 6384 | data.recycle(); |
| 6385 | reply.recycle(); |
| 6386 | } |
| 6387 | |
| 6388 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6389 | public void stopLockTaskMode() throws RemoteException { |
| 6390 | Parcel data = Parcel.obtain(); |
| 6391 | Parcel reply = Parcel.obtain(); |
| 6392 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6393 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6394 | reply.readException(); |
| 6395 | data.recycle(); |
| 6396 | reply.recycle(); |
| 6397 | } |
| 6398 | |
| 6399 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6400 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 6401 | Parcel data = Parcel.obtain(); |
| 6402 | Parcel reply = Parcel.obtain(); |
| 6403 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6404 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6405 | reply.readException(); |
| 6406 | data.recycle(); |
| 6407 | reply.recycle(); |
| 6408 | } |
| 6409 | |
| 6410 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6411 | public boolean isInLockTaskMode() throws RemoteException { |
| 6412 | Parcel data = Parcel.obtain(); |
| 6413 | Parcel reply = Parcel.obtain(); |
| 6414 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6415 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6416 | reply.readException(); |
| 6417 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 6418 | data.recycle(); |
| 6419 | reply.recycle(); |
| 6420 | return isInLockTaskMode; |
| 6421 | } |
| 6422 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 6423 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 6424 | public int getLockTaskModeState() throws RemoteException { |
| 6425 | Parcel data = Parcel.obtain(); |
| 6426 | Parcel reply = Parcel.obtain(); |
| 6427 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6428 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 6429 | reply.readException(); |
| 6430 | int lockTaskModeState = reply.readInt(); |
| 6431 | data.recycle(); |
| 6432 | reply.recycle(); |
| 6433 | return lockTaskModeState; |
| 6434 | } |
| 6435 | |
| 6436 | @Override |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 6437 | public void showLockTaskEscapeMessage(IBinder token) throws RemoteException { |
| 6438 | Parcel data = Parcel.obtain(); |
| 6439 | Parcel reply = Parcel.obtain(); |
| 6440 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6441 | data.writeStrongBinder(token); |
| 6442 | mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply, |
| 6443 | IBinder.FLAG_ONEWAY); |
| 6444 | reply.readException(); |
| 6445 | data.recycle(); |
| 6446 | reply.recycle(); |
| 6447 | } |
| 6448 | |
| 6449 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 6450 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6451 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6452 | Parcel data = Parcel.obtain(); |
| 6453 | Parcel reply = Parcel.obtain(); |
| 6454 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6455 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6456 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6457 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6458 | reply.readException(); |
| 6459 | data.recycle(); |
| 6460 | reply.recycle(); |
| 6461 | } |
| 6462 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6463 | @Override |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6464 | public void setTaskResizeable(int taskId, int resizeableMode) throws RemoteException { |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6465 | Parcel data = Parcel.obtain(); |
| 6466 | Parcel reply = Parcel.obtain(); |
| 6467 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6468 | data.writeInt(taskId); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6469 | data.writeInt(resizeableMode); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6470 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6471 | reply.readException(); |
| 6472 | data.recycle(); |
| 6473 | reply.recycle(); |
| 6474 | } |
| 6475 | |
| 6476 | @Override |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6477 | public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6478 | { |
| 6479 | Parcel data = Parcel.obtain(); |
| 6480 | Parcel reply = Parcel.obtain(); |
| 6481 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6482 | data.writeInt(taskId); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6483 | data.writeInt(resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6484 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6485 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6486 | reply.readException(); |
| 6487 | data.recycle(); |
| 6488 | reply.recycle(); |
| 6489 | } |
| 6490 | |
| 6491 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 6492 | public Rect getTaskBounds(int taskId) throws RemoteException |
| 6493 | { |
| 6494 | Parcel data = Parcel.obtain(); |
| 6495 | Parcel reply = Parcel.obtain(); |
| 6496 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6497 | data.writeInt(taskId); |
| 6498 | mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0); |
| 6499 | reply.readException(); |
| 6500 | Rect rect = Rect.CREATOR.createFromParcel(reply); |
| 6501 | data.recycle(); |
| 6502 | reply.recycle(); |
| 6503 | return rect; |
| 6504 | } |
| 6505 | |
| 6506 | @Override |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6507 | public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException { |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6508 | Parcel data = Parcel.obtain(); |
| 6509 | Parcel reply = Parcel.obtain(); |
| 6510 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6511 | data.writeString(filename); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6512 | data.writeInt(userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6513 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 6514 | reply.readException(); |
| 6515 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 6516 | data.recycle(); |
| 6517 | reply.recycle(); |
| 6518 | return icon; |
| 6519 | } |
| 6520 | |
| 6521 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6522 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 6523 | throws RemoteException { |
| 6524 | Parcel data = Parcel.obtain(); |
| 6525 | Parcel reply = Parcel.obtain(); |
| 6526 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6527 | if (options == null) { |
| 6528 | data.writeInt(0); |
| 6529 | } else { |
| 6530 | data.writeInt(1); |
| 6531 | data.writeBundle(options.toBundle()); |
| 6532 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6533 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6534 | reply.readException(); |
| 6535 | data.recycle(); |
| 6536 | reply.recycle(); |
| 6537 | } |
| 6538 | |
| 6539 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6540 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6541 | Parcel data = Parcel.obtain(); |
| 6542 | Parcel reply = Parcel.obtain(); |
| 6543 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6544 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6545 | data.writeInt(visible ? 1 : 0); |
| 6546 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6547 | reply.readException(); |
| 6548 | boolean success = reply.readInt() > 0; |
| 6549 | data.recycle(); |
| 6550 | reply.recycle(); |
| 6551 | return success; |
| 6552 | } |
| 6553 | |
| 6554 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6555 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6556 | Parcel data = Parcel.obtain(); |
| 6557 | Parcel reply = Parcel.obtain(); |
| 6558 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6559 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6560 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6561 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6562 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6563 | data.recycle(); |
| 6564 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6565 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6566 | } |
| 6567 | |
| 6568 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6569 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6570 | Parcel data = Parcel.obtain(); |
| 6571 | Parcel reply = Parcel.obtain(); |
| 6572 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6573 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6574 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 6575 | reply.readException(); |
| 6576 | data.recycle(); |
| 6577 | reply.recycle(); |
| 6578 | } |
| 6579 | |
| 6580 | @Override |
| 6581 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 6582 | Parcel data = Parcel.obtain(); |
| 6583 | Parcel reply = Parcel.obtain(); |
| 6584 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6585 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6586 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6587 | reply.readException(); |
| 6588 | data.recycle(); |
| 6589 | reply.recycle(); |
| 6590 | } |
| 6591 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6592 | @Override |
| 6593 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 6594 | Parcel data = Parcel.obtain(); |
| 6595 | Parcel reply = Parcel.obtain(); |
| 6596 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6597 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6598 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6599 | reply.readException(); |
| 6600 | data.recycle(); |
| 6601 | reply.recycle(); |
| 6602 | } |
| 6603 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 6604 | @Override |
| 6605 | public void bootAnimationComplete() throws RemoteException { |
| 6606 | Parcel data = Parcel.obtain(); |
| 6607 | Parcel reply = Parcel.obtain(); |
| 6608 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6609 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 6610 | reply.readException(); |
| 6611 | data.recycle(); |
| 6612 | reply.recycle(); |
| 6613 | } |
| 6614 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 6615 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 6616 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 6617 | Parcel data = Parcel.obtain(); |
| 6618 | Parcel reply = Parcel.obtain(); |
| 6619 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6620 | data.writeInt(uid); |
| 6621 | data.writeByteArray(firstPacket); |
| 6622 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 6623 | reply.readException(); |
| 6624 | data.recycle(); |
| 6625 | reply.recycle(); |
| 6626 | } |
| 6627 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6628 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6629 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 6630 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6631 | Parcel data = Parcel.obtain(); |
| 6632 | Parcel reply = Parcel.obtain(); |
| 6633 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6634 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6635 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6636 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6637 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6638 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 6639 | reply.readException(); |
| 6640 | data.recycle(); |
| 6641 | reply.recycle(); |
| 6642 | } |
| 6643 | |
| 6644 | @Override |
| 6645 | public void dumpHeapFinished(String path) throws RemoteException { |
| 6646 | Parcel data = Parcel.obtain(); |
| 6647 | Parcel reply = Parcel.obtain(); |
| 6648 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6649 | data.writeString(path); |
| 6650 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 6651 | reply.readException(); |
| 6652 | data.recycle(); |
| 6653 | reply.recycle(); |
| 6654 | } |
| 6655 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 6656 | @Override |
| 6657 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 6658 | throws RemoteException { |
| 6659 | Parcel data = Parcel.obtain(); |
| 6660 | Parcel reply = Parcel.obtain(); |
| 6661 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6662 | data.writeStrongBinder(session.asBinder()); |
| 6663 | data.writeInt(keepAwake ? 1 : 0); |
| 6664 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 6665 | reply.readException(); |
| 6666 | data.recycle(); |
| 6667 | reply.recycle(); |
| 6668 | } |
| 6669 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6670 | @Override |
| 6671 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 6672 | Parcel data = Parcel.obtain(); |
| 6673 | Parcel reply = Parcel.obtain(); |
| 6674 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6675 | data.writeInt(userId); |
| 6676 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6677 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6678 | reply.readException(); |
| 6679 | data.recycle(); |
| 6680 | reply.recycle(); |
| 6681 | } |
| 6682 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6683 | @Override |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 6684 | public void updateDeviceOwner(String packageName) throws RemoteException { |
| 6685 | Parcel data = Parcel.obtain(); |
| 6686 | Parcel reply = Parcel.obtain(); |
| 6687 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6688 | data.writeString(packageName); |
| 6689 | mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0); |
| 6690 | reply.readException(); |
| 6691 | data.recycle(); |
| 6692 | reply.recycle(); |
| 6693 | } |
| 6694 | |
| 6695 | @Override |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6696 | public int getPackageProcessState(String packageName, String callingPackage) |
| 6697 | throws RemoteException { |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6698 | Parcel data = Parcel.obtain(); |
| 6699 | Parcel reply = Parcel.obtain(); |
| 6700 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6701 | data.writeString(packageName); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6702 | data.writeString(callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6703 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 6704 | reply.readException(); |
| 6705 | int res = reply.readInt(); |
| 6706 | data.recycle(); |
| 6707 | reply.recycle(); |
| 6708 | return res; |
| 6709 | } |
| 6710 | |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 6711 | @Override |
| 6712 | public boolean setProcessMemoryTrimLevel(String process, int userId, int level) |
| 6713 | throws RemoteException { |
| 6714 | Parcel data = Parcel.obtain(); |
| 6715 | Parcel reply = Parcel.obtain(); |
| 6716 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6717 | data.writeString(process); |
| 6718 | data.writeInt(userId); |
| 6719 | data.writeInt(level); |
| 6720 | mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0); |
| 6721 | reply.readException(); |
| 6722 | int res = reply.readInt(); |
| 6723 | data.recycle(); |
| 6724 | reply.recycle(); |
| 6725 | return res != 0; |
| 6726 | } |
| 6727 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 6728 | @Override |
| 6729 | public boolean isRootVoiceInteraction(IBinder token) throws RemoteException { |
| 6730 | Parcel data = Parcel.obtain(); |
| 6731 | Parcel reply = Parcel.obtain(); |
| 6732 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6733 | data.writeStrongBinder(token); |
| 6734 | mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 6735 | reply.readException(); |
| 6736 | int res = reply.readInt(); |
| 6737 | data.recycle(); |
| 6738 | reply.recycle(); |
| 6739 | return res != 0; |
| 6740 | } |
| 6741 | |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6742 | @Override |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6743 | public void exitFreeformMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6744 | Parcel data = Parcel.obtain(); |
| 6745 | Parcel reply = Parcel.obtain(); |
| 6746 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6747 | data.writeStrongBinder(token); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6748 | mRemote.transact(EXIT_FREEFORM_MODE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6749 | reply.readException(); |
| 6750 | data.recycle(); |
| 6751 | reply.recycle(); |
| 6752 | } |
| 6753 | |
| 6754 | @Override |
| 6755 | public int getActivityStackId(IBinder token) throws RemoteException { |
| 6756 | Parcel data = Parcel.obtain(); |
| 6757 | Parcel reply = Parcel.obtain(); |
| 6758 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6759 | data.writeStrongBinder(token); |
| 6760 | mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0); |
| 6761 | reply.readException(); |
| 6762 | int stackId = reply.readInt(); |
| 6763 | data.recycle(); |
| 6764 | reply.recycle(); |
| 6765 | return stackId; |
| 6766 | } |
| 6767 | |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6768 | @Override |
| 6769 | public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration, |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6770 | int[] verticalSizeConfigurations, int[] smallestSizeConfigurations) |
| 6771 | throws RemoteException { |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6772 | Parcel data = Parcel.obtain(); |
| 6773 | Parcel reply = Parcel.obtain(); |
| 6774 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6775 | data.writeStrongBinder(token); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6776 | writeIntArray(horizontalSizeConfiguration, data); |
| 6777 | writeIntArray(verticalSizeConfigurations, data); |
| 6778 | writeIntArray(smallestSizeConfigurations, data); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6779 | mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0); |
| 6780 | reply.readException(); |
| 6781 | data.recycle(); |
| 6782 | reply.recycle(); |
| 6783 | } |
| 6784 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6785 | private static void writeIntArray(int[] array, Parcel data) { |
| 6786 | if (array == null) { |
| 6787 | data.writeInt(0); |
| 6788 | } else { |
| 6789 | data.writeInt(array.length); |
| 6790 | data.writeIntArray(array); |
| 6791 | } |
| 6792 | } |
| 6793 | |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 6794 | @Override |
| 6795 | public void suppressResizeConfigChanges(boolean suppress) throws RemoteException { |
| 6796 | Parcel data = Parcel.obtain(); |
| 6797 | Parcel reply = Parcel.obtain(); |
| 6798 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6799 | data.writeInt(suppress ? 1 : 0); |
| 6800 | mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0); |
| 6801 | reply.readException(); |
| 6802 | data.recycle(); |
| 6803 | reply.recycle(); |
| 6804 | } |
| 6805 | |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6806 | @Override |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6807 | public void moveTasksToFullscreenStack(int fromStackId, boolean onTop) throws RemoteException { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6808 | Parcel data = Parcel.obtain(); |
| 6809 | Parcel reply = Parcel.obtain(); |
| 6810 | data.writeInterfaceToken(IActivityManager.descriptor); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6811 | data.writeInt(fromStackId); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6812 | data.writeInt(onTop ? 1 : 0); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6813 | mRemote.transact(MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION, data, reply, 0); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6814 | reply.readException(); |
| 6815 | data.recycle(); |
| 6816 | reply.recycle(); |
| 6817 | } |
| 6818 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6819 | @Override |
| 6820 | public int getAppStartMode(int uid, String packageName) throws RemoteException { |
| 6821 | Parcel data = Parcel.obtain(); |
| 6822 | Parcel reply = Parcel.obtain(); |
| 6823 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6824 | data.writeInt(uid); |
| 6825 | data.writeString(packageName); |
| 6826 | mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0); |
| 6827 | reply.readException(); |
| 6828 | int res = reply.readInt(); |
| 6829 | data.recycle(); |
| 6830 | reply.recycle(); |
| 6831 | return res; |
| 6832 | } |
| 6833 | |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6834 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6835 | public boolean inMultiWindow(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6836 | Parcel data = Parcel.obtain(); |
| 6837 | Parcel reply = Parcel.obtain(); |
| 6838 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6839 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6840 | mRemote.transact(IN_MULTI_WINDOW_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6841 | reply.readException(); |
| 6842 | final boolean multiWindowMode = reply.readInt() == 1 ? true : false; |
| 6843 | data.recycle(); |
| 6844 | reply.recycle(); |
| 6845 | return multiWindowMode; |
| 6846 | } |
| 6847 | |
| 6848 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6849 | public boolean inPictureInPicture(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6850 | Parcel data = Parcel.obtain(); |
| 6851 | Parcel reply = Parcel.obtain(); |
| 6852 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6853 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6854 | mRemote.transact(IN_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6855 | reply.readException(); |
| 6856 | final boolean pipMode = reply.readInt() == 1 ? true : false; |
| 6857 | data.recycle(); |
| 6858 | reply.recycle(); |
| 6859 | return pipMode; |
| 6860 | } |
| 6861 | |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6862 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6863 | public void enterPictureInPicture(IBinder token) throws RemoteException { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6864 | Parcel data = Parcel.obtain(); |
| 6865 | Parcel reply = Parcel.obtain(); |
| 6866 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6867 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6868 | mRemote.transact(ENTER_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6869 | reply.readException(); |
| 6870 | data.recycle(); |
| 6871 | reply.recycle(); |
| 6872 | } |
| 6873 | |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 6874 | @Override |
| 6875 | public boolean isAppForeground(int uid) throws RemoteException { |
| 6876 | Parcel data = Parcel.obtain(); |
| 6877 | Parcel reply = Parcel.obtain(); |
| 6878 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6879 | data.writeInt(uid); |
| 6880 | mRemote.transact(IS_APP_FOREGROUND_TRANSACTION, data, reply, 0); |
| 6881 | final boolean isForeground = reply.readInt() == 1 ? true : false; |
| 6882 | data.recycle(); |
| 6883 | reply.recycle(); |
| 6884 | return isForeground; |
| 6885 | }; |
| 6886 | |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 6887 | @Override |
| 6888 | public void notifyPinnedStackAnimationEnded() throws RemoteException { |
| 6889 | Parcel data = Parcel.obtain(); |
| 6890 | Parcel reply = Parcel.obtain(); |
| 6891 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6892 | mRemote.transact(NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION, data, reply, 0); |
| 6893 | data.recycle(); |
| 6894 | reply.recycle(); |
| 6895 | }; |
| 6896 | |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 6897 | @Override |
| 6898 | public void removeStack(int stackId) throws RemoteException { |
| 6899 | Parcel data = Parcel.obtain(); |
| 6900 | Parcel reply = Parcel.obtain(); |
| 6901 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6902 | data.writeInt(stackId); |
| 6903 | mRemote.transact(REMOVE_STACK, data, reply, 0); |
| 6904 | reply.readException(); |
| 6905 | data.recycle(); |
| 6906 | reply.recycle(); |
| 6907 | } |
| 6908 | |
Tony Mak | 9c6e8ce | 2016-03-21 12:07:16 +0000 | [diff] [blame] | 6909 | public void notifyLockedProfile(@UserIdInt int userId) throws RemoteException |
| 6910 | { |
| 6911 | Parcel data = Parcel.obtain(); |
| 6912 | Parcel reply = Parcel.obtain(); |
| 6913 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6914 | data.writeInt(userId); |
| 6915 | mRemote.transact(NOTIFY_LOCKED_PROFILE, data, reply, 0); |
| 6916 | reply.readException(); |
| 6917 | data.recycle(); |
| 6918 | reply.recycle(); |
| 6919 | } |
| 6920 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6921 | private IBinder mRemote; |
| 6922 | } |