The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.app; |
| 18 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 19 | import android.app.ActivityManager.StackInfo; |
Dianne Hackborn | 69c6adc | 2015-06-02 10:52:59 -0700 | [diff] [blame] | 20 | import android.app.assist.AssistContent; |
| 21 | import android.app.assist.AssistStructure; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.content.ComponentName; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 23 | import android.content.IIntentReceiver; |
| 24 | import android.content.IIntentSender; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | import android.content.Intent; |
| 26 | import android.content.IntentFilter; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 27 | import android.content.IntentSender; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 28 | import android.content.UriPermission; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 29 | import android.content.pm.ApplicationInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | import android.content.pm.ConfigurationInfo; |
| 31 | import android.content.pm.IPackageDataObserver; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 32 | import android.content.pm.ParceledListSlice; |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 33 | import android.content.pm.UserInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 34 | import android.content.res.Configuration; |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 35 | import android.graphics.Bitmap; |
| 36 | import android.graphics.Point; |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 37 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 38 | import android.net.Uri; |
| 39 | import android.os.Binder; |
| 40 | import android.os.Bundle; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 41 | import android.os.Debug; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | import android.os.IBinder; |
| 43 | import android.os.Parcel; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 44 | import android.os.ParcelFileDescriptor; |
| 45 | import android.os.Parcelable; |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 46 | import android.os.PersistableBundle; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 47 | import android.os.RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | import android.os.ServiceManager; |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 49 | import android.os.StrictMode; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 50 | import android.service.voice.IVoiceInteractionSession; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 51 | import android.text.TextUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | import android.util.Log; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 53 | import android.util.Singleton; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 54 | import com.android.internal.app.IVoiceInteractor; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 55 | import com.android.internal.os.IResultReceiver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | import java.util.ArrayList; |
| 58 | import java.util.List; |
| 59 | |
| 60 | /** {@hide} */ |
| 61 | public abstract class ActivityManagerNative extends Binder implements IActivityManager |
| 62 | { |
| 63 | /** |
| 64 | * Cast a Binder object into an activity manager interface, generating |
| 65 | * a proxy if needed. |
| 66 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 67 | static public IActivityManager asInterface(IBinder obj) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 68 | if (obj == null) { |
| 69 | return null; |
| 70 | } |
| 71 | IActivityManager in = |
| 72 | (IActivityManager)obj.queryLocalInterface(descriptor); |
| 73 | if (in != null) { |
| 74 | return in; |
| 75 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 76 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 77 | return new ActivityManagerProxy(obj); |
| 78 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 79 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | /** |
| 81 | * Retrieve the system's default/global activity manager. |
| 82 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 83 | static public IActivityManager getDefault() { |
| 84 | return gDefault.get(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Convenience for checking whether the system is ready. For internal use only. |
| 89 | */ |
| 90 | static public boolean isSystemReady() { |
| 91 | if (!sSystemReady) { |
| 92 | sSystemReady = getDefault().testIsSystemReady(); |
| 93 | } |
| 94 | return sSystemReady; |
| 95 | } |
| 96 | static boolean sSystemReady = false; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 97 | |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 98 | static public void broadcastStickyIntent(Intent intent, String permission, int userId) { |
| 99 | broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId); |
| 100 | } |
| 101 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 102 | /** |
| 103 | * Convenience for sending a sticky broadcast. For internal use only. |
| 104 | * If you don't care about permission, use null. |
| 105 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 106 | static public void broadcastStickyIntent(Intent intent, String permission, int appOp, |
| 107 | int userId) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 108 | try { |
| 109 | getDefault().broadcastIntent( |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 110 | null, intent, null, null, Activity.RESULT_OK, null, null, |
| 111 | null /*permission*/, appOp, null, false, true, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 112 | } catch (RemoteException ex) { |
| 113 | } |
| 114 | } |
| 115 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 116 | static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg, |
| 117 | String tag) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 118 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 119 | getDefault().noteWakeupAlarm((ps != null) ? ps.getTarget() : null, |
| 120 | sourceUid, sourcePkg, tag); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 121 | } catch (RemoteException ex) { |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) { |
| 126 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 127 | getDefault().noteAlarmStart((ps != null) ? ps.getTarget() : null, sourceUid, tag); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 128 | } catch (RemoteException ex) { |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) { |
| 133 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 134 | getDefault().noteAlarmFinish((ps != null) ? ps.getTarget() : null, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 135 | } catch (RemoteException ex) { |
| 136 | } |
| 137 | } |
| 138 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 139 | public ActivityManagerNative() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 140 | attachInterface(this, descriptor); |
| 141 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 142 | |
| 143 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 144 | public boolean onTransact(int code, Parcel data, Parcel reply, int flags) |
| 145 | throws RemoteException { |
| 146 | switch (code) { |
| 147 | case START_ACTIVITY_TRANSACTION: |
| 148 | { |
| 149 | data.enforceInterface(IActivityManager.descriptor); |
| 150 | IBinder b = data.readStrongBinder(); |
| 151 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 152 | String callingPackage = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 153 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 154 | String resolvedType = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 155 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 156 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 157 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 158 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 159 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 160 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 161 | Bundle options = data.readInt() != 0 |
| 162 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 163 | int result = startActivity(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 164 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 165 | reply.writeNoException(); |
| 166 | reply.writeInt(result); |
| 167 | return true; |
| 168 | } |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 169 | |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 170 | case START_ACTIVITY_AS_USER_TRANSACTION: |
| 171 | { |
| 172 | data.enforceInterface(IActivityManager.descriptor); |
| 173 | IBinder b = data.readStrongBinder(); |
| 174 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 175 | String callingPackage = data.readString(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 176 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 177 | String resolvedType = data.readString(); |
| 178 | IBinder resultTo = data.readStrongBinder(); |
| 179 | String resultWho = data.readString(); |
| 180 | int requestCode = data.readInt(); |
| 181 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 182 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 183 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 184 | Bundle options = data.readInt() != 0 |
| 185 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 186 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 187 | int result = startActivityAsUser(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 188 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 189 | reply.writeNoException(); |
| 190 | reply.writeInt(result); |
| 191 | return true; |
| 192 | } |
| 193 | |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 194 | case START_ACTIVITY_AS_CALLER_TRANSACTION: |
| 195 | { |
| 196 | data.enforceInterface(IActivityManager.descriptor); |
| 197 | IBinder b = data.readStrongBinder(); |
| 198 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 199 | String callingPackage = data.readString(); |
| 200 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 201 | String resolvedType = data.readString(); |
| 202 | IBinder resultTo = data.readStrongBinder(); |
| 203 | String resultWho = data.readString(); |
| 204 | int requestCode = data.readInt(); |
| 205 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 206 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 207 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 208 | Bundle options = data.readInt() != 0 |
| 209 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 210 | boolean ignoreTargetSecurity = data.readInt() != 0; |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 211 | int userId = data.readInt(); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 212 | int result = startActivityAsCaller(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 213 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, |
| 214 | ignoreTargetSecurity, userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 215 | reply.writeNoException(); |
| 216 | reply.writeInt(result); |
| 217 | return true; |
| 218 | } |
| 219 | |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 220 | case START_ACTIVITY_AND_WAIT_TRANSACTION: |
| 221 | { |
| 222 | data.enforceInterface(IActivityManager.descriptor); |
| 223 | IBinder b = data.readStrongBinder(); |
| 224 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 225 | String callingPackage = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 226 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 227 | String resolvedType = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 228 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 229 | String resultWho = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 230 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 231 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 232 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 233 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 234 | Bundle options = data.readInt() != 0 |
| 235 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 236 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 237 | WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 238 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 239 | reply.writeNoException(); |
| 240 | result.writeToParcel(reply, 0); |
| 241 | return true; |
| 242 | } |
| 243 | |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 244 | case START_ACTIVITY_WITH_CONFIG_TRANSACTION: |
| 245 | { |
| 246 | data.enforceInterface(IActivityManager.descriptor); |
| 247 | IBinder b = data.readStrongBinder(); |
| 248 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 249 | String callingPackage = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 250 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 251 | String resolvedType = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 252 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 253 | String resultWho = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 254 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 255 | int startFlags = data.readInt(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 256 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 257 | Bundle options = data.readInt() != 0 |
| 258 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 259 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 260 | int result = startActivityWithConfig(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 261 | resultTo, resultWho, requestCode, startFlags, config, options, userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 262 | reply.writeNoException(); |
| 263 | reply.writeInt(result); |
| 264 | return true; |
| 265 | } |
| 266 | |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 267 | case START_ACTIVITY_INTENT_SENDER_TRANSACTION: |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 268 | { |
| 269 | data.enforceInterface(IActivityManager.descriptor); |
| 270 | IBinder b = data.readStrongBinder(); |
| 271 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 272 | IntentSender intent = IntentSender.CREATOR.createFromParcel(data); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 273 | Intent fillInIntent = null; |
| 274 | if (data.readInt() != 0) { |
| 275 | fillInIntent = Intent.CREATOR.createFromParcel(data); |
| 276 | } |
| 277 | String resolvedType = data.readString(); |
| 278 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 279 | String resultWho = data.readString(); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 280 | int requestCode = data.readInt(); |
| 281 | int flagsMask = data.readInt(); |
| 282 | int flagsValues = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 283 | Bundle options = data.readInt() != 0 |
| 284 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 285 | int result = startActivityIntentSender(app, intent, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 286 | fillInIntent, resolvedType, resultTo, resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 287 | requestCode, flagsMask, flagsValues, options); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 288 | reply.writeNoException(); |
| 289 | reply.writeInt(result); |
| 290 | return true; |
| 291 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 292 | |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 293 | case START_VOICE_ACTIVITY_TRANSACTION: |
| 294 | { |
| 295 | data.enforceInterface(IActivityManager.descriptor); |
| 296 | String callingPackage = data.readString(); |
| 297 | int callingPid = data.readInt(); |
| 298 | int callingUid = data.readInt(); |
| 299 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 300 | String resolvedType = data.readString(); |
| 301 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 302 | data.readStrongBinder()); |
| 303 | IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface( |
| 304 | data.readStrongBinder()); |
| 305 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 306 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 307 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 308 | Bundle options = data.readInt() != 0 |
| 309 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 310 | int userId = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 311 | int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent, |
| 312 | resolvedType, session, interactor, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 313 | reply.writeNoException(); |
| 314 | reply.writeInt(result); |
| 315 | return true; |
| 316 | } |
| 317 | |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 318 | case START_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 319 | { |
| 320 | data.enforceInterface(IActivityManager.descriptor); |
| 321 | IBinder token = data.readStrongBinder(); |
| 322 | Bundle options = data.readBundle(); |
| 323 | startLocalVoiceInteraction(token, options); |
| 324 | reply.writeNoException(); |
| 325 | return true; |
| 326 | } |
| 327 | |
| 328 | case STOP_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 329 | { |
| 330 | data.enforceInterface(IActivityManager.descriptor); |
| 331 | IBinder token = data.readStrongBinder(); |
| 332 | stopLocalVoiceInteraction(token); |
| 333 | reply.writeNoException(); |
| 334 | return true; |
| 335 | } |
| 336 | |
| 337 | case SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 338 | { |
| 339 | data.enforceInterface(IActivityManager.descriptor); |
| 340 | boolean result = supportsLocalVoiceInteraction(); |
| 341 | reply.writeNoException(); |
| 342 | reply.writeInt(result? 1 : 0); |
| 343 | return true; |
| 344 | } |
| 345 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 346 | case START_NEXT_MATCHING_ACTIVITY_TRANSACTION: |
| 347 | { |
| 348 | data.enforceInterface(IActivityManager.descriptor); |
| 349 | IBinder callingActivity = data.readStrongBinder(); |
| 350 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 351 | Bundle options = data.readInt() != 0 |
| 352 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 353 | boolean result = startNextMatchingActivity(callingActivity, intent, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 354 | reply.writeNoException(); |
| 355 | reply.writeInt(result ? 1 : 0); |
| 356 | return true; |
| 357 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 358 | |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 359 | case START_ACTIVITY_FROM_RECENTS_TRANSACTION: |
| 360 | { |
| 361 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 362 | final int taskId = data.readInt(); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 363 | final Bundle options = |
| 364 | data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data); |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 365 | final int result = startActivityFromRecents(taskId, options); |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 366 | reply.writeNoException(); |
| 367 | reply.writeInt(result); |
| 368 | return true; |
| 369 | } |
| 370 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 371 | case FINISH_ACTIVITY_TRANSACTION: { |
| 372 | data.enforceInterface(IActivityManager.descriptor); |
| 373 | IBinder token = data.readStrongBinder(); |
| 374 | Intent resultData = null; |
| 375 | int resultCode = data.readInt(); |
| 376 | if (data.readInt() != 0) { |
| 377 | resultData = Intent.CREATOR.createFromParcel(data); |
| 378 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 379 | int finishTask = data.readInt(); |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 380 | boolean res = finishActivity(token, resultCode, resultData, finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 381 | reply.writeNoException(); |
| 382 | reply.writeInt(res ? 1 : 0); |
| 383 | return true; |
| 384 | } |
| 385 | |
| 386 | case FINISH_SUB_ACTIVITY_TRANSACTION: { |
| 387 | data.enforceInterface(IActivityManager.descriptor); |
| 388 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 389 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 390 | int requestCode = data.readInt(); |
| 391 | finishSubActivity(token, resultWho, requestCode); |
| 392 | reply.writeNoException(); |
| 393 | return true; |
| 394 | } |
| 395 | |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 396 | case FINISH_ACTIVITY_AFFINITY_TRANSACTION: { |
| 397 | data.enforceInterface(IActivityManager.descriptor); |
| 398 | IBinder token = data.readStrongBinder(); |
| 399 | boolean res = finishActivityAffinity(token); |
| 400 | reply.writeNoException(); |
| 401 | reply.writeInt(res ? 1 : 0); |
| 402 | return true; |
| 403 | } |
| 404 | |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 405 | case FINISH_VOICE_TASK_TRANSACTION: { |
| 406 | data.enforceInterface(IActivityManager.descriptor); |
| 407 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 408 | data.readStrongBinder()); |
| 409 | finishVoiceTask(session); |
| 410 | reply.writeNoException(); |
| 411 | return true; |
| 412 | } |
| 413 | |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 414 | case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: { |
| 415 | data.enforceInterface(IActivityManager.descriptor); |
| 416 | IBinder token = data.readStrongBinder(); |
| 417 | boolean res = releaseActivityInstance(token); |
| 418 | reply.writeNoException(); |
| 419 | reply.writeInt(res ? 1 : 0); |
| 420 | return true; |
| 421 | } |
| 422 | |
| 423 | case RELEASE_SOME_ACTIVITIES_TRANSACTION: { |
| 424 | data.enforceInterface(IActivityManager.descriptor); |
| 425 | IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder()); |
| 426 | releaseSomeActivities(app); |
| 427 | reply.writeNoException(); |
| 428 | return true; |
| 429 | } |
| 430 | |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 431 | case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: { |
| 432 | data.enforceInterface(IActivityManager.descriptor); |
| 433 | IBinder token = data.readStrongBinder(); |
| 434 | boolean res = willActivityBeVisible(token); |
| 435 | reply.writeNoException(); |
| 436 | reply.writeInt(res ? 1 : 0); |
| 437 | return true; |
| 438 | } |
| 439 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 440 | case REGISTER_RECEIVER_TRANSACTION: |
| 441 | { |
| 442 | data.enforceInterface(IActivityManager.descriptor); |
| 443 | IBinder b = data.readStrongBinder(); |
| 444 | IApplicationThread app = |
| 445 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 446 | String packageName = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 447 | b = data.readStrongBinder(); |
| 448 | IIntentReceiver rec |
| 449 | = b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 450 | IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data); |
| 451 | String perm = data.readString(); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 452 | int userId = data.readInt(); |
| 453 | Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 454 | reply.writeNoException(); |
| 455 | if (intent != null) { |
| 456 | reply.writeInt(1); |
| 457 | intent.writeToParcel(reply, 0); |
| 458 | } else { |
| 459 | reply.writeInt(0); |
| 460 | } |
| 461 | return true; |
| 462 | } |
| 463 | |
| 464 | case UNREGISTER_RECEIVER_TRANSACTION: |
| 465 | { |
| 466 | data.enforceInterface(IActivityManager.descriptor); |
| 467 | IBinder b = data.readStrongBinder(); |
| 468 | if (b == null) { |
| 469 | return true; |
| 470 | } |
| 471 | IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b); |
| 472 | unregisterReceiver(rec); |
| 473 | reply.writeNoException(); |
| 474 | return true; |
| 475 | } |
| 476 | |
| 477 | case BROADCAST_INTENT_TRANSACTION: |
| 478 | { |
| 479 | data.enforceInterface(IActivityManager.descriptor); |
| 480 | IBinder b = data.readStrongBinder(); |
| 481 | IApplicationThread app = |
| 482 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 483 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 484 | String resolvedType = data.readString(); |
| 485 | b = data.readStrongBinder(); |
| 486 | IIntentReceiver resultTo = |
| 487 | b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 488 | int resultCode = data.readInt(); |
| 489 | String resultData = data.readString(); |
| 490 | Bundle resultExtras = data.readBundle(); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 491 | String[] perms = data.readStringArray(); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 492 | int appOp = data.readInt(); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 493 | Bundle options = data.readBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 494 | boolean serialized = data.readInt() != 0; |
| 495 | boolean sticky = data.readInt() != 0; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 496 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 497 | int res = broadcastIntent(app, intent, resolvedType, resultTo, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 498 | resultCode, resultData, resultExtras, perms, appOp, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 499 | options, serialized, sticky, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 500 | reply.writeNoException(); |
| 501 | reply.writeInt(res); |
| 502 | return true; |
| 503 | } |
| 504 | |
| 505 | case UNBROADCAST_INTENT_TRANSACTION: |
| 506 | { |
| 507 | data.enforceInterface(IActivityManager.descriptor); |
| 508 | IBinder b = data.readStrongBinder(); |
| 509 | IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 510 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 511 | int userId = data.readInt(); |
| 512 | unbroadcastIntent(app, intent, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 513 | reply.writeNoException(); |
| 514 | return true; |
| 515 | } |
| 516 | |
| 517 | case FINISH_RECEIVER_TRANSACTION: { |
| 518 | data.enforceInterface(IActivityManager.descriptor); |
| 519 | IBinder who = data.readStrongBinder(); |
| 520 | int resultCode = data.readInt(); |
| 521 | String resultData = data.readString(); |
| 522 | Bundle resultExtras = data.readBundle(); |
| 523 | boolean resultAbort = data.readInt() != 0; |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 524 | int intentFlags = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 525 | if (who != null) { |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 526 | finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 527 | } |
| 528 | reply.writeNoException(); |
| 529 | return true; |
| 530 | } |
| 531 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 532 | case ATTACH_APPLICATION_TRANSACTION: { |
| 533 | data.enforceInterface(IActivityManager.descriptor); |
| 534 | IApplicationThread app = ApplicationThreadNative.asInterface( |
| 535 | data.readStrongBinder()); |
| 536 | if (app != null) { |
| 537 | attachApplication(app); |
| 538 | } |
| 539 | reply.writeNoException(); |
| 540 | return true; |
| 541 | } |
| 542 | |
| 543 | case ACTIVITY_IDLE_TRANSACTION: { |
| 544 | data.enforceInterface(IActivityManager.descriptor); |
| 545 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 546 | Configuration config = null; |
| 547 | if (data.readInt() != 0) { |
| 548 | config = Configuration.CREATOR.createFromParcel(data); |
| 549 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 550 | boolean stopProfiling = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 551 | if (token != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 552 | activityIdle(token, config, stopProfiling); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 553 | } |
| 554 | reply.writeNoException(); |
| 555 | return true; |
| 556 | } |
| 557 | |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 558 | case ACTIVITY_RESUMED_TRANSACTION: { |
| 559 | data.enforceInterface(IActivityManager.descriptor); |
| 560 | IBinder token = data.readStrongBinder(); |
| 561 | activityResumed(token); |
| 562 | reply.writeNoException(); |
| 563 | return true; |
| 564 | } |
| 565 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 566 | case ACTIVITY_PAUSED_TRANSACTION: { |
| 567 | data.enforceInterface(IActivityManager.descriptor); |
| 568 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 569 | activityPaused(token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 570 | reply.writeNoException(); |
| 571 | return true; |
| 572 | } |
| 573 | |
| 574 | case ACTIVITY_STOPPED_TRANSACTION: { |
| 575 | data.enforceInterface(IActivityManager.descriptor); |
| 576 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 577 | Bundle map = data.readBundle(); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 578 | PersistableBundle persistentState = data.readPersistableBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 579 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 580 | activityStopped(token, map, persistentState, description); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 581 | reply.writeNoException(); |
| 582 | return true; |
| 583 | } |
| 584 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 585 | case ACTIVITY_SLEPT_TRANSACTION: { |
| 586 | data.enforceInterface(IActivityManager.descriptor); |
| 587 | IBinder token = data.readStrongBinder(); |
| 588 | activitySlept(token); |
| 589 | reply.writeNoException(); |
| 590 | return true; |
| 591 | } |
| 592 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 593 | case ACTIVITY_DESTROYED_TRANSACTION: { |
| 594 | data.enforceInterface(IActivityManager.descriptor); |
| 595 | IBinder token = data.readStrongBinder(); |
| 596 | activityDestroyed(token); |
| 597 | reply.writeNoException(); |
| 598 | return true; |
| 599 | } |
| 600 | |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 601 | case ACTIVITY_RELAUNCHED_TRANSACTION: { |
| 602 | data.enforceInterface(IActivityManager.descriptor); |
| 603 | IBinder token = data.readStrongBinder(); |
| 604 | activityRelaunched(token); |
| 605 | reply.writeNoException(); |
| 606 | return true; |
| 607 | } |
| 608 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 609 | case GET_CALLING_PACKAGE_TRANSACTION: { |
| 610 | data.enforceInterface(IActivityManager.descriptor); |
| 611 | IBinder token = data.readStrongBinder(); |
| 612 | String res = token != null ? getCallingPackage(token) : null; |
| 613 | reply.writeNoException(); |
| 614 | reply.writeString(res); |
| 615 | return true; |
| 616 | } |
| 617 | |
| 618 | case GET_CALLING_ACTIVITY_TRANSACTION: { |
| 619 | data.enforceInterface(IActivityManager.descriptor); |
| 620 | IBinder token = data.readStrongBinder(); |
| 621 | ComponentName cn = getCallingActivity(token); |
| 622 | reply.writeNoException(); |
| 623 | ComponentName.writeToParcel(cn, reply); |
| 624 | return true; |
| 625 | } |
| 626 | |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 627 | case GET_APP_TASKS_TRANSACTION: { |
| 628 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 629 | String callingPackage = data.readString(); |
| 630 | List<IAppTask> list = getAppTasks(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 631 | reply.writeNoException(); |
| 632 | int N = list != null ? list.size() : -1; |
| 633 | reply.writeInt(N); |
| 634 | int i; |
| 635 | for (i=0; i<N; i++) { |
| 636 | IAppTask task = list.get(i); |
| 637 | reply.writeStrongBinder(task.asBinder()); |
| 638 | } |
| 639 | return true; |
| 640 | } |
| 641 | |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 642 | case ADD_APP_TASK_TRANSACTION: { |
| 643 | data.enforceInterface(IActivityManager.descriptor); |
| 644 | IBinder activityToken = data.readStrongBinder(); |
| 645 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 646 | ActivityManager.TaskDescription descr |
| 647 | = ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 648 | Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data); |
| 649 | int res = addAppTask(activityToken, intent, descr, thumbnail); |
| 650 | reply.writeNoException(); |
| 651 | reply.writeInt(res); |
| 652 | return true; |
| 653 | } |
| 654 | |
| 655 | case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: { |
| 656 | data.enforceInterface(IActivityManager.descriptor); |
| 657 | Point size = getAppTaskThumbnailSize(); |
| 658 | reply.writeNoException(); |
| 659 | size.writeToParcel(reply, 0); |
| 660 | return true; |
| 661 | } |
| 662 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 663 | case GET_TASKS_TRANSACTION: { |
| 664 | data.enforceInterface(IActivityManager.descriptor); |
| 665 | int maxNum = data.readInt(); |
| 666 | int fl = data.readInt(); |
Dianne Hackborn | 0923328 | 2014-04-30 11:33:59 -0700 | [diff] [blame] | 667 | List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 668 | reply.writeNoException(); |
| 669 | int N = list != null ? list.size() : -1; |
| 670 | reply.writeInt(N); |
| 671 | int i; |
| 672 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 673 | ActivityManager.RunningTaskInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 674 | info.writeToParcel(reply, 0); |
| 675 | } |
| 676 | return true; |
| 677 | } |
| 678 | |
| 679 | case GET_RECENT_TASKS_TRANSACTION: { |
| 680 | data.enforceInterface(IActivityManager.descriptor); |
| 681 | int maxNum = data.readInt(); |
| 682 | int fl = data.readInt(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 683 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 684 | List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 685 | fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 686 | reply.writeNoException(); |
| 687 | reply.writeTypedList(list); |
| 688 | return true; |
| 689 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 690 | |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 691 | case GET_TASK_THUMBNAIL_TRANSACTION: { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 692 | data.enforceInterface(IActivityManager.descriptor); |
| 693 | int id = data.readInt(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 694 | ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 695 | reply.writeNoException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 696 | if (taskThumbnail != null) { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 697 | reply.writeInt(1); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 698 | taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 699 | } else { |
| 700 | reply.writeInt(0); |
| 701 | } |
| 702 | return true; |
| 703 | } |
| 704 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 705 | case GET_SERVICES_TRANSACTION: { |
| 706 | data.enforceInterface(IActivityManager.descriptor); |
| 707 | int maxNum = data.readInt(); |
| 708 | int fl = data.readInt(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 709 | List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 710 | reply.writeNoException(); |
| 711 | int N = list != null ? list.size() : -1; |
| 712 | reply.writeInt(N); |
| 713 | int i; |
| 714 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 715 | ActivityManager.RunningServiceInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 716 | info.writeToParcel(reply, 0); |
| 717 | } |
| 718 | return true; |
| 719 | } |
| 720 | |
| 721 | case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: { |
| 722 | data.enforceInterface(IActivityManager.descriptor); |
| 723 | List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState(); |
| 724 | reply.writeNoException(); |
| 725 | reply.writeTypedList(list); |
| 726 | return true; |
| 727 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 728 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 729 | case GET_RUNNING_APP_PROCESSES_TRANSACTION: { |
| 730 | data.enforceInterface(IActivityManager.descriptor); |
| 731 | List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses(); |
| 732 | reply.writeNoException(); |
| 733 | reply.writeTypedList(list); |
| 734 | return true; |
| 735 | } |
| 736 | |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 737 | case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: { |
| 738 | data.enforceInterface(IActivityManager.descriptor); |
| 739 | List<ApplicationInfo> list = getRunningExternalApplications(); |
| 740 | reply.writeNoException(); |
| 741 | reply.writeTypedList(list); |
| 742 | return true; |
| 743 | } |
| 744 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 745 | case MOVE_TASK_TO_FRONT_TRANSACTION: { |
| 746 | data.enforceInterface(IActivityManager.descriptor); |
| 747 | int task = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 748 | int fl = data.readInt(); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 749 | Bundle options = data.readInt() != 0 |
| 750 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 751 | moveTaskToFront(task, fl, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 752 | reply.writeNoException(); |
| 753 | return true; |
| 754 | } |
| 755 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 756 | case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: { |
| 757 | data.enforceInterface(IActivityManager.descriptor); |
| 758 | IBinder token = data.readStrongBinder(); |
| 759 | boolean nonRoot = data.readInt() != 0; |
| 760 | boolean res = moveActivityTaskToBack(token, nonRoot); |
| 761 | reply.writeNoException(); |
| 762 | reply.writeInt(res ? 1 : 0); |
| 763 | return true; |
| 764 | } |
| 765 | |
| 766 | case MOVE_TASK_BACKWARDS_TRANSACTION: { |
| 767 | data.enforceInterface(IActivityManager.descriptor); |
| 768 | int task = data.readInt(); |
| 769 | moveTaskBackwards(task); |
| 770 | reply.writeNoException(); |
| 771 | return true; |
| 772 | } |
| 773 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 774 | case MOVE_TASK_TO_STACK_TRANSACTION: { |
| 775 | data.enforceInterface(IActivityManager.descriptor); |
| 776 | int taskId = data.readInt(); |
| 777 | int stackId = data.readInt(); |
| 778 | boolean toTop = data.readInt() != 0; |
| 779 | moveTaskToStack(taskId, stackId, toTop); |
| 780 | reply.writeNoException(); |
| 781 | return true; |
| 782 | } |
| 783 | |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 784 | case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: { |
| 785 | data.enforceInterface(IActivityManager.descriptor); |
| 786 | int taskId = data.readInt(); |
| 787 | int createMode = data.readInt(); |
| 788 | boolean toTop = data.readInt() != 0; |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 789 | boolean animate = data.readInt() != 0; |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 790 | Rect bounds = null; |
| 791 | boolean hasBounds = data.readInt() != 0; |
| 792 | if (hasBounds) { |
| 793 | bounds = Rect.CREATOR.createFromParcel(data); |
| 794 | } |
| 795 | moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 796 | reply.writeNoException(); |
| 797 | return true; |
| 798 | } |
| 799 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 800 | case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: { |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 801 | data.enforceInterface(IActivityManager.descriptor); |
| 802 | final int stackId = data.readInt(); |
| 803 | final Rect r = Rect.CREATOR.createFromParcel(data); |
| 804 | final boolean res = moveTopActivityToPinnedStack(stackId, r); |
| 805 | reply.writeNoException(); |
| 806 | reply.writeInt(res ? 1 : 0); |
| 807 | return true; |
| 808 | } |
| 809 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 810 | case RESIZE_STACK_TRANSACTION: { |
| 811 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 812 | final int stackId = data.readInt(); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 813 | final boolean hasRect = data.readInt() != 0; |
| 814 | Rect r = null; |
| 815 | if (hasRect) { |
| 816 | r = Rect.CREATOR.createFromParcel(data); |
| 817 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 818 | final boolean allowResizeInDockedMode = data.readInt() == 1; |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 819 | final boolean preserveWindows = data.readInt() == 1; |
| 820 | final boolean animate = data.readInt() == 1; |
| 821 | resizeStack(stackId, r, allowResizeInDockedMode, preserveWindows, animate); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 822 | reply.writeNoException(); |
| 823 | return true; |
| 824 | } |
| 825 | |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 826 | case RESIZE_DOCKED_STACK_TRANSACTION: { |
| 827 | data.enforceInterface(IActivityManager.descriptor); |
| 828 | final boolean hasBounds = data.readInt() != 0; |
| 829 | Rect bounds = null; |
| 830 | if (hasBounds) { |
| 831 | bounds = Rect.CREATOR.createFromParcel(data); |
| 832 | } |
| 833 | final boolean hasTempDockedTaskBounds = data.readInt() != 0; |
| 834 | Rect tempDockedTaskBounds = null; |
| 835 | if (hasTempDockedTaskBounds) { |
| 836 | tempDockedTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 837 | } |
| 838 | final boolean hasTempDockedTaskInsetBounds = data.readInt() != 0; |
| 839 | Rect tempDockedTaskInsetBounds = null; |
| 840 | if (hasTempDockedTaskInsetBounds) { |
| 841 | tempDockedTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 842 | } |
| 843 | final boolean hasTempOtherTaskBounds = data.readInt() != 0; |
| 844 | Rect tempOtherTaskBounds = null; |
| 845 | if (hasTempOtherTaskBounds) { |
| 846 | tempOtherTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 847 | } |
| 848 | final boolean hasTempOtherTaskInsetBounds = data.readInt() != 0; |
| 849 | Rect tempOtherTaskInsetBounds = null; |
| 850 | if (hasTempOtherTaskInsetBounds) { |
| 851 | tempOtherTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 852 | } |
| 853 | resizeDockedStack(bounds, tempDockedTaskBounds, tempDockedTaskInsetBounds, |
| 854 | tempOtherTaskBounds, tempOtherTaskInsetBounds); |
| 855 | reply.writeNoException(); |
| 856 | return true; |
| 857 | } |
| 858 | |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 859 | case POSITION_TASK_IN_STACK_TRANSACTION: { |
| 860 | data.enforceInterface(IActivityManager.descriptor); |
| 861 | int taskId = data.readInt(); |
| 862 | int stackId = data.readInt(); |
| 863 | int position = data.readInt(); |
| 864 | positionTaskInStack(taskId, stackId, position); |
| 865 | reply.writeNoException(); |
| 866 | return true; |
| 867 | } |
| 868 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 869 | case GET_ALL_STACK_INFOS_TRANSACTION: { |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 870 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 871 | List<StackInfo> list = getAllStackInfos(); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 872 | reply.writeNoException(); |
| 873 | reply.writeTypedList(list); |
| 874 | return true; |
| 875 | } |
| 876 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 877 | case GET_STACK_INFO_TRANSACTION: { |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 878 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 879 | int stackId = data.readInt(); |
| 880 | StackInfo info = getStackInfo(stackId); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 881 | reply.writeNoException(); |
| 882 | if (info != null) { |
| 883 | reply.writeInt(1); |
| 884 | info.writeToParcel(reply, 0); |
| 885 | } else { |
| 886 | reply.writeInt(0); |
| 887 | } |
| 888 | return true; |
| 889 | } |
| 890 | |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 891 | case IS_IN_HOME_STACK_TRANSACTION: { |
| 892 | data.enforceInterface(IActivityManager.descriptor); |
| 893 | int taskId = data.readInt(); |
| 894 | boolean isInHomeStack = isInHomeStack(taskId); |
| 895 | reply.writeNoException(); |
| 896 | reply.writeInt(isInHomeStack ? 1 : 0); |
| 897 | return true; |
| 898 | } |
| 899 | |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 900 | case SET_FOCUSED_STACK_TRANSACTION: { |
| 901 | data.enforceInterface(IActivityManager.descriptor); |
| 902 | int stackId = data.readInt(); |
| 903 | setFocusedStack(stackId); |
| 904 | reply.writeNoException(); |
| 905 | return true; |
| 906 | } |
| 907 | |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 908 | case GET_FOCUSED_STACK_ID_TRANSACTION: { |
| 909 | data.enforceInterface(IActivityManager.descriptor); |
| 910 | int focusedStackId = getFocusedStackId(); |
| 911 | reply.writeNoException(); |
| 912 | reply.writeInt(focusedStackId); |
| 913 | return true; |
| 914 | } |
| 915 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 916 | case SET_FOCUSED_TASK_TRANSACTION: { |
| 917 | data.enforceInterface(IActivityManager.descriptor); |
| 918 | int taskId = data.readInt(); |
Skuhne | f36bb0c | 2015-08-26 14:26:17 -0700 | [diff] [blame] | 919 | setFocusedTask(taskId); |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 920 | reply.writeNoException(); |
| 921 | return true; |
| 922 | } |
| 923 | |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 924 | case REGISTER_TASK_STACK_LISTENER_TRANSACTION: { |
| 925 | data.enforceInterface(IActivityManager.descriptor); |
| 926 | IBinder token = data.readStrongBinder(); |
| 927 | registerTaskStackListener(ITaskStackListener.Stub.asInterface(token)); |
| 928 | reply.writeNoException(); |
| 929 | return true; |
| 930 | } |
| 931 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 932 | case GET_TASK_FOR_ACTIVITY_TRANSACTION: { |
| 933 | data.enforceInterface(IActivityManager.descriptor); |
| 934 | IBinder token = data.readStrongBinder(); |
| 935 | boolean onlyRoot = data.readInt() != 0; |
| 936 | int res = token != null |
| 937 | ? getTaskForActivity(token, onlyRoot) : -1; |
| 938 | reply.writeNoException(); |
| 939 | reply.writeInt(res); |
| 940 | return true; |
| 941 | } |
| 942 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 943 | case GET_CONTENT_PROVIDER_TRANSACTION: { |
| 944 | data.enforceInterface(IActivityManager.descriptor); |
| 945 | IBinder b = data.readStrongBinder(); |
| 946 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 947 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 948 | int userId = data.readInt(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 949 | boolean stable = data.readInt() != 0; |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 950 | ContentProviderHolder cph = getContentProvider(app, name, userId, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 951 | reply.writeNoException(); |
| 952 | if (cph != null) { |
| 953 | reply.writeInt(1); |
| 954 | cph.writeToParcel(reply, 0); |
| 955 | } else { |
| 956 | reply.writeInt(0); |
| 957 | } |
| 958 | return true; |
| 959 | } |
| 960 | |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 961 | case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 962 | data.enforceInterface(IActivityManager.descriptor); |
| 963 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 964 | int userId = data.readInt(); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 965 | IBinder token = data.readStrongBinder(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 966 | ContentProviderHolder cph = getContentProviderExternal(name, userId, token); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 967 | reply.writeNoException(); |
| 968 | if (cph != null) { |
| 969 | reply.writeInt(1); |
| 970 | cph.writeToParcel(reply, 0); |
| 971 | } else { |
| 972 | reply.writeInt(0); |
| 973 | } |
| 974 | return true; |
| 975 | } |
| 976 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 977 | case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: { |
| 978 | data.enforceInterface(IActivityManager.descriptor); |
| 979 | IBinder b = data.readStrongBinder(); |
| 980 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 981 | ArrayList<ContentProviderHolder> providers = |
| 982 | data.createTypedArrayList(ContentProviderHolder.CREATOR); |
| 983 | publishContentProviders(app, providers); |
| 984 | reply.writeNoException(); |
| 985 | return true; |
| 986 | } |
| 987 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 988 | case REF_CONTENT_PROVIDER_TRANSACTION: { |
| 989 | data.enforceInterface(IActivityManager.descriptor); |
| 990 | IBinder b = data.readStrongBinder(); |
| 991 | int stable = data.readInt(); |
| 992 | int unstable = data.readInt(); |
| 993 | boolean res = refContentProvider(b, stable, unstable); |
| 994 | reply.writeNoException(); |
| 995 | reply.writeInt(res ? 1 : 0); |
| 996 | return true; |
| 997 | } |
| 998 | |
| 999 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: { |
| 1000 | data.enforceInterface(IActivityManager.descriptor); |
| 1001 | IBinder b = data.readStrongBinder(); |
| 1002 | unstableProviderDied(b); |
| 1003 | reply.writeNoException(); |
| 1004 | return true; |
| 1005 | } |
| 1006 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 1007 | case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: { |
| 1008 | data.enforceInterface(IActivityManager.descriptor); |
| 1009 | IBinder b = data.readStrongBinder(); |
| 1010 | appNotRespondingViaProvider(b); |
| 1011 | reply.writeNoException(); |
| 1012 | return true; |
| 1013 | } |
| 1014 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1015 | case REMOVE_CONTENT_PROVIDER_TRANSACTION: { |
| 1016 | data.enforceInterface(IActivityManager.descriptor); |
| 1017 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1018 | boolean stable = data.readInt() != 0; |
| 1019 | removeContentProvider(b, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1020 | reply.writeNoException(); |
| 1021 | return true; |
| 1022 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 1023 | |
| 1024 | case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 1025 | data.enforceInterface(IActivityManager.descriptor); |
| 1026 | String name = data.readString(); |
| 1027 | IBinder token = data.readStrongBinder(); |
| 1028 | removeContentProviderExternal(name, token); |
| 1029 | reply.writeNoException(); |
| 1030 | return true; |
| 1031 | } |
| 1032 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 1033 | case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: { |
| 1034 | data.enforceInterface(IActivityManager.descriptor); |
| 1035 | ComponentName comp = ComponentName.CREATOR.createFromParcel(data); |
| 1036 | PendingIntent pi = getRunningServiceControlPanel(comp); |
| 1037 | reply.writeNoException(); |
| 1038 | PendingIntent.writePendingIntentOrNullToParcel(pi, reply); |
| 1039 | return true; |
| 1040 | } |
| 1041 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1042 | case START_SERVICE_TRANSACTION: { |
| 1043 | data.enforceInterface(IActivityManager.descriptor); |
| 1044 | IBinder b = data.readStrongBinder(); |
| 1045 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1046 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1047 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1048 | String callingPackage = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1049 | int userId = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1050 | ComponentName cn = startService(app, service, resolvedType, callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1051 | reply.writeNoException(); |
| 1052 | ComponentName.writeToParcel(cn, reply); |
| 1053 | return true; |
| 1054 | } |
| 1055 | |
| 1056 | case STOP_SERVICE_TRANSACTION: { |
| 1057 | data.enforceInterface(IActivityManager.descriptor); |
| 1058 | IBinder b = data.readStrongBinder(); |
| 1059 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1060 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1061 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1062 | int userId = data.readInt(); |
| 1063 | int res = stopService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1064 | reply.writeNoException(); |
| 1065 | reply.writeInt(res); |
| 1066 | return true; |
| 1067 | } |
| 1068 | |
| 1069 | case STOP_SERVICE_TOKEN_TRANSACTION: { |
| 1070 | data.enforceInterface(IActivityManager.descriptor); |
| 1071 | ComponentName className = ComponentName.readFromParcel(data); |
| 1072 | IBinder token = data.readStrongBinder(); |
| 1073 | int startId = data.readInt(); |
| 1074 | boolean res = stopServiceToken(className, token, startId); |
| 1075 | reply.writeNoException(); |
| 1076 | reply.writeInt(res ? 1 : 0); |
| 1077 | return true; |
| 1078 | } |
| 1079 | |
| 1080 | case SET_SERVICE_FOREGROUND_TRANSACTION: { |
| 1081 | data.enforceInterface(IActivityManager.descriptor); |
| 1082 | ComponentName className = ComponentName.readFromParcel(data); |
| 1083 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 1084 | int id = data.readInt(); |
| 1085 | Notification notification = null; |
| 1086 | if (data.readInt() != 0) { |
| 1087 | notification = Notification.CREATOR.createFromParcel(data); |
| 1088 | } |
| 1089 | boolean removeNotification = data.readInt() != 0; |
| 1090 | setServiceForeground(className, token, id, notification, removeNotification); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1091 | reply.writeNoException(); |
| 1092 | return true; |
| 1093 | } |
| 1094 | |
| 1095 | case BIND_SERVICE_TRANSACTION: { |
| 1096 | data.enforceInterface(IActivityManager.descriptor); |
| 1097 | IBinder b = data.readStrongBinder(); |
| 1098 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1099 | IBinder token = data.readStrongBinder(); |
| 1100 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1101 | String resolvedType = data.readString(); |
| 1102 | b = data.readStrongBinder(); |
| 1103 | int fl = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1104 | String callingPackage = data.readString(); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 1105 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1106 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1107 | int res = bindService(app, token, service, resolvedType, conn, fl, |
| 1108 | callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1109 | reply.writeNoException(); |
| 1110 | reply.writeInt(res); |
| 1111 | return true; |
| 1112 | } |
| 1113 | |
| 1114 | case UNBIND_SERVICE_TRANSACTION: { |
| 1115 | data.enforceInterface(IActivityManager.descriptor); |
| 1116 | IBinder b = data.readStrongBinder(); |
| 1117 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
| 1118 | boolean res = unbindService(conn); |
| 1119 | reply.writeNoException(); |
| 1120 | reply.writeInt(res ? 1 : 0); |
| 1121 | return true; |
| 1122 | } |
| 1123 | |
| 1124 | case PUBLISH_SERVICE_TRANSACTION: { |
| 1125 | data.enforceInterface(IActivityManager.descriptor); |
| 1126 | IBinder token = data.readStrongBinder(); |
| 1127 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1128 | IBinder service = data.readStrongBinder(); |
| 1129 | publishService(token, intent, service); |
| 1130 | reply.writeNoException(); |
| 1131 | return true; |
| 1132 | } |
| 1133 | |
| 1134 | case UNBIND_FINISHED_TRANSACTION: { |
| 1135 | data.enforceInterface(IActivityManager.descriptor); |
| 1136 | IBinder token = data.readStrongBinder(); |
| 1137 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1138 | boolean doRebind = data.readInt() != 0; |
| 1139 | unbindFinished(token, intent, doRebind); |
| 1140 | reply.writeNoException(); |
| 1141 | return true; |
| 1142 | } |
| 1143 | |
| 1144 | case SERVICE_DONE_EXECUTING_TRANSACTION: { |
| 1145 | data.enforceInterface(IActivityManager.descriptor); |
| 1146 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 1147 | int type = data.readInt(); |
| 1148 | int startId = data.readInt(); |
| 1149 | int res = data.readInt(); |
| 1150 | serviceDoneExecuting(token, type, startId, res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1151 | reply.writeNoException(); |
| 1152 | return true; |
| 1153 | } |
| 1154 | |
| 1155 | case START_INSTRUMENTATION_TRANSACTION: { |
| 1156 | data.enforceInterface(IActivityManager.descriptor); |
| 1157 | ComponentName className = ComponentName.readFromParcel(data); |
| 1158 | String profileFile = data.readString(); |
| 1159 | int fl = data.readInt(); |
| 1160 | Bundle arguments = data.readBundle(); |
| 1161 | IBinder b = data.readStrongBinder(); |
| 1162 | IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 1163 | b = data.readStrongBinder(); |
| 1164 | IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1165 | int userId = data.readInt(); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 1166 | String abiOverride = data.readString(); |
| 1167 | boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId, |
| 1168 | abiOverride); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1169 | reply.writeNoException(); |
| 1170 | reply.writeInt(res ? 1 : 0); |
| 1171 | return true; |
| 1172 | } |
| 1173 | |
| 1174 | |
| 1175 | case FINISH_INSTRUMENTATION_TRANSACTION: { |
| 1176 | data.enforceInterface(IActivityManager.descriptor); |
| 1177 | IBinder b = data.readStrongBinder(); |
| 1178 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1179 | int resultCode = data.readInt(); |
| 1180 | Bundle results = data.readBundle(); |
| 1181 | finishInstrumentation(app, resultCode, results); |
| 1182 | reply.writeNoException(); |
| 1183 | return true; |
| 1184 | } |
| 1185 | |
| 1186 | case GET_CONFIGURATION_TRANSACTION: { |
| 1187 | data.enforceInterface(IActivityManager.descriptor); |
| 1188 | Configuration config = getConfiguration(); |
| 1189 | reply.writeNoException(); |
| 1190 | config.writeToParcel(reply, 0); |
| 1191 | return true; |
| 1192 | } |
| 1193 | |
| 1194 | case UPDATE_CONFIGURATION_TRANSACTION: { |
| 1195 | data.enforceInterface(IActivityManager.descriptor); |
| 1196 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 1197 | updateConfiguration(config); |
| 1198 | reply.writeNoException(); |
| 1199 | return true; |
| 1200 | } |
| 1201 | |
| 1202 | case SET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1203 | data.enforceInterface(IActivityManager.descriptor); |
| 1204 | IBinder token = data.readStrongBinder(); |
| 1205 | int requestedOrientation = data.readInt(); |
| 1206 | setRequestedOrientation(token, requestedOrientation); |
| 1207 | reply.writeNoException(); |
| 1208 | return true; |
| 1209 | } |
| 1210 | |
| 1211 | case GET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1212 | data.enforceInterface(IActivityManager.descriptor); |
| 1213 | IBinder token = data.readStrongBinder(); |
| 1214 | int req = getRequestedOrientation(token); |
| 1215 | reply.writeNoException(); |
| 1216 | reply.writeInt(req); |
| 1217 | return true; |
| 1218 | } |
| 1219 | |
| 1220 | case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: { |
| 1221 | data.enforceInterface(IActivityManager.descriptor); |
| 1222 | IBinder token = data.readStrongBinder(); |
| 1223 | ComponentName cn = getActivityClassForToken(token); |
| 1224 | reply.writeNoException(); |
| 1225 | ComponentName.writeToParcel(cn, reply); |
| 1226 | return true; |
| 1227 | } |
| 1228 | |
| 1229 | case GET_PACKAGE_FOR_TOKEN_TRANSACTION: { |
| 1230 | data.enforceInterface(IActivityManager.descriptor); |
| 1231 | IBinder token = data.readStrongBinder(); |
| 1232 | reply.writeNoException(); |
| 1233 | reply.writeString(getPackageForToken(token)); |
| 1234 | return true; |
| 1235 | } |
| 1236 | |
| 1237 | case GET_INTENT_SENDER_TRANSACTION: { |
| 1238 | data.enforceInterface(IActivityManager.descriptor); |
| 1239 | int type = data.readInt(); |
| 1240 | String packageName = data.readString(); |
| 1241 | IBinder token = data.readStrongBinder(); |
| 1242 | String resultWho = data.readString(); |
| 1243 | int requestCode = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1244 | Intent[] requestIntents; |
| 1245 | String[] requestResolvedTypes; |
| 1246 | if (data.readInt() != 0) { |
| 1247 | requestIntents = data.createTypedArray(Intent.CREATOR); |
| 1248 | requestResolvedTypes = data.createStringArray(); |
| 1249 | } else { |
| 1250 | requestIntents = null; |
| 1251 | requestResolvedTypes = null; |
| 1252 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1253 | int fl = data.readInt(); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 1254 | Bundle options = data.readInt() != 0 |
| 1255 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1256 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1257 | IIntentSender res = getIntentSender(type, packageName, token, |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1258 | resultWho, requestCode, requestIntents, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1259 | requestResolvedTypes, fl, options, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1260 | reply.writeNoException(); |
| 1261 | reply.writeStrongBinder(res != null ? res.asBinder() : null); |
| 1262 | return true; |
| 1263 | } |
| 1264 | |
| 1265 | case CANCEL_INTENT_SENDER_TRANSACTION: { |
| 1266 | data.enforceInterface(IActivityManager.descriptor); |
| 1267 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1268 | data.readStrongBinder()); |
| 1269 | cancelIntentSender(r); |
| 1270 | reply.writeNoException(); |
| 1271 | return true; |
| 1272 | } |
| 1273 | |
| 1274 | case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: { |
| 1275 | data.enforceInterface(IActivityManager.descriptor); |
| 1276 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1277 | data.readStrongBinder()); |
| 1278 | String res = getPackageForIntentSender(r); |
| 1279 | reply.writeNoException(); |
| 1280 | reply.writeString(res); |
| 1281 | return true; |
| 1282 | } |
| 1283 | |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 1284 | case GET_UID_FOR_INTENT_SENDER_TRANSACTION: { |
| 1285 | data.enforceInterface(IActivityManager.descriptor); |
| 1286 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1287 | data.readStrongBinder()); |
| 1288 | int res = getUidForIntentSender(r); |
| 1289 | reply.writeNoException(); |
| 1290 | reply.writeInt(res); |
| 1291 | return true; |
| 1292 | } |
| 1293 | |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1294 | case HANDLE_INCOMING_USER_TRANSACTION: { |
| 1295 | data.enforceInterface(IActivityManager.descriptor); |
| 1296 | int callingPid = data.readInt(); |
| 1297 | int callingUid = data.readInt(); |
| 1298 | int userId = data.readInt(); |
| 1299 | boolean allowAll = data.readInt() != 0 ; |
| 1300 | boolean requireFull = data.readInt() != 0; |
| 1301 | String name = data.readString(); |
| 1302 | String callerPackage = data.readString(); |
| 1303 | int res = handleIncomingUser(callingPid, callingUid, userId, allowAll, |
| 1304 | requireFull, name, callerPackage); |
| 1305 | reply.writeNoException(); |
| 1306 | reply.writeInt(res); |
| 1307 | return true; |
| 1308 | } |
| 1309 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1310 | case SET_PROCESS_LIMIT_TRANSACTION: { |
| 1311 | data.enforceInterface(IActivityManager.descriptor); |
| 1312 | int max = data.readInt(); |
| 1313 | setProcessLimit(max); |
| 1314 | reply.writeNoException(); |
| 1315 | return true; |
| 1316 | } |
| 1317 | |
| 1318 | case GET_PROCESS_LIMIT_TRANSACTION: { |
| 1319 | data.enforceInterface(IActivityManager.descriptor); |
| 1320 | int limit = getProcessLimit(); |
| 1321 | reply.writeNoException(); |
| 1322 | reply.writeInt(limit); |
| 1323 | return true; |
| 1324 | } |
| 1325 | |
| 1326 | case SET_PROCESS_FOREGROUND_TRANSACTION: { |
| 1327 | data.enforceInterface(IActivityManager.descriptor); |
| 1328 | IBinder token = data.readStrongBinder(); |
| 1329 | int pid = data.readInt(); |
| 1330 | boolean isForeground = data.readInt() != 0; |
| 1331 | setProcessForeground(token, pid, isForeground); |
| 1332 | reply.writeNoException(); |
| 1333 | return true; |
| 1334 | } |
| 1335 | |
| 1336 | case CHECK_PERMISSION_TRANSACTION: { |
| 1337 | data.enforceInterface(IActivityManager.descriptor); |
| 1338 | String perm = data.readString(); |
| 1339 | int pid = data.readInt(); |
| 1340 | int uid = data.readInt(); |
| 1341 | int res = checkPermission(perm, pid, uid); |
| 1342 | reply.writeNoException(); |
| 1343 | reply.writeInt(res); |
| 1344 | return true; |
| 1345 | } |
| 1346 | |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1347 | case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: { |
| 1348 | data.enforceInterface(IActivityManager.descriptor); |
| 1349 | String perm = data.readString(); |
| 1350 | int pid = data.readInt(); |
| 1351 | int uid = data.readInt(); |
| 1352 | IBinder token = data.readStrongBinder(); |
| 1353 | int res = checkPermissionWithToken(perm, pid, uid, token); |
| 1354 | reply.writeNoException(); |
| 1355 | reply.writeInt(res); |
| 1356 | return true; |
| 1357 | } |
| 1358 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1359 | case CHECK_URI_PERMISSION_TRANSACTION: { |
| 1360 | data.enforceInterface(IActivityManager.descriptor); |
| 1361 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1362 | int pid = data.readInt(); |
| 1363 | int uid = data.readInt(); |
| 1364 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1365 | int userId = data.readInt(); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1366 | IBinder callerToken = data.readStrongBinder(); |
| 1367 | int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1368 | reply.writeNoException(); |
| 1369 | reply.writeInt(res); |
| 1370 | return true; |
| 1371 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1372 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1373 | case CLEAR_APP_DATA_TRANSACTION: { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1374 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1375 | String packageName = data.readString(); |
| 1376 | IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface( |
| 1377 | data.readStrongBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 1378 | int userId = data.readInt(); |
| 1379 | boolean res = clearApplicationUserData(packageName, observer, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1380 | reply.writeNoException(); |
| 1381 | reply.writeInt(res ? 1 : 0); |
| 1382 | return true; |
| 1383 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1384 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1385 | case GRANT_URI_PERMISSION_TRANSACTION: { |
| 1386 | data.enforceInterface(IActivityManager.descriptor); |
| 1387 | IBinder b = data.readStrongBinder(); |
| 1388 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1389 | String targetPkg = data.readString(); |
| 1390 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1391 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1392 | int userId = data.readInt(); |
| 1393 | grantUriPermission(app, targetPkg, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1394 | reply.writeNoException(); |
| 1395 | return true; |
| 1396 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1397 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1398 | case REVOKE_URI_PERMISSION_TRANSACTION: { |
| 1399 | data.enforceInterface(IActivityManager.descriptor); |
| 1400 | IBinder b = data.readStrongBinder(); |
| 1401 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1402 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1403 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1404 | int userId = data.readInt(); |
| 1405 | revokeUriPermission(app, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1406 | reply.writeNoException(); |
| 1407 | return true; |
| 1408 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1409 | |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1410 | case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1411 | data.enforceInterface(IActivityManager.descriptor); |
| 1412 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1413 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1414 | int userId = data.readInt(); |
| 1415 | takePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1416 | reply.writeNoException(); |
| 1417 | return true; |
| 1418 | } |
| 1419 | |
| 1420 | case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1421 | data.enforceInterface(IActivityManager.descriptor); |
| 1422 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1423 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1424 | int userId = data.readInt(); |
| 1425 | releasePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1426 | reply.writeNoException(); |
| 1427 | return true; |
| 1428 | } |
| 1429 | |
| 1430 | case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: { |
| 1431 | data.enforceInterface(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 1432 | final String packageName = data.readString(); |
| 1433 | final boolean incoming = data.readInt() != 0; |
| 1434 | final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions( |
| 1435 | packageName, incoming); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1436 | reply.writeNoException(); |
| 1437 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1438 | return true; |
| 1439 | } |
| 1440 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 1441 | case GET_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1442 | data.enforceInterface(IActivityManager.descriptor); |
| 1443 | final String packageName = data.readString(); |
| 1444 | final int userId = data.readInt(); |
| 1445 | final ParceledListSlice<UriPermission> perms = getGrantedUriPermissions(packageName, |
| 1446 | userId); |
| 1447 | reply.writeNoException(); |
| 1448 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1449 | return true; |
| 1450 | } |
| 1451 | |
| 1452 | case CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1453 | data.enforceInterface(IActivityManager.descriptor); |
| 1454 | final String packageName = data.readString(); |
| 1455 | final int userId = data.readInt(); |
| 1456 | clearGrantedUriPermissions(packageName, userId); |
| 1457 | reply.writeNoException(); |
| 1458 | return true; |
| 1459 | } |
| 1460 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1461 | case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: { |
| 1462 | data.enforceInterface(IActivityManager.descriptor); |
| 1463 | IBinder b = data.readStrongBinder(); |
| 1464 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1465 | boolean waiting = data.readInt() != 0; |
| 1466 | showWaitingForDebugger(app, waiting); |
| 1467 | reply.writeNoException(); |
| 1468 | return true; |
| 1469 | } |
| 1470 | |
| 1471 | case GET_MEMORY_INFO_TRANSACTION: { |
| 1472 | data.enforceInterface(IActivityManager.descriptor); |
| 1473 | ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); |
| 1474 | getMemoryInfo(mi); |
| 1475 | reply.writeNoException(); |
| 1476 | mi.writeToParcel(reply, 0); |
| 1477 | return true; |
| 1478 | } |
| 1479 | |
| 1480 | case UNHANDLED_BACK_TRANSACTION: { |
| 1481 | data.enforceInterface(IActivityManager.descriptor); |
| 1482 | unhandledBack(); |
| 1483 | reply.writeNoException(); |
| 1484 | return true; |
| 1485 | } |
| 1486 | |
| 1487 | case OPEN_CONTENT_URI_TRANSACTION: { |
| 1488 | data.enforceInterface(IActivityManager.descriptor); |
| 1489 | Uri uri = Uri.parse(data.readString()); |
| 1490 | ParcelFileDescriptor pfd = openContentUri(uri); |
| 1491 | reply.writeNoException(); |
| 1492 | if (pfd != null) { |
| 1493 | reply.writeInt(1); |
| 1494 | pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1495 | } else { |
| 1496 | reply.writeInt(0); |
| 1497 | } |
| 1498 | return true; |
| 1499 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1500 | |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1501 | case SET_LOCK_SCREEN_SHOWN_TRANSACTION: { |
| 1502 | data.enforceInterface(IActivityManager.descriptor); |
| 1503 | setLockScreenShown(data.readInt() != 0); |
| 1504 | reply.writeNoException(); |
| 1505 | return true; |
| 1506 | } |
| 1507 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1508 | case SET_DEBUG_APP_TRANSACTION: { |
| 1509 | data.enforceInterface(IActivityManager.descriptor); |
| 1510 | String pn = data.readString(); |
| 1511 | boolean wfd = data.readInt() != 0; |
| 1512 | boolean per = data.readInt() != 0; |
| 1513 | setDebugApp(pn, wfd, per); |
| 1514 | reply.writeNoException(); |
| 1515 | return true; |
| 1516 | } |
| 1517 | |
| 1518 | case SET_ALWAYS_FINISH_TRANSACTION: { |
| 1519 | data.enforceInterface(IActivityManager.descriptor); |
| 1520 | boolean enabled = data.readInt() != 0; |
| 1521 | setAlwaysFinish(enabled); |
| 1522 | reply.writeNoException(); |
| 1523 | return true; |
| 1524 | } |
| 1525 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1526 | case SET_ACTIVITY_CONTROLLER_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1527 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1528 | IActivityController watcher = IActivityController.Stub.asInterface( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1529 | data.readStrongBinder()); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1530 | setActivityController(watcher); |
Sungmin Choi | cdb86bb | 2012-12-20 14:08:59 +0900 | [diff] [blame] | 1531 | reply.writeNoException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1532 | return true; |
| 1533 | } |
| 1534 | |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 1535 | case SET_LENIENT_BACKGROUND_CHECK_TRANSACTION: { |
| 1536 | data.enforceInterface(IActivityManager.descriptor); |
| 1537 | boolean enabled = data.readInt() != 0; |
| 1538 | setLenientBackgroundCheck(enabled); |
| 1539 | reply.writeNoException(); |
| 1540 | return true; |
| 1541 | } |
| 1542 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1543 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1544 | data.enforceInterface(IActivityManager.descriptor); |
| 1545 | enterSafeMode(); |
| 1546 | reply.writeNoException(); |
| 1547 | return true; |
| 1548 | } |
| 1549 | |
| 1550 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1551 | data.enforceInterface(IActivityManager.descriptor); |
| 1552 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1553 | data.readStrongBinder()); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 1554 | int sourceUid = data.readInt(); |
| 1555 | String sourcePkg = data.readString(); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 1556 | String tag = data.readString(); |
| 1557 | noteWakeupAlarm(is, sourceUid, sourcePkg, tag); |
| 1558 | reply.writeNoException(); |
| 1559 | return true; |
| 1560 | } |
| 1561 | |
| 1562 | case NOTE_ALARM_START_TRANSACTION: { |
| 1563 | data.enforceInterface(IActivityManager.descriptor); |
| 1564 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1565 | data.readStrongBinder()); |
| 1566 | int sourceUid = data.readInt(); |
| 1567 | String tag = data.readString(); |
| 1568 | noteAlarmStart(is, sourceUid, tag); |
| 1569 | reply.writeNoException(); |
| 1570 | return true; |
| 1571 | } |
| 1572 | |
| 1573 | case NOTE_ALARM_FINISH_TRANSACTION: { |
| 1574 | data.enforceInterface(IActivityManager.descriptor); |
| 1575 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1576 | data.readStrongBinder()); |
| 1577 | int sourceUid = data.readInt(); |
| 1578 | String tag = data.readString(); |
| 1579 | noteAlarmFinish(is, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1580 | reply.writeNoException(); |
| 1581 | return true; |
| 1582 | } |
| 1583 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1584 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1585 | data.enforceInterface(IActivityManager.descriptor); |
| 1586 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1587 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1588 | boolean secure = data.readInt() != 0; |
| 1589 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1590 | reply.writeNoException(); |
| 1591 | reply.writeInt(res ? 1 : 0); |
| 1592 | return true; |
| 1593 | } |
| 1594 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1595 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1596 | data.enforceInterface(IActivityManager.descriptor); |
| 1597 | String reason = data.readString(); |
| 1598 | boolean res = killProcessesBelowForeground(reason); |
| 1599 | reply.writeNoException(); |
| 1600 | reply.writeInt(res ? 1 : 0); |
| 1601 | return true; |
| 1602 | } |
| 1603 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1604 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1605 | data.enforceInterface(IActivityManager.descriptor); |
| 1606 | IBinder app = data.readStrongBinder(); |
| 1607 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1608 | handleApplicationCrash(app, ci); |
| 1609 | reply.writeNoException(); |
| 1610 | return true; |
| 1611 | } |
| 1612 | |
| 1613 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1614 | data.enforceInterface(IActivityManager.descriptor); |
| 1615 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1616 | String tag = data.readString(); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1617 | boolean system = data.readInt() != 0; |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1618 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1619 | boolean res = handleApplicationWtf(app, tag, system, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1620 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1621 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1622 | return true; |
| 1623 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1624 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1625 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1626 | data.enforceInterface(IActivityManager.descriptor); |
| 1627 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1628 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1629 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1630 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1631 | reply.writeNoException(); |
| 1632 | return true; |
| 1633 | } |
| 1634 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1635 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1636 | data.enforceInterface(IActivityManager.descriptor); |
| 1637 | int sig = data.readInt(); |
| 1638 | signalPersistentProcesses(sig); |
| 1639 | reply.writeNoException(); |
| 1640 | return true; |
| 1641 | } |
| 1642 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1643 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1644 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1645 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1646 | int userId = data.readInt(); |
| 1647 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1648 | reply.writeNoException(); |
| 1649 | return true; |
| 1650 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1651 | |
| 1652 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1653 | data.enforceInterface(IActivityManager.descriptor); |
| 1654 | killAllBackgroundProcesses(); |
| 1655 | reply.writeNoException(); |
| 1656 | return true; |
| 1657 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1658 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 1659 | case KILL_PACKAGE_DEPENDENTS_TRANSACTION: { |
| 1660 | data.enforceInterface(IActivityManager.descriptor); |
| 1661 | String packageName = data.readString(); |
| 1662 | int userId = data.readInt(); |
| 1663 | killPackageDependents(packageName, userId); |
| 1664 | reply.writeNoException(); |
| 1665 | return true; |
| 1666 | } |
| 1667 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1668 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1669 | data.enforceInterface(IActivityManager.descriptor); |
| 1670 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1671 | int userId = data.readInt(); |
| 1672 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1673 | reply.writeNoException(); |
| 1674 | return true; |
| 1675 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1676 | |
| 1677 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1678 | data.enforceInterface(IActivityManager.descriptor); |
| 1679 | ActivityManager.RunningAppProcessInfo info = |
| 1680 | new ActivityManager.RunningAppProcessInfo(); |
| 1681 | getMyMemoryState(info); |
| 1682 | reply.writeNoException(); |
| 1683 | info.writeToParcel(reply, 0); |
| 1684 | return true; |
| 1685 | } |
| 1686 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1687 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1688 | data.enforceInterface(IActivityManager.descriptor); |
| 1689 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1690 | reply.writeNoException(); |
| 1691 | config.writeToParcel(reply, 0); |
| 1692 | return true; |
| 1693 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1694 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1695 | case PROFILE_CONTROL_TRANSACTION: { |
| 1696 | data.enforceInterface(IActivityManager.descriptor); |
| 1697 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1698 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1699 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1700 | int profileType = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1701 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 1702 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
| 1703 | boolean res = profileControl(process, userId, start, profilerInfo, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1704 | reply.writeNoException(); |
| 1705 | reply.writeInt(res ? 1 : 0); |
| 1706 | return true; |
| 1707 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1708 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1709 | case SHUTDOWN_TRANSACTION: { |
| 1710 | data.enforceInterface(IActivityManager.descriptor); |
| 1711 | boolean res = shutdown(data.readInt()); |
| 1712 | reply.writeNoException(); |
| 1713 | reply.writeInt(res ? 1 : 0); |
| 1714 | return true; |
| 1715 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1716 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1717 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1718 | data.enforceInterface(IActivityManager.descriptor); |
| 1719 | stopAppSwitches(); |
| 1720 | reply.writeNoException(); |
| 1721 | return true; |
| 1722 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1723 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1724 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1725 | data.enforceInterface(IActivityManager.descriptor); |
| 1726 | resumeAppSwitches(); |
| 1727 | reply.writeNoException(); |
| 1728 | return true; |
| 1729 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1730 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1731 | case PEEK_SERVICE_TRANSACTION: { |
| 1732 | data.enforceInterface(IActivityManager.descriptor); |
| 1733 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1734 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1735 | String callingPackage = data.readString(); |
| 1736 | IBinder binder = peekService(service, resolvedType, callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1737 | reply.writeNoException(); |
| 1738 | reply.writeStrongBinder(binder); |
| 1739 | return true; |
| 1740 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1741 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1742 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1743 | data.enforceInterface(IActivityManager.descriptor); |
| 1744 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1745 | int backupRestoreMode = data.readInt(); |
| 1746 | boolean success = bindBackupAgent(info, backupRestoreMode); |
| 1747 | reply.writeNoException(); |
| 1748 | reply.writeInt(success ? 1 : 0); |
| 1749 | return true; |
| 1750 | } |
| 1751 | |
| 1752 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1753 | data.enforceInterface(IActivityManager.descriptor); |
| 1754 | String packageName = data.readString(); |
| 1755 | IBinder agent = data.readStrongBinder(); |
| 1756 | backupAgentCreated(packageName, agent); |
| 1757 | reply.writeNoException(); |
| 1758 | return true; |
| 1759 | } |
| 1760 | |
| 1761 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1762 | data.enforceInterface(IActivityManager.descriptor); |
| 1763 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1764 | unbindBackupAgent(info); |
| 1765 | reply.writeNoException(); |
| 1766 | return true; |
| 1767 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1768 | |
| 1769 | case ADD_PACKAGE_DEPENDENCY_TRANSACTION: { |
| 1770 | data.enforceInterface(IActivityManager.descriptor); |
| 1771 | String packageName = data.readString(); |
| 1772 | addPackageDependency(packageName); |
| 1773 | reply.writeNoException(); |
| 1774 | return true; |
| 1775 | } |
| 1776 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1777 | case KILL_APPLICATION_WITH_APPID_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1778 | data.enforceInterface(IActivityManager.descriptor); |
| 1779 | String pkg = data.readString(); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1780 | int appid = data.readInt(); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 1781 | String reason = data.readString(); |
| 1782 | killApplicationWithAppId(pkg, appid, reason); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1783 | reply.writeNoException(); |
| 1784 | return true; |
| 1785 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1786 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1787 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1788 | data.enforceInterface(IActivityManager.descriptor); |
| 1789 | String reason = data.readString(); |
| 1790 | closeSystemDialogs(reason); |
| 1791 | reply.writeNoException(); |
| 1792 | return true; |
| 1793 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1794 | |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1795 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1796 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1797 | int[] pids = data.createIntArray(); |
| 1798 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1799 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1800 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1801 | return true; |
| 1802 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1803 | |
| 1804 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1805 | data.enforceInterface(IActivityManager.descriptor); |
| 1806 | String processName = data.readString(); |
| 1807 | int uid = data.readInt(); |
| 1808 | killApplicationProcess(processName, uid); |
| 1809 | reply.writeNoException(); |
| 1810 | return true; |
| 1811 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1812 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1813 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1814 | data.enforceInterface(IActivityManager.descriptor); |
| 1815 | IBinder token = data.readStrongBinder(); |
| 1816 | String packageName = data.readString(); |
| 1817 | int enterAnim = data.readInt(); |
| 1818 | int exitAnim = data.readInt(); |
| 1819 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1820 | reply.writeNoException(); |
| 1821 | return true; |
| 1822 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1823 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1824 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1825 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1826 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1827 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1828 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1829 | return true; |
| 1830 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1831 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1832 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1833 | data.enforceInterface(IActivityManager.descriptor); |
| 1834 | final boolean monkey = (data.readInt() == 1); |
| 1835 | setUserIsMonkey(monkey); |
| 1836 | reply.writeNoException(); |
| 1837 | return true; |
| 1838 | } |
| 1839 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1840 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1841 | data.enforceInterface(IActivityManager.descriptor); |
| 1842 | finishHeavyWeightApp(); |
| 1843 | reply.writeNoException(); |
| 1844 | return true; |
| 1845 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1846 | |
| 1847 | case IS_IMMERSIVE_TRANSACTION: { |
| 1848 | data.enforceInterface(IActivityManager.descriptor); |
| 1849 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1850 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1851 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1852 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1853 | return true; |
| 1854 | } |
| 1855 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 1856 | case IS_TOP_OF_TASK_TRANSACTION: { |
| 1857 | data.enforceInterface(IActivityManager.descriptor); |
| 1858 | IBinder token = data.readStrongBinder(); |
| 1859 | final boolean isTopOfTask = isTopOfTask(token); |
| 1860 | reply.writeNoException(); |
| 1861 | reply.writeInt(isTopOfTask ? 1 : 0); |
| 1862 | return true; |
| 1863 | } |
| 1864 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1865 | case CONVERT_FROM_TRANSLUCENT_TRANSACTION: { |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1866 | data.enforceInterface(IActivityManager.descriptor); |
| 1867 | IBinder token = data.readStrongBinder(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1868 | boolean converted = convertFromTranslucent(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1869 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1870 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1871 | return true; |
| 1872 | } |
| 1873 | |
| 1874 | case CONVERT_TO_TRANSLUCENT_TRANSACTION: { |
| 1875 | data.enforceInterface(IActivityManager.descriptor); |
| 1876 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1877 | final Bundle bundle; |
| 1878 | if (data.readInt() == 0) { |
| 1879 | bundle = null; |
| 1880 | } else { |
| 1881 | bundle = data.readBundle(); |
| 1882 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 1883 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1884 | boolean converted = convertToTranslucent(token, options); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1885 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1886 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1887 | return true; |
| 1888 | } |
| 1889 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1890 | case GET_ACTIVITY_OPTIONS_TRANSACTION: { |
| 1891 | data.enforceInterface(IActivityManager.descriptor); |
| 1892 | IBinder token = data.readStrongBinder(); |
| 1893 | final ActivityOptions options = getActivityOptions(token); |
| 1894 | reply.writeNoException(); |
| 1895 | reply.writeBundle(options == null ? null : options.toBundle()); |
| 1896 | return true; |
| 1897 | } |
| 1898 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1899 | case SET_IMMERSIVE_TRANSACTION: { |
| 1900 | data.enforceInterface(IActivityManager.descriptor); |
| 1901 | IBinder token = data.readStrongBinder(); |
| 1902 | boolean imm = data.readInt() == 1; |
| 1903 | setImmersive(token, imm); |
| 1904 | reply.writeNoException(); |
| 1905 | return true; |
| 1906 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1907 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1908 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1909 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1910 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1911 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1912 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1913 | return true; |
| 1914 | } |
| 1915 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1916 | case CRASH_APPLICATION_TRANSACTION: { |
| 1917 | data.enforceInterface(IActivityManager.descriptor); |
| 1918 | int uid = data.readInt(); |
| 1919 | int initialPid = data.readInt(); |
| 1920 | String packageName = data.readString(); |
| 1921 | String message = data.readString(); |
| 1922 | crashApplication(uid, initialPid, packageName, message); |
| 1923 | reply.writeNoException(); |
| 1924 | return true; |
| 1925 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1926 | |
| 1927 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1928 | data.enforceInterface(IActivityManager.descriptor); |
| 1929 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1930 | int userId = data.readInt(); |
| 1931 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1932 | reply.writeNoException(); |
| 1933 | reply.writeString(type); |
| 1934 | return true; |
| 1935 | } |
| 1936 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1937 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1938 | data.enforceInterface(IActivityManager.descriptor); |
| 1939 | String name = data.readString(); |
| 1940 | IBinder perm = newUriPermissionOwner(name); |
| 1941 | reply.writeNoException(); |
| 1942 | reply.writeStrongBinder(perm); |
| 1943 | return true; |
| 1944 | } |
| 1945 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 1946 | case GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION: { |
| 1947 | data.enforceInterface(IActivityManager.descriptor); |
| 1948 | IBinder activityToken = data.readStrongBinder(); |
| 1949 | IBinder perm = getUriPermissionOwnerForActivity(activityToken); |
| 1950 | reply.writeNoException(); |
| 1951 | reply.writeStrongBinder(perm); |
| 1952 | return true; |
| 1953 | } |
| 1954 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1955 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1956 | data.enforceInterface(IActivityManager.descriptor); |
| 1957 | IBinder owner = data.readStrongBinder(); |
| 1958 | int fromUid = data.readInt(); |
| 1959 | String targetPkg = data.readString(); |
| 1960 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1961 | int mode = data.readInt(); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 1962 | int sourceUserId = data.readInt(); |
| 1963 | int targetUserId = data.readInt(); |
| 1964 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId, |
| 1965 | targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1966 | reply.writeNoException(); |
| 1967 | return true; |
| 1968 | } |
| 1969 | |
| 1970 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1971 | data.enforceInterface(IActivityManager.descriptor); |
| 1972 | IBinder owner = data.readStrongBinder(); |
| 1973 | Uri uri = null; |
| 1974 | if (data.readInt() != 0) { |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1975 | uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1976 | } |
| 1977 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1978 | int userId = data.readInt(); |
| 1979 | revokeUriPermissionFromOwner(owner, uri, mode, userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1980 | reply.writeNoException(); |
| 1981 | return true; |
| 1982 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1983 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1984 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 1985 | data.enforceInterface(IActivityManager.descriptor); |
| 1986 | int callingUid = data.readInt(); |
| 1987 | String targetPkg = data.readString(); |
| 1988 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1989 | int modeFlags = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1990 | int userId = data.readInt(); |
| 1991 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1992 | reply.writeNoException(); |
| 1993 | reply.writeInt(res); |
| 1994 | return true; |
| 1995 | } |
| 1996 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1997 | case DUMP_HEAP_TRANSACTION: { |
| 1998 | data.enforceInterface(IActivityManager.descriptor); |
| 1999 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 2000 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2001 | boolean managed = data.readInt() != 0; |
| 2002 | String path = data.readString(); |
| 2003 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 2004 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 2005 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2006 | reply.writeNoException(); |
| 2007 | reply.writeInt(res ? 1 : 0); |
| 2008 | return true; |
| 2009 | } |
| 2010 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2011 | case START_ACTIVITIES_TRANSACTION: |
| 2012 | { |
| 2013 | data.enforceInterface(IActivityManager.descriptor); |
| 2014 | IBinder b = data.readStrongBinder(); |
| 2015 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2016 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2017 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 2018 | String[] resolvedTypes = data.createStringArray(); |
| 2019 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2020 | Bundle options = data.readInt() != 0 |
| 2021 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2022 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2023 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2024 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2025 | reply.writeNoException(); |
| 2026 | reply.writeInt(result); |
| 2027 | return true; |
| 2028 | } |
| 2029 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2030 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2031 | { |
| 2032 | data.enforceInterface(IActivityManager.descriptor); |
| 2033 | int mode = getFrontActivityScreenCompatMode(); |
| 2034 | reply.writeNoException(); |
| 2035 | reply.writeInt(mode); |
| 2036 | return true; |
| 2037 | } |
| 2038 | |
| 2039 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2040 | { |
| 2041 | data.enforceInterface(IActivityManager.descriptor); |
| 2042 | int mode = data.readInt(); |
| 2043 | setFrontActivityScreenCompatMode(mode); |
| 2044 | reply.writeNoException(); |
| 2045 | reply.writeInt(mode); |
| 2046 | return true; |
| 2047 | } |
| 2048 | |
| 2049 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2050 | { |
| 2051 | data.enforceInterface(IActivityManager.descriptor); |
| 2052 | String pkg = data.readString(); |
| 2053 | int mode = getPackageScreenCompatMode(pkg); |
| 2054 | reply.writeNoException(); |
| 2055 | reply.writeInt(mode); |
| 2056 | return true; |
| 2057 | } |
| 2058 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2059 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2060 | { |
| 2061 | data.enforceInterface(IActivityManager.descriptor); |
| 2062 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2063 | int mode = data.readInt(); |
| 2064 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2065 | reply.writeNoException(); |
| 2066 | return true; |
| 2067 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2068 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2069 | case SWITCH_USER_TRANSACTION: { |
| 2070 | data.enforceInterface(IActivityManager.descriptor); |
| 2071 | int userid = data.readInt(); |
| 2072 | boolean result = switchUser(userid); |
| 2073 | reply.writeNoException(); |
| 2074 | reply.writeInt(result ? 1 : 0); |
| 2075 | return true; |
| 2076 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2077 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 2078 | case START_USER_IN_BACKGROUND_TRANSACTION: { |
| 2079 | data.enforceInterface(IActivityManager.descriptor); |
| 2080 | int userid = data.readInt(); |
| 2081 | boolean result = startUserInBackground(userid); |
| 2082 | reply.writeNoException(); |
| 2083 | reply.writeInt(result ? 1 : 0); |
| 2084 | return true; |
| 2085 | } |
| 2086 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2087 | case UNLOCK_USER_TRANSACTION: { |
| 2088 | data.enforceInterface(IActivityManager.descriptor); |
| 2089 | int userId = data.readInt(); |
| 2090 | byte[] token = data.createByteArray(); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 2091 | byte[] secret = data.createByteArray(); |
| 2092 | boolean result = unlockUser(userId, token, secret); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2093 | reply.writeNoException(); |
| 2094 | reply.writeInt(result ? 1 : 0); |
| 2095 | return true; |
| 2096 | } |
| 2097 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2098 | case STOP_USER_TRANSACTION: { |
| 2099 | data.enforceInterface(IActivityManager.descriptor); |
| 2100 | int userid = data.readInt(); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2101 | boolean force = data.readInt() != 0; |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2102 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 2103 | data.readStrongBinder()); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2104 | int result = stopUser(userid, force, callback); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2105 | reply.writeNoException(); |
| 2106 | reply.writeInt(result); |
| 2107 | return true; |
| 2108 | } |
| 2109 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2110 | case GET_CURRENT_USER_TRANSACTION: { |
| 2111 | data.enforceInterface(IActivityManager.descriptor); |
| 2112 | UserInfo userInfo = getCurrentUser(); |
| 2113 | reply.writeNoException(); |
| 2114 | userInfo.writeToParcel(reply, 0); |
| 2115 | return true; |
| 2116 | } |
| 2117 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2118 | case IS_USER_RUNNING_TRANSACTION: { |
| 2119 | data.enforceInterface(IActivityManager.descriptor); |
| 2120 | int userid = data.readInt(); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 2121 | int _flags = data.readInt(); |
| 2122 | boolean result = isUserRunning(userid, _flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2123 | reply.writeNoException(); |
| 2124 | reply.writeInt(result ? 1 : 0); |
| 2125 | return true; |
| 2126 | } |
| 2127 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 2128 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 2129 | data.enforceInterface(IActivityManager.descriptor); |
| 2130 | int[] result = getRunningUserIds(); |
| 2131 | reply.writeNoException(); |
| 2132 | reply.writeIntArray(result); |
| 2133 | return true; |
| 2134 | } |
| 2135 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2136 | case REMOVE_TASK_TRANSACTION: |
| 2137 | { |
| 2138 | data.enforceInterface(IActivityManager.descriptor); |
| 2139 | int taskId = data.readInt(); |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 2140 | boolean result = removeTask(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2141 | reply.writeNoException(); |
| 2142 | reply.writeInt(result ? 1 : 0); |
| 2143 | return true; |
| 2144 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2145 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 2146 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2147 | data.enforceInterface(IActivityManager.descriptor); |
| 2148 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2149 | data.readStrongBinder()); |
| 2150 | registerProcessObserver(observer); |
| 2151 | return true; |
| 2152 | } |
| 2153 | |
| 2154 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2155 | data.enforceInterface(IActivityManager.descriptor); |
| 2156 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2157 | data.readStrongBinder()); |
| 2158 | unregisterProcessObserver(observer); |
| 2159 | return true; |
| 2160 | } |
| 2161 | |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2162 | case REGISTER_UID_OBSERVER_TRANSACTION: { |
| 2163 | data.enforceInterface(IActivityManager.descriptor); |
| 2164 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2165 | data.readStrongBinder()); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2166 | int which = data.readInt(); |
| 2167 | registerUidObserver(observer, which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2168 | return true; |
| 2169 | } |
| 2170 | |
| 2171 | case UNREGISTER_UID_OBSERVER_TRANSACTION: { |
| 2172 | data.enforceInterface(IActivityManager.descriptor); |
| 2173 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2174 | data.readStrongBinder()); |
| 2175 | unregisterUidObserver(observer); |
| 2176 | return true; |
| 2177 | } |
| 2178 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 2179 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2180 | { |
| 2181 | data.enforceInterface(IActivityManager.descriptor); |
| 2182 | String pkg = data.readString(); |
| 2183 | boolean ask = getPackageAskScreenCompat(pkg); |
| 2184 | reply.writeNoException(); |
| 2185 | reply.writeInt(ask ? 1 : 0); |
| 2186 | return true; |
| 2187 | } |
| 2188 | |
| 2189 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2190 | { |
| 2191 | data.enforceInterface(IActivityManager.descriptor); |
| 2192 | String pkg = data.readString(); |
| 2193 | boolean ask = data.readInt() != 0; |
| 2194 | setPackageAskScreenCompat(pkg, ask); |
| 2195 | reply.writeNoException(); |
| 2196 | return true; |
| 2197 | } |
| 2198 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2199 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 2200 | data.enforceInterface(IActivityManager.descriptor); |
| 2201 | IIntentSender r = IIntentSender.Stub.asInterface( |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2202 | data.readStrongBinder()); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2203 | boolean res = isIntentSenderTargetedToPackage(r); |
| 2204 | reply.writeNoException(); |
| 2205 | reply.writeInt(res ? 1 : 0); |
| 2206 | return true; |
| 2207 | } |
| 2208 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 2209 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 2210 | data.enforceInterface(IActivityManager.descriptor); |
| 2211 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2212 | data.readStrongBinder()); |
| 2213 | boolean res = isIntentSenderAnActivity(r); |
| 2214 | reply.writeNoException(); |
| 2215 | reply.writeInt(res ? 1 : 0); |
| 2216 | return true; |
| 2217 | } |
| 2218 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 2219 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 2220 | data.enforceInterface(IActivityManager.descriptor); |
| 2221 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2222 | data.readStrongBinder()); |
| 2223 | Intent intent = getIntentForIntentSender(r); |
| 2224 | reply.writeNoException(); |
| 2225 | if (intent != null) { |
| 2226 | reply.writeInt(1); |
| 2227 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2228 | } else { |
| 2229 | reply.writeInt(0); |
| 2230 | } |
| 2231 | return true; |
| 2232 | } |
| 2233 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 2234 | case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { |
| 2235 | data.enforceInterface(IActivityManager.descriptor); |
| 2236 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2237 | data.readStrongBinder()); |
| 2238 | String prefix = data.readString(); |
| 2239 | String tag = getTagForIntentSender(r, prefix); |
| 2240 | reply.writeNoException(); |
| 2241 | reply.writeString(tag); |
| 2242 | return true; |
| 2243 | } |
| 2244 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2245 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 2246 | data.enforceInterface(IActivityManager.descriptor); |
| 2247 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 2248 | updatePersistentConfiguration(config); |
| 2249 | reply.writeNoException(); |
| 2250 | return true; |
| 2251 | } |
| 2252 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 2253 | case GET_PROCESS_PSS_TRANSACTION: { |
| 2254 | data.enforceInterface(IActivityManager.descriptor); |
| 2255 | int[] pids = data.createIntArray(); |
| 2256 | long[] pss = getProcessPss(pids); |
| 2257 | reply.writeNoException(); |
| 2258 | reply.writeLongArray(pss); |
| 2259 | return true; |
| 2260 | } |
| 2261 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 2262 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 2263 | data.enforceInterface(IActivityManager.descriptor); |
| 2264 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 2265 | boolean always = data.readInt() != 0; |
| 2266 | showBootMessage(msg, always); |
| 2267 | reply.writeNoException(); |
| 2268 | return true; |
| 2269 | } |
| 2270 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2271 | case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2272 | data.enforceInterface(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2273 | keyguardWaitingForActivityDrawn(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2274 | reply.writeNoException(); |
| 2275 | return true; |
| 2276 | } |
| 2277 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2278 | case KEYGUARD_GOING_AWAY_TRANSACTION: { |
| 2279 | data.enforceInterface(IActivityManager.descriptor); |
| 2280 | keyguardGoingAway(data.readInt() != 0, data.readInt() != 0); |
| 2281 | reply.writeNoException(); |
| 2282 | return true; |
| 2283 | } |
| 2284 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2285 | case SHOULD_UP_RECREATE_TASK_TRANSACTION: { |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2286 | data.enforceInterface(IActivityManager.descriptor); |
| 2287 | IBinder token = data.readStrongBinder(); |
| 2288 | String destAffinity = data.readString(); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2289 | boolean res = shouldUpRecreateTask(token, destAffinity); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2290 | reply.writeNoException(); |
| 2291 | reply.writeInt(res ? 1 : 0); |
| 2292 | return true; |
| 2293 | } |
| 2294 | |
| 2295 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 2296 | data.enforceInterface(IActivityManager.descriptor); |
| 2297 | IBinder token = data.readStrongBinder(); |
| 2298 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 2299 | int resultCode = data.readInt(); |
| 2300 | Intent resultData = null; |
| 2301 | if (data.readInt() != 0) { |
| 2302 | resultData = Intent.CREATOR.createFromParcel(data); |
| 2303 | } |
| 2304 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 2305 | reply.writeNoException(); |
| 2306 | reply.writeInt(res ? 1 : 0); |
| 2307 | return true; |
| 2308 | } |
| 2309 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 2310 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 2311 | data.enforceInterface(IActivityManager.descriptor); |
| 2312 | IBinder token = data.readStrongBinder(); |
| 2313 | int res = getLaunchedFromUid(token); |
| 2314 | reply.writeNoException(); |
| 2315 | reply.writeInt(res); |
| 2316 | return true; |
| 2317 | } |
| 2318 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2319 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 2320 | data.enforceInterface(IActivityManager.descriptor); |
| 2321 | IBinder token = data.readStrongBinder(); |
| 2322 | String res = getLaunchedFromPackage(token); |
| 2323 | reply.writeNoException(); |
| 2324 | reply.writeString(res); |
| 2325 | return true; |
| 2326 | } |
| 2327 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2328 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2329 | data.enforceInterface(IActivityManager.descriptor); |
| 2330 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2331 | data.readStrongBinder()); |
| 2332 | registerUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2333 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2334 | return true; |
| 2335 | } |
| 2336 | |
| 2337 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2338 | data.enforceInterface(IActivityManager.descriptor); |
| 2339 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2340 | data.readStrongBinder()); |
| 2341 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2342 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2343 | return true; |
| 2344 | } |
| 2345 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2346 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 2347 | data.enforceInterface(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 2348 | int bugreportType = data.readInt(); |
| 2349 | requestBugReport(bugreportType); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2350 | reply.writeNoException(); |
| 2351 | return true; |
| 2352 | } |
| 2353 | |
| 2354 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 2355 | data.enforceInterface(IActivityManager.descriptor); |
| 2356 | int pid = data.readInt(); |
| 2357 | boolean aboveSystem = data.readInt() != 0; |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 2358 | String reason = data.readString(); |
| 2359 | long res = inputDispatchingTimedOut(pid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2360 | reply.writeNoException(); |
| 2361 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2362 | return true; |
| 2363 | } |
| 2364 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2365 | case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2366 | data.enforceInterface(IActivityManager.descriptor); |
| 2367 | int requestType = data.readInt(); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2368 | Bundle res = getAssistContextExtras(requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2369 | reply.writeNoException(); |
| 2370 | reply.writeBundle(res); |
| 2371 | return true; |
| 2372 | } |
| 2373 | |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2374 | case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
| 2375 | data.enforceInterface(IActivityManager.descriptor); |
| 2376 | int requestType = data.readInt(); |
| 2377 | IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2378 | IBinder activityToken = data.readStrongBinder(); |
| 2379 | boolean res = requestAssistContextExtras(requestType, receiver, activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2380 | reply.writeNoException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2381 | reply.writeInt(res ? 1 : 0); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2382 | return true; |
| 2383 | } |
| 2384 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2385 | case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2386 | data.enforceInterface(IActivityManager.descriptor); |
| 2387 | IBinder token = data.readStrongBinder(); |
| 2388 | Bundle extras = data.readBundle(); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 2389 | AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data); |
| 2390 | AssistContent content = AssistContent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 2391 | Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null; |
| 2392 | reportAssistContextExtras(token, extras, structure, content, referrer); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2393 | reply.writeNoException(); |
| 2394 | return true; |
| 2395 | } |
| 2396 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2397 | case LAUNCH_ASSIST_INTENT_TRANSACTION: { |
| 2398 | data.enforceInterface(IActivityManager.descriptor); |
| 2399 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2400 | int requestType = data.readInt(); |
| 2401 | String hint = data.readString(); |
| 2402 | int userHandle = data.readInt(); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 2403 | Bundle args = data.readBundle(); |
| 2404 | boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2405 | reply.writeNoException(); |
| 2406 | reply.writeInt(res ? 1 : 0); |
| 2407 | return true; |
| 2408 | } |
| 2409 | |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2410 | case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: { |
| 2411 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2412 | boolean res = isAssistDataAllowedOnCurrentActivity(); |
| 2413 | reply.writeNoException(); |
| 2414 | reply.writeInt(res ? 1 : 0); |
| 2415 | return true; |
| 2416 | } |
| 2417 | |
| 2418 | case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: { |
| 2419 | data.enforceInterface(IActivityManager.descriptor); |
| 2420 | IBinder token = data.readStrongBinder(); |
| 2421 | Bundle args = data.readBundle(); |
| 2422 | boolean res = showAssistFromActivity(token, args); |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2423 | reply.writeNoException(); |
| 2424 | reply.writeInt(res ? 1 : 0); |
| 2425 | return true; |
| 2426 | } |
| 2427 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2428 | case KILL_UID_TRANSACTION: { |
| 2429 | data.enforceInterface(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2430 | int appId = data.readInt(); |
| 2431 | int userId = data.readInt(); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2432 | String reason = data.readString(); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2433 | killUid(appId, userId, reason); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2434 | reply.writeNoException(); |
| 2435 | return true; |
| 2436 | } |
| 2437 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2438 | case HANG_TRANSACTION: { |
| 2439 | data.enforceInterface(IActivityManager.descriptor); |
| 2440 | IBinder who = data.readStrongBinder(); |
| 2441 | boolean allowRestart = data.readInt() != 0; |
| 2442 | hang(who, allowRestart); |
| 2443 | reply.writeNoException(); |
| 2444 | return true; |
| 2445 | } |
| 2446 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2447 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2448 | data.enforceInterface(IActivityManager.descriptor); |
| 2449 | IBinder token = data.readStrongBinder(); |
| 2450 | reportActivityFullyDrawn(token); |
| 2451 | reply.writeNoException(); |
| 2452 | return true; |
| 2453 | } |
| 2454 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2455 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2456 | data.enforceInterface(IActivityManager.descriptor); |
| 2457 | IBinder token = data.readStrongBinder(); |
| 2458 | notifyActivityDrawn(token); |
| 2459 | reply.writeNoException(); |
| 2460 | return true; |
| 2461 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2462 | |
| 2463 | case RESTART_TRANSACTION: { |
| 2464 | data.enforceInterface(IActivityManager.descriptor); |
| 2465 | restart(); |
| 2466 | reply.writeNoException(); |
| 2467 | return true; |
| 2468 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2469 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2470 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2471 | data.enforceInterface(IActivityManager.descriptor); |
| 2472 | performIdleMaintenance(); |
| 2473 | reply.writeNoException(); |
| 2474 | return true; |
| 2475 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2476 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2477 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2478 | data.enforceInterface(IActivityManager.descriptor); |
| 2479 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2480 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2481 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2482 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2483 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2484 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2485 | if (activityContainer != null) { |
| 2486 | reply.writeInt(1); |
| 2487 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2488 | } else { |
| 2489 | reply.writeInt(0); |
| 2490 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2491 | return true; |
| 2492 | } |
| 2493 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2494 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2495 | data.enforceInterface(IActivityManager.descriptor); |
| 2496 | IActivityContainer activityContainer = |
| 2497 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2498 | deleteActivityContainer(activityContainer); |
| 2499 | reply.writeNoException(); |
| 2500 | return true; |
| 2501 | } |
| 2502 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2503 | case CREATE_STACK_ON_DISPLAY: { |
| 2504 | data.enforceInterface(IActivityManager.descriptor); |
| 2505 | int displayId = data.readInt(); |
| 2506 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2507 | reply.writeNoException(); |
| 2508 | if (activityContainer != null) { |
| 2509 | reply.writeInt(1); |
| 2510 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2511 | } else { |
| 2512 | reply.writeInt(0); |
| 2513 | } |
| 2514 | return true; |
| 2515 | } |
| 2516 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2517 | case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: { |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2518 | data.enforceInterface(IActivityManager.descriptor); |
| 2519 | IBinder activityToken = data.readStrongBinder(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2520 | int displayId = getActivityDisplayId(activityToken); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2521 | reply.writeNoException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2522 | reply.writeInt(displayId); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2523 | return true; |
| 2524 | } |
| 2525 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2526 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2527 | data.enforceInterface(IActivityManager.descriptor); |
| 2528 | final int taskId = data.readInt(); |
| 2529 | startLockTaskMode(taskId); |
| 2530 | reply.writeNoException(); |
| 2531 | return true; |
| 2532 | } |
| 2533 | |
| 2534 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2535 | data.enforceInterface(IActivityManager.descriptor); |
| 2536 | IBinder token = data.readStrongBinder(); |
| 2537 | startLockTaskMode(token); |
| 2538 | reply.writeNoException(); |
| 2539 | return true; |
| 2540 | } |
| 2541 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2542 | case START_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2543 | data.enforceInterface(IActivityManager.descriptor); |
| 2544 | startLockTaskModeOnCurrent(); |
| 2545 | reply.writeNoException(); |
| 2546 | return true; |
| 2547 | } |
| 2548 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2549 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2550 | data.enforceInterface(IActivityManager.descriptor); |
| 2551 | stopLockTaskMode(); |
| 2552 | reply.writeNoException(); |
| 2553 | return true; |
| 2554 | } |
| 2555 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2556 | case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2557 | data.enforceInterface(IActivityManager.descriptor); |
| 2558 | stopLockTaskModeOnCurrent(); |
| 2559 | reply.writeNoException(); |
| 2560 | return true; |
| 2561 | } |
| 2562 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2563 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2564 | data.enforceInterface(IActivityManager.descriptor); |
| 2565 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2566 | reply.writeNoException(); |
| 2567 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2568 | return true; |
| 2569 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2570 | |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 2571 | case GET_LOCK_TASK_MODE_STATE_TRANSACTION: { |
| 2572 | data.enforceInterface(IActivityManager.descriptor); |
| 2573 | final int lockTaskModeState = getLockTaskModeState(); |
| 2574 | reply.writeNoException(); |
| 2575 | reply.writeInt(lockTaskModeState); |
| 2576 | return true; |
| 2577 | } |
| 2578 | |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 2579 | case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: { |
| 2580 | data.enforceInterface(IActivityManager.descriptor); |
| 2581 | final IBinder token = data.readStrongBinder(); |
| 2582 | showLockTaskEscapeMessage(token); |
| 2583 | reply.writeNoException(); |
| 2584 | return true; |
| 2585 | } |
| 2586 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2587 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2588 | data.enforceInterface(IActivityManager.descriptor); |
| 2589 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2590 | ActivityManager.TaskDescription values = |
| 2591 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2592 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2593 | reply.writeNoException(); |
| 2594 | return true; |
| 2595 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2596 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2597 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2598 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 2599 | final int taskId = data.readInt(); |
| 2600 | final int resizeableMode = data.readInt(); |
| 2601 | setTaskResizeable(taskId, resizeableMode); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2602 | reply.writeNoException(); |
| 2603 | return true; |
| 2604 | } |
| 2605 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2606 | case RESIZE_TASK_TRANSACTION: { |
| 2607 | data.enforceInterface(IActivityManager.descriptor); |
| 2608 | int taskId = data.readInt(); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2609 | int resizeMode = data.readInt(); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2610 | Rect r = Rect.CREATOR.createFromParcel(data); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2611 | resizeTask(taskId, r, resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2612 | reply.writeNoException(); |
| 2613 | return true; |
| 2614 | } |
| 2615 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 2616 | case GET_TASK_BOUNDS_TRANSACTION: { |
| 2617 | data.enforceInterface(IActivityManager.descriptor); |
| 2618 | int taskId = data.readInt(); |
| 2619 | Rect r = getTaskBounds(taskId); |
| 2620 | reply.writeNoException(); |
| 2621 | r.writeToParcel(reply, 0); |
| 2622 | return true; |
| 2623 | } |
| 2624 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2625 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2626 | data.enforceInterface(IActivityManager.descriptor); |
| 2627 | String filename = data.readString(); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 2628 | int userId = data.readInt(); |
| 2629 | Bitmap icon = getTaskDescriptionIcon(filename, userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2630 | reply.writeNoException(); |
| 2631 | if (icon == null) { |
| 2632 | reply.writeInt(0); |
| 2633 | } else { |
| 2634 | reply.writeInt(1); |
| 2635 | icon.writeToParcel(reply, 0); |
| 2636 | } |
| 2637 | return true; |
| 2638 | } |
| 2639 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2640 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2641 | data.enforceInterface(IActivityManager.descriptor); |
| 2642 | final Bundle bundle; |
| 2643 | if (data.readInt() == 0) { |
| 2644 | bundle = null; |
| 2645 | } else { |
| 2646 | bundle = data.readBundle(); |
| 2647 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 2648 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2649 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2650 | reply.writeNoException(); |
| 2651 | return true; |
| 2652 | } |
| 2653 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2654 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2655 | data.enforceInterface(IActivityManager.descriptor); |
| 2656 | IBinder token = data.readStrongBinder(); |
| 2657 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2658 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2659 | reply.writeNoException(); |
| 2660 | reply.writeInt(success ? 1 : 0); |
| 2661 | return true; |
| 2662 | } |
| 2663 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2664 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2665 | data.enforceInterface(IActivityManager.descriptor); |
| 2666 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2667 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2668 | reply.writeNoException(); |
| 2669 | reply.writeInt(enabled ? 1 : 0); |
| 2670 | return true; |
| 2671 | } |
| 2672 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2673 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2674 | data.enforceInterface(IActivityManager.descriptor); |
| 2675 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2676 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2677 | reply.writeNoException(); |
| 2678 | return true; |
| 2679 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2680 | |
| 2681 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2682 | data.enforceInterface(IActivityManager.descriptor); |
| 2683 | IBinder token = data.readStrongBinder(); |
| 2684 | notifyLaunchTaskBehindComplete(token); |
| 2685 | reply.writeNoException(); |
| 2686 | return true; |
| 2687 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2688 | |
| 2689 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2690 | data.enforceInterface(IActivityManager.descriptor); |
| 2691 | IBinder token = data.readStrongBinder(); |
| 2692 | notifyEnterAnimationComplete(token); |
| 2693 | reply.writeNoException(); |
| 2694 | return true; |
| 2695 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2696 | |
| 2697 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2698 | data.enforceInterface(IActivityManager.descriptor); |
| 2699 | bootAnimationComplete(); |
| 2700 | reply.writeNoException(); |
| 2701 | return true; |
| 2702 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2703 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2704 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2705 | data.enforceInterface(IActivityManager.descriptor); |
| 2706 | final int uid = data.readInt(); |
| 2707 | final byte[] firstPacket = data.createByteArray(); |
| 2708 | notifyCleartextNetwork(uid, firstPacket); |
| 2709 | reply.writeNoException(); |
| 2710 | return true; |
| 2711 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2712 | |
| 2713 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2714 | data.enforceInterface(IActivityManager.descriptor); |
| 2715 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2716 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2717 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2718 | String reportPackage = data.readString(); |
| 2719 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2720 | reply.writeNoException(); |
| 2721 | return true; |
| 2722 | } |
| 2723 | |
| 2724 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2725 | data.enforceInterface(IActivityManager.descriptor); |
| 2726 | String path = data.readString(); |
| 2727 | dumpHeapFinished(path); |
| 2728 | reply.writeNoException(); |
| 2729 | return true; |
| 2730 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2731 | |
| 2732 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2733 | data.enforceInterface(IActivityManager.descriptor); |
| 2734 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2735 | data.readStrongBinder()); |
| 2736 | boolean keepAwake = data.readInt() != 0; |
| 2737 | setVoiceKeepAwake(session, keepAwake); |
| 2738 | reply.writeNoException(); |
| 2739 | return true; |
| 2740 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2741 | |
| 2742 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2743 | data.enforceInterface(IActivityManager.descriptor); |
| 2744 | int userId = data.readInt(); |
| 2745 | String[] packages = data.readStringArray(); |
| 2746 | updateLockTaskPackages(userId, packages); |
| 2747 | reply.writeNoException(); |
| 2748 | return true; |
| 2749 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2750 | |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 2751 | case UPDATE_DEVICE_OWNER_TRANSACTION: { |
| 2752 | data.enforceInterface(IActivityManager.descriptor); |
| 2753 | String packageName = data.readString(); |
| 2754 | updateDeviceOwner(packageName); |
| 2755 | reply.writeNoException(); |
| 2756 | return true; |
| 2757 | } |
| 2758 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2759 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2760 | data.enforceInterface(IActivityManager.descriptor); |
| 2761 | String pkg = data.readString(); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 2762 | String callingPackage = data.readString(); |
| 2763 | int res = getPackageProcessState(pkg, callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2764 | reply.writeNoException(); |
| 2765 | reply.writeInt(res); |
| 2766 | return true; |
| 2767 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2768 | |
| 2769 | case SET_PROCESS_MEMORY_TRIM_TRANSACTION: { |
| 2770 | data.enforceInterface(IActivityManager.descriptor); |
| 2771 | String process = data.readString(); |
| 2772 | int userId = data.readInt(); |
| 2773 | int level = data.readInt(); |
| 2774 | boolean res = setProcessMemoryTrimLevel(process, userId, level); |
| 2775 | reply.writeNoException(); |
| 2776 | reply.writeInt(res ? 1 : 0); |
| 2777 | return true; |
| 2778 | } |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2779 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 2780 | case IS_ROOT_VOICE_INTERACTION_TRANSACTION: { |
| 2781 | data.enforceInterface(IActivityManager.descriptor); |
| 2782 | IBinder token = data.readStrongBinder(); |
| 2783 | boolean res = isRootVoiceInteraction(token); |
| 2784 | reply.writeNoException(); |
| 2785 | reply.writeInt(res ? 1 : 0); |
| 2786 | return true; |
| 2787 | } |
Ian Pedowitz | a371084 | 2015-08-03 23:36:15 -0700 | [diff] [blame] | 2788 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2789 | case START_BINDER_TRACKING_TRANSACTION: { |
| 2790 | data.enforceInterface(IActivityManager.descriptor); |
| 2791 | boolean res = startBinderTracking(); |
| 2792 | reply.writeNoException(); |
| 2793 | reply.writeInt(res ? 1 : 0); |
| 2794 | return true; |
| 2795 | } |
| 2796 | |
| 2797 | case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: { |
| 2798 | data.enforceInterface(IActivityManager.descriptor); |
| 2799 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 2800 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
| 2801 | boolean res = stopBinderTrackingAndDump(fd); |
| 2802 | reply.writeNoException(); |
| 2803 | reply.writeInt(res ? 1 : 0); |
| 2804 | return true; |
| 2805 | } |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2806 | case GET_ACTIVITY_STACK_ID_TRANSACTION: { |
| 2807 | data.enforceInterface(IActivityManager.descriptor); |
| 2808 | IBinder token = data.readStrongBinder(); |
| 2809 | int stackId = getActivityStackId(token); |
| 2810 | reply.writeNoException(); |
| 2811 | reply.writeInt(stackId); |
| 2812 | return true; |
| 2813 | } |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2814 | case EXIT_FREEFORM_MODE_TRANSACTION: { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2815 | data.enforceInterface(IActivityManager.descriptor); |
| 2816 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2817 | exitFreeformMode(token); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2818 | reply.writeNoException(); |
| 2819 | return true; |
| 2820 | } |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2821 | case REPORT_SIZE_CONFIGURATIONS: { |
| 2822 | data.enforceInterface(IActivityManager.descriptor); |
| 2823 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2824 | int[] horizontal = readIntArray(data); |
| 2825 | int[] vertical = readIntArray(data); |
| 2826 | int[] smallest = readIntArray(data); |
| 2827 | reportSizeConfigurations(token, horizontal, vertical, smallest); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2828 | return true; |
| 2829 | } |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 2830 | case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: { |
| 2831 | data.enforceInterface(IActivityManager.descriptor); |
| 2832 | final boolean suppress = data.readInt() == 1; |
| 2833 | suppressResizeConfigChanges(suppress); |
| 2834 | reply.writeNoException(); |
| 2835 | return true; |
| 2836 | } |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 2837 | case MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION: { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2838 | data.enforceInterface(IActivityManager.descriptor); |
| 2839 | final int stackId = data.readInt(); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 2840 | final boolean onTop = data.readInt() == 1; |
| 2841 | moveTasksToFullscreenStack(stackId, onTop); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2842 | reply.writeNoException(); |
| 2843 | return true; |
| 2844 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2845 | case GET_APP_START_MODE_TRANSACTION: { |
| 2846 | data.enforceInterface(IActivityManager.descriptor); |
| 2847 | final int uid = data.readInt(); |
| 2848 | final String pkg = data.readString(); |
| 2849 | int res = getAppStartMode(uid, pkg); |
| 2850 | reply.writeNoException(); |
| 2851 | reply.writeInt(res); |
| 2852 | return true; |
| 2853 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2854 | case IN_MULTI_WINDOW_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2855 | data.enforceInterface(IActivityManager.descriptor); |
| 2856 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2857 | final boolean inMultiWindow = inMultiWindow(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2858 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2859 | reply.writeInt(inMultiWindow ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2860 | return true; |
| 2861 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2862 | case IN_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2863 | data.enforceInterface(IActivityManager.descriptor); |
| 2864 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2865 | final boolean inPip = inPictureInPicture(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2866 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2867 | reply.writeInt(inPip ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2868 | return true; |
| 2869 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2870 | case ENTER_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2871 | data.enforceInterface(IActivityManager.descriptor); |
| 2872 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2873 | enterPictureInPicture(token); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2874 | reply.writeNoException(); |
| 2875 | return true; |
| 2876 | } |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2877 | case SET_VR_MODE_TRANSACTION: { |
| 2878 | data.enforceInterface(IActivityManager.descriptor); |
| 2879 | final IBinder token = data.readStrongBinder(); |
| 2880 | final boolean enable = data.readInt() == 1; |
| 2881 | setVrMode(token, enable); |
| 2882 | reply.writeNoException(); |
| 2883 | return true; |
| 2884 | } |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 2885 | case IS_APP_FOREGROUND_TRANSACTION: { |
| 2886 | data.enforceInterface(IActivityManager.descriptor); |
| 2887 | final int userHandle = data.readInt(); |
| 2888 | final boolean isForeground = isAppForeground(userHandle); |
| 2889 | reply.writeNoException(); |
| 2890 | reply.writeInt(isForeground ? 1 : 0); |
| 2891 | return true; |
| 2892 | } |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 2893 | case NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION: { |
| 2894 | data.enforceInterface(IActivityManager.descriptor); |
| 2895 | reply.writeNoException(); |
| 2896 | return true; |
| 2897 | } |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 2898 | case REMOVE_STACK: { |
| 2899 | data.enforceInterface(IActivityManager.descriptor); |
| 2900 | final int stackId = data.readInt(); |
| 2901 | removeStack(stackId); |
| 2902 | reply.writeNoException(); |
| 2903 | return true; |
| 2904 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2905 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2906 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2907 | return super.onTransact(code, data, reply, flags); |
| 2908 | } |
| 2909 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2910 | private int[] readIntArray(Parcel data) { |
| 2911 | int[] smallest = null; |
| 2912 | int smallestSize = data.readInt(); |
| 2913 | if (smallestSize > 0) { |
| 2914 | smallest = new int[smallestSize]; |
| 2915 | data.readIntArray(smallest); |
| 2916 | } |
| 2917 | return smallest; |
| 2918 | } |
| 2919 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2920 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2921 | return this; |
| 2922 | } |
| 2923 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2924 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2925 | protected IActivityManager create() { |
| 2926 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2927 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2928 | Log.v("ActivityManager", "default service binder = " + b); |
| 2929 | } |
| 2930 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2931 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2932 | Log.v("ActivityManager", "default service = " + am); |
| 2933 | } |
| 2934 | return am; |
| 2935 | } |
| 2936 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2937 | } |
| 2938 | |
| 2939 | class ActivityManagerProxy implements IActivityManager |
| 2940 | { |
| 2941 | public ActivityManagerProxy(IBinder remote) |
| 2942 | { |
| 2943 | mRemote = remote; |
| 2944 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2945 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2946 | public IBinder asBinder() |
| 2947 | { |
| 2948 | return mRemote; |
| 2949 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2950 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2951 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2952 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2953 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2954 | Parcel data = Parcel.obtain(); |
| 2955 | Parcel reply = Parcel.obtain(); |
| 2956 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2957 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2958 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2959 | intent.writeToParcel(data, 0); |
| 2960 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2961 | data.writeStrongBinder(resultTo); |
| 2962 | data.writeString(resultWho); |
| 2963 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2964 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2965 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2966 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2967 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2968 | } else { |
| 2969 | data.writeInt(0); |
| 2970 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2971 | if (options != null) { |
| 2972 | data.writeInt(1); |
| 2973 | options.writeToParcel(data, 0); |
| 2974 | } else { |
| 2975 | data.writeInt(0); |
| 2976 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2977 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2978 | reply.readException(); |
| 2979 | int result = reply.readInt(); |
| 2980 | reply.recycle(); |
| 2981 | data.recycle(); |
| 2982 | return result; |
| 2983 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2984 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2985 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2986 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2987 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2988 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2989 | Parcel data = Parcel.obtain(); |
| 2990 | Parcel reply = Parcel.obtain(); |
| 2991 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2992 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2993 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2994 | intent.writeToParcel(data, 0); |
| 2995 | data.writeString(resolvedType); |
| 2996 | data.writeStrongBinder(resultTo); |
| 2997 | data.writeString(resultWho); |
| 2998 | data.writeInt(requestCode); |
| 2999 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3000 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3001 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3002 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3003 | } else { |
| 3004 | data.writeInt(0); |
| 3005 | } |
| 3006 | if (options != null) { |
| 3007 | data.writeInt(1); |
| 3008 | options.writeToParcel(data, 0); |
| 3009 | } else { |
| 3010 | data.writeInt(0); |
| 3011 | } |
| 3012 | data.writeInt(userId); |
| 3013 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 3014 | reply.readException(); |
| 3015 | int result = reply.readInt(); |
| 3016 | reply.recycle(); |
| 3017 | data.recycle(); |
| 3018 | return result; |
| 3019 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3020 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 3021 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3022 | int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, |
| 3023 | int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3024 | Parcel data = Parcel.obtain(); |
| 3025 | Parcel reply = Parcel.obtain(); |
| 3026 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3027 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3028 | data.writeString(callingPackage); |
| 3029 | intent.writeToParcel(data, 0); |
| 3030 | data.writeString(resolvedType); |
| 3031 | data.writeStrongBinder(resultTo); |
| 3032 | data.writeString(resultWho); |
| 3033 | data.writeInt(requestCode); |
| 3034 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3035 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3036 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3037 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3038 | } else { |
| 3039 | data.writeInt(0); |
| 3040 | } |
| 3041 | if (options != null) { |
| 3042 | data.writeInt(1); |
| 3043 | options.writeToParcel(data, 0); |
| 3044 | } else { |
| 3045 | data.writeInt(0); |
| 3046 | } |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3047 | data.writeInt(ignoreTargetSecurity ? 1 : 0); |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 3048 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3049 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 3050 | reply.readException(); |
| 3051 | int result = reply.readInt(); |
| 3052 | reply.recycle(); |
| 3053 | data.recycle(); |
| 3054 | return result; |
| 3055 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3056 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 3057 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3058 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3059 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3060 | Parcel data = Parcel.obtain(); |
| 3061 | Parcel reply = Parcel.obtain(); |
| 3062 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3063 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3064 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3065 | intent.writeToParcel(data, 0); |
| 3066 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3067 | data.writeStrongBinder(resultTo); |
| 3068 | data.writeString(resultWho); |
| 3069 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3070 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3071 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3072 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3073 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3074 | } else { |
| 3075 | data.writeInt(0); |
| 3076 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3077 | if (options != null) { |
| 3078 | data.writeInt(1); |
| 3079 | options.writeToParcel(data, 0); |
| 3080 | } else { |
| 3081 | data.writeInt(0); |
| 3082 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3083 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3084 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 3085 | reply.readException(); |
| 3086 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 3087 | reply.recycle(); |
| 3088 | data.recycle(); |
| 3089 | return result; |
| 3090 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3091 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 3092 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3093 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3094 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3095 | Parcel data = Parcel.obtain(); |
| 3096 | Parcel reply = Parcel.obtain(); |
| 3097 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3098 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3099 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3100 | intent.writeToParcel(data, 0); |
| 3101 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3102 | data.writeStrongBinder(resultTo); |
| 3103 | data.writeString(resultWho); |
| 3104 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3105 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3106 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3107 | if (options != null) { |
| 3108 | data.writeInt(1); |
| 3109 | options.writeToParcel(data, 0); |
| 3110 | } else { |
| 3111 | data.writeInt(0); |
| 3112 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3113 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3114 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3115 | reply.readException(); |
| 3116 | int result = reply.readInt(); |
| 3117 | reply.recycle(); |
| 3118 | data.recycle(); |
| 3119 | return result; |
| 3120 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3121 | public int startActivityIntentSender(IApplicationThread caller, |
| 3122 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3123 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3124 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3125 | Parcel data = Parcel.obtain(); |
| 3126 | Parcel reply = Parcel.obtain(); |
| 3127 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3128 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3129 | intent.writeToParcel(data, 0); |
| 3130 | if (fillInIntent != null) { |
| 3131 | data.writeInt(1); |
| 3132 | fillInIntent.writeToParcel(data, 0); |
| 3133 | } else { |
| 3134 | data.writeInt(0); |
| 3135 | } |
| 3136 | data.writeString(resolvedType); |
| 3137 | data.writeStrongBinder(resultTo); |
| 3138 | data.writeString(resultWho); |
| 3139 | data.writeInt(requestCode); |
| 3140 | data.writeInt(flagsMask); |
| 3141 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3142 | if (options != null) { |
| 3143 | data.writeInt(1); |
| 3144 | options.writeToParcel(data, 0); |
| 3145 | } else { |
| 3146 | data.writeInt(0); |
| 3147 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3148 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3149 | reply.readException(); |
| 3150 | int result = reply.readInt(); |
| 3151 | reply.recycle(); |
| 3152 | data.recycle(); |
| 3153 | return result; |
| 3154 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3155 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 3156 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3157 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 3158 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3159 | Parcel data = Parcel.obtain(); |
| 3160 | Parcel reply = Parcel.obtain(); |
| 3161 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3162 | data.writeString(callingPackage); |
| 3163 | data.writeInt(callingPid); |
| 3164 | data.writeInt(callingUid); |
| 3165 | intent.writeToParcel(data, 0); |
| 3166 | data.writeString(resolvedType); |
| 3167 | data.writeStrongBinder(session.asBinder()); |
| 3168 | data.writeStrongBinder(interactor.asBinder()); |
| 3169 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3170 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3171 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3172 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3173 | } else { |
| 3174 | data.writeInt(0); |
| 3175 | } |
| 3176 | if (options != null) { |
| 3177 | data.writeInt(1); |
| 3178 | options.writeToParcel(data, 0); |
| 3179 | } else { |
| 3180 | data.writeInt(0); |
| 3181 | } |
| 3182 | data.writeInt(userId); |
| 3183 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3184 | reply.readException(); |
| 3185 | int result = reply.readInt(); |
| 3186 | reply.recycle(); |
| 3187 | data.recycle(); |
| 3188 | return result; |
| 3189 | } |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 3190 | |
| 3191 | public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options) |
| 3192 | throws RemoteException { |
| 3193 | Parcel data = Parcel.obtain(); |
| 3194 | Parcel reply = Parcel.obtain(); |
| 3195 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3196 | data.writeStrongBinder(callingActivity); |
| 3197 | data.writeBundle(options); |
| 3198 | mRemote.transact(START_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3199 | reply.readException(); |
| 3200 | reply.recycle(); |
| 3201 | data.recycle(); |
| 3202 | } |
| 3203 | |
| 3204 | public void stopLocalVoiceInteraction(IBinder callingActivity) throws RemoteException { |
| 3205 | Parcel data = Parcel.obtain(); |
| 3206 | Parcel reply = Parcel.obtain(); |
| 3207 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3208 | data.writeStrongBinder(callingActivity); |
| 3209 | mRemote.transact(STOP_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3210 | reply.readException(); |
| 3211 | reply.recycle(); |
| 3212 | data.recycle(); |
| 3213 | } |
| 3214 | |
| 3215 | public boolean supportsLocalVoiceInteraction() throws RemoteException { |
| 3216 | Parcel data = Parcel.obtain(); |
| 3217 | Parcel reply = Parcel.obtain(); |
| 3218 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3219 | mRemote.transact(SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3220 | reply.readException(); |
| 3221 | int result = reply.readInt(); |
| 3222 | reply.recycle(); |
| 3223 | data.recycle(); |
| 3224 | return result != 0; |
| 3225 | } |
| 3226 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3227 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3228 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3229 | Parcel data = Parcel.obtain(); |
| 3230 | Parcel reply = Parcel.obtain(); |
| 3231 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3232 | data.writeStrongBinder(callingActivity); |
| 3233 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3234 | if (options != null) { |
| 3235 | data.writeInt(1); |
| 3236 | options.writeToParcel(data, 0); |
| 3237 | } else { |
| 3238 | data.writeInt(0); |
| 3239 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3240 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3241 | reply.readException(); |
| 3242 | int result = reply.readInt(); |
| 3243 | reply.recycle(); |
| 3244 | data.recycle(); |
| 3245 | return result != 0; |
| 3246 | } |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 3247 | public int startActivityFromRecents(int taskId, Bundle options) |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3248 | throws RemoteException { |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3249 | Parcel data = Parcel.obtain(); |
| 3250 | Parcel reply = Parcel.obtain(); |
| 3251 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3252 | data.writeInt(taskId); |
| 3253 | if (options == null) { |
| 3254 | data.writeInt(0); |
| 3255 | } else { |
| 3256 | data.writeInt(1); |
| 3257 | options.writeToParcel(data, 0); |
| 3258 | } |
| 3259 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 3260 | reply.readException(); |
| 3261 | int result = reply.readInt(); |
| 3262 | reply.recycle(); |
| 3263 | data.recycle(); |
| 3264 | return result; |
| 3265 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3266 | 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] | 3267 | throws RemoteException { |
| 3268 | Parcel data = Parcel.obtain(); |
| 3269 | Parcel reply = Parcel.obtain(); |
| 3270 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3271 | data.writeStrongBinder(token); |
| 3272 | data.writeInt(resultCode); |
| 3273 | if (resultData != null) { |
| 3274 | data.writeInt(1); |
| 3275 | resultData.writeToParcel(data, 0); |
| 3276 | } else { |
| 3277 | data.writeInt(0); |
| 3278 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3279 | data.writeInt(finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3280 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3281 | reply.readException(); |
| 3282 | boolean res = reply.readInt() != 0; |
| 3283 | data.recycle(); |
| 3284 | reply.recycle(); |
| 3285 | return res; |
| 3286 | } |
| 3287 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 3288 | { |
| 3289 | Parcel data = Parcel.obtain(); |
| 3290 | Parcel reply = Parcel.obtain(); |
| 3291 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3292 | data.writeStrongBinder(token); |
| 3293 | data.writeString(resultWho); |
| 3294 | data.writeInt(requestCode); |
| 3295 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3296 | reply.readException(); |
| 3297 | data.recycle(); |
| 3298 | reply.recycle(); |
| 3299 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 3300 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 3301 | Parcel data = Parcel.obtain(); |
| 3302 | Parcel reply = Parcel.obtain(); |
| 3303 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3304 | data.writeStrongBinder(token); |
| 3305 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 3306 | reply.readException(); |
| 3307 | boolean res = reply.readInt() != 0; |
| 3308 | data.recycle(); |
| 3309 | reply.recycle(); |
| 3310 | return res; |
| 3311 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 3312 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 3313 | Parcel data = Parcel.obtain(); |
| 3314 | Parcel reply = Parcel.obtain(); |
| 3315 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3316 | data.writeStrongBinder(session.asBinder()); |
| 3317 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 3318 | reply.readException(); |
| 3319 | data.recycle(); |
| 3320 | reply.recycle(); |
| 3321 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 3322 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 3323 | Parcel data = Parcel.obtain(); |
| 3324 | Parcel reply = Parcel.obtain(); |
| 3325 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3326 | data.writeStrongBinder(token); |
| 3327 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 3328 | reply.readException(); |
| 3329 | boolean res = reply.readInt() != 0; |
| 3330 | data.recycle(); |
| 3331 | reply.recycle(); |
| 3332 | return res; |
| 3333 | } |
| 3334 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 3335 | Parcel data = Parcel.obtain(); |
| 3336 | Parcel reply = Parcel.obtain(); |
| 3337 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3338 | data.writeStrongBinder(app.asBinder()); |
| 3339 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 3340 | reply.readException(); |
| 3341 | data.recycle(); |
| 3342 | reply.recycle(); |
| 3343 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 3344 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 3345 | Parcel data = Parcel.obtain(); |
| 3346 | Parcel reply = Parcel.obtain(); |
| 3347 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3348 | data.writeStrongBinder(token); |
| 3349 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 3350 | reply.readException(); |
| 3351 | boolean res = reply.readInt() != 0; |
| 3352 | data.recycle(); |
| 3353 | reply.recycle(); |
| 3354 | return res; |
| 3355 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3356 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3357 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3358 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3359 | { |
| 3360 | Parcel data = Parcel.obtain(); |
| 3361 | Parcel reply = Parcel.obtain(); |
| 3362 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3363 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3364 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3365 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 3366 | filter.writeToParcel(data, 0); |
| 3367 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3368 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3369 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3370 | reply.readException(); |
| 3371 | Intent intent = null; |
| 3372 | int haveIntent = reply.readInt(); |
| 3373 | if (haveIntent != 0) { |
| 3374 | intent = Intent.CREATOR.createFromParcel(reply); |
| 3375 | } |
| 3376 | reply.recycle(); |
| 3377 | data.recycle(); |
| 3378 | return intent; |
| 3379 | } |
| 3380 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 3381 | { |
| 3382 | Parcel data = Parcel.obtain(); |
| 3383 | Parcel reply = Parcel.obtain(); |
| 3384 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3385 | data.writeStrongBinder(receiver.asBinder()); |
| 3386 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3387 | reply.readException(); |
| 3388 | data.recycle(); |
| 3389 | reply.recycle(); |
| 3390 | } |
| 3391 | public int broadcastIntent(IApplicationThread caller, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3392 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3393 | int resultCode, String resultData, Bundle map, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3394 | String[] requiredPermissions, int appOp, Bundle options, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3395 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3396 | { |
| 3397 | Parcel data = Parcel.obtain(); |
| 3398 | Parcel reply = Parcel.obtain(); |
| 3399 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3400 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3401 | intent.writeToParcel(data, 0); |
| 3402 | data.writeString(resolvedType); |
| 3403 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 3404 | data.writeInt(resultCode); |
| 3405 | data.writeString(resultData); |
| 3406 | data.writeBundle(map); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3407 | data.writeStringArray(requiredPermissions); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 3408 | data.writeInt(appOp); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3409 | data.writeBundle(options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3410 | data.writeInt(serialized ? 1 : 0); |
| 3411 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3412 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3413 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3414 | reply.readException(); |
| 3415 | int res = reply.readInt(); |
| 3416 | reply.recycle(); |
| 3417 | data.recycle(); |
| 3418 | return res; |
| 3419 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3420 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 3421 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3422 | { |
| 3423 | Parcel data = Parcel.obtain(); |
| 3424 | Parcel reply = Parcel.obtain(); |
| 3425 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3426 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3427 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3428 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3429 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3430 | reply.readException(); |
| 3431 | data.recycle(); |
| 3432 | reply.recycle(); |
| 3433 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3434 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 3435 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3436 | { |
| 3437 | Parcel data = Parcel.obtain(); |
| 3438 | Parcel reply = Parcel.obtain(); |
| 3439 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3440 | data.writeStrongBinder(who); |
| 3441 | data.writeInt(resultCode); |
| 3442 | data.writeString(resultData); |
| 3443 | data.writeBundle(map); |
| 3444 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3445 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3446 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3447 | reply.readException(); |
| 3448 | data.recycle(); |
| 3449 | reply.recycle(); |
| 3450 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3451 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3452 | { |
| 3453 | Parcel data = Parcel.obtain(); |
| 3454 | Parcel reply = Parcel.obtain(); |
| 3455 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3456 | data.writeStrongBinder(app.asBinder()); |
| 3457 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3458 | reply.readException(); |
| 3459 | data.recycle(); |
| 3460 | reply.recycle(); |
| 3461 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3462 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3463 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3464 | { |
| 3465 | Parcel data = Parcel.obtain(); |
| 3466 | Parcel reply = Parcel.obtain(); |
| 3467 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3468 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3469 | if (config != null) { |
| 3470 | data.writeInt(1); |
| 3471 | config.writeToParcel(data, 0); |
| 3472 | } else { |
| 3473 | data.writeInt(0); |
| 3474 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3475 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3476 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3477 | reply.readException(); |
| 3478 | data.recycle(); |
| 3479 | reply.recycle(); |
| 3480 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3481 | public void activityResumed(IBinder token) throws RemoteException |
| 3482 | { |
| 3483 | Parcel data = Parcel.obtain(); |
| 3484 | Parcel reply = Parcel.obtain(); |
| 3485 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3486 | data.writeStrongBinder(token); |
| 3487 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3488 | reply.readException(); |
| 3489 | data.recycle(); |
| 3490 | reply.recycle(); |
| 3491 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3492 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3493 | { |
| 3494 | Parcel data = Parcel.obtain(); |
| 3495 | Parcel reply = Parcel.obtain(); |
| 3496 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3497 | data.writeStrongBinder(token); |
| 3498 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3499 | reply.readException(); |
| 3500 | data.recycle(); |
| 3501 | reply.recycle(); |
| 3502 | } |
| 3503 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3504 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3505 | { |
| 3506 | Parcel data = Parcel.obtain(); |
| 3507 | Parcel reply = Parcel.obtain(); |
| 3508 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3509 | data.writeStrongBinder(token); |
| 3510 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3511 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3512 | TextUtils.writeToParcel(description, data, 0); |
| 3513 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3514 | reply.readException(); |
| 3515 | data.recycle(); |
| 3516 | reply.recycle(); |
| 3517 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3518 | public void activitySlept(IBinder token) throws RemoteException |
| 3519 | { |
| 3520 | Parcel data = Parcel.obtain(); |
| 3521 | Parcel reply = Parcel.obtain(); |
| 3522 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3523 | data.writeStrongBinder(token); |
| 3524 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3525 | reply.readException(); |
| 3526 | data.recycle(); |
| 3527 | reply.recycle(); |
| 3528 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3529 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3530 | { |
| 3531 | Parcel data = Parcel.obtain(); |
| 3532 | Parcel reply = Parcel.obtain(); |
| 3533 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3534 | data.writeStrongBinder(token); |
| 3535 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3536 | reply.readException(); |
| 3537 | data.recycle(); |
| 3538 | reply.recycle(); |
| 3539 | } |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 3540 | public void activityRelaunched(IBinder token) throws RemoteException |
| 3541 | { |
| 3542 | Parcel data = Parcel.obtain(); |
| 3543 | Parcel reply = Parcel.obtain(); |
| 3544 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3545 | data.writeStrongBinder(token); |
| 3546 | mRemote.transact(ACTIVITY_RELAUNCHED_TRANSACTION, data, reply, 0); |
| 3547 | reply.readException(); |
| 3548 | data.recycle(); |
| 3549 | reply.recycle(); |
| 3550 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3551 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3552 | { |
| 3553 | Parcel data = Parcel.obtain(); |
| 3554 | Parcel reply = Parcel.obtain(); |
| 3555 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3556 | data.writeStrongBinder(token); |
| 3557 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3558 | reply.readException(); |
| 3559 | String res = reply.readString(); |
| 3560 | data.recycle(); |
| 3561 | reply.recycle(); |
| 3562 | return res; |
| 3563 | } |
| 3564 | public ComponentName getCallingActivity(IBinder token) |
| 3565 | throws RemoteException { |
| 3566 | Parcel data = Parcel.obtain(); |
| 3567 | Parcel reply = Parcel.obtain(); |
| 3568 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3569 | data.writeStrongBinder(token); |
| 3570 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3571 | reply.readException(); |
| 3572 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3573 | data.recycle(); |
| 3574 | reply.recycle(); |
| 3575 | return res; |
| 3576 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3577 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3578 | Parcel data = Parcel.obtain(); |
| 3579 | Parcel reply = Parcel.obtain(); |
| 3580 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3581 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3582 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3583 | reply.readException(); |
| 3584 | ArrayList<IAppTask> list = null; |
| 3585 | int N = reply.readInt(); |
| 3586 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3587 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3588 | while (N > 0) { |
| 3589 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3590 | list.add(task); |
| 3591 | N--; |
| 3592 | } |
| 3593 | } |
| 3594 | data.recycle(); |
| 3595 | reply.recycle(); |
| 3596 | return list; |
| 3597 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3598 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3599 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3600 | Parcel data = Parcel.obtain(); |
| 3601 | Parcel reply = Parcel.obtain(); |
| 3602 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3603 | data.writeStrongBinder(activityToken); |
| 3604 | intent.writeToParcel(data, 0); |
| 3605 | description.writeToParcel(data, 0); |
| 3606 | thumbnail.writeToParcel(data, 0); |
| 3607 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3608 | reply.readException(); |
| 3609 | int res = reply.readInt(); |
| 3610 | data.recycle(); |
| 3611 | reply.recycle(); |
| 3612 | return res; |
| 3613 | } |
| 3614 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3615 | Parcel data = Parcel.obtain(); |
| 3616 | Parcel reply = Parcel.obtain(); |
| 3617 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3618 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3619 | reply.readException(); |
| 3620 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3621 | data.recycle(); |
| 3622 | reply.recycle(); |
| 3623 | return size; |
| 3624 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3625 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3626 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3627 | Parcel data = Parcel.obtain(); |
| 3628 | Parcel reply = Parcel.obtain(); |
| 3629 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3630 | data.writeInt(maxNum); |
| 3631 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3632 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3633 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3634 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3638 | while (N > 0) { |
| 3639 | ActivityManager.RunningTaskInfo info = |
| 3640 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3641 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3642 | list.add(info); |
| 3643 | N--; |
| 3644 | } |
| 3645 | } |
| 3646 | data.recycle(); |
| 3647 | reply.recycle(); |
| 3648 | return list; |
| 3649 | } |
| 3650 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3651 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3652 | Parcel data = Parcel.obtain(); |
| 3653 | Parcel reply = Parcel.obtain(); |
| 3654 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3655 | data.writeInt(maxNum); |
| 3656 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3657 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3658 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3659 | reply.readException(); |
| 3660 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3661 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3662 | data.recycle(); |
| 3663 | reply.recycle(); |
| 3664 | return list; |
| 3665 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3666 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3667 | Parcel data = Parcel.obtain(); |
| 3668 | Parcel reply = Parcel.obtain(); |
| 3669 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3670 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3671 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3672 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3673 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3674 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3675 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3676 | } |
| 3677 | data.recycle(); |
| 3678 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3679 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3680 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3681 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3682 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3683 | Parcel data = Parcel.obtain(); |
| 3684 | Parcel reply = Parcel.obtain(); |
| 3685 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3686 | data.writeInt(maxNum); |
| 3687 | data.writeInt(flags); |
| 3688 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3689 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3690 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3691 | int N = reply.readInt(); |
| 3692 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3693 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3694 | while (N > 0) { |
| 3695 | ActivityManager.RunningServiceInfo info = |
| 3696 | ActivityManager.RunningServiceInfo.CREATOR |
| 3697 | .createFromParcel(reply); |
| 3698 | list.add(info); |
| 3699 | N--; |
| 3700 | } |
| 3701 | } |
| 3702 | data.recycle(); |
| 3703 | reply.recycle(); |
| 3704 | return list; |
| 3705 | } |
| 3706 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3707 | throws RemoteException { |
| 3708 | Parcel data = Parcel.obtain(); |
| 3709 | Parcel reply = Parcel.obtain(); |
| 3710 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3711 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3712 | reply.readException(); |
| 3713 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3714 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3715 | data.recycle(); |
| 3716 | reply.recycle(); |
| 3717 | return list; |
| 3718 | } |
| 3719 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3720 | throws RemoteException { |
| 3721 | Parcel data = Parcel.obtain(); |
| 3722 | Parcel reply = Parcel.obtain(); |
| 3723 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3724 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3725 | reply.readException(); |
| 3726 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3727 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3728 | data.recycle(); |
| 3729 | reply.recycle(); |
| 3730 | return list; |
| 3731 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3732 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3733 | throws RemoteException { |
| 3734 | Parcel data = Parcel.obtain(); |
| 3735 | Parcel reply = Parcel.obtain(); |
| 3736 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3737 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3738 | reply.readException(); |
| 3739 | ArrayList<ApplicationInfo> list |
| 3740 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3741 | data.recycle(); |
| 3742 | reply.recycle(); |
| 3743 | return list; |
| 3744 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3745 | 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] | 3746 | { |
| 3747 | Parcel data = Parcel.obtain(); |
| 3748 | Parcel reply = Parcel.obtain(); |
| 3749 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3750 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3751 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3752 | if (options != null) { |
| 3753 | data.writeInt(1); |
| 3754 | options.writeToParcel(data, 0); |
| 3755 | } else { |
| 3756 | data.writeInt(0); |
| 3757 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3758 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3759 | reply.readException(); |
| 3760 | data.recycle(); |
| 3761 | reply.recycle(); |
| 3762 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3763 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3764 | throws RemoteException { |
| 3765 | Parcel data = Parcel.obtain(); |
| 3766 | Parcel reply = Parcel.obtain(); |
| 3767 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3768 | data.writeStrongBinder(token); |
| 3769 | data.writeInt(nonRoot ? 1 : 0); |
| 3770 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3771 | reply.readException(); |
| 3772 | boolean res = reply.readInt() != 0; |
| 3773 | data.recycle(); |
| 3774 | reply.recycle(); |
| 3775 | return res; |
| 3776 | } |
| 3777 | public void moveTaskBackwards(int task) throws RemoteException |
| 3778 | { |
| 3779 | Parcel data = Parcel.obtain(); |
| 3780 | Parcel reply = Parcel.obtain(); |
| 3781 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3782 | data.writeInt(task); |
| 3783 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3784 | reply.readException(); |
| 3785 | data.recycle(); |
| 3786 | reply.recycle(); |
| 3787 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3788 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3789 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3790 | { |
| 3791 | Parcel data = Parcel.obtain(); |
| 3792 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3793 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3794 | data.writeInt(taskId); |
| 3795 | data.writeInt(stackId); |
| 3796 | data.writeInt(toTop ? 1 : 0); |
| 3797 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3798 | reply.readException(); |
| 3799 | data.recycle(); |
| 3800 | reply.recycle(); |
| 3801 | } |
| 3802 | @Override |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3803 | public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, |
| 3804 | Rect initialBounds) throws RemoteException |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3805 | { |
| 3806 | Parcel data = Parcel.obtain(); |
| 3807 | Parcel reply = Parcel.obtain(); |
| 3808 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3809 | data.writeInt(taskId); |
| 3810 | data.writeInt(createMode); |
| 3811 | data.writeInt(toTop ? 1 : 0); |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 3812 | data.writeInt(animate ? 1 : 0); |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3813 | if (initialBounds != null) { |
| 3814 | data.writeInt(1); |
| 3815 | initialBounds.writeToParcel(data, 0); |
| 3816 | } else { |
| 3817 | data.writeInt(0); |
| 3818 | } |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3819 | mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3820 | reply.readException(); |
| 3821 | data.recycle(); |
| 3822 | reply.recycle(); |
| 3823 | } |
| 3824 | @Override |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3825 | public boolean moveTopActivityToPinnedStack(int stackId, Rect r) |
| 3826 | throws RemoteException |
| 3827 | { |
| 3828 | Parcel data = Parcel.obtain(); |
| 3829 | Parcel reply = Parcel.obtain(); |
| 3830 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3831 | data.writeInt(stackId); |
| 3832 | r.writeToParcel(data, 0); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 3833 | mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3834 | reply.readException(); |
| 3835 | final boolean res = reply.readInt() != 0; |
| 3836 | data.recycle(); |
| 3837 | reply.recycle(); |
| 3838 | return res; |
| 3839 | } |
| 3840 | @Override |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3841 | public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode, |
| 3842 | boolean preserveWindows, boolean animate) throws RemoteException { |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3843 | Parcel data = Parcel.obtain(); |
| 3844 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3845 | data.writeInterfaceToken(IActivityManager.descriptor); |
Wale Ogunwale | b34a7ad | 2015-08-14 11:05:30 -0700 | [diff] [blame] | 3846 | data.writeInt(stackId); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 3847 | if (r != null) { |
| 3848 | data.writeInt(1); |
| 3849 | r.writeToParcel(data, 0); |
| 3850 | } else { |
| 3851 | data.writeInt(0); |
| 3852 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3853 | data.writeInt(allowResizeInDockedMode ? 1 : 0); |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3854 | data.writeInt(preserveWindows ? 1 : 0); |
| 3855 | data.writeInt(animate ? 1 : 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3856 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3857 | reply.readException(); |
| 3858 | data.recycle(); |
| 3859 | reply.recycle(); |
| 3860 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3861 | @Override |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 3862 | public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds, |
| 3863 | Rect tempDockedTaskInsetBounds, |
| 3864 | Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds) |
| 3865 | throws RemoteException |
| 3866 | { |
| 3867 | Parcel data = Parcel.obtain(); |
| 3868 | Parcel reply = Parcel.obtain(); |
| 3869 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3870 | if (dockedBounds != null) { |
| 3871 | data.writeInt(1); |
| 3872 | dockedBounds.writeToParcel(data, 0); |
| 3873 | } else { |
| 3874 | data.writeInt(0); |
| 3875 | } |
| 3876 | if (tempDockedTaskBounds != null) { |
| 3877 | data.writeInt(1); |
| 3878 | tempDockedTaskBounds.writeToParcel(data, 0); |
| 3879 | } else { |
| 3880 | data.writeInt(0); |
| 3881 | } |
| 3882 | if (tempDockedTaskInsetBounds != null) { |
| 3883 | data.writeInt(1); |
| 3884 | tempDockedTaskInsetBounds.writeToParcel(data, 0); |
| 3885 | } else { |
| 3886 | data.writeInt(0); |
| 3887 | } |
| 3888 | if (tempOtherTaskBounds != null) { |
| 3889 | data.writeInt(1); |
| 3890 | tempOtherTaskBounds.writeToParcel(data, 0); |
| 3891 | } else { |
| 3892 | data.writeInt(0); |
| 3893 | } |
| 3894 | if (tempOtherTaskInsetBounds != null) { |
| 3895 | data.writeInt(1); |
| 3896 | tempOtherTaskInsetBounds.writeToParcel(data, 0); |
| 3897 | } else { |
| 3898 | data.writeInt(0); |
| 3899 | } |
| 3900 | mRemote.transact(RESIZE_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3901 | reply.readException(); |
| 3902 | data.recycle(); |
| 3903 | reply.recycle(); |
| 3904 | } |
| 3905 | @Override |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 3906 | public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException |
| 3907 | { |
| 3908 | Parcel data = Parcel.obtain(); |
| 3909 | Parcel reply = Parcel.obtain(); |
| 3910 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3911 | data.writeInt(taskId); |
| 3912 | data.writeInt(stackId); |
| 3913 | data.writeInt(position); |
| 3914 | mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0); |
| 3915 | reply.readException(); |
| 3916 | data.recycle(); |
| 3917 | reply.recycle(); |
| 3918 | } |
| 3919 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3920 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3921 | { |
| 3922 | Parcel data = Parcel.obtain(); |
| 3923 | Parcel reply = Parcel.obtain(); |
| 3924 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3925 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3926 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3927 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3928 | data.recycle(); |
| 3929 | reply.recycle(); |
| 3930 | return list; |
| 3931 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3932 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3933 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3934 | { |
| 3935 | Parcel data = Parcel.obtain(); |
| 3936 | Parcel reply = Parcel.obtain(); |
| 3937 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3938 | data.writeInt(stackId); |
| 3939 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3940 | reply.readException(); |
| 3941 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3942 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3943 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3944 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3945 | } |
| 3946 | data.recycle(); |
| 3947 | reply.recycle(); |
| 3948 | return info; |
| 3949 | } |
| 3950 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 3951 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 3952 | Parcel data = Parcel.obtain(); |
| 3953 | Parcel reply = Parcel.obtain(); |
| 3954 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3955 | data.writeInt(taskId); |
| 3956 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 3957 | reply.readException(); |
| 3958 | boolean isInHomeStack = reply.readInt() > 0; |
| 3959 | data.recycle(); |
| 3960 | reply.recycle(); |
| 3961 | return isInHomeStack; |
| 3962 | } |
| 3963 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3964 | public void setFocusedStack(int stackId) throws RemoteException |
| 3965 | { |
| 3966 | Parcel data = Parcel.obtain(); |
| 3967 | Parcel reply = Parcel.obtain(); |
| 3968 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3969 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3970 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3971 | reply.readException(); |
| 3972 | data.recycle(); |
| 3973 | reply.recycle(); |
| 3974 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3975 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 3976 | public int getFocusedStackId() throws RemoteException { |
| 3977 | Parcel data = Parcel.obtain(); |
| 3978 | Parcel reply = Parcel.obtain(); |
| 3979 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3980 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 3981 | reply.readException(); |
| 3982 | int focusedStackId = reply.readInt(); |
| 3983 | data.recycle(); |
| 3984 | reply.recycle(); |
| 3985 | return focusedStackId; |
| 3986 | } |
| 3987 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 3988 | public void setFocusedTask(int taskId) throws RemoteException |
| 3989 | { |
| 3990 | Parcel data = Parcel.obtain(); |
| 3991 | Parcel reply = Parcel.obtain(); |
| 3992 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3993 | data.writeInt(taskId); |
| 3994 | mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0); |
| 3995 | reply.readException(); |
| 3996 | data.recycle(); |
| 3997 | reply.recycle(); |
| 3998 | } |
| 3999 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4000 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 4001 | { |
| 4002 | Parcel data = Parcel.obtain(); |
| 4003 | Parcel reply = Parcel.obtain(); |
| 4004 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4005 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4006 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4007 | reply.readException(); |
| 4008 | data.recycle(); |
| 4009 | reply.recycle(); |
| 4010 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4011 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 4012 | { |
| 4013 | Parcel data = Parcel.obtain(); |
| 4014 | Parcel reply = Parcel.obtain(); |
| 4015 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4016 | data.writeStrongBinder(token); |
| 4017 | data.writeInt(onlyRoot ? 1 : 0); |
| 4018 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4019 | reply.readException(); |
| 4020 | int res = reply.readInt(); |
| 4021 | data.recycle(); |
| 4022 | reply.recycle(); |
| 4023 | return res; |
| 4024 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4025 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4026 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4027 | Parcel data = Parcel.obtain(); |
| 4028 | Parcel reply = Parcel.obtain(); |
| 4029 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4030 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4031 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4032 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4033 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4034 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4035 | reply.readException(); |
| 4036 | int res = reply.readInt(); |
| 4037 | ContentProviderHolder cph = null; |
| 4038 | if (res != 0) { |
| 4039 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4040 | } |
| 4041 | data.recycle(); |
| 4042 | reply.recycle(); |
| 4043 | return cph; |
| 4044 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4045 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 4046 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4047 | Parcel data = Parcel.obtain(); |
| 4048 | Parcel reply = Parcel.obtain(); |
| 4049 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4050 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4051 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4052 | data.writeStrongBinder(token); |
| 4053 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4054 | reply.readException(); |
| 4055 | int res = reply.readInt(); |
| 4056 | ContentProviderHolder cph = null; |
| 4057 | if (res != 0) { |
| 4058 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4059 | } |
| 4060 | data.recycle(); |
| 4061 | reply.recycle(); |
| 4062 | return cph; |
| 4063 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4064 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4065 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4066 | { |
| 4067 | Parcel data = Parcel.obtain(); |
| 4068 | Parcel reply = Parcel.obtain(); |
| 4069 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4070 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4071 | data.writeTypedList(providers); |
| 4072 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 4073 | reply.readException(); |
| 4074 | data.recycle(); |
| 4075 | reply.recycle(); |
| 4076 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4077 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 4078 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4079 | Parcel data = Parcel.obtain(); |
| 4080 | Parcel reply = Parcel.obtain(); |
| 4081 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4082 | data.writeStrongBinder(connection); |
| 4083 | data.writeInt(stable); |
| 4084 | data.writeInt(unstable); |
| 4085 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4086 | reply.readException(); |
| 4087 | boolean res = reply.readInt() != 0; |
| 4088 | data.recycle(); |
| 4089 | reply.recycle(); |
| 4090 | return res; |
| 4091 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4092 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4093 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 4094 | Parcel data = Parcel.obtain(); |
| 4095 | Parcel reply = Parcel.obtain(); |
| 4096 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4097 | data.writeStrongBinder(connection); |
| 4098 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 4099 | reply.readException(); |
| 4100 | data.recycle(); |
| 4101 | reply.recycle(); |
| 4102 | } |
| 4103 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4104 | @Override |
| 4105 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 4106 | Parcel data = Parcel.obtain(); |
| 4107 | Parcel reply = Parcel.obtain(); |
| 4108 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4109 | data.writeStrongBinder(connection); |
| 4110 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 4111 | reply.readException(); |
| 4112 | data.recycle(); |
| 4113 | reply.recycle(); |
| 4114 | } |
| 4115 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4116 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 4117 | Parcel data = Parcel.obtain(); |
| 4118 | Parcel reply = Parcel.obtain(); |
| 4119 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4120 | data.writeStrongBinder(connection); |
| 4121 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4122 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4123 | reply.readException(); |
| 4124 | data.recycle(); |
| 4125 | reply.recycle(); |
| 4126 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4127 | |
| 4128 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 4129 | Parcel data = Parcel.obtain(); |
| 4130 | Parcel reply = Parcel.obtain(); |
| 4131 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4132 | data.writeString(name); |
| 4133 | data.writeStrongBinder(token); |
| 4134 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4135 | reply.readException(); |
| 4136 | data.recycle(); |
| 4137 | reply.recycle(); |
| 4138 | } |
| 4139 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 4140 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 4141 | throws RemoteException |
| 4142 | { |
| 4143 | Parcel data = Parcel.obtain(); |
| 4144 | Parcel reply = Parcel.obtain(); |
| 4145 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4146 | service.writeToParcel(data, 0); |
| 4147 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 4148 | reply.readException(); |
| 4149 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 4150 | data.recycle(); |
| 4151 | reply.recycle(); |
| 4152 | return res; |
| 4153 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4154 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4155 | public ComponentName startService(IApplicationThread caller, Intent service, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4156 | String resolvedType, String callingPackage, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4157 | { |
| 4158 | Parcel data = Parcel.obtain(); |
| 4159 | Parcel reply = Parcel.obtain(); |
| 4160 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4161 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4162 | service.writeToParcel(data, 0); |
| 4163 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4164 | data.writeString(callingPackage); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4165 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4166 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 4167 | reply.readException(); |
| 4168 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4169 | data.recycle(); |
| 4170 | reply.recycle(); |
| 4171 | return res; |
| 4172 | } |
| 4173 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4174 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4175 | { |
| 4176 | Parcel data = Parcel.obtain(); |
| 4177 | Parcel reply = Parcel.obtain(); |
| 4178 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4179 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4180 | service.writeToParcel(data, 0); |
| 4181 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4182 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4183 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 4184 | reply.readException(); |
| 4185 | int res = reply.readInt(); |
| 4186 | reply.recycle(); |
| 4187 | data.recycle(); |
| 4188 | return res; |
| 4189 | } |
| 4190 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 4191 | int startId) throws RemoteException { |
| 4192 | Parcel data = Parcel.obtain(); |
| 4193 | Parcel reply = Parcel.obtain(); |
| 4194 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4195 | ComponentName.writeToParcel(className, data); |
| 4196 | data.writeStrongBinder(token); |
| 4197 | data.writeInt(startId); |
| 4198 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 4199 | reply.readException(); |
| 4200 | boolean res = reply.readInt() != 0; |
| 4201 | data.recycle(); |
| 4202 | reply.recycle(); |
| 4203 | return res; |
| 4204 | } |
| 4205 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4206 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4207 | Parcel data = Parcel.obtain(); |
| 4208 | Parcel reply = Parcel.obtain(); |
| 4209 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4210 | ComponentName.writeToParcel(className, data); |
| 4211 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4212 | data.writeInt(id); |
| 4213 | if (notification != null) { |
| 4214 | data.writeInt(1); |
| 4215 | notification.writeToParcel(data, 0); |
| 4216 | } else { |
| 4217 | data.writeInt(0); |
| 4218 | } |
| 4219 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4220 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4221 | reply.readException(); |
| 4222 | data.recycle(); |
| 4223 | reply.recycle(); |
| 4224 | } |
| 4225 | public int bindService(IApplicationThread caller, IBinder token, |
| 4226 | Intent service, String resolvedType, IServiceConnection connection, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4227 | int flags, String callingPackage, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4228 | Parcel data = Parcel.obtain(); |
| 4229 | Parcel reply = Parcel.obtain(); |
| 4230 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4231 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4232 | data.writeStrongBinder(token); |
| 4233 | service.writeToParcel(data, 0); |
| 4234 | data.writeString(resolvedType); |
| 4235 | data.writeStrongBinder(connection.asBinder()); |
| 4236 | data.writeInt(flags); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4237 | data.writeString(callingPackage); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 4238 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4239 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4240 | reply.readException(); |
| 4241 | int res = reply.readInt(); |
| 4242 | data.recycle(); |
| 4243 | reply.recycle(); |
| 4244 | return res; |
| 4245 | } |
| 4246 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 4247 | { |
| 4248 | Parcel data = Parcel.obtain(); |
| 4249 | Parcel reply = Parcel.obtain(); |
| 4250 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4251 | data.writeStrongBinder(connection.asBinder()); |
| 4252 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4253 | reply.readException(); |
| 4254 | boolean res = reply.readInt() != 0; |
| 4255 | data.recycle(); |
| 4256 | reply.recycle(); |
| 4257 | return res; |
| 4258 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4259 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4260 | public void publishService(IBinder token, |
| 4261 | Intent intent, IBinder service) throws RemoteException { |
| 4262 | Parcel data = Parcel.obtain(); |
| 4263 | Parcel reply = Parcel.obtain(); |
| 4264 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4265 | data.writeStrongBinder(token); |
| 4266 | intent.writeToParcel(data, 0); |
| 4267 | data.writeStrongBinder(service); |
| 4268 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 4269 | reply.readException(); |
| 4270 | data.recycle(); |
| 4271 | reply.recycle(); |
| 4272 | } |
| 4273 | |
| 4274 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 4275 | throws RemoteException { |
| 4276 | Parcel data = Parcel.obtain(); |
| 4277 | Parcel reply = Parcel.obtain(); |
| 4278 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4279 | data.writeStrongBinder(token); |
| 4280 | intent.writeToParcel(data, 0); |
| 4281 | data.writeInt(doRebind ? 1 : 0); |
| 4282 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 4283 | reply.readException(); |
| 4284 | data.recycle(); |
| 4285 | reply.recycle(); |
| 4286 | } |
| 4287 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4288 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 4289 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4290 | Parcel data = Parcel.obtain(); |
| 4291 | Parcel reply = Parcel.obtain(); |
| 4292 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4293 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4294 | data.writeInt(type); |
| 4295 | data.writeInt(startId); |
| 4296 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4297 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 4298 | reply.readException(); |
| 4299 | data.recycle(); |
| 4300 | reply.recycle(); |
| 4301 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4302 | |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4303 | public IBinder peekService(Intent service, String resolvedType, String callingPackage) |
| 4304 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4305 | Parcel data = Parcel.obtain(); |
| 4306 | Parcel reply = Parcel.obtain(); |
| 4307 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4308 | service.writeToParcel(data, 0); |
| 4309 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4310 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4311 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 4312 | reply.readException(); |
| 4313 | IBinder binder = reply.readStrongBinder(); |
| 4314 | reply.recycle(); |
| 4315 | data.recycle(); |
| 4316 | return binder; |
| 4317 | } |
| 4318 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4319 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 4320 | throws RemoteException { |
| 4321 | Parcel data = Parcel.obtain(); |
| 4322 | Parcel reply = Parcel.obtain(); |
| 4323 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4324 | app.writeToParcel(data, 0); |
| 4325 | data.writeInt(backupRestoreMode); |
| 4326 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4327 | reply.readException(); |
| 4328 | boolean success = reply.readInt() != 0; |
| 4329 | reply.recycle(); |
| 4330 | data.recycle(); |
| 4331 | return success; |
| 4332 | } |
| 4333 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 4334 | public void clearPendingBackup() throws RemoteException { |
| 4335 | Parcel data = Parcel.obtain(); |
| 4336 | Parcel reply = Parcel.obtain(); |
| 4337 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4338 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 4339 | reply.recycle(); |
| 4340 | data.recycle(); |
| 4341 | } |
| 4342 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4343 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 4344 | Parcel data = Parcel.obtain(); |
| 4345 | Parcel reply = Parcel.obtain(); |
| 4346 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4347 | data.writeString(packageName); |
| 4348 | data.writeStrongBinder(agent); |
| 4349 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 4350 | reply.recycle(); |
| 4351 | data.recycle(); |
| 4352 | } |
| 4353 | |
| 4354 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 4355 | Parcel data = Parcel.obtain(); |
| 4356 | Parcel reply = Parcel.obtain(); |
| 4357 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4358 | app.writeToParcel(data, 0); |
| 4359 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4360 | reply.readException(); |
| 4361 | reply.recycle(); |
| 4362 | data.recycle(); |
| 4363 | } |
| 4364 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4365 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4366 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4367 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 4368 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4369 | Parcel data = Parcel.obtain(); |
| 4370 | Parcel reply = Parcel.obtain(); |
| 4371 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4372 | ComponentName.writeToParcel(className, data); |
| 4373 | data.writeString(profileFile); |
| 4374 | data.writeInt(flags); |
| 4375 | data.writeBundle(arguments); |
| 4376 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4377 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4378 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4379 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4380 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4381 | reply.readException(); |
| 4382 | boolean res = reply.readInt() != 0; |
| 4383 | reply.recycle(); |
| 4384 | data.recycle(); |
| 4385 | return res; |
| 4386 | } |
| 4387 | |
| 4388 | public void finishInstrumentation(IApplicationThread target, |
| 4389 | int resultCode, Bundle results) throws RemoteException { |
| 4390 | Parcel data = Parcel.obtain(); |
| 4391 | Parcel reply = Parcel.obtain(); |
| 4392 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4393 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 4394 | data.writeInt(resultCode); |
| 4395 | data.writeBundle(results); |
| 4396 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4397 | reply.readException(); |
| 4398 | data.recycle(); |
| 4399 | reply.recycle(); |
| 4400 | } |
| 4401 | public Configuration getConfiguration() throws RemoteException |
| 4402 | { |
| 4403 | Parcel data = Parcel.obtain(); |
| 4404 | Parcel reply = Parcel.obtain(); |
| 4405 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4406 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4407 | reply.readException(); |
| 4408 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 4409 | reply.recycle(); |
| 4410 | data.recycle(); |
| 4411 | return res; |
| 4412 | } |
| 4413 | public void updateConfiguration(Configuration values) throws RemoteException |
| 4414 | { |
| 4415 | Parcel data = Parcel.obtain(); |
| 4416 | Parcel reply = Parcel.obtain(); |
| 4417 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4418 | values.writeToParcel(data, 0); |
| 4419 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4420 | reply.readException(); |
| 4421 | data.recycle(); |
| 4422 | reply.recycle(); |
| 4423 | } |
| 4424 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 4425 | throws RemoteException { |
| 4426 | Parcel data = Parcel.obtain(); |
| 4427 | Parcel reply = Parcel.obtain(); |
| 4428 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4429 | data.writeStrongBinder(token); |
| 4430 | data.writeInt(requestedOrientation); |
| 4431 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4432 | reply.readException(); |
| 4433 | data.recycle(); |
| 4434 | reply.recycle(); |
| 4435 | } |
| 4436 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 4437 | Parcel data = Parcel.obtain(); |
| 4438 | Parcel reply = Parcel.obtain(); |
| 4439 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4440 | data.writeStrongBinder(token); |
| 4441 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4442 | reply.readException(); |
| 4443 | int res = reply.readInt(); |
| 4444 | data.recycle(); |
| 4445 | reply.recycle(); |
| 4446 | return res; |
| 4447 | } |
| 4448 | public ComponentName getActivityClassForToken(IBinder token) |
| 4449 | throws RemoteException { |
| 4450 | Parcel data = Parcel.obtain(); |
| 4451 | Parcel reply = Parcel.obtain(); |
| 4452 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4453 | data.writeStrongBinder(token); |
| 4454 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4455 | reply.readException(); |
| 4456 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4457 | data.recycle(); |
| 4458 | reply.recycle(); |
| 4459 | return res; |
| 4460 | } |
| 4461 | public String getPackageForToken(IBinder token) throws RemoteException |
| 4462 | { |
| 4463 | Parcel data = Parcel.obtain(); |
| 4464 | Parcel reply = Parcel.obtain(); |
| 4465 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4466 | data.writeStrongBinder(token); |
| 4467 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4468 | reply.readException(); |
| 4469 | String res = reply.readString(); |
| 4470 | data.recycle(); |
| 4471 | reply.recycle(); |
| 4472 | return res; |
| 4473 | } |
| 4474 | public IIntentSender getIntentSender(int type, |
| 4475 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4476 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4477 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4478 | Parcel data = Parcel.obtain(); |
| 4479 | Parcel reply = Parcel.obtain(); |
| 4480 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4481 | data.writeInt(type); |
| 4482 | data.writeString(packageName); |
| 4483 | data.writeStrongBinder(token); |
| 4484 | data.writeString(resultWho); |
| 4485 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4486 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4487 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4488 | data.writeTypedArray(intents, 0); |
| 4489 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4490 | } else { |
| 4491 | data.writeInt(0); |
| 4492 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4493 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4494 | if (options != null) { |
| 4495 | data.writeInt(1); |
| 4496 | options.writeToParcel(data, 0); |
| 4497 | } else { |
| 4498 | data.writeInt(0); |
| 4499 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4500 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4501 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4502 | reply.readException(); |
| 4503 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4504 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4505 | data.recycle(); |
| 4506 | reply.recycle(); |
| 4507 | return res; |
| 4508 | } |
| 4509 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 4510 | Parcel data = Parcel.obtain(); |
| 4511 | Parcel reply = Parcel.obtain(); |
| 4512 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4513 | data.writeStrongBinder(sender.asBinder()); |
| 4514 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4515 | reply.readException(); |
| 4516 | data.recycle(); |
| 4517 | reply.recycle(); |
| 4518 | } |
| 4519 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 4520 | Parcel data = Parcel.obtain(); |
| 4521 | Parcel reply = Parcel.obtain(); |
| 4522 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4523 | data.writeStrongBinder(sender.asBinder()); |
| 4524 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4525 | reply.readException(); |
| 4526 | String res = reply.readString(); |
| 4527 | data.recycle(); |
| 4528 | reply.recycle(); |
| 4529 | return res; |
| 4530 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 4531 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 4532 | Parcel data = Parcel.obtain(); |
| 4533 | Parcel reply = Parcel.obtain(); |
| 4534 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4535 | data.writeStrongBinder(sender.asBinder()); |
| 4536 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4537 | reply.readException(); |
| 4538 | int res = reply.readInt(); |
| 4539 | data.recycle(); |
| 4540 | reply.recycle(); |
| 4541 | return res; |
| 4542 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4543 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 4544 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 4545 | Parcel data = Parcel.obtain(); |
| 4546 | Parcel reply = Parcel.obtain(); |
| 4547 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4548 | data.writeInt(callingPid); |
| 4549 | data.writeInt(callingUid); |
| 4550 | data.writeInt(userId); |
| 4551 | data.writeInt(allowAll ? 1 : 0); |
| 4552 | data.writeInt(requireFull ? 1 : 0); |
| 4553 | data.writeString(name); |
| 4554 | data.writeString(callerPackage); |
| 4555 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 4556 | reply.readException(); |
| 4557 | int res = reply.readInt(); |
| 4558 | data.recycle(); |
| 4559 | reply.recycle(); |
| 4560 | return res; |
| 4561 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4562 | public void setProcessLimit(int max) throws RemoteException |
| 4563 | { |
| 4564 | Parcel data = Parcel.obtain(); |
| 4565 | Parcel reply = Parcel.obtain(); |
| 4566 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4567 | data.writeInt(max); |
| 4568 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4569 | reply.readException(); |
| 4570 | data.recycle(); |
| 4571 | reply.recycle(); |
| 4572 | } |
| 4573 | public int getProcessLimit() throws RemoteException |
| 4574 | { |
| 4575 | Parcel data = Parcel.obtain(); |
| 4576 | Parcel reply = Parcel.obtain(); |
| 4577 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4578 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4579 | reply.readException(); |
| 4580 | int res = reply.readInt(); |
| 4581 | data.recycle(); |
| 4582 | reply.recycle(); |
| 4583 | return res; |
| 4584 | } |
| 4585 | public void setProcessForeground(IBinder token, int pid, |
| 4586 | boolean isForeground) throws RemoteException { |
| 4587 | Parcel data = Parcel.obtain(); |
| 4588 | Parcel reply = Parcel.obtain(); |
| 4589 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4590 | data.writeStrongBinder(token); |
| 4591 | data.writeInt(pid); |
| 4592 | data.writeInt(isForeground ? 1 : 0); |
| 4593 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4594 | reply.readException(); |
| 4595 | data.recycle(); |
| 4596 | reply.recycle(); |
| 4597 | } |
| 4598 | public int checkPermission(String permission, int pid, int uid) |
| 4599 | throws RemoteException { |
| 4600 | Parcel data = Parcel.obtain(); |
| 4601 | Parcel reply = Parcel.obtain(); |
| 4602 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4603 | data.writeString(permission); |
| 4604 | data.writeInt(pid); |
| 4605 | data.writeInt(uid); |
| 4606 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4607 | reply.readException(); |
| 4608 | int res = reply.readInt(); |
| 4609 | data.recycle(); |
| 4610 | reply.recycle(); |
| 4611 | return res; |
| 4612 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4613 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4614 | throws RemoteException { |
| 4615 | Parcel data = Parcel.obtain(); |
| 4616 | Parcel reply = Parcel.obtain(); |
| 4617 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4618 | data.writeString(permission); |
| 4619 | data.writeInt(pid); |
| 4620 | data.writeInt(uid); |
| 4621 | data.writeStrongBinder(callerToken); |
| 4622 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4623 | reply.readException(); |
| 4624 | int res = reply.readInt(); |
| 4625 | data.recycle(); |
| 4626 | reply.recycle(); |
| 4627 | return res; |
| 4628 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4629 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4630 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4631 | Parcel data = Parcel.obtain(); |
| 4632 | Parcel reply = Parcel.obtain(); |
| 4633 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4634 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4635 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4636 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4637 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4638 | reply.readException(); |
| 4639 | boolean res = reply.readInt() != 0; |
| 4640 | data.recycle(); |
| 4641 | reply.recycle(); |
| 4642 | return res; |
| 4643 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4644 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4645 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4646 | Parcel data = Parcel.obtain(); |
| 4647 | Parcel reply = Parcel.obtain(); |
| 4648 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4649 | uri.writeToParcel(data, 0); |
| 4650 | data.writeInt(pid); |
| 4651 | data.writeInt(uid); |
| 4652 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4653 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4654 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4655 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4656 | reply.readException(); |
| 4657 | int res = reply.readInt(); |
| 4658 | data.recycle(); |
| 4659 | reply.recycle(); |
| 4660 | return res; |
| 4661 | } |
| 4662 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4663 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4664 | Parcel data = Parcel.obtain(); |
| 4665 | Parcel reply = Parcel.obtain(); |
| 4666 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4667 | data.writeStrongBinder(caller.asBinder()); |
| 4668 | data.writeString(targetPkg); |
| 4669 | uri.writeToParcel(data, 0); |
| 4670 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4671 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4672 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4673 | reply.readException(); |
| 4674 | data.recycle(); |
| 4675 | reply.recycle(); |
| 4676 | } |
| 4677 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4678 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4679 | Parcel data = Parcel.obtain(); |
| 4680 | Parcel reply = Parcel.obtain(); |
| 4681 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4682 | data.writeStrongBinder(caller.asBinder()); |
| 4683 | uri.writeToParcel(data, 0); |
| 4684 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4685 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4686 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4687 | reply.readException(); |
| 4688 | data.recycle(); |
| 4689 | reply.recycle(); |
| 4690 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4691 | |
| 4692 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4693 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4694 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4695 | Parcel data = Parcel.obtain(); |
| 4696 | Parcel reply = Parcel.obtain(); |
| 4697 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4698 | uri.writeToParcel(data, 0); |
| 4699 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4700 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4701 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4702 | reply.readException(); |
| 4703 | data.recycle(); |
| 4704 | reply.recycle(); |
| 4705 | } |
| 4706 | |
| 4707 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4708 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4709 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4710 | Parcel data = Parcel.obtain(); |
| 4711 | Parcel reply = Parcel.obtain(); |
| 4712 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4713 | uri.writeToParcel(data, 0); |
| 4714 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4715 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4716 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4717 | reply.readException(); |
| 4718 | data.recycle(); |
| 4719 | reply.recycle(); |
| 4720 | } |
| 4721 | |
| 4722 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4723 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4724 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4725 | Parcel data = Parcel.obtain(); |
| 4726 | Parcel reply = Parcel.obtain(); |
| 4727 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4728 | data.writeString(packageName); |
| 4729 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4730 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4731 | reply.readException(); |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4732 | @SuppressWarnings("unchecked") |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4733 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4734 | reply); |
| 4735 | data.recycle(); |
| 4736 | reply.recycle(); |
| 4737 | return perms; |
| 4738 | } |
| 4739 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4740 | @Override |
| 4741 | public ParceledListSlice<UriPermission> getGrantedUriPermissions(String packageName, int userId) |
| 4742 | throws RemoteException { |
| 4743 | Parcel data = Parcel.obtain(); |
| 4744 | Parcel reply = Parcel.obtain(); |
| 4745 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4746 | data.writeString(packageName); |
| 4747 | data.writeInt(userId); |
| 4748 | mRemote.transact(GET_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4749 | reply.readException(); |
| 4750 | @SuppressWarnings("unchecked") |
| 4751 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4752 | reply); |
| 4753 | data.recycle(); |
| 4754 | reply.recycle(); |
| 4755 | return perms; |
| 4756 | } |
| 4757 | |
| 4758 | @Override |
| 4759 | public void clearGrantedUriPermissions(String packageName, int userId) throws RemoteException { |
| 4760 | Parcel data = Parcel.obtain(); |
| 4761 | Parcel reply = Parcel.obtain(); |
| 4762 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4763 | data.writeString(packageName); |
| 4764 | data.writeInt(userId); |
| 4765 | mRemote.transact(CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4766 | reply.readException(); |
| 4767 | data.recycle(); |
| 4768 | reply.recycle(); |
| 4769 | } |
| 4770 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4771 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4772 | throws RemoteException { |
| 4773 | Parcel data = Parcel.obtain(); |
| 4774 | Parcel reply = Parcel.obtain(); |
| 4775 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4776 | data.writeStrongBinder(who.asBinder()); |
| 4777 | data.writeInt(waiting ? 1 : 0); |
| 4778 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4779 | reply.readException(); |
| 4780 | data.recycle(); |
| 4781 | reply.recycle(); |
| 4782 | } |
| 4783 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4784 | Parcel data = Parcel.obtain(); |
| 4785 | Parcel reply = Parcel.obtain(); |
| 4786 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4787 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4788 | reply.readException(); |
| 4789 | outInfo.readFromParcel(reply); |
| 4790 | data.recycle(); |
| 4791 | reply.recycle(); |
| 4792 | } |
| 4793 | public void unhandledBack() throws RemoteException |
| 4794 | { |
| 4795 | Parcel data = Parcel.obtain(); |
| 4796 | Parcel reply = Parcel.obtain(); |
| 4797 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4798 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4799 | reply.readException(); |
| 4800 | data.recycle(); |
| 4801 | reply.recycle(); |
| 4802 | } |
| 4803 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4804 | { |
| 4805 | Parcel data = Parcel.obtain(); |
| 4806 | Parcel reply = Parcel.obtain(); |
| 4807 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4808 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4809 | reply.readException(); |
| 4810 | ParcelFileDescriptor pfd = null; |
| 4811 | if (reply.readInt() != 0) { |
| 4812 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4813 | } |
| 4814 | data.recycle(); |
| 4815 | reply.recycle(); |
| 4816 | return pfd; |
| 4817 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4818 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4819 | { |
| 4820 | Parcel data = Parcel.obtain(); |
| 4821 | Parcel reply = Parcel.obtain(); |
| 4822 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4823 | data.writeInt(shown ? 1 : 0); |
| 4824 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4825 | reply.readException(); |
| 4826 | data.recycle(); |
| 4827 | reply.recycle(); |
| 4828 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4829 | public void setDebugApp( |
| 4830 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4831 | throws RemoteException |
| 4832 | { |
| 4833 | Parcel data = Parcel.obtain(); |
| 4834 | Parcel reply = Parcel.obtain(); |
| 4835 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4836 | data.writeString(packageName); |
| 4837 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4838 | data.writeInt(persistent ? 1 : 0); |
| 4839 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4840 | reply.readException(); |
| 4841 | data.recycle(); |
| 4842 | reply.recycle(); |
| 4843 | } |
| 4844 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4845 | { |
| 4846 | Parcel data = Parcel.obtain(); |
| 4847 | Parcel reply = Parcel.obtain(); |
| 4848 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4849 | data.writeInt(enabled ? 1 : 0); |
| 4850 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4851 | reply.readException(); |
| 4852 | data.recycle(); |
| 4853 | reply.recycle(); |
| 4854 | } |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4855 | public void setActivityController(IActivityController watcher) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4856 | { |
| 4857 | Parcel data = Parcel.obtain(); |
| 4858 | Parcel reply = Parcel.obtain(); |
| 4859 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4860 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4861 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4862 | reply.readException(); |
| 4863 | data.recycle(); |
| 4864 | reply.recycle(); |
| 4865 | } |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 4866 | public void setLenientBackgroundCheck(boolean enabled) throws RemoteException |
| 4867 | { |
| 4868 | Parcel data = Parcel.obtain(); |
| 4869 | Parcel reply = Parcel.obtain(); |
| 4870 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4871 | data.writeInt(enabled ? 1 : 0); |
| 4872 | mRemote.transact(SET_LENIENT_BACKGROUND_CHECK_TRANSACTION, data, reply, 0); |
| 4873 | reply.readException(); |
| 4874 | data.recycle(); |
| 4875 | reply.recycle(); |
| 4876 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4877 | public void enterSafeMode() throws RemoteException { |
| 4878 | Parcel data = Parcel.obtain(); |
| 4879 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4880 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4881 | data.recycle(); |
| 4882 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4883 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4884 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4885 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4886 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4887 | data.writeStrongBinder(sender.asBinder()); |
| 4888 | data.writeInt(sourceUid); |
| 4889 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4890 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4891 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4892 | data.recycle(); |
| 4893 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4894 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 4895 | throws RemoteException { |
| 4896 | Parcel data = Parcel.obtain(); |
| 4897 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4898 | data.writeStrongBinder(sender.asBinder()); |
| 4899 | data.writeInt(sourceUid); |
| 4900 | data.writeString(tag); |
| 4901 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 4902 | data.recycle(); |
| 4903 | } |
| 4904 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 4905 | throws RemoteException { |
| 4906 | Parcel data = Parcel.obtain(); |
| 4907 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4908 | data.writeStrongBinder(sender.asBinder()); |
| 4909 | data.writeInt(sourceUid); |
| 4910 | data.writeString(tag); |
| 4911 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 4912 | data.recycle(); |
| 4913 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4914 | 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] | 4915 | Parcel data = Parcel.obtain(); |
| 4916 | Parcel reply = Parcel.obtain(); |
| 4917 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4918 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4919 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4920 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4921 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 4922 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4923 | boolean res = reply.readInt() != 0; |
| 4924 | data.recycle(); |
| 4925 | reply.recycle(); |
| 4926 | return res; |
| 4927 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 4928 | @Override |
| 4929 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 4930 | Parcel data = Parcel.obtain(); |
| 4931 | Parcel reply = Parcel.obtain(); |
| 4932 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4933 | data.writeString(reason); |
| 4934 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4935 | boolean res = reply.readInt() != 0; |
| 4936 | data.recycle(); |
| 4937 | reply.recycle(); |
| 4938 | return res; |
| 4939 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4940 | public boolean testIsSystemReady() |
| 4941 | { |
| 4942 | /* this base class version is never called */ |
| 4943 | return true; |
| 4944 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4945 | public void handleApplicationCrash(IBinder app, |
| 4946 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 4947 | { |
| 4948 | Parcel data = Parcel.obtain(); |
| 4949 | Parcel reply = Parcel.obtain(); |
| 4950 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4951 | data.writeStrongBinder(app); |
| 4952 | crashInfo.writeToParcel(data, 0); |
| 4953 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 4954 | reply.readException(); |
| 4955 | reply.recycle(); |
| 4956 | data.recycle(); |
| 4957 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4958 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4959 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4960 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4961 | { |
| 4962 | Parcel data = Parcel.obtain(); |
| 4963 | Parcel reply = Parcel.obtain(); |
| 4964 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4965 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4966 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4967 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4968 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4969 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4970 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4971 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4972 | reply.recycle(); |
| 4973 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4974 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4975 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4976 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4977 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4978 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4979 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4980 | { |
| 4981 | Parcel data = Parcel.obtain(); |
| 4982 | Parcel reply = Parcel.obtain(); |
| 4983 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4984 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4985 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4986 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4987 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 4988 | reply.readException(); |
| 4989 | reply.recycle(); |
| 4990 | data.recycle(); |
| 4991 | } |
| 4992 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4993 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 4994 | Parcel data = Parcel.obtain(); |
| 4995 | Parcel reply = Parcel.obtain(); |
| 4996 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4997 | data.writeInt(sig); |
| 4998 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 4999 | reply.readException(); |
| 5000 | data.recycle(); |
| 5001 | reply.recycle(); |
| 5002 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5003 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5004 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5005 | Parcel data = Parcel.obtain(); |
| 5006 | Parcel reply = Parcel.obtain(); |
| 5007 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5008 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5009 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5010 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5011 | reply.readException(); |
| 5012 | data.recycle(); |
| 5013 | reply.recycle(); |
| 5014 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5015 | |
| 5016 | public void killAllBackgroundProcesses() throws RemoteException { |
| 5017 | Parcel data = Parcel.obtain(); |
| 5018 | Parcel reply = Parcel.obtain(); |
| 5019 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5020 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5021 | reply.readException(); |
| 5022 | data.recycle(); |
| 5023 | reply.recycle(); |
| 5024 | } |
| 5025 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 5026 | public void killPackageDependents(String packageName, int userId) throws RemoteException { |
| 5027 | Parcel data = Parcel.obtain(); |
| 5028 | Parcel reply = Parcel.obtain(); |
| 5029 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5030 | data.writeString(packageName); |
| 5031 | data.writeInt(userId); |
| 5032 | mRemote.transact(KILL_PACKAGE_DEPENDENTS_TRANSACTION, data, reply, 0); |
| 5033 | reply.readException(); |
| 5034 | data.recycle(); |
| 5035 | reply.recycle(); |
| 5036 | } |
| 5037 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5038 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5039 | Parcel data = Parcel.obtain(); |
| 5040 | Parcel reply = Parcel.obtain(); |
| 5041 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5042 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5043 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5044 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5045 | reply.readException(); |
| 5046 | data.recycle(); |
| 5047 | reply.recycle(); |
| 5048 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5049 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 5050 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 5051 | throws RemoteException |
| 5052 | { |
| 5053 | Parcel data = Parcel.obtain(); |
| 5054 | Parcel reply = Parcel.obtain(); |
| 5055 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5056 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 5057 | reply.readException(); |
| 5058 | outInfo.readFromParcel(reply); |
| 5059 | reply.recycle(); |
| 5060 | data.recycle(); |
| 5061 | } |
| 5062 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5063 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 5064 | { |
| 5065 | Parcel data = Parcel.obtain(); |
| 5066 | Parcel reply = Parcel.obtain(); |
| 5067 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5068 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5069 | reply.readException(); |
| 5070 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 5071 | reply.recycle(); |
| 5072 | data.recycle(); |
| 5073 | return res; |
| 5074 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5075 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5076 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5077 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5078 | { |
| 5079 | Parcel data = Parcel.obtain(); |
| 5080 | Parcel reply = Parcel.obtain(); |
| 5081 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5082 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5083 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5084 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 5085 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5086 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5087 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5088 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5089 | } else { |
| 5090 | data.writeInt(0); |
| 5091 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5092 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 5093 | reply.readException(); |
| 5094 | boolean res = reply.readInt() != 0; |
| 5095 | reply.recycle(); |
| 5096 | data.recycle(); |
| 5097 | return res; |
| 5098 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5099 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 5100 | public boolean shutdown(int timeout) throws RemoteException |
| 5101 | { |
| 5102 | Parcel data = Parcel.obtain(); |
| 5103 | Parcel reply = Parcel.obtain(); |
| 5104 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5105 | data.writeInt(timeout); |
| 5106 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 5107 | reply.readException(); |
| 5108 | boolean res = reply.readInt() != 0; |
| 5109 | reply.recycle(); |
| 5110 | data.recycle(); |
| 5111 | return res; |
| 5112 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5113 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5114 | public void stopAppSwitches() throws RemoteException { |
| 5115 | Parcel data = Parcel.obtain(); |
| 5116 | Parcel reply = Parcel.obtain(); |
| 5117 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5118 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5119 | reply.readException(); |
| 5120 | reply.recycle(); |
| 5121 | data.recycle(); |
| 5122 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5123 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5124 | public void resumeAppSwitches() throws RemoteException { |
| 5125 | Parcel data = Parcel.obtain(); |
| 5126 | Parcel reply = Parcel.obtain(); |
| 5127 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5128 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5129 | reply.readException(); |
| 5130 | reply.recycle(); |
| 5131 | data.recycle(); |
| 5132 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 5133 | |
| 5134 | public void addPackageDependency(String packageName) throws RemoteException { |
| 5135 | Parcel data = Parcel.obtain(); |
| 5136 | Parcel reply = Parcel.obtain(); |
| 5137 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5138 | data.writeString(packageName); |
| 5139 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 5140 | reply.readException(); |
| 5141 | data.recycle(); |
| 5142 | reply.recycle(); |
| 5143 | } |
| 5144 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5145 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 5146 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5147 | Parcel data = Parcel.obtain(); |
| 5148 | Parcel reply = Parcel.obtain(); |
| 5149 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5150 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5151 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5152 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5153 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5154 | reply.readException(); |
| 5155 | data.recycle(); |
| 5156 | reply.recycle(); |
| 5157 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5158 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 5159 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 5160 | Parcel data = Parcel.obtain(); |
| 5161 | Parcel reply = Parcel.obtain(); |
| 5162 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5163 | data.writeString(reason); |
| 5164 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 5165 | reply.readException(); |
| 5166 | data.recycle(); |
| 5167 | reply.recycle(); |
| 5168 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5169 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5170 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5171 | throws RemoteException { |
| 5172 | Parcel data = Parcel.obtain(); |
| 5173 | Parcel reply = Parcel.obtain(); |
| 5174 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5175 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5176 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 5177 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5178 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5179 | data.recycle(); |
| 5180 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5181 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5182 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 5183 | |
| 5184 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 5185 | Parcel data = Parcel.obtain(); |
| 5186 | Parcel reply = Parcel.obtain(); |
| 5187 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5188 | data.writeString(processName); |
| 5189 | data.writeInt(uid); |
| 5190 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 5191 | reply.readException(); |
| 5192 | data.recycle(); |
| 5193 | reply.recycle(); |
| 5194 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5195 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 5196 | public void overridePendingTransition(IBinder token, String packageName, |
| 5197 | int enterAnim, int exitAnim) throws RemoteException { |
| 5198 | Parcel data = Parcel.obtain(); |
| 5199 | Parcel reply = Parcel.obtain(); |
| 5200 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5201 | data.writeStrongBinder(token); |
| 5202 | data.writeString(packageName); |
| 5203 | data.writeInt(enterAnim); |
| 5204 | data.writeInt(exitAnim); |
| 5205 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 5206 | reply.readException(); |
| 5207 | data.recycle(); |
| 5208 | reply.recycle(); |
| 5209 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5210 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 5211 | public boolean isUserAMonkey() throws RemoteException { |
| 5212 | Parcel data = Parcel.obtain(); |
| 5213 | Parcel reply = Parcel.obtain(); |
| 5214 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5215 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 5216 | reply.readException(); |
| 5217 | boolean res = reply.readInt() != 0; |
| 5218 | data.recycle(); |
| 5219 | reply.recycle(); |
| 5220 | return res; |
| 5221 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 5222 | |
| 5223 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 5224 | Parcel data = Parcel.obtain(); |
| 5225 | Parcel reply = Parcel.obtain(); |
| 5226 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5227 | data.writeInt(monkey ? 1 : 0); |
| 5228 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 5229 | reply.readException(); |
| 5230 | data.recycle(); |
| 5231 | reply.recycle(); |
| 5232 | } |
| 5233 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 5234 | public void finishHeavyWeightApp() throws RemoteException { |
| 5235 | Parcel data = Parcel.obtain(); |
| 5236 | Parcel reply = Parcel.obtain(); |
| 5237 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5238 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 5239 | reply.readException(); |
| 5240 | data.recycle(); |
| 5241 | reply.recycle(); |
| 5242 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5243 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5244 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5245 | throws RemoteException { |
| 5246 | Parcel data = Parcel.obtain(); |
| 5247 | Parcel reply = Parcel.obtain(); |
| 5248 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5249 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5250 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 5251 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5252 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5253 | data.recycle(); |
| 5254 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5255 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5256 | } |
| 5257 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5258 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5259 | throws RemoteException { |
| 5260 | Parcel data = Parcel.obtain(); |
| 5261 | Parcel reply = Parcel.obtain(); |
| 5262 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5263 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5264 | if (options == null) { |
| 5265 | data.writeInt(0); |
| 5266 | } else { |
| 5267 | data.writeInt(1); |
| 5268 | data.writeBundle(options.toBundle()); |
| 5269 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5270 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5271 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5272 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5273 | data.recycle(); |
| 5274 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5275 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5276 | } |
| 5277 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5278 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 5279 | Parcel data = Parcel.obtain(); |
| 5280 | Parcel reply = Parcel.obtain(); |
| 5281 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5282 | data.writeStrongBinder(token); |
| 5283 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 5284 | reply.readException(); |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 5285 | ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle()); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5286 | data.recycle(); |
| 5287 | reply.recycle(); |
| 5288 | return options; |
| 5289 | } |
| 5290 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5291 | public void setImmersive(IBinder token, boolean immersive) |
| 5292 | throws RemoteException { |
| 5293 | Parcel data = Parcel.obtain(); |
| 5294 | Parcel reply = Parcel.obtain(); |
| 5295 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5296 | data.writeStrongBinder(token); |
| 5297 | data.writeInt(immersive ? 1 : 0); |
| 5298 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 5299 | reply.readException(); |
| 5300 | data.recycle(); |
| 5301 | reply.recycle(); |
| 5302 | } |
| 5303 | |
| 5304 | public boolean isImmersive(IBinder token) |
| 5305 | throws RemoteException { |
| 5306 | Parcel data = Parcel.obtain(); |
| 5307 | Parcel reply = Parcel.obtain(); |
| 5308 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5309 | data.writeStrongBinder(token); |
| 5310 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5311 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5312 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5313 | data.recycle(); |
| 5314 | reply.recycle(); |
| 5315 | return res; |
| 5316 | } |
| 5317 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5318 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 5319 | Parcel data = Parcel.obtain(); |
| 5320 | Parcel reply = Parcel.obtain(); |
| 5321 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5322 | data.writeStrongBinder(token); |
| 5323 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 5324 | reply.readException(); |
| 5325 | boolean res = reply.readInt() == 1; |
| 5326 | data.recycle(); |
| 5327 | reply.recycle(); |
| 5328 | return res; |
| 5329 | } |
| 5330 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5331 | public boolean isTopActivityImmersive() |
| 5332 | throws RemoteException { |
| 5333 | Parcel data = Parcel.obtain(); |
| 5334 | Parcel reply = Parcel.obtain(); |
| 5335 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5336 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5337 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5338 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5339 | data.recycle(); |
| 5340 | reply.recycle(); |
| 5341 | return res; |
| 5342 | } |
| 5343 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 5344 | public void crashApplication(int uid, int initialPid, String packageName, |
| 5345 | String message) throws RemoteException { |
| 5346 | Parcel data = Parcel.obtain(); |
| 5347 | Parcel reply = Parcel.obtain(); |
| 5348 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5349 | data.writeInt(uid); |
| 5350 | data.writeInt(initialPid); |
| 5351 | data.writeString(packageName); |
| 5352 | data.writeString(message); |
| 5353 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 5354 | reply.readException(); |
| 5355 | data.recycle(); |
| 5356 | reply.recycle(); |
| 5357 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5358 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5359 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5360 | Parcel data = Parcel.obtain(); |
| 5361 | Parcel reply = Parcel.obtain(); |
| 5362 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5363 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5364 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5365 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 5366 | reply.readException(); |
| 5367 | String res = reply.readString(); |
| 5368 | data.recycle(); |
| 5369 | reply.recycle(); |
| 5370 | return res; |
| 5371 | } |
| 5372 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5373 | public IBinder newUriPermissionOwner(String name) |
| 5374 | throws RemoteException { |
| 5375 | Parcel data = Parcel.obtain(); |
| 5376 | Parcel reply = Parcel.obtain(); |
| 5377 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5378 | data.writeString(name); |
| 5379 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 5380 | reply.readException(); |
| 5381 | IBinder res = reply.readStrongBinder(); |
| 5382 | data.recycle(); |
| 5383 | reply.recycle(); |
| 5384 | return res; |
| 5385 | } |
| 5386 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 5387 | public IBinder getUriPermissionOwnerForActivity(IBinder activityToken) throws RemoteException { |
| 5388 | Parcel data = Parcel.obtain(); |
| 5389 | Parcel reply = Parcel.obtain(); |
| 5390 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5391 | data.writeStrongBinder(activityToken); |
| 5392 | mRemote.transact(GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5393 | reply.readException(); |
| 5394 | IBinder res = reply.readStrongBinder(); |
| 5395 | data.recycle(); |
| 5396 | reply.recycle(); |
| 5397 | return res; |
| 5398 | } |
| 5399 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5400 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5401 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5402 | Parcel data = Parcel.obtain(); |
| 5403 | Parcel reply = Parcel.obtain(); |
| 5404 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5405 | data.writeStrongBinder(owner); |
| 5406 | data.writeInt(fromUid); |
| 5407 | data.writeString(targetPkg); |
| 5408 | uri.writeToParcel(data, 0); |
| 5409 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5410 | data.writeInt(sourceUserId); |
| 5411 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5412 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5413 | reply.readException(); |
| 5414 | data.recycle(); |
| 5415 | reply.recycle(); |
| 5416 | } |
| 5417 | |
| 5418 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5419 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5420 | Parcel data = Parcel.obtain(); |
| 5421 | Parcel reply = Parcel.obtain(); |
| 5422 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5423 | data.writeStrongBinder(owner); |
| 5424 | if (uri != null) { |
| 5425 | data.writeInt(1); |
| 5426 | uri.writeToParcel(data, 0); |
| 5427 | } else { |
| 5428 | data.writeInt(0); |
| 5429 | } |
| 5430 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5431 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5432 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5433 | reply.readException(); |
| 5434 | data.recycle(); |
| 5435 | reply.recycle(); |
| 5436 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 5437 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5438 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5439 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5440 | Parcel data = Parcel.obtain(); |
| 5441 | Parcel reply = Parcel.obtain(); |
| 5442 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5443 | data.writeInt(callingUid); |
| 5444 | data.writeString(targetPkg); |
| 5445 | uri.writeToParcel(data, 0); |
| 5446 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5447 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5448 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5449 | reply.readException(); |
| 5450 | int res = reply.readInt(); |
| 5451 | data.recycle(); |
| 5452 | reply.recycle(); |
| 5453 | return res; |
| 5454 | } |
| 5455 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5456 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5457 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 5458 | Parcel data = Parcel.obtain(); |
| 5459 | Parcel reply = Parcel.obtain(); |
| 5460 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5461 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5462 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5463 | data.writeInt(managed ? 1 : 0); |
| 5464 | data.writeString(path); |
| 5465 | if (fd != null) { |
| 5466 | data.writeInt(1); |
| 5467 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5468 | } else { |
| 5469 | data.writeInt(0); |
| 5470 | } |
| 5471 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 5472 | reply.readException(); |
| 5473 | boolean res = reply.readInt() != 0; |
| 5474 | reply.recycle(); |
| 5475 | data.recycle(); |
| 5476 | return res; |
| 5477 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5478 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5479 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5480 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5481 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5482 | Parcel data = Parcel.obtain(); |
| 5483 | Parcel reply = Parcel.obtain(); |
| 5484 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5485 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5486 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5487 | data.writeTypedArray(intents, 0); |
| 5488 | data.writeStringArray(resolvedTypes); |
| 5489 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5490 | if (options != null) { |
| 5491 | data.writeInt(1); |
| 5492 | options.writeToParcel(data, 0); |
| 5493 | } else { |
| 5494 | data.writeInt(0); |
| 5495 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5496 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5497 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 5498 | reply.readException(); |
| 5499 | int result = reply.readInt(); |
| 5500 | reply.recycle(); |
| 5501 | data.recycle(); |
| 5502 | return result; |
| 5503 | } |
| 5504 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5505 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 5506 | Parcel data = Parcel.obtain(); |
| 5507 | Parcel reply = Parcel.obtain(); |
| 5508 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5509 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5510 | reply.readException(); |
| 5511 | int mode = reply.readInt(); |
| 5512 | reply.recycle(); |
| 5513 | data.recycle(); |
| 5514 | return mode; |
| 5515 | } |
| 5516 | |
| 5517 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 5518 | Parcel data = Parcel.obtain(); |
| 5519 | Parcel reply = Parcel.obtain(); |
| 5520 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5521 | data.writeInt(mode); |
| 5522 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5523 | reply.readException(); |
| 5524 | reply.recycle(); |
| 5525 | data.recycle(); |
| 5526 | } |
| 5527 | |
| 5528 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 5529 | Parcel data = Parcel.obtain(); |
| 5530 | Parcel reply = Parcel.obtain(); |
| 5531 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5532 | data.writeString(packageName); |
| 5533 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5534 | reply.readException(); |
| 5535 | int mode = reply.readInt(); |
| 5536 | reply.recycle(); |
| 5537 | data.recycle(); |
| 5538 | return mode; |
| 5539 | } |
| 5540 | |
| 5541 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5542 | throws RemoteException { |
| 5543 | Parcel data = Parcel.obtain(); |
| 5544 | Parcel reply = Parcel.obtain(); |
| 5545 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5546 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5547 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5548 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5549 | reply.readException(); |
| 5550 | reply.recycle(); |
| 5551 | data.recycle(); |
| 5552 | } |
| 5553 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5554 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 5555 | Parcel data = Parcel.obtain(); |
| 5556 | Parcel reply = Parcel.obtain(); |
| 5557 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5558 | data.writeString(packageName); |
| 5559 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5560 | reply.readException(); |
| 5561 | boolean ask = reply.readInt() != 0; |
| 5562 | reply.recycle(); |
| 5563 | data.recycle(); |
| 5564 | return ask; |
| 5565 | } |
| 5566 | |
| 5567 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 5568 | throws RemoteException { |
| 5569 | Parcel data = Parcel.obtain(); |
| 5570 | Parcel reply = Parcel.obtain(); |
| 5571 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5572 | data.writeString(packageName); |
| 5573 | data.writeInt(ask ? 1 : 0); |
| 5574 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5575 | reply.readException(); |
| 5576 | reply.recycle(); |
| 5577 | data.recycle(); |
| 5578 | } |
| 5579 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5580 | public boolean switchUser(int userid) throws RemoteException { |
| 5581 | Parcel data = Parcel.obtain(); |
| 5582 | Parcel reply = Parcel.obtain(); |
| 5583 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5584 | data.writeInt(userid); |
| 5585 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 5586 | reply.readException(); |
| 5587 | boolean result = reply.readInt() != 0; |
| 5588 | reply.recycle(); |
| 5589 | data.recycle(); |
| 5590 | return result; |
| 5591 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5592 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 5593 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 5594 | Parcel data = Parcel.obtain(); |
| 5595 | Parcel reply = Parcel.obtain(); |
| 5596 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5597 | data.writeInt(userid); |
| 5598 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 5599 | reply.readException(); |
| 5600 | boolean result = reply.readInt() != 0; |
| 5601 | reply.recycle(); |
| 5602 | data.recycle(); |
| 5603 | return result; |
| 5604 | } |
| 5605 | |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5606 | public boolean unlockUser(int userId, byte[] token, byte[] secret) throws RemoteException { |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5607 | Parcel data = Parcel.obtain(); |
| 5608 | Parcel reply = Parcel.obtain(); |
| 5609 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5610 | data.writeInt(userId); |
| 5611 | data.writeByteArray(token); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5612 | data.writeByteArray(secret); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5613 | mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0); |
| 5614 | reply.readException(); |
| 5615 | boolean result = reply.readInt() != 0; |
| 5616 | reply.recycle(); |
| 5617 | data.recycle(); |
| 5618 | return result; |
| 5619 | } |
| 5620 | |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5621 | public int stopUser(int userid, boolean force, IStopUserCallback callback) |
| 5622 | throws RemoteException { |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5623 | Parcel data = Parcel.obtain(); |
| 5624 | Parcel reply = Parcel.obtain(); |
| 5625 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5626 | data.writeInt(userid); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5627 | data.writeInt(force ? 1 : 0); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5628 | data.writeStrongInterface(callback); |
| 5629 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 5630 | reply.readException(); |
| 5631 | int result = reply.readInt(); |
| 5632 | reply.recycle(); |
| 5633 | data.recycle(); |
| 5634 | return result; |
| 5635 | } |
| 5636 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5637 | public UserInfo getCurrentUser() throws RemoteException { |
| 5638 | Parcel data = Parcel.obtain(); |
| 5639 | Parcel reply = Parcel.obtain(); |
| 5640 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5641 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5642 | reply.readException(); |
| 5643 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 5644 | reply.recycle(); |
| 5645 | data.recycle(); |
| 5646 | return userInfo; |
| 5647 | } |
| 5648 | |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5649 | public boolean isUserRunning(int userid, int flags) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5650 | Parcel data = Parcel.obtain(); |
| 5651 | Parcel reply = Parcel.obtain(); |
| 5652 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5653 | data.writeInt(userid); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5654 | data.writeInt(flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5655 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5656 | reply.readException(); |
| 5657 | boolean result = reply.readInt() != 0; |
| 5658 | reply.recycle(); |
| 5659 | data.recycle(); |
| 5660 | return result; |
| 5661 | } |
| 5662 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5663 | public int[] getRunningUserIds() throws RemoteException { |
| 5664 | Parcel data = Parcel.obtain(); |
| 5665 | Parcel reply = Parcel.obtain(); |
| 5666 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5667 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5668 | reply.readException(); |
| 5669 | int[] result = reply.createIntArray(); |
| 5670 | reply.recycle(); |
| 5671 | data.recycle(); |
| 5672 | return result; |
| 5673 | } |
| 5674 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5675 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5676 | Parcel data = Parcel.obtain(); |
| 5677 | Parcel reply = Parcel.obtain(); |
| 5678 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5679 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5680 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5681 | reply.readException(); |
| 5682 | boolean result = reply.readInt() != 0; |
| 5683 | reply.recycle(); |
| 5684 | data.recycle(); |
| 5685 | return result; |
| 5686 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5687 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5688 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5689 | Parcel data = Parcel.obtain(); |
| 5690 | Parcel reply = Parcel.obtain(); |
| 5691 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5692 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5693 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5694 | reply.readException(); |
| 5695 | data.recycle(); |
| 5696 | reply.recycle(); |
| 5697 | } |
| 5698 | |
| 5699 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5700 | Parcel data = Parcel.obtain(); |
| 5701 | Parcel reply = Parcel.obtain(); |
| 5702 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5703 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5704 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5705 | reply.readException(); |
| 5706 | data.recycle(); |
| 5707 | reply.recycle(); |
| 5708 | } |
| 5709 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5710 | public void registerUidObserver(IUidObserver observer, int which) throws RemoteException { |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5711 | Parcel data = Parcel.obtain(); |
| 5712 | Parcel reply = Parcel.obtain(); |
| 5713 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5714 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5715 | data.writeInt(which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5716 | mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5717 | reply.readException(); |
| 5718 | data.recycle(); |
| 5719 | reply.recycle(); |
| 5720 | } |
| 5721 | |
| 5722 | public void unregisterUidObserver(IUidObserver observer) throws RemoteException { |
| 5723 | Parcel data = Parcel.obtain(); |
| 5724 | Parcel reply = Parcel.obtain(); |
| 5725 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5726 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5727 | mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5728 | reply.readException(); |
| 5729 | data.recycle(); |
| 5730 | reply.recycle(); |
| 5731 | } |
| 5732 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5733 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5734 | Parcel data = Parcel.obtain(); |
| 5735 | Parcel reply = Parcel.obtain(); |
| 5736 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5737 | data.writeStrongBinder(sender.asBinder()); |
| 5738 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5739 | reply.readException(); |
| 5740 | boolean res = reply.readInt() != 0; |
| 5741 | data.recycle(); |
| 5742 | reply.recycle(); |
| 5743 | return res; |
| 5744 | } |
| 5745 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5746 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5747 | Parcel data = Parcel.obtain(); |
| 5748 | Parcel reply = Parcel.obtain(); |
| 5749 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5750 | data.writeStrongBinder(sender.asBinder()); |
| 5751 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5752 | reply.readException(); |
| 5753 | boolean res = reply.readInt() != 0; |
| 5754 | data.recycle(); |
| 5755 | reply.recycle(); |
| 5756 | return res; |
| 5757 | } |
| 5758 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5759 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5760 | Parcel data = Parcel.obtain(); |
| 5761 | Parcel reply = Parcel.obtain(); |
| 5762 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5763 | data.writeStrongBinder(sender.asBinder()); |
| 5764 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5765 | reply.readException(); |
| 5766 | Intent res = reply.readInt() != 0 |
| 5767 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5768 | data.recycle(); |
| 5769 | reply.recycle(); |
| 5770 | return res; |
| 5771 | } |
| 5772 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5773 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5774 | throws RemoteException { |
| 5775 | Parcel data = Parcel.obtain(); |
| 5776 | Parcel reply = Parcel.obtain(); |
| 5777 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5778 | data.writeStrongBinder(sender.asBinder()); |
| 5779 | data.writeString(prefix); |
| 5780 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5781 | reply.readException(); |
| 5782 | String res = reply.readString(); |
| 5783 | data.recycle(); |
| 5784 | reply.recycle(); |
| 5785 | return res; |
| 5786 | } |
| 5787 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5788 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5789 | { |
| 5790 | Parcel data = Parcel.obtain(); |
| 5791 | Parcel reply = Parcel.obtain(); |
| 5792 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5793 | values.writeToParcel(data, 0); |
| 5794 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5795 | reply.readException(); |
| 5796 | data.recycle(); |
| 5797 | reply.recycle(); |
| 5798 | } |
| 5799 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 5800 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 5801 | Parcel data = Parcel.obtain(); |
| 5802 | Parcel reply = Parcel.obtain(); |
| 5803 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5804 | data.writeIntArray(pids); |
| 5805 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 5806 | reply.readException(); |
| 5807 | long[] res = reply.createLongArray(); |
| 5808 | data.recycle(); |
| 5809 | reply.recycle(); |
| 5810 | return res; |
| 5811 | } |
| 5812 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5813 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5814 | Parcel data = Parcel.obtain(); |
| 5815 | Parcel reply = Parcel.obtain(); |
| 5816 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5817 | TextUtils.writeToParcel(msg, data, 0); |
| 5818 | data.writeInt(always ? 1 : 0); |
| 5819 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5820 | reply.readException(); |
| 5821 | data.recycle(); |
| 5822 | reply.recycle(); |
| 5823 | } |
| 5824 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5825 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5826 | Parcel data = Parcel.obtain(); |
| 5827 | Parcel reply = Parcel.obtain(); |
| 5828 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5829 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5830 | reply.readException(); |
| 5831 | data.recycle(); |
| 5832 | reply.recycle(); |
| 5833 | } |
| 5834 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5835 | public void keyguardGoingAway(boolean disableWindowAnimations, |
| 5836 | boolean keyguardGoingToNotificationShade) throws RemoteException { |
| 5837 | Parcel data = Parcel.obtain(); |
| 5838 | Parcel reply = Parcel.obtain(); |
| 5839 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5840 | data.writeInt(disableWindowAnimations ? 1 : 0); |
| 5841 | data.writeInt(keyguardGoingToNotificationShade ? 1 : 0); |
| 5842 | mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0); |
| 5843 | reply.readException(); |
| 5844 | data.recycle(); |
| 5845 | reply.recycle(); |
| 5846 | } |
| 5847 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5848 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5849 | throws RemoteException { |
| 5850 | Parcel data = Parcel.obtain(); |
| 5851 | Parcel reply = Parcel.obtain(); |
| 5852 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5853 | data.writeStrongBinder(token); |
| 5854 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5855 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5856 | reply.readException(); |
| 5857 | boolean result = reply.readInt() != 0; |
| 5858 | data.recycle(); |
| 5859 | reply.recycle(); |
| 5860 | return result; |
| 5861 | } |
| 5862 | |
| 5863 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5864 | throws RemoteException { |
| 5865 | Parcel data = Parcel.obtain(); |
| 5866 | Parcel reply = Parcel.obtain(); |
| 5867 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5868 | data.writeStrongBinder(token); |
| 5869 | target.writeToParcel(data, 0); |
| 5870 | data.writeInt(resultCode); |
| 5871 | if (resultData != null) { |
| 5872 | data.writeInt(1); |
| 5873 | resultData.writeToParcel(data, 0); |
| 5874 | } else { |
| 5875 | data.writeInt(0); |
| 5876 | } |
| 5877 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5878 | reply.readException(); |
| 5879 | boolean result = reply.readInt() != 0; |
| 5880 | data.recycle(); |
| 5881 | reply.recycle(); |
| 5882 | return result; |
| 5883 | } |
| 5884 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5885 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5886 | Parcel data = Parcel.obtain(); |
| 5887 | Parcel reply = Parcel.obtain(); |
| 5888 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5889 | data.writeStrongBinder(activityToken); |
| 5890 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5891 | reply.readException(); |
| 5892 | int result = reply.readInt(); |
| 5893 | data.recycle(); |
| 5894 | reply.recycle(); |
| 5895 | return result; |
| 5896 | } |
| 5897 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5898 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 5899 | Parcel data = Parcel.obtain(); |
| 5900 | Parcel reply = Parcel.obtain(); |
| 5901 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5902 | data.writeStrongBinder(activityToken); |
| 5903 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 5904 | reply.readException(); |
| 5905 | String result = reply.readString(); |
| 5906 | data.recycle(); |
| 5907 | reply.recycle(); |
| 5908 | return result; |
| 5909 | } |
| 5910 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 5911 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5912 | Parcel data = Parcel.obtain(); |
| 5913 | Parcel reply = Parcel.obtain(); |
| 5914 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5915 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5916 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5917 | reply.readException(); |
| 5918 | data.recycle(); |
| 5919 | reply.recycle(); |
| 5920 | } |
| 5921 | |
| 5922 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5923 | Parcel data = Parcel.obtain(); |
| 5924 | Parcel reply = Parcel.obtain(); |
| 5925 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5926 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5927 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5928 | reply.readException(); |
| 5929 | data.recycle(); |
| 5930 | reply.recycle(); |
| 5931 | } |
| 5932 | |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 5933 | public void requestBugReport(@ActivityManager.BugreportMode int bugreportType) |
| 5934 | throws RemoteException { |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5935 | Parcel data = Parcel.obtain(); |
| 5936 | Parcel reply = Parcel.obtain(); |
| 5937 | data.writeInterfaceToken(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 5938 | data.writeInt(bugreportType); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5939 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 5940 | reply.readException(); |
| 5941 | data.recycle(); |
| 5942 | reply.recycle(); |
| 5943 | } |
| 5944 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5945 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 5946 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5947 | Parcel data = Parcel.obtain(); |
| 5948 | Parcel reply = Parcel.obtain(); |
| 5949 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5950 | data.writeInt(pid); |
| 5951 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5952 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5953 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 5954 | reply.readException(); |
| 5955 | long res = reply.readInt(); |
| 5956 | data.recycle(); |
| 5957 | reply.recycle(); |
| 5958 | return res; |
| 5959 | } |
| 5960 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5961 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5962 | Parcel data = Parcel.obtain(); |
| 5963 | Parcel reply = Parcel.obtain(); |
| 5964 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5965 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5966 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5967 | reply.readException(); |
| 5968 | Bundle res = reply.readBundle(); |
| 5969 | data.recycle(); |
| 5970 | reply.recycle(); |
| 5971 | return res; |
| 5972 | } |
| 5973 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5974 | public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, |
| 5975 | IBinder activityToken) throws RemoteException { |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5976 | Parcel data = Parcel.obtain(); |
| 5977 | Parcel reply = Parcel.obtain(); |
| 5978 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5979 | data.writeInt(requestType); |
| 5980 | data.writeStrongBinder(receiver.asBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5981 | data.writeStrongBinder(activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5982 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 5983 | reply.readException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5984 | boolean res = reply.readInt() != 0; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5985 | data.recycle(); |
| 5986 | reply.recycle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5987 | return res; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5988 | } |
| 5989 | |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 5990 | public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 5991 | AssistContent content, Uri referrer) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5992 | Parcel data = Parcel.obtain(); |
| 5993 | Parcel reply = Parcel.obtain(); |
| 5994 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5995 | data.writeStrongBinder(token); |
| 5996 | data.writeBundle(extras); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 5997 | structure.writeToParcel(data, 0); |
| 5998 | content.writeToParcel(data, 0); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 5999 | if (referrer != null) { |
| 6000 | data.writeInt(1); |
| 6001 | referrer.writeToParcel(data, 0); |
| 6002 | } else { |
| 6003 | data.writeInt(0); |
| 6004 | } |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6005 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6006 | reply.readException(); |
| 6007 | data.recycle(); |
| 6008 | reply.recycle(); |
| 6009 | } |
| 6010 | |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6011 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, |
| 6012 | Bundle args) throws RemoteException { |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6013 | Parcel data = Parcel.obtain(); |
| 6014 | Parcel reply = Parcel.obtain(); |
| 6015 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6016 | intent.writeToParcel(data, 0); |
| 6017 | data.writeInt(requestType); |
| 6018 | data.writeString(hint); |
| 6019 | data.writeInt(userHandle); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6020 | data.writeBundle(args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6021 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 6022 | reply.readException(); |
| 6023 | boolean res = reply.readInt() != 0; |
| 6024 | data.recycle(); |
| 6025 | reply.recycle(); |
| 6026 | return res; |
| 6027 | } |
| 6028 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6029 | public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException { |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 6030 | Parcel data = Parcel.obtain(); |
| 6031 | Parcel reply = Parcel.obtain(); |
| 6032 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6033 | mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6034 | reply.readException(); |
| 6035 | boolean res = reply.readInt() != 0; |
| 6036 | data.recycle(); |
| 6037 | reply.recycle(); |
| 6038 | return res; |
| 6039 | } |
| 6040 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6041 | public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException { |
| 6042 | Parcel data = Parcel.obtain(); |
| 6043 | Parcel reply = Parcel.obtain(); |
| 6044 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6045 | data.writeStrongBinder(token); |
| 6046 | data.writeBundle(args); |
| 6047 | mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6048 | reply.readException(); |
| 6049 | boolean res = reply.readInt() != 0; |
| 6050 | data.recycle(); |
| 6051 | reply.recycle(); |
| 6052 | return res; |
| 6053 | } |
| 6054 | |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6055 | public void killUid(int appId, int userId, String reason) throws RemoteException { |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6056 | Parcel data = Parcel.obtain(); |
| 6057 | Parcel reply = Parcel.obtain(); |
| 6058 | data.writeInterfaceToken(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6059 | data.writeInt(appId); |
| 6060 | data.writeInt(userId); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6061 | data.writeString(reason); |
| 6062 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 6063 | reply.readException(); |
| 6064 | data.recycle(); |
| 6065 | reply.recycle(); |
| 6066 | } |
| 6067 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 6068 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 6069 | Parcel data = Parcel.obtain(); |
| 6070 | Parcel reply = Parcel.obtain(); |
| 6071 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6072 | data.writeStrongBinder(who); |
| 6073 | data.writeInt(allowRestart ? 1 : 0); |
| 6074 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 6075 | reply.readException(); |
| 6076 | data.recycle(); |
| 6077 | reply.recycle(); |
| 6078 | } |
| 6079 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 6080 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 6081 | Parcel data = Parcel.obtain(); |
| 6082 | Parcel reply = Parcel.obtain(); |
| 6083 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6084 | data.writeStrongBinder(token); |
| 6085 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 6086 | reply.readException(); |
| 6087 | data.recycle(); |
| 6088 | reply.recycle(); |
| 6089 | } |
| 6090 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 6091 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 6092 | Parcel data = Parcel.obtain(); |
| 6093 | Parcel reply = Parcel.obtain(); |
| 6094 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6095 | data.writeStrongBinder(token); |
| 6096 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 6097 | reply.readException(); |
| 6098 | data.recycle(); |
| 6099 | reply.recycle(); |
| 6100 | } |
| 6101 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 6102 | public void restart() throws RemoteException { |
| 6103 | Parcel data = Parcel.obtain(); |
| 6104 | Parcel reply = Parcel.obtain(); |
| 6105 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6106 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 6107 | reply.readException(); |
| 6108 | data.recycle(); |
| 6109 | reply.recycle(); |
| 6110 | } |
| 6111 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 6112 | public void performIdleMaintenance() throws RemoteException { |
| 6113 | Parcel data = Parcel.obtain(); |
| 6114 | Parcel reply = Parcel.obtain(); |
| 6115 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6116 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 6117 | reply.readException(); |
| 6118 | data.recycle(); |
| 6119 | reply.recycle(); |
| 6120 | } |
| 6121 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6122 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6123 | IActivityContainerCallback callback) throws RemoteException { |
| 6124 | Parcel data = Parcel.obtain(); |
| 6125 | Parcel reply = Parcel.obtain(); |
| 6126 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6127 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 6128 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6129 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6130 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 6131 | final int result = reply.readInt(); |
| 6132 | final IActivityContainer res; |
| 6133 | if (result == 1) { |
| 6134 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6135 | } else { |
| 6136 | res = null; |
| 6137 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6138 | data.recycle(); |
| 6139 | reply.recycle(); |
| 6140 | return res; |
| 6141 | } |
| 6142 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 6143 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 6144 | throws RemoteException { |
| 6145 | Parcel data = Parcel.obtain(); |
| 6146 | Parcel reply = Parcel.obtain(); |
| 6147 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6148 | data.writeStrongBinder(activityContainer.asBinder()); |
| 6149 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 6150 | reply.readException(); |
| 6151 | data.recycle(); |
| 6152 | reply.recycle(); |
| 6153 | } |
| 6154 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 6155 | public boolean startBinderTracking() throws RemoteException { |
| 6156 | Parcel data = Parcel.obtain(); |
| 6157 | Parcel reply = Parcel.obtain(); |
| 6158 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6159 | mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0); |
| 6160 | reply.readException(); |
| 6161 | boolean res = reply.readInt() != 0; |
| 6162 | reply.recycle(); |
| 6163 | data.recycle(); |
| 6164 | return res; |
| 6165 | } |
| 6166 | |
| 6167 | public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException { |
| 6168 | Parcel data = Parcel.obtain(); |
| 6169 | Parcel reply = Parcel.obtain(); |
| 6170 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6171 | if (fd != null) { |
| 6172 | data.writeInt(1); |
| 6173 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 6174 | } else { |
| 6175 | data.writeInt(0); |
| 6176 | } |
| 6177 | mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0); |
| 6178 | reply.readException(); |
| 6179 | boolean res = reply.readInt() != 0; |
| 6180 | reply.recycle(); |
| 6181 | data.recycle(); |
| 6182 | return res; |
| 6183 | } |
| 6184 | |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6185 | public void setVrMode(IBinder token, boolean enabled) throws RemoteException { |
| 6186 | Parcel data = Parcel.obtain(); |
| 6187 | Parcel reply = Parcel.obtain(); |
| 6188 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6189 | data.writeStrongBinder(token); |
| 6190 | data.writeInt(enabled ? 1 : 0); |
| 6191 | mRemote.transact(SET_VR_MODE_TRANSACTION, data, reply, 0); |
| 6192 | reply.readException(); |
| 6193 | data.recycle(); |
| 6194 | reply.recycle(); |
| 6195 | } |
| 6196 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6197 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 6198 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 6199 | Parcel data = Parcel.obtain(); |
| 6200 | Parcel reply = Parcel.obtain(); |
| 6201 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6202 | data.writeInt(displayId); |
| 6203 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 6204 | reply.readException(); |
| 6205 | final int result = reply.readInt(); |
| 6206 | final IActivityContainer res; |
| 6207 | if (result == 1) { |
| 6208 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6209 | } else { |
| 6210 | res = null; |
| 6211 | } |
| 6212 | data.recycle(); |
| 6213 | reply.recycle(); |
| 6214 | return res; |
| 6215 | } |
| 6216 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6217 | @Override |
| 6218 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6219 | throws RemoteException { |
| 6220 | Parcel data = Parcel.obtain(); |
| 6221 | Parcel reply = Parcel.obtain(); |
| 6222 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6223 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6224 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6225 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6226 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6227 | data.recycle(); |
| 6228 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6229 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6230 | } |
| 6231 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6232 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6233 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 6234 | Parcel data = Parcel.obtain(); |
| 6235 | Parcel reply = Parcel.obtain(); |
| 6236 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6237 | data.writeInt(taskId); |
| 6238 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 6239 | reply.readException(); |
| 6240 | data.recycle(); |
| 6241 | reply.recycle(); |
| 6242 | } |
| 6243 | |
| 6244 | @Override |
| 6245 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 6246 | Parcel data = Parcel.obtain(); |
| 6247 | Parcel reply = Parcel.obtain(); |
| 6248 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6249 | data.writeStrongBinder(token); |
| 6250 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 6251 | reply.readException(); |
| 6252 | data.recycle(); |
| 6253 | reply.recycle(); |
| 6254 | } |
| 6255 | |
| 6256 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6257 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 6258 | Parcel data = Parcel.obtain(); |
| 6259 | Parcel reply = Parcel.obtain(); |
| 6260 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6261 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6262 | reply.readException(); |
| 6263 | data.recycle(); |
| 6264 | reply.recycle(); |
| 6265 | } |
| 6266 | |
| 6267 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6268 | public void stopLockTaskMode() throws RemoteException { |
| 6269 | Parcel data = Parcel.obtain(); |
| 6270 | Parcel reply = Parcel.obtain(); |
| 6271 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6272 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6273 | reply.readException(); |
| 6274 | data.recycle(); |
| 6275 | reply.recycle(); |
| 6276 | } |
| 6277 | |
| 6278 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6279 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 6280 | Parcel data = Parcel.obtain(); |
| 6281 | Parcel reply = Parcel.obtain(); |
| 6282 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6283 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6284 | reply.readException(); |
| 6285 | data.recycle(); |
| 6286 | reply.recycle(); |
| 6287 | } |
| 6288 | |
| 6289 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6290 | public boolean isInLockTaskMode() throws RemoteException { |
| 6291 | Parcel data = Parcel.obtain(); |
| 6292 | Parcel reply = Parcel.obtain(); |
| 6293 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6294 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6295 | reply.readException(); |
| 6296 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 6297 | data.recycle(); |
| 6298 | reply.recycle(); |
| 6299 | return isInLockTaskMode; |
| 6300 | } |
| 6301 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 6302 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 6303 | public int getLockTaskModeState() throws RemoteException { |
| 6304 | Parcel data = Parcel.obtain(); |
| 6305 | Parcel reply = Parcel.obtain(); |
| 6306 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6307 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 6308 | reply.readException(); |
| 6309 | int lockTaskModeState = reply.readInt(); |
| 6310 | data.recycle(); |
| 6311 | reply.recycle(); |
| 6312 | return lockTaskModeState; |
| 6313 | } |
| 6314 | |
| 6315 | @Override |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 6316 | public void showLockTaskEscapeMessage(IBinder token) throws RemoteException { |
| 6317 | Parcel data = Parcel.obtain(); |
| 6318 | Parcel reply = Parcel.obtain(); |
| 6319 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6320 | data.writeStrongBinder(token); |
| 6321 | mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply, |
| 6322 | IBinder.FLAG_ONEWAY); |
| 6323 | reply.readException(); |
| 6324 | data.recycle(); |
| 6325 | reply.recycle(); |
| 6326 | } |
| 6327 | |
| 6328 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 6329 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6330 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6331 | Parcel data = Parcel.obtain(); |
| 6332 | Parcel reply = Parcel.obtain(); |
| 6333 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6334 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6335 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6336 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6337 | reply.readException(); |
| 6338 | data.recycle(); |
| 6339 | reply.recycle(); |
| 6340 | } |
| 6341 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6342 | @Override |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6343 | public void setTaskResizeable(int taskId, int resizeableMode) throws RemoteException { |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6344 | Parcel data = Parcel.obtain(); |
| 6345 | Parcel reply = Parcel.obtain(); |
| 6346 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6347 | data.writeInt(taskId); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6348 | data.writeInt(resizeableMode); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6349 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6350 | reply.readException(); |
| 6351 | data.recycle(); |
| 6352 | reply.recycle(); |
| 6353 | } |
| 6354 | |
| 6355 | @Override |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6356 | public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6357 | { |
| 6358 | Parcel data = Parcel.obtain(); |
| 6359 | Parcel reply = Parcel.obtain(); |
| 6360 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6361 | data.writeInt(taskId); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6362 | data.writeInt(resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6363 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6364 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6365 | reply.readException(); |
| 6366 | data.recycle(); |
| 6367 | reply.recycle(); |
| 6368 | } |
| 6369 | |
| 6370 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 6371 | public Rect getTaskBounds(int taskId) throws RemoteException |
| 6372 | { |
| 6373 | Parcel data = Parcel.obtain(); |
| 6374 | Parcel reply = Parcel.obtain(); |
| 6375 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6376 | data.writeInt(taskId); |
| 6377 | mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0); |
| 6378 | reply.readException(); |
| 6379 | Rect rect = Rect.CREATOR.createFromParcel(reply); |
| 6380 | data.recycle(); |
| 6381 | reply.recycle(); |
| 6382 | return rect; |
| 6383 | } |
| 6384 | |
| 6385 | @Override |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6386 | public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException { |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6387 | Parcel data = Parcel.obtain(); |
| 6388 | Parcel reply = Parcel.obtain(); |
| 6389 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6390 | data.writeString(filename); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6391 | data.writeInt(userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6392 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 6393 | reply.readException(); |
| 6394 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 6395 | data.recycle(); |
| 6396 | reply.recycle(); |
| 6397 | return icon; |
| 6398 | } |
| 6399 | |
| 6400 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6401 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 6402 | throws RemoteException { |
| 6403 | Parcel data = Parcel.obtain(); |
| 6404 | Parcel reply = Parcel.obtain(); |
| 6405 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6406 | if (options == null) { |
| 6407 | data.writeInt(0); |
| 6408 | } else { |
| 6409 | data.writeInt(1); |
| 6410 | data.writeBundle(options.toBundle()); |
| 6411 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6412 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6413 | reply.readException(); |
| 6414 | data.recycle(); |
| 6415 | reply.recycle(); |
| 6416 | } |
| 6417 | |
| 6418 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6419 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6420 | Parcel data = Parcel.obtain(); |
| 6421 | Parcel reply = Parcel.obtain(); |
| 6422 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6423 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6424 | data.writeInt(visible ? 1 : 0); |
| 6425 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6426 | reply.readException(); |
| 6427 | boolean success = reply.readInt() > 0; |
| 6428 | data.recycle(); |
| 6429 | reply.recycle(); |
| 6430 | return success; |
| 6431 | } |
| 6432 | |
| 6433 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6434 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6435 | Parcel data = Parcel.obtain(); |
| 6436 | Parcel reply = Parcel.obtain(); |
| 6437 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6438 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6439 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6440 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6441 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6442 | data.recycle(); |
| 6443 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6444 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6445 | } |
| 6446 | |
| 6447 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6448 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6449 | Parcel data = Parcel.obtain(); |
| 6450 | Parcel reply = Parcel.obtain(); |
| 6451 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6452 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6453 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 6454 | reply.readException(); |
| 6455 | data.recycle(); |
| 6456 | reply.recycle(); |
| 6457 | } |
| 6458 | |
| 6459 | @Override |
| 6460 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 6461 | Parcel data = Parcel.obtain(); |
| 6462 | Parcel reply = Parcel.obtain(); |
| 6463 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6464 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6465 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6466 | reply.readException(); |
| 6467 | data.recycle(); |
| 6468 | reply.recycle(); |
| 6469 | } |
| 6470 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6471 | @Override |
| 6472 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 6473 | Parcel data = Parcel.obtain(); |
| 6474 | Parcel reply = Parcel.obtain(); |
| 6475 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6476 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6477 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6478 | reply.readException(); |
| 6479 | data.recycle(); |
| 6480 | reply.recycle(); |
| 6481 | } |
| 6482 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 6483 | @Override |
| 6484 | public void bootAnimationComplete() throws RemoteException { |
| 6485 | Parcel data = Parcel.obtain(); |
| 6486 | Parcel reply = Parcel.obtain(); |
| 6487 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6488 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 6489 | reply.readException(); |
| 6490 | data.recycle(); |
| 6491 | reply.recycle(); |
| 6492 | } |
| 6493 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 6494 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 6495 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 6496 | Parcel data = Parcel.obtain(); |
| 6497 | Parcel reply = Parcel.obtain(); |
| 6498 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6499 | data.writeInt(uid); |
| 6500 | data.writeByteArray(firstPacket); |
| 6501 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 6502 | reply.readException(); |
| 6503 | data.recycle(); |
| 6504 | reply.recycle(); |
| 6505 | } |
| 6506 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6507 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6508 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 6509 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6510 | Parcel data = Parcel.obtain(); |
| 6511 | Parcel reply = Parcel.obtain(); |
| 6512 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6513 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6514 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6515 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6516 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6517 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 6518 | reply.readException(); |
| 6519 | data.recycle(); |
| 6520 | reply.recycle(); |
| 6521 | } |
| 6522 | |
| 6523 | @Override |
| 6524 | public void dumpHeapFinished(String path) throws RemoteException { |
| 6525 | Parcel data = Parcel.obtain(); |
| 6526 | Parcel reply = Parcel.obtain(); |
| 6527 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6528 | data.writeString(path); |
| 6529 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 6530 | reply.readException(); |
| 6531 | data.recycle(); |
| 6532 | reply.recycle(); |
| 6533 | } |
| 6534 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 6535 | @Override |
| 6536 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 6537 | throws RemoteException { |
| 6538 | Parcel data = Parcel.obtain(); |
| 6539 | Parcel reply = Parcel.obtain(); |
| 6540 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6541 | data.writeStrongBinder(session.asBinder()); |
| 6542 | data.writeInt(keepAwake ? 1 : 0); |
| 6543 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 6544 | reply.readException(); |
| 6545 | data.recycle(); |
| 6546 | reply.recycle(); |
| 6547 | } |
| 6548 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6549 | @Override |
| 6550 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 6551 | Parcel data = Parcel.obtain(); |
| 6552 | Parcel reply = Parcel.obtain(); |
| 6553 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6554 | data.writeInt(userId); |
| 6555 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6556 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6557 | reply.readException(); |
| 6558 | data.recycle(); |
| 6559 | reply.recycle(); |
| 6560 | } |
| 6561 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6562 | @Override |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 6563 | public void updateDeviceOwner(String packageName) throws RemoteException { |
| 6564 | Parcel data = Parcel.obtain(); |
| 6565 | Parcel reply = Parcel.obtain(); |
| 6566 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6567 | data.writeString(packageName); |
| 6568 | mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0); |
| 6569 | reply.readException(); |
| 6570 | data.recycle(); |
| 6571 | reply.recycle(); |
| 6572 | } |
| 6573 | |
| 6574 | @Override |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6575 | public int getPackageProcessState(String packageName, String callingPackage) |
| 6576 | throws RemoteException { |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6577 | Parcel data = Parcel.obtain(); |
| 6578 | Parcel reply = Parcel.obtain(); |
| 6579 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6580 | data.writeString(packageName); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6581 | data.writeString(callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6582 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 6583 | reply.readException(); |
| 6584 | int res = reply.readInt(); |
| 6585 | data.recycle(); |
| 6586 | reply.recycle(); |
| 6587 | return res; |
| 6588 | } |
| 6589 | |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 6590 | @Override |
| 6591 | public boolean setProcessMemoryTrimLevel(String process, int userId, int level) |
| 6592 | throws RemoteException { |
| 6593 | Parcel data = Parcel.obtain(); |
| 6594 | Parcel reply = Parcel.obtain(); |
| 6595 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6596 | data.writeString(process); |
| 6597 | data.writeInt(userId); |
| 6598 | data.writeInt(level); |
| 6599 | mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0); |
| 6600 | reply.readException(); |
| 6601 | int res = reply.readInt(); |
| 6602 | data.recycle(); |
| 6603 | reply.recycle(); |
| 6604 | return res != 0; |
| 6605 | } |
| 6606 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 6607 | @Override |
| 6608 | public boolean isRootVoiceInteraction(IBinder token) throws RemoteException { |
| 6609 | Parcel data = Parcel.obtain(); |
| 6610 | Parcel reply = Parcel.obtain(); |
| 6611 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6612 | data.writeStrongBinder(token); |
| 6613 | mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 6614 | reply.readException(); |
| 6615 | int res = reply.readInt(); |
| 6616 | data.recycle(); |
| 6617 | reply.recycle(); |
| 6618 | return res != 0; |
| 6619 | } |
| 6620 | |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6621 | @Override |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6622 | public void exitFreeformMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6623 | Parcel data = Parcel.obtain(); |
| 6624 | Parcel reply = Parcel.obtain(); |
| 6625 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6626 | data.writeStrongBinder(token); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6627 | mRemote.transact(EXIT_FREEFORM_MODE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6628 | reply.readException(); |
| 6629 | data.recycle(); |
| 6630 | reply.recycle(); |
| 6631 | } |
| 6632 | |
| 6633 | @Override |
| 6634 | public int getActivityStackId(IBinder token) throws RemoteException { |
| 6635 | Parcel data = Parcel.obtain(); |
| 6636 | Parcel reply = Parcel.obtain(); |
| 6637 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6638 | data.writeStrongBinder(token); |
| 6639 | mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0); |
| 6640 | reply.readException(); |
| 6641 | int stackId = reply.readInt(); |
| 6642 | data.recycle(); |
| 6643 | reply.recycle(); |
| 6644 | return stackId; |
| 6645 | } |
| 6646 | |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6647 | @Override |
| 6648 | public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration, |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6649 | int[] verticalSizeConfigurations, int[] smallestSizeConfigurations) |
| 6650 | throws RemoteException { |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6651 | Parcel data = Parcel.obtain(); |
| 6652 | Parcel reply = Parcel.obtain(); |
| 6653 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6654 | data.writeStrongBinder(token); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6655 | writeIntArray(horizontalSizeConfiguration, data); |
| 6656 | writeIntArray(verticalSizeConfigurations, data); |
| 6657 | writeIntArray(smallestSizeConfigurations, data); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6658 | mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0); |
| 6659 | reply.readException(); |
| 6660 | data.recycle(); |
| 6661 | reply.recycle(); |
| 6662 | } |
| 6663 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6664 | private static void writeIntArray(int[] array, Parcel data) { |
| 6665 | if (array == null) { |
| 6666 | data.writeInt(0); |
| 6667 | } else { |
| 6668 | data.writeInt(array.length); |
| 6669 | data.writeIntArray(array); |
| 6670 | } |
| 6671 | } |
| 6672 | |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 6673 | @Override |
| 6674 | public void suppressResizeConfigChanges(boolean suppress) throws RemoteException { |
| 6675 | Parcel data = Parcel.obtain(); |
| 6676 | Parcel reply = Parcel.obtain(); |
| 6677 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6678 | data.writeInt(suppress ? 1 : 0); |
| 6679 | mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0); |
| 6680 | reply.readException(); |
| 6681 | data.recycle(); |
| 6682 | reply.recycle(); |
| 6683 | } |
| 6684 | |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6685 | @Override |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6686 | public void moveTasksToFullscreenStack(int fromStackId, boolean onTop) throws RemoteException { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6687 | Parcel data = Parcel.obtain(); |
| 6688 | Parcel reply = Parcel.obtain(); |
| 6689 | data.writeInterfaceToken(IActivityManager.descriptor); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6690 | data.writeInt(fromStackId); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6691 | data.writeInt(onTop ? 1 : 0); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6692 | mRemote.transact(MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION, data, reply, 0); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6693 | reply.readException(); |
| 6694 | data.recycle(); |
| 6695 | reply.recycle(); |
| 6696 | } |
| 6697 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6698 | @Override |
| 6699 | public int getAppStartMode(int uid, String packageName) throws RemoteException { |
| 6700 | Parcel data = Parcel.obtain(); |
| 6701 | Parcel reply = Parcel.obtain(); |
| 6702 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6703 | data.writeInt(uid); |
| 6704 | data.writeString(packageName); |
| 6705 | mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0); |
| 6706 | reply.readException(); |
| 6707 | int res = reply.readInt(); |
| 6708 | data.recycle(); |
| 6709 | reply.recycle(); |
| 6710 | return res; |
| 6711 | } |
| 6712 | |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6713 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6714 | public boolean inMultiWindow(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6715 | Parcel data = Parcel.obtain(); |
| 6716 | Parcel reply = Parcel.obtain(); |
| 6717 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6718 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6719 | mRemote.transact(IN_MULTI_WINDOW_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6720 | reply.readException(); |
| 6721 | final boolean multiWindowMode = reply.readInt() == 1 ? true : false; |
| 6722 | data.recycle(); |
| 6723 | reply.recycle(); |
| 6724 | return multiWindowMode; |
| 6725 | } |
| 6726 | |
| 6727 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6728 | public boolean inPictureInPicture(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6729 | Parcel data = Parcel.obtain(); |
| 6730 | Parcel reply = Parcel.obtain(); |
| 6731 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6732 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6733 | mRemote.transact(IN_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6734 | reply.readException(); |
| 6735 | final boolean pipMode = reply.readInt() == 1 ? true : false; |
| 6736 | data.recycle(); |
| 6737 | reply.recycle(); |
| 6738 | return pipMode; |
| 6739 | } |
| 6740 | |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6741 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6742 | public void enterPictureInPicture(IBinder token) throws RemoteException { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6743 | Parcel data = Parcel.obtain(); |
| 6744 | Parcel reply = Parcel.obtain(); |
| 6745 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6746 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6747 | mRemote.transact(ENTER_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6748 | reply.readException(); |
| 6749 | data.recycle(); |
| 6750 | reply.recycle(); |
| 6751 | } |
| 6752 | |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 6753 | @Override |
| 6754 | public boolean isAppForeground(int uid) throws RemoteException { |
| 6755 | Parcel data = Parcel.obtain(); |
| 6756 | Parcel reply = Parcel.obtain(); |
| 6757 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6758 | data.writeInt(uid); |
| 6759 | mRemote.transact(IS_APP_FOREGROUND_TRANSACTION, data, reply, 0); |
| 6760 | final boolean isForeground = reply.readInt() == 1 ? true : false; |
| 6761 | data.recycle(); |
| 6762 | reply.recycle(); |
| 6763 | return isForeground; |
| 6764 | }; |
| 6765 | |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 6766 | @Override |
| 6767 | public void notifyPinnedStackAnimationEnded() throws RemoteException { |
| 6768 | Parcel data = Parcel.obtain(); |
| 6769 | Parcel reply = Parcel.obtain(); |
| 6770 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6771 | mRemote.transact(NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION, data, reply, 0); |
| 6772 | data.recycle(); |
| 6773 | reply.recycle(); |
| 6774 | }; |
| 6775 | |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 6776 | @Override |
| 6777 | public void removeStack(int stackId) throws RemoteException { |
| 6778 | Parcel data = Parcel.obtain(); |
| 6779 | Parcel reply = Parcel.obtain(); |
| 6780 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6781 | data.writeInt(stackId); |
| 6782 | mRemote.transact(REMOVE_STACK, data, reply, 0); |
| 6783 | reply.readException(); |
| 6784 | data.recycle(); |
| 6785 | reply.recycle(); |
| 6786 | } |
| 6787 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6788 | private IBinder mRemote; |
| 6789 | } |