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 | |
| 1535 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1536 | data.enforceInterface(IActivityManager.descriptor); |
| 1537 | enterSafeMode(); |
| 1538 | reply.writeNoException(); |
| 1539 | return true; |
| 1540 | } |
| 1541 | |
| 1542 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1543 | data.enforceInterface(IActivityManager.descriptor); |
| 1544 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1545 | data.readStrongBinder()); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 1546 | int sourceUid = data.readInt(); |
| 1547 | String sourcePkg = data.readString(); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 1548 | String tag = data.readString(); |
| 1549 | noteWakeupAlarm(is, sourceUid, sourcePkg, tag); |
| 1550 | reply.writeNoException(); |
| 1551 | return true; |
| 1552 | } |
| 1553 | |
| 1554 | case NOTE_ALARM_START_TRANSACTION: { |
| 1555 | data.enforceInterface(IActivityManager.descriptor); |
| 1556 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1557 | data.readStrongBinder()); |
| 1558 | int sourceUid = data.readInt(); |
| 1559 | String tag = data.readString(); |
| 1560 | noteAlarmStart(is, sourceUid, tag); |
| 1561 | reply.writeNoException(); |
| 1562 | return true; |
| 1563 | } |
| 1564 | |
| 1565 | case NOTE_ALARM_FINISH_TRANSACTION: { |
| 1566 | data.enforceInterface(IActivityManager.descriptor); |
| 1567 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1568 | data.readStrongBinder()); |
| 1569 | int sourceUid = data.readInt(); |
| 1570 | String tag = data.readString(); |
| 1571 | noteAlarmFinish(is, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1572 | reply.writeNoException(); |
| 1573 | return true; |
| 1574 | } |
| 1575 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1576 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1577 | data.enforceInterface(IActivityManager.descriptor); |
| 1578 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1579 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1580 | boolean secure = data.readInt() != 0; |
| 1581 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1582 | reply.writeNoException(); |
| 1583 | reply.writeInt(res ? 1 : 0); |
| 1584 | return true; |
| 1585 | } |
| 1586 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1587 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1588 | data.enforceInterface(IActivityManager.descriptor); |
| 1589 | String reason = data.readString(); |
| 1590 | boolean res = killProcessesBelowForeground(reason); |
| 1591 | reply.writeNoException(); |
| 1592 | reply.writeInt(res ? 1 : 0); |
| 1593 | return true; |
| 1594 | } |
| 1595 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1596 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1597 | data.enforceInterface(IActivityManager.descriptor); |
| 1598 | IBinder app = data.readStrongBinder(); |
| 1599 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1600 | handleApplicationCrash(app, ci); |
| 1601 | reply.writeNoException(); |
| 1602 | return true; |
| 1603 | } |
| 1604 | |
| 1605 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1606 | data.enforceInterface(IActivityManager.descriptor); |
| 1607 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1608 | String tag = data.readString(); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1609 | boolean system = data.readInt() != 0; |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1610 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1611 | boolean res = handleApplicationWtf(app, tag, system, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1612 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1613 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1614 | return true; |
| 1615 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1616 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1617 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1618 | data.enforceInterface(IActivityManager.descriptor); |
| 1619 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1620 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1621 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1622 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1623 | reply.writeNoException(); |
| 1624 | return true; |
| 1625 | } |
| 1626 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1627 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1628 | data.enforceInterface(IActivityManager.descriptor); |
| 1629 | int sig = data.readInt(); |
| 1630 | signalPersistentProcesses(sig); |
| 1631 | reply.writeNoException(); |
| 1632 | return true; |
| 1633 | } |
| 1634 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1635 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1636 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1637 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1638 | int userId = data.readInt(); |
| 1639 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1640 | reply.writeNoException(); |
| 1641 | return true; |
| 1642 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1643 | |
| 1644 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1645 | data.enforceInterface(IActivityManager.descriptor); |
| 1646 | killAllBackgroundProcesses(); |
| 1647 | reply.writeNoException(); |
| 1648 | return true; |
| 1649 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1650 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 1651 | case KILL_PACKAGE_DEPENDENTS_TRANSACTION: { |
| 1652 | data.enforceInterface(IActivityManager.descriptor); |
| 1653 | String packageName = data.readString(); |
| 1654 | int userId = data.readInt(); |
| 1655 | killPackageDependents(packageName, userId); |
| 1656 | reply.writeNoException(); |
| 1657 | return true; |
| 1658 | } |
| 1659 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1660 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1661 | data.enforceInterface(IActivityManager.descriptor); |
| 1662 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1663 | int userId = data.readInt(); |
| 1664 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1665 | reply.writeNoException(); |
| 1666 | return true; |
| 1667 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1668 | |
| 1669 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1670 | data.enforceInterface(IActivityManager.descriptor); |
| 1671 | ActivityManager.RunningAppProcessInfo info = |
| 1672 | new ActivityManager.RunningAppProcessInfo(); |
| 1673 | getMyMemoryState(info); |
| 1674 | reply.writeNoException(); |
| 1675 | info.writeToParcel(reply, 0); |
| 1676 | return true; |
| 1677 | } |
| 1678 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1679 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1680 | data.enforceInterface(IActivityManager.descriptor); |
| 1681 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1682 | reply.writeNoException(); |
| 1683 | config.writeToParcel(reply, 0); |
| 1684 | return true; |
| 1685 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1686 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1687 | case PROFILE_CONTROL_TRANSACTION: { |
| 1688 | data.enforceInterface(IActivityManager.descriptor); |
| 1689 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1690 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1691 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1692 | int profileType = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1693 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 1694 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
| 1695 | boolean res = profileControl(process, userId, start, profilerInfo, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1696 | reply.writeNoException(); |
| 1697 | reply.writeInt(res ? 1 : 0); |
| 1698 | return true; |
| 1699 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1700 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1701 | case SHUTDOWN_TRANSACTION: { |
| 1702 | data.enforceInterface(IActivityManager.descriptor); |
| 1703 | boolean res = shutdown(data.readInt()); |
| 1704 | reply.writeNoException(); |
| 1705 | reply.writeInt(res ? 1 : 0); |
| 1706 | return true; |
| 1707 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1708 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1709 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1710 | data.enforceInterface(IActivityManager.descriptor); |
| 1711 | stopAppSwitches(); |
| 1712 | reply.writeNoException(); |
| 1713 | return true; |
| 1714 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1715 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1716 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1717 | data.enforceInterface(IActivityManager.descriptor); |
| 1718 | resumeAppSwitches(); |
| 1719 | reply.writeNoException(); |
| 1720 | return true; |
| 1721 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1722 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1723 | case PEEK_SERVICE_TRANSACTION: { |
| 1724 | data.enforceInterface(IActivityManager.descriptor); |
| 1725 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1726 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1727 | String callingPackage = data.readString(); |
| 1728 | IBinder binder = peekService(service, resolvedType, callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1729 | reply.writeNoException(); |
| 1730 | reply.writeStrongBinder(binder); |
| 1731 | return true; |
| 1732 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1733 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1734 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1735 | data.enforceInterface(IActivityManager.descriptor); |
| 1736 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1737 | int backupRestoreMode = data.readInt(); |
| 1738 | boolean success = bindBackupAgent(info, backupRestoreMode); |
| 1739 | reply.writeNoException(); |
| 1740 | reply.writeInt(success ? 1 : 0); |
| 1741 | return true; |
| 1742 | } |
| 1743 | |
| 1744 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1745 | data.enforceInterface(IActivityManager.descriptor); |
| 1746 | String packageName = data.readString(); |
| 1747 | IBinder agent = data.readStrongBinder(); |
| 1748 | backupAgentCreated(packageName, agent); |
| 1749 | reply.writeNoException(); |
| 1750 | return true; |
| 1751 | } |
| 1752 | |
| 1753 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1754 | data.enforceInterface(IActivityManager.descriptor); |
| 1755 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1756 | unbindBackupAgent(info); |
| 1757 | reply.writeNoException(); |
| 1758 | return true; |
| 1759 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1760 | |
| 1761 | case ADD_PACKAGE_DEPENDENCY_TRANSACTION: { |
| 1762 | data.enforceInterface(IActivityManager.descriptor); |
| 1763 | String packageName = data.readString(); |
| 1764 | addPackageDependency(packageName); |
| 1765 | reply.writeNoException(); |
| 1766 | return true; |
| 1767 | } |
| 1768 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1769 | case KILL_APPLICATION_WITH_APPID_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1770 | data.enforceInterface(IActivityManager.descriptor); |
| 1771 | String pkg = data.readString(); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1772 | int appid = data.readInt(); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 1773 | String reason = data.readString(); |
| 1774 | killApplicationWithAppId(pkg, appid, reason); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1775 | reply.writeNoException(); |
| 1776 | return true; |
| 1777 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1778 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1779 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1780 | data.enforceInterface(IActivityManager.descriptor); |
| 1781 | String reason = data.readString(); |
| 1782 | closeSystemDialogs(reason); |
| 1783 | reply.writeNoException(); |
| 1784 | return true; |
| 1785 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1786 | |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1787 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1788 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1789 | int[] pids = data.createIntArray(); |
| 1790 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1791 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1792 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1793 | return true; |
| 1794 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1795 | |
| 1796 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1797 | data.enforceInterface(IActivityManager.descriptor); |
| 1798 | String processName = data.readString(); |
| 1799 | int uid = data.readInt(); |
| 1800 | killApplicationProcess(processName, uid); |
| 1801 | reply.writeNoException(); |
| 1802 | return true; |
| 1803 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1804 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1805 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1806 | data.enforceInterface(IActivityManager.descriptor); |
| 1807 | IBinder token = data.readStrongBinder(); |
| 1808 | String packageName = data.readString(); |
| 1809 | int enterAnim = data.readInt(); |
| 1810 | int exitAnim = data.readInt(); |
| 1811 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1812 | reply.writeNoException(); |
| 1813 | return true; |
| 1814 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1815 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1816 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1817 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1818 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1819 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1820 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1821 | return true; |
| 1822 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1823 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1824 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1825 | data.enforceInterface(IActivityManager.descriptor); |
| 1826 | final boolean monkey = (data.readInt() == 1); |
| 1827 | setUserIsMonkey(monkey); |
| 1828 | reply.writeNoException(); |
| 1829 | return true; |
| 1830 | } |
| 1831 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1832 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1833 | data.enforceInterface(IActivityManager.descriptor); |
| 1834 | finishHeavyWeightApp(); |
| 1835 | reply.writeNoException(); |
| 1836 | return true; |
| 1837 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1838 | |
| 1839 | case IS_IMMERSIVE_TRANSACTION: { |
| 1840 | data.enforceInterface(IActivityManager.descriptor); |
| 1841 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1842 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1843 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1844 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1845 | return true; |
| 1846 | } |
| 1847 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 1848 | case IS_TOP_OF_TASK_TRANSACTION: { |
| 1849 | data.enforceInterface(IActivityManager.descriptor); |
| 1850 | IBinder token = data.readStrongBinder(); |
| 1851 | final boolean isTopOfTask = isTopOfTask(token); |
| 1852 | reply.writeNoException(); |
| 1853 | reply.writeInt(isTopOfTask ? 1 : 0); |
| 1854 | return true; |
| 1855 | } |
| 1856 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1857 | case CONVERT_FROM_TRANSLUCENT_TRANSACTION: { |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1858 | data.enforceInterface(IActivityManager.descriptor); |
| 1859 | IBinder token = data.readStrongBinder(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1860 | boolean converted = convertFromTranslucent(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1861 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1862 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1863 | return true; |
| 1864 | } |
| 1865 | |
| 1866 | case CONVERT_TO_TRANSLUCENT_TRANSACTION: { |
| 1867 | data.enforceInterface(IActivityManager.descriptor); |
| 1868 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1869 | final Bundle bundle; |
| 1870 | if (data.readInt() == 0) { |
| 1871 | bundle = null; |
| 1872 | } else { |
| 1873 | bundle = data.readBundle(); |
| 1874 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 1875 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1876 | boolean converted = convertToTranslucent(token, options); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1877 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1878 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1879 | return true; |
| 1880 | } |
| 1881 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1882 | case GET_ACTIVITY_OPTIONS_TRANSACTION: { |
| 1883 | data.enforceInterface(IActivityManager.descriptor); |
| 1884 | IBinder token = data.readStrongBinder(); |
| 1885 | final ActivityOptions options = getActivityOptions(token); |
| 1886 | reply.writeNoException(); |
| 1887 | reply.writeBundle(options == null ? null : options.toBundle()); |
| 1888 | return true; |
| 1889 | } |
| 1890 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1891 | case SET_IMMERSIVE_TRANSACTION: { |
| 1892 | data.enforceInterface(IActivityManager.descriptor); |
| 1893 | IBinder token = data.readStrongBinder(); |
| 1894 | boolean imm = data.readInt() == 1; |
| 1895 | setImmersive(token, imm); |
| 1896 | reply.writeNoException(); |
| 1897 | return true; |
| 1898 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1899 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1900 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1901 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1902 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1903 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1904 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1905 | return true; |
| 1906 | } |
| 1907 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1908 | case CRASH_APPLICATION_TRANSACTION: { |
| 1909 | data.enforceInterface(IActivityManager.descriptor); |
| 1910 | int uid = data.readInt(); |
| 1911 | int initialPid = data.readInt(); |
| 1912 | String packageName = data.readString(); |
| 1913 | String message = data.readString(); |
| 1914 | crashApplication(uid, initialPid, packageName, message); |
| 1915 | reply.writeNoException(); |
| 1916 | return true; |
| 1917 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1918 | |
| 1919 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1920 | data.enforceInterface(IActivityManager.descriptor); |
| 1921 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1922 | int userId = data.readInt(); |
| 1923 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1924 | reply.writeNoException(); |
| 1925 | reply.writeString(type); |
| 1926 | return true; |
| 1927 | } |
| 1928 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1929 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1930 | data.enforceInterface(IActivityManager.descriptor); |
| 1931 | String name = data.readString(); |
| 1932 | IBinder perm = newUriPermissionOwner(name); |
| 1933 | reply.writeNoException(); |
| 1934 | reply.writeStrongBinder(perm); |
| 1935 | return true; |
| 1936 | } |
| 1937 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 1938 | case GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION: { |
| 1939 | data.enforceInterface(IActivityManager.descriptor); |
| 1940 | IBinder activityToken = data.readStrongBinder(); |
| 1941 | IBinder perm = getUriPermissionOwnerForActivity(activityToken); |
| 1942 | reply.writeNoException(); |
| 1943 | reply.writeStrongBinder(perm); |
| 1944 | return true; |
| 1945 | } |
| 1946 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1947 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1948 | data.enforceInterface(IActivityManager.descriptor); |
| 1949 | IBinder owner = data.readStrongBinder(); |
| 1950 | int fromUid = data.readInt(); |
| 1951 | String targetPkg = data.readString(); |
| 1952 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1953 | int mode = data.readInt(); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 1954 | int sourceUserId = data.readInt(); |
| 1955 | int targetUserId = data.readInt(); |
| 1956 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId, |
| 1957 | targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1958 | reply.writeNoException(); |
| 1959 | return true; |
| 1960 | } |
| 1961 | |
| 1962 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1963 | data.enforceInterface(IActivityManager.descriptor); |
| 1964 | IBinder owner = data.readStrongBinder(); |
| 1965 | Uri uri = null; |
| 1966 | if (data.readInt() != 0) { |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1967 | uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1968 | } |
| 1969 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1970 | int userId = data.readInt(); |
| 1971 | revokeUriPermissionFromOwner(owner, uri, mode, userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1972 | reply.writeNoException(); |
| 1973 | return true; |
| 1974 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1975 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1976 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 1977 | data.enforceInterface(IActivityManager.descriptor); |
| 1978 | int callingUid = data.readInt(); |
| 1979 | String targetPkg = data.readString(); |
| 1980 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1981 | int modeFlags = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1982 | int userId = data.readInt(); |
| 1983 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1984 | reply.writeNoException(); |
| 1985 | reply.writeInt(res); |
| 1986 | return true; |
| 1987 | } |
| 1988 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1989 | case DUMP_HEAP_TRANSACTION: { |
| 1990 | data.enforceInterface(IActivityManager.descriptor); |
| 1991 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 1992 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1993 | boolean managed = data.readInt() != 0; |
| 1994 | String path = data.readString(); |
| 1995 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 1996 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1997 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1998 | reply.writeNoException(); |
| 1999 | reply.writeInt(res ? 1 : 0); |
| 2000 | return true; |
| 2001 | } |
| 2002 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2003 | case START_ACTIVITIES_TRANSACTION: |
| 2004 | { |
| 2005 | data.enforceInterface(IActivityManager.descriptor); |
| 2006 | IBinder b = data.readStrongBinder(); |
| 2007 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2008 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2009 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 2010 | String[] resolvedTypes = data.createStringArray(); |
| 2011 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2012 | Bundle options = data.readInt() != 0 |
| 2013 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2014 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2015 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2016 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2017 | reply.writeNoException(); |
| 2018 | reply.writeInt(result); |
| 2019 | return true; |
| 2020 | } |
| 2021 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2022 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2023 | { |
| 2024 | data.enforceInterface(IActivityManager.descriptor); |
| 2025 | int mode = getFrontActivityScreenCompatMode(); |
| 2026 | reply.writeNoException(); |
| 2027 | reply.writeInt(mode); |
| 2028 | return true; |
| 2029 | } |
| 2030 | |
| 2031 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2032 | { |
| 2033 | data.enforceInterface(IActivityManager.descriptor); |
| 2034 | int mode = data.readInt(); |
| 2035 | setFrontActivityScreenCompatMode(mode); |
| 2036 | reply.writeNoException(); |
| 2037 | reply.writeInt(mode); |
| 2038 | return true; |
| 2039 | } |
| 2040 | |
| 2041 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2042 | { |
| 2043 | data.enforceInterface(IActivityManager.descriptor); |
| 2044 | String pkg = data.readString(); |
| 2045 | int mode = getPackageScreenCompatMode(pkg); |
| 2046 | reply.writeNoException(); |
| 2047 | reply.writeInt(mode); |
| 2048 | return true; |
| 2049 | } |
| 2050 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2051 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2052 | { |
| 2053 | data.enforceInterface(IActivityManager.descriptor); |
| 2054 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2055 | int mode = data.readInt(); |
| 2056 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2057 | reply.writeNoException(); |
| 2058 | return true; |
| 2059 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2060 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2061 | case SWITCH_USER_TRANSACTION: { |
| 2062 | data.enforceInterface(IActivityManager.descriptor); |
| 2063 | int userid = data.readInt(); |
| 2064 | boolean result = switchUser(userid); |
| 2065 | reply.writeNoException(); |
| 2066 | reply.writeInt(result ? 1 : 0); |
| 2067 | return true; |
| 2068 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2069 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 2070 | case START_USER_IN_BACKGROUND_TRANSACTION: { |
| 2071 | data.enforceInterface(IActivityManager.descriptor); |
| 2072 | int userid = data.readInt(); |
| 2073 | boolean result = startUserInBackground(userid); |
| 2074 | reply.writeNoException(); |
| 2075 | reply.writeInt(result ? 1 : 0); |
| 2076 | return true; |
| 2077 | } |
| 2078 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2079 | case UNLOCK_USER_TRANSACTION: { |
| 2080 | data.enforceInterface(IActivityManager.descriptor); |
| 2081 | int userId = data.readInt(); |
| 2082 | byte[] token = data.createByteArray(); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 2083 | byte[] secret = data.createByteArray(); |
| 2084 | boolean result = unlockUser(userId, token, secret); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2085 | reply.writeNoException(); |
| 2086 | reply.writeInt(result ? 1 : 0); |
| 2087 | return true; |
| 2088 | } |
| 2089 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2090 | case STOP_USER_TRANSACTION: { |
| 2091 | data.enforceInterface(IActivityManager.descriptor); |
| 2092 | int userid = data.readInt(); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2093 | boolean force = data.readInt() != 0; |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2094 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 2095 | data.readStrongBinder()); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2096 | int result = stopUser(userid, force, callback); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2097 | reply.writeNoException(); |
| 2098 | reply.writeInt(result); |
| 2099 | return true; |
| 2100 | } |
| 2101 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2102 | case GET_CURRENT_USER_TRANSACTION: { |
| 2103 | data.enforceInterface(IActivityManager.descriptor); |
| 2104 | UserInfo userInfo = getCurrentUser(); |
| 2105 | reply.writeNoException(); |
| 2106 | userInfo.writeToParcel(reply, 0); |
| 2107 | return true; |
| 2108 | } |
| 2109 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2110 | case IS_USER_RUNNING_TRANSACTION: { |
| 2111 | data.enforceInterface(IActivityManager.descriptor); |
| 2112 | int userid = data.readInt(); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 2113 | int _flags = data.readInt(); |
| 2114 | boolean result = isUserRunning(userid, _flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2115 | reply.writeNoException(); |
| 2116 | reply.writeInt(result ? 1 : 0); |
| 2117 | return true; |
| 2118 | } |
| 2119 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 2120 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 2121 | data.enforceInterface(IActivityManager.descriptor); |
| 2122 | int[] result = getRunningUserIds(); |
| 2123 | reply.writeNoException(); |
| 2124 | reply.writeIntArray(result); |
| 2125 | return true; |
| 2126 | } |
| 2127 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2128 | case REMOVE_TASK_TRANSACTION: |
| 2129 | { |
| 2130 | data.enforceInterface(IActivityManager.descriptor); |
| 2131 | int taskId = data.readInt(); |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 2132 | boolean result = removeTask(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2133 | reply.writeNoException(); |
| 2134 | reply.writeInt(result ? 1 : 0); |
| 2135 | return true; |
| 2136 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2137 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 2138 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2139 | data.enforceInterface(IActivityManager.descriptor); |
| 2140 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2141 | data.readStrongBinder()); |
| 2142 | registerProcessObserver(observer); |
| 2143 | return true; |
| 2144 | } |
| 2145 | |
| 2146 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2147 | data.enforceInterface(IActivityManager.descriptor); |
| 2148 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2149 | data.readStrongBinder()); |
| 2150 | unregisterProcessObserver(observer); |
| 2151 | return true; |
| 2152 | } |
| 2153 | |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2154 | case REGISTER_UID_OBSERVER_TRANSACTION: { |
| 2155 | data.enforceInterface(IActivityManager.descriptor); |
| 2156 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2157 | data.readStrongBinder()); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2158 | int which = data.readInt(); |
| 2159 | registerUidObserver(observer, which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2160 | return true; |
| 2161 | } |
| 2162 | |
| 2163 | case UNREGISTER_UID_OBSERVER_TRANSACTION: { |
| 2164 | data.enforceInterface(IActivityManager.descriptor); |
| 2165 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2166 | data.readStrongBinder()); |
| 2167 | unregisterUidObserver(observer); |
| 2168 | return true; |
| 2169 | } |
| 2170 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 2171 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2172 | { |
| 2173 | data.enforceInterface(IActivityManager.descriptor); |
| 2174 | String pkg = data.readString(); |
| 2175 | boolean ask = getPackageAskScreenCompat(pkg); |
| 2176 | reply.writeNoException(); |
| 2177 | reply.writeInt(ask ? 1 : 0); |
| 2178 | return true; |
| 2179 | } |
| 2180 | |
| 2181 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2182 | { |
| 2183 | data.enforceInterface(IActivityManager.descriptor); |
| 2184 | String pkg = data.readString(); |
| 2185 | boolean ask = data.readInt() != 0; |
| 2186 | setPackageAskScreenCompat(pkg, ask); |
| 2187 | reply.writeNoException(); |
| 2188 | return true; |
| 2189 | } |
| 2190 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2191 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 2192 | data.enforceInterface(IActivityManager.descriptor); |
| 2193 | IIntentSender r = IIntentSender.Stub.asInterface( |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2194 | data.readStrongBinder()); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2195 | boolean res = isIntentSenderTargetedToPackage(r); |
| 2196 | reply.writeNoException(); |
| 2197 | reply.writeInt(res ? 1 : 0); |
| 2198 | return true; |
| 2199 | } |
| 2200 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 2201 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 2202 | data.enforceInterface(IActivityManager.descriptor); |
| 2203 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2204 | data.readStrongBinder()); |
| 2205 | boolean res = isIntentSenderAnActivity(r); |
| 2206 | reply.writeNoException(); |
| 2207 | reply.writeInt(res ? 1 : 0); |
| 2208 | return true; |
| 2209 | } |
| 2210 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 2211 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 2212 | data.enforceInterface(IActivityManager.descriptor); |
| 2213 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2214 | data.readStrongBinder()); |
| 2215 | Intent intent = getIntentForIntentSender(r); |
| 2216 | reply.writeNoException(); |
| 2217 | if (intent != null) { |
| 2218 | reply.writeInt(1); |
| 2219 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2220 | } else { |
| 2221 | reply.writeInt(0); |
| 2222 | } |
| 2223 | return true; |
| 2224 | } |
| 2225 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 2226 | case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { |
| 2227 | data.enforceInterface(IActivityManager.descriptor); |
| 2228 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2229 | data.readStrongBinder()); |
| 2230 | String prefix = data.readString(); |
| 2231 | String tag = getTagForIntentSender(r, prefix); |
| 2232 | reply.writeNoException(); |
| 2233 | reply.writeString(tag); |
| 2234 | return true; |
| 2235 | } |
| 2236 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2237 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 2238 | data.enforceInterface(IActivityManager.descriptor); |
| 2239 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 2240 | updatePersistentConfiguration(config); |
| 2241 | reply.writeNoException(); |
| 2242 | return true; |
| 2243 | } |
| 2244 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 2245 | case GET_PROCESS_PSS_TRANSACTION: { |
| 2246 | data.enforceInterface(IActivityManager.descriptor); |
| 2247 | int[] pids = data.createIntArray(); |
| 2248 | long[] pss = getProcessPss(pids); |
| 2249 | reply.writeNoException(); |
| 2250 | reply.writeLongArray(pss); |
| 2251 | return true; |
| 2252 | } |
| 2253 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 2254 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 2255 | data.enforceInterface(IActivityManager.descriptor); |
| 2256 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 2257 | boolean always = data.readInt() != 0; |
| 2258 | showBootMessage(msg, always); |
| 2259 | reply.writeNoException(); |
| 2260 | return true; |
| 2261 | } |
| 2262 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2263 | case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2264 | data.enforceInterface(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2265 | keyguardWaitingForActivityDrawn(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2266 | reply.writeNoException(); |
| 2267 | return true; |
| 2268 | } |
| 2269 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2270 | case KEYGUARD_GOING_AWAY_TRANSACTION: { |
| 2271 | data.enforceInterface(IActivityManager.descriptor); |
| 2272 | keyguardGoingAway(data.readInt() != 0, data.readInt() != 0); |
| 2273 | reply.writeNoException(); |
| 2274 | return true; |
| 2275 | } |
| 2276 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2277 | case SHOULD_UP_RECREATE_TASK_TRANSACTION: { |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2278 | data.enforceInterface(IActivityManager.descriptor); |
| 2279 | IBinder token = data.readStrongBinder(); |
| 2280 | String destAffinity = data.readString(); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2281 | boolean res = shouldUpRecreateTask(token, destAffinity); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2282 | reply.writeNoException(); |
| 2283 | reply.writeInt(res ? 1 : 0); |
| 2284 | return true; |
| 2285 | } |
| 2286 | |
| 2287 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 2288 | data.enforceInterface(IActivityManager.descriptor); |
| 2289 | IBinder token = data.readStrongBinder(); |
| 2290 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 2291 | int resultCode = data.readInt(); |
| 2292 | Intent resultData = null; |
| 2293 | if (data.readInt() != 0) { |
| 2294 | resultData = Intent.CREATOR.createFromParcel(data); |
| 2295 | } |
| 2296 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 2297 | reply.writeNoException(); |
| 2298 | reply.writeInt(res ? 1 : 0); |
| 2299 | return true; |
| 2300 | } |
| 2301 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 2302 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 2303 | data.enforceInterface(IActivityManager.descriptor); |
| 2304 | IBinder token = data.readStrongBinder(); |
| 2305 | int res = getLaunchedFromUid(token); |
| 2306 | reply.writeNoException(); |
| 2307 | reply.writeInt(res); |
| 2308 | return true; |
| 2309 | } |
| 2310 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2311 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 2312 | data.enforceInterface(IActivityManager.descriptor); |
| 2313 | IBinder token = data.readStrongBinder(); |
| 2314 | String res = getLaunchedFromPackage(token); |
| 2315 | reply.writeNoException(); |
| 2316 | reply.writeString(res); |
| 2317 | return true; |
| 2318 | } |
| 2319 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2320 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2321 | data.enforceInterface(IActivityManager.descriptor); |
| 2322 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2323 | data.readStrongBinder()); |
| 2324 | registerUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2325 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2326 | return true; |
| 2327 | } |
| 2328 | |
| 2329 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2330 | data.enforceInterface(IActivityManager.descriptor); |
| 2331 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2332 | data.readStrongBinder()); |
| 2333 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2334 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2335 | return true; |
| 2336 | } |
| 2337 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2338 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 2339 | data.enforceInterface(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 2340 | int bugreportType = data.readInt(); |
| 2341 | requestBugReport(bugreportType); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2342 | reply.writeNoException(); |
| 2343 | return true; |
| 2344 | } |
| 2345 | |
| 2346 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 2347 | data.enforceInterface(IActivityManager.descriptor); |
| 2348 | int pid = data.readInt(); |
| 2349 | boolean aboveSystem = data.readInt() != 0; |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 2350 | String reason = data.readString(); |
| 2351 | long res = inputDispatchingTimedOut(pid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2352 | reply.writeNoException(); |
| 2353 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2354 | return true; |
| 2355 | } |
| 2356 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2357 | case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2358 | data.enforceInterface(IActivityManager.descriptor); |
| 2359 | int requestType = data.readInt(); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2360 | Bundle res = getAssistContextExtras(requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2361 | reply.writeNoException(); |
| 2362 | reply.writeBundle(res); |
| 2363 | return true; |
| 2364 | } |
| 2365 | |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2366 | case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
| 2367 | data.enforceInterface(IActivityManager.descriptor); |
| 2368 | int requestType = data.readInt(); |
| 2369 | IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2370 | IBinder activityToken = data.readStrongBinder(); |
| 2371 | boolean res = requestAssistContextExtras(requestType, receiver, activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2372 | reply.writeNoException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2373 | reply.writeInt(res ? 1 : 0); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2374 | return true; |
| 2375 | } |
| 2376 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2377 | case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2378 | data.enforceInterface(IActivityManager.descriptor); |
| 2379 | IBinder token = data.readStrongBinder(); |
| 2380 | Bundle extras = data.readBundle(); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 2381 | AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data); |
| 2382 | AssistContent content = AssistContent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 2383 | Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null; |
| 2384 | reportAssistContextExtras(token, extras, structure, content, referrer); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2385 | reply.writeNoException(); |
| 2386 | return true; |
| 2387 | } |
| 2388 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2389 | case LAUNCH_ASSIST_INTENT_TRANSACTION: { |
| 2390 | data.enforceInterface(IActivityManager.descriptor); |
| 2391 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2392 | int requestType = data.readInt(); |
| 2393 | String hint = data.readString(); |
| 2394 | int userHandle = data.readInt(); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 2395 | Bundle args = data.readBundle(); |
| 2396 | boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2397 | reply.writeNoException(); |
| 2398 | reply.writeInt(res ? 1 : 0); |
| 2399 | return true; |
| 2400 | } |
| 2401 | |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2402 | case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: { |
| 2403 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2404 | boolean res = isAssistDataAllowedOnCurrentActivity(); |
| 2405 | reply.writeNoException(); |
| 2406 | reply.writeInt(res ? 1 : 0); |
| 2407 | return true; |
| 2408 | } |
| 2409 | |
| 2410 | case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: { |
| 2411 | data.enforceInterface(IActivityManager.descriptor); |
| 2412 | IBinder token = data.readStrongBinder(); |
| 2413 | Bundle args = data.readBundle(); |
| 2414 | boolean res = showAssistFromActivity(token, args); |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2415 | reply.writeNoException(); |
| 2416 | reply.writeInt(res ? 1 : 0); |
| 2417 | return true; |
| 2418 | } |
| 2419 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2420 | case KILL_UID_TRANSACTION: { |
| 2421 | data.enforceInterface(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2422 | int appId = data.readInt(); |
| 2423 | int userId = data.readInt(); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2424 | String reason = data.readString(); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2425 | killUid(appId, userId, reason); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2426 | reply.writeNoException(); |
| 2427 | return true; |
| 2428 | } |
| 2429 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2430 | case HANG_TRANSACTION: { |
| 2431 | data.enforceInterface(IActivityManager.descriptor); |
| 2432 | IBinder who = data.readStrongBinder(); |
| 2433 | boolean allowRestart = data.readInt() != 0; |
| 2434 | hang(who, allowRestart); |
| 2435 | reply.writeNoException(); |
| 2436 | return true; |
| 2437 | } |
| 2438 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2439 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2440 | data.enforceInterface(IActivityManager.descriptor); |
| 2441 | IBinder token = data.readStrongBinder(); |
| 2442 | reportActivityFullyDrawn(token); |
| 2443 | reply.writeNoException(); |
| 2444 | return true; |
| 2445 | } |
| 2446 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2447 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2448 | data.enforceInterface(IActivityManager.descriptor); |
| 2449 | IBinder token = data.readStrongBinder(); |
| 2450 | notifyActivityDrawn(token); |
| 2451 | reply.writeNoException(); |
| 2452 | return true; |
| 2453 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2454 | |
| 2455 | case RESTART_TRANSACTION: { |
| 2456 | data.enforceInterface(IActivityManager.descriptor); |
| 2457 | restart(); |
| 2458 | reply.writeNoException(); |
| 2459 | return true; |
| 2460 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2461 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2462 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2463 | data.enforceInterface(IActivityManager.descriptor); |
| 2464 | performIdleMaintenance(); |
| 2465 | reply.writeNoException(); |
| 2466 | return true; |
| 2467 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2468 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2469 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2470 | data.enforceInterface(IActivityManager.descriptor); |
| 2471 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2472 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2473 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2474 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2475 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2476 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2477 | if (activityContainer != null) { |
| 2478 | reply.writeInt(1); |
| 2479 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2480 | } else { |
| 2481 | reply.writeInt(0); |
| 2482 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2483 | return true; |
| 2484 | } |
| 2485 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2486 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2487 | data.enforceInterface(IActivityManager.descriptor); |
| 2488 | IActivityContainer activityContainer = |
| 2489 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2490 | deleteActivityContainer(activityContainer); |
| 2491 | reply.writeNoException(); |
| 2492 | return true; |
| 2493 | } |
| 2494 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2495 | case CREATE_STACK_ON_DISPLAY: { |
| 2496 | data.enforceInterface(IActivityManager.descriptor); |
| 2497 | int displayId = data.readInt(); |
| 2498 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2499 | reply.writeNoException(); |
| 2500 | if (activityContainer != null) { |
| 2501 | reply.writeInt(1); |
| 2502 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2503 | } else { |
| 2504 | reply.writeInt(0); |
| 2505 | } |
| 2506 | return true; |
| 2507 | } |
| 2508 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2509 | case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: { |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2510 | data.enforceInterface(IActivityManager.descriptor); |
| 2511 | IBinder activityToken = data.readStrongBinder(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2512 | int displayId = getActivityDisplayId(activityToken); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2513 | reply.writeNoException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2514 | reply.writeInt(displayId); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2515 | return true; |
| 2516 | } |
| 2517 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2518 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2519 | data.enforceInterface(IActivityManager.descriptor); |
| 2520 | final int taskId = data.readInt(); |
| 2521 | startLockTaskMode(taskId); |
| 2522 | reply.writeNoException(); |
| 2523 | return true; |
| 2524 | } |
| 2525 | |
| 2526 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2527 | data.enforceInterface(IActivityManager.descriptor); |
| 2528 | IBinder token = data.readStrongBinder(); |
| 2529 | startLockTaskMode(token); |
| 2530 | reply.writeNoException(); |
| 2531 | return true; |
| 2532 | } |
| 2533 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2534 | case START_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2535 | data.enforceInterface(IActivityManager.descriptor); |
| 2536 | startLockTaskModeOnCurrent(); |
| 2537 | reply.writeNoException(); |
| 2538 | return true; |
| 2539 | } |
| 2540 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2541 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2542 | data.enforceInterface(IActivityManager.descriptor); |
| 2543 | stopLockTaskMode(); |
| 2544 | reply.writeNoException(); |
| 2545 | return true; |
| 2546 | } |
| 2547 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2548 | case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2549 | data.enforceInterface(IActivityManager.descriptor); |
| 2550 | stopLockTaskModeOnCurrent(); |
| 2551 | reply.writeNoException(); |
| 2552 | return true; |
| 2553 | } |
| 2554 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2555 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2556 | data.enforceInterface(IActivityManager.descriptor); |
| 2557 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2558 | reply.writeNoException(); |
| 2559 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2560 | return true; |
| 2561 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2562 | |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 2563 | case GET_LOCK_TASK_MODE_STATE_TRANSACTION: { |
| 2564 | data.enforceInterface(IActivityManager.descriptor); |
| 2565 | final int lockTaskModeState = getLockTaskModeState(); |
| 2566 | reply.writeNoException(); |
| 2567 | reply.writeInt(lockTaskModeState); |
| 2568 | return true; |
| 2569 | } |
| 2570 | |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 2571 | case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: { |
| 2572 | data.enforceInterface(IActivityManager.descriptor); |
| 2573 | final IBinder token = data.readStrongBinder(); |
| 2574 | showLockTaskEscapeMessage(token); |
| 2575 | reply.writeNoException(); |
| 2576 | return true; |
| 2577 | } |
| 2578 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2579 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2580 | data.enforceInterface(IActivityManager.descriptor); |
| 2581 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2582 | ActivityManager.TaskDescription values = |
| 2583 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2584 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2585 | reply.writeNoException(); |
| 2586 | return true; |
| 2587 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2588 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2589 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2590 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 2591 | final int taskId = data.readInt(); |
| 2592 | final int resizeableMode = data.readInt(); |
| 2593 | setTaskResizeable(taskId, resizeableMode); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2594 | reply.writeNoException(); |
| 2595 | return true; |
| 2596 | } |
| 2597 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2598 | case RESIZE_TASK_TRANSACTION: { |
| 2599 | data.enforceInterface(IActivityManager.descriptor); |
| 2600 | int taskId = data.readInt(); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2601 | int resizeMode = data.readInt(); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2602 | Rect r = Rect.CREATOR.createFromParcel(data); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2603 | resizeTask(taskId, r, resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2604 | reply.writeNoException(); |
| 2605 | return true; |
| 2606 | } |
| 2607 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 2608 | case GET_TASK_BOUNDS_TRANSACTION: { |
| 2609 | data.enforceInterface(IActivityManager.descriptor); |
| 2610 | int taskId = data.readInt(); |
| 2611 | Rect r = getTaskBounds(taskId); |
| 2612 | reply.writeNoException(); |
| 2613 | r.writeToParcel(reply, 0); |
| 2614 | return true; |
| 2615 | } |
| 2616 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2617 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2618 | data.enforceInterface(IActivityManager.descriptor); |
| 2619 | String filename = data.readString(); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 2620 | int userId = data.readInt(); |
| 2621 | Bitmap icon = getTaskDescriptionIcon(filename, userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2622 | reply.writeNoException(); |
| 2623 | if (icon == null) { |
| 2624 | reply.writeInt(0); |
| 2625 | } else { |
| 2626 | reply.writeInt(1); |
| 2627 | icon.writeToParcel(reply, 0); |
| 2628 | } |
| 2629 | return true; |
| 2630 | } |
| 2631 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2632 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2633 | data.enforceInterface(IActivityManager.descriptor); |
| 2634 | final Bundle bundle; |
| 2635 | if (data.readInt() == 0) { |
| 2636 | bundle = null; |
| 2637 | } else { |
| 2638 | bundle = data.readBundle(); |
| 2639 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 2640 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2641 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2642 | reply.writeNoException(); |
| 2643 | return true; |
| 2644 | } |
| 2645 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2646 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2647 | data.enforceInterface(IActivityManager.descriptor); |
| 2648 | IBinder token = data.readStrongBinder(); |
| 2649 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2650 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2651 | reply.writeNoException(); |
| 2652 | reply.writeInt(success ? 1 : 0); |
| 2653 | return true; |
| 2654 | } |
| 2655 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2656 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2657 | data.enforceInterface(IActivityManager.descriptor); |
| 2658 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2659 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2660 | reply.writeNoException(); |
| 2661 | reply.writeInt(enabled ? 1 : 0); |
| 2662 | return true; |
| 2663 | } |
| 2664 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2665 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2666 | data.enforceInterface(IActivityManager.descriptor); |
| 2667 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2668 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2669 | reply.writeNoException(); |
| 2670 | return true; |
| 2671 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2672 | |
| 2673 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2674 | data.enforceInterface(IActivityManager.descriptor); |
| 2675 | IBinder token = data.readStrongBinder(); |
| 2676 | notifyLaunchTaskBehindComplete(token); |
| 2677 | reply.writeNoException(); |
| 2678 | return true; |
| 2679 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2680 | |
| 2681 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2682 | data.enforceInterface(IActivityManager.descriptor); |
| 2683 | IBinder token = data.readStrongBinder(); |
| 2684 | notifyEnterAnimationComplete(token); |
| 2685 | reply.writeNoException(); |
| 2686 | return true; |
| 2687 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2688 | |
| 2689 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2690 | data.enforceInterface(IActivityManager.descriptor); |
| 2691 | bootAnimationComplete(); |
| 2692 | reply.writeNoException(); |
| 2693 | return true; |
| 2694 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2695 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2696 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2697 | data.enforceInterface(IActivityManager.descriptor); |
| 2698 | final int uid = data.readInt(); |
| 2699 | final byte[] firstPacket = data.createByteArray(); |
| 2700 | notifyCleartextNetwork(uid, firstPacket); |
| 2701 | reply.writeNoException(); |
| 2702 | return true; |
| 2703 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2704 | |
| 2705 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2706 | data.enforceInterface(IActivityManager.descriptor); |
| 2707 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2708 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2709 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2710 | String reportPackage = data.readString(); |
| 2711 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2712 | reply.writeNoException(); |
| 2713 | return true; |
| 2714 | } |
| 2715 | |
| 2716 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2717 | data.enforceInterface(IActivityManager.descriptor); |
| 2718 | String path = data.readString(); |
| 2719 | dumpHeapFinished(path); |
| 2720 | reply.writeNoException(); |
| 2721 | return true; |
| 2722 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2723 | |
| 2724 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2725 | data.enforceInterface(IActivityManager.descriptor); |
| 2726 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2727 | data.readStrongBinder()); |
| 2728 | boolean keepAwake = data.readInt() != 0; |
| 2729 | setVoiceKeepAwake(session, keepAwake); |
| 2730 | reply.writeNoException(); |
| 2731 | return true; |
| 2732 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2733 | |
| 2734 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2735 | data.enforceInterface(IActivityManager.descriptor); |
| 2736 | int userId = data.readInt(); |
| 2737 | String[] packages = data.readStringArray(); |
| 2738 | updateLockTaskPackages(userId, packages); |
| 2739 | reply.writeNoException(); |
| 2740 | return true; |
| 2741 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2742 | |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 2743 | case UPDATE_DEVICE_OWNER_TRANSACTION: { |
| 2744 | data.enforceInterface(IActivityManager.descriptor); |
| 2745 | String packageName = data.readString(); |
| 2746 | updateDeviceOwner(packageName); |
| 2747 | reply.writeNoException(); |
| 2748 | return true; |
| 2749 | } |
| 2750 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2751 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2752 | data.enforceInterface(IActivityManager.descriptor); |
| 2753 | String pkg = data.readString(); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 2754 | String callingPackage = data.readString(); |
| 2755 | int res = getPackageProcessState(pkg, callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2756 | reply.writeNoException(); |
| 2757 | reply.writeInt(res); |
| 2758 | return true; |
| 2759 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2760 | |
| 2761 | case SET_PROCESS_MEMORY_TRIM_TRANSACTION: { |
| 2762 | data.enforceInterface(IActivityManager.descriptor); |
| 2763 | String process = data.readString(); |
| 2764 | int userId = data.readInt(); |
| 2765 | int level = data.readInt(); |
| 2766 | boolean res = setProcessMemoryTrimLevel(process, userId, level); |
| 2767 | reply.writeNoException(); |
| 2768 | reply.writeInt(res ? 1 : 0); |
| 2769 | return true; |
| 2770 | } |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2771 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 2772 | case IS_ROOT_VOICE_INTERACTION_TRANSACTION: { |
| 2773 | data.enforceInterface(IActivityManager.descriptor); |
| 2774 | IBinder token = data.readStrongBinder(); |
| 2775 | boolean res = isRootVoiceInteraction(token); |
| 2776 | reply.writeNoException(); |
| 2777 | reply.writeInt(res ? 1 : 0); |
| 2778 | return true; |
| 2779 | } |
Ian Pedowitz | a371084 | 2015-08-03 23:36:15 -0700 | [diff] [blame] | 2780 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2781 | case START_BINDER_TRACKING_TRANSACTION: { |
| 2782 | data.enforceInterface(IActivityManager.descriptor); |
| 2783 | boolean res = startBinderTracking(); |
| 2784 | reply.writeNoException(); |
| 2785 | reply.writeInt(res ? 1 : 0); |
| 2786 | return true; |
| 2787 | } |
| 2788 | |
| 2789 | case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: { |
| 2790 | data.enforceInterface(IActivityManager.descriptor); |
| 2791 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 2792 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
| 2793 | boolean res = stopBinderTrackingAndDump(fd); |
| 2794 | reply.writeNoException(); |
| 2795 | reply.writeInt(res ? 1 : 0); |
| 2796 | return true; |
| 2797 | } |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2798 | case GET_ACTIVITY_STACK_ID_TRANSACTION: { |
| 2799 | data.enforceInterface(IActivityManager.descriptor); |
| 2800 | IBinder token = data.readStrongBinder(); |
| 2801 | int stackId = getActivityStackId(token); |
| 2802 | reply.writeNoException(); |
| 2803 | reply.writeInt(stackId); |
| 2804 | return true; |
| 2805 | } |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2806 | case EXIT_FREEFORM_MODE_TRANSACTION: { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2807 | data.enforceInterface(IActivityManager.descriptor); |
| 2808 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2809 | exitFreeformMode(token); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2810 | reply.writeNoException(); |
| 2811 | return true; |
| 2812 | } |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2813 | case REPORT_SIZE_CONFIGURATIONS: { |
| 2814 | data.enforceInterface(IActivityManager.descriptor); |
| 2815 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2816 | int[] horizontal = readIntArray(data); |
| 2817 | int[] vertical = readIntArray(data); |
| 2818 | int[] smallest = readIntArray(data); |
| 2819 | reportSizeConfigurations(token, horizontal, vertical, smallest); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2820 | return true; |
| 2821 | } |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 2822 | case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: { |
| 2823 | data.enforceInterface(IActivityManager.descriptor); |
| 2824 | final boolean suppress = data.readInt() == 1; |
| 2825 | suppressResizeConfigChanges(suppress); |
| 2826 | reply.writeNoException(); |
| 2827 | return true; |
| 2828 | } |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 2829 | case MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION: { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2830 | data.enforceInterface(IActivityManager.descriptor); |
| 2831 | final int stackId = data.readInt(); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 2832 | final boolean onTop = data.readInt() == 1; |
| 2833 | moveTasksToFullscreenStack(stackId, onTop); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2834 | reply.writeNoException(); |
| 2835 | return true; |
| 2836 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2837 | case GET_APP_START_MODE_TRANSACTION: { |
| 2838 | data.enforceInterface(IActivityManager.descriptor); |
| 2839 | final int uid = data.readInt(); |
| 2840 | final String pkg = data.readString(); |
| 2841 | int res = getAppStartMode(uid, pkg); |
| 2842 | reply.writeNoException(); |
| 2843 | reply.writeInt(res); |
| 2844 | return true; |
| 2845 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2846 | case IN_MULTI_WINDOW_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2847 | data.enforceInterface(IActivityManager.descriptor); |
| 2848 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2849 | final boolean inMultiWindow = inMultiWindow(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2850 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2851 | reply.writeInt(inMultiWindow ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2852 | return true; |
| 2853 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2854 | case IN_PICTURE_IN_PICTURE_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 inPip = inPictureInPicture(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(inPip ? 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 ENTER_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -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 | enterPictureInPicture(token); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2866 | reply.writeNoException(); |
| 2867 | return true; |
| 2868 | } |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2869 | case SET_VR_MODE_TRANSACTION: { |
| 2870 | data.enforceInterface(IActivityManager.descriptor); |
| 2871 | final IBinder token = data.readStrongBinder(); |
| 2872 | final boolean enable = data.readInt() == 1; |
| 2873 | setVrMode(token, enable); |
| 2874 | reply.writeNoException(); |
| 2875 | return true; |
| 2876 | } |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 2877 | case IS_APP_FOREGROUND_TRANSACTION: { |
| 2878 | data.enforceInterface(IActivityManager.descriptor); |
| 2879 | final int userHandle = data.readInt(); |
| 2880 | final boolean isForeground = isAppForeground(userHandle); |
| 2881 | reply.writeNoException(); |
| 2882 | reply.writeInt(isForeground ? 1 : 0); |
| 2883 | return true; |
| 2884 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2885 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2886 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2887 | return super.onTransact(code, data, reply, flags); |
| 2888 | } |
| 2889 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2890 | private int[] readIntArray(Parcel data) { |
| 2891 | int[] smallest = null; |
| 2892 | int smallestSize = data.readInt(); |
| 2893 | if (smallestSize > 0) { |
| 2894 | smallest = new int[smallestSize]; |
| 2895 | data.readIntArray(smallest); |
| 2896 | } |
| 2897 | return smallest; |
| 2898 | } |
| 2899 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2900 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2901 | return this; |
| 2902 | } |
| 2903 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2904 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2905 | protected IActivityManager create() { |
| 2906 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2907 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2908 | Log.v("ActivityManager", "default service binder = " + b); |
| 2909 | } |
| 2910 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2911 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2912 | Log.v("ActivityManager", "default service = " + am); |
| 2913 | } |
| 2914 | return am; |
| 2915 | } |
| 2916 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2917 | } |
| 2918 | |
| 2919 | class ActivityManagerProxy implements IActivityManager |
| 2920 | { |
| 2921 | public ActivityManagerProxy(IBinder remote) |
| 2922 | { |
| 2923 | mRemote = remote; |
| 2924 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2925 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2926 | public IBinder asBinder() |
| 2927 | { |
| 2928 | return mRemote; |
| 2929 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2930 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2931 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2932 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2933 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2934 | Parcel data = Parcel.obtain(); |
| 2935 | Parcel reply = Parcel.obtain(); |
| 2936 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2937 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2938 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2939 | intent.writeToParcel(data, 0); |
| 2940 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2941 | data.writeStrongBinder(resultTo); |
| 2942 | data.writeString(resultWho); |
| 2943 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2944 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2945 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2946 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2947 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2948 | } else { |
| 2949 | data.writeInt(0); |
| 2950 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2951 | if (options != null) { |
| 2952 | data.writeInt(1); |
| 2953 | options.writeToParcel(data, 0); |
| 2954 | } else { |
| 2955 | data.writeInt(0); |
| 2956 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2957 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2958 | reply.readException(); |
| 2959 | int result = reply.readInt(); |
| 2960 | reply.recycle(); |
| 2961 | data.recycle(); |
| 2962 | return result; |
| 2963 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2964 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2965 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2966 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2967 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2968 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2969 | Parcel data = Parcel.obtain(); |
| 2970 | Parcel reply = Parcel.obtain(); |
| 2971 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2972 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2973 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2974 | intent.writeToParcel(data, 0); |
| 2975 | data.writeString(resolvedType); |
| 2976 | data.writeStrongBinder(resultTo); |
| 2977 | data.writeString(resultWho); |
| 2978 | data.writeInt(requestCode); |
| 2979 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2980 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2981 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2982 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2983 | } else { |
| 2984 | data.writeInt(0); |
| 2985 | } |
| 2986 | if (options != null) { |
| 2987 | data.writeInt(1); |
| 2988 | options.writeToParcel(data, 0); |
| 2989 | } else { |
| 2990 | data.writeInt(0); |
| 2991 | } |
| 2992 | data.writeInt(userId); |
| 2993 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 2994 | reply.readException(); |
| 2995 | int result = reply.readInt(); |
| 2996 | reply.recycle(); |
| 2997 | data.recycle(); |
| 2998 | return result; |
| 2999 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3000 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 3001 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3002 | int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, |
| 3003 | int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3004 | Parcel data = Parcel.obtain(); |
| 3005 | Parcel reply = Parcel.obtain(); |
| 3006 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3007 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3008 | data.writeString(callingPackage); |
| 3009 | intent.writeToParcel(data, 0); |
| 3010 | data.writeString(resolvedType); |
| 3011 | data.writeStrongBinder(resultTo); |
| 3012 | data.writeString(resultWho); |
| 3013 | data.writeInt(requestCode); |
| 3014 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3015 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3016 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3017 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3018 | } else { |
| 3019 | data.writeInt(0); |
| 3020 | } |
| 3021 | if (options != null) { |
| 3022 | data.writeInt(1); |
| 3023 | options.writeToParcel(data, 0); |
| 3024 | } else { |
| 3025 | data.writeInt(0); |
| 3026 | } |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3027 | data.writeInt(ignoreTargetSecurity ? 1 : 0); |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 3028 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3029 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 3030 | reply.readException(); |
| 3031 | int result = reply.readInt(); |
| 3032 | reply.recycle(); |
| 3033 | data.recycle(); |
| 3034 | return result; |
| 3035 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3036 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 3037 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3038 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3039 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3040 | Parcel data = Parcel.obtain(); |
| 3041 | Parcel reply = Parcel.obtain(); |
| 3042 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3043 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3044 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3045 | intent.writeToParcel(data, 0); |
| 3046 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3047 | data.writeStrongBinder(resultTo); |
| 3048 | data.writeString(resultWho); |
| 3049 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3050 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3051 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3052 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3053 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3054 | } else { |
| 3055 | data.writeInt(0); |
| 3056 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3057 | if (options != null) { |
| 3058 | data.writeInt(1); |
| 3059 | options.writeToParcel(data, 0); |
| 3060 | } else { |
| 3061 | data.writeInt(0); |
| 3062 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3063 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3064 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 3065 | reply.readException(); |
| 3066 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 3067 | reply.recycle(); |
| 3068 | data.recycle(); |
| 3069 | return result; |
| 3070 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3071 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 3072 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3073 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3074 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3075 | Parcel data = Parcel.obtain(); |
| 3076 | Parcel reply = Parcel.obtain(); |
| 3077 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3078 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3079 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3080 | intent.writeToParcel(data, 0); |
| 3081 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3082 | data.writeStrongBinder(resultTo); |
| 3083 | data.writeString(resultWho); |
| 3084 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3085 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3086 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3087 | if (options != null) { |
| 3088 | data.writeInt(1); |
| 3089 | options.writeToParcel(data, 0); |
| 3090 | } else { |
| 3091 | data.writeInt(0); |
| 3092 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3093 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3094 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3095 | reply.readException(); |
| 3096 | int result = reply.readInt(); |
| 3097 | reply.recycle(); |
| 3098 | data.recycle(); |
| 3099 | return result; |
| 3100 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3101 | public int startActivityIntentSender(IApplicationThread caller, |
| 3102 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3103 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3104 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3105 | Parcel data = Parcel.obtain(); |
| 3106 | Parcel reply = Parcel.obtain(); |
| 3107 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3108 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3109 | intent.writeToParcel(data, 0); |
| 3110 | if (fillInIntent != null) { |
| 3111 | data.writeInt(1); |
| 3112 | fillInIntent.writeToParcel(data, 0); |
| 3113 | } else { |
| 3114 | data.writeInt(0); |
| 3115 | } |
| 3116 | data.writeString(resolvedType); |
| 3117 | data.writeStrongBinder(resultTo); |
| 3118 | data.writeString(resultWho); |
| 3119 | data.writeInt(requestCode); |
| 3120 | data.writeInt(flagsMask); |
| 3121 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3122 | if (options != null) { |
| 3123 | data.writeInt(1); |
| 3124 | options.writeToParcel(data, 0); |
| 3125 | } else { |
| 3126 | data.writeInt(0); |
| 3127 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3128 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3129 | reply.readException(); |
| 3130 | int result = reply.readInt(); |
| 3131 | reply.recycle(); |
| 3132 | data.recycle(); |
| 3133 | return result; |
| 3134 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3135 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 3136 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3137 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 3138 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3139 | Parcel data = Parcel.obtain(); |
| 3140 | Parcel reply = Parcel.obtain(); |
| 3141 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3142 | data.writeString(callingPackage); |
| 3143 | data.writeInt(callingPid); |
| 3144 | data.writeInt(callingUid); |
| 3145 | intent.writeToParcel(data, 0); |
| 3146 | data.writeString(resolvedType); |
| 3147 | data.writeStrongBinder(session.asBinder()); |
| 3148 | data.writeStrongBinder(interactor.asBinder()); |
| 3149 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3150 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3151 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3152 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3153 | } else { |
| 3154 | data.writeInt(0); |
| 3155 | } |
| 3156 | if (options != null) { |
| 3157 | data.writeInt(1); |
| 3158 | options.writeToParcel(data, 0); |
| 3159 | } else { |
| 3160 | data.writeInt(0); |
| 3161 | } |
| 3162 | data.writeInt(userId); |
| 3163 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3164 | reply.readException(); |
| 3165 | int result = reply.readInt(); |
| 3166 | reply.recycle(); |
| 3167 | data.recycle(); |
| 3168 | return result; |
| 3169 | } |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 3170 | |
| 3171 | public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options) |
| 3172 | throws RemoteException { |
| 3173 | Parcel data = Parcel.obtain(); |
| 3174 | Parcel reply = Parcel.obtain(); |
| 3175 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3176 | data.writeStrongBinder(callingActivity); |
| 3177 | data.writeBundle(options); |
| 3178 | mRemote.transact(START_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3179 | reply.readException(); |
| 3180 | reply.recycle(); |
| 3181 | data.recycle(); |
| 3182 | } |
| 3183 | |
| 3184 | public void stopLocalVoiceInteraction(IBinder callingActivity) throws RemoteException { |
| 3185 | Parcel data = Parcel.obtain(); |
| 3186 | Parcel reply = Parcel.obtain(); |
| 3187 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3188 | data.writeStrongBinder(callingActivity); |
| 3189 | mRemote.transact(STOP_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3190 | reply.readException(); |
| 3191 | reply.recycle(); |
| 3192 | data.recycle(); |
| 3193 | } |
| 3194 | |
| 3195 | public boolean supportsLocalVoiceInteraction() throws RemoteException { |
| 3196 | Parcel data = Parcel.obtain(); |
| 3197 | Parcel reply = Parcel.obtain(); |
| 3198 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3199 | mRemote.transact(SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3200 | reply.readException(); |
| 3201 | int result = reply.readInt(); |
| 3202 | reply.recycle(); |
| 3203 | data.recycle(); |
| 3204 | return result != 0; |
| 3205 | } |
| 3206 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3207 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3208 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3209 | Parcel data = Parcel.obtain(); |
| 3210 | Parcel reply = Parcel.obtain(); |
| 3211 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3212 | data.writeStrongBinder(callingActivity); |
| 3213 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3214 | if (options != null) { |
| 3215 | data.writeInt(1); |
| 3216 | options.writeToParcel(data, 0); |
| 3217 | } else { |
| 3218 | data.writeInt(0); |
| 3219 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3220 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3221 | reply.readException(); |
| 3222 | int result = reply.readInt(); |
| 3223 | reply.recycle(); |
| 3224 | data.recycle(); |
| 3225 | return result != 0; |
| 3226 | } |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 3227 | public int startActivityFromRecents(int taskId, Bundle options) |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3228 | throws RemoteException { |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3229 | Parcel data = Parcel.obtain(); |
| 3230 | Parcel reply = Parcel.obtain(); |
| 3231 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3232 | data.writeInt(taskId); |
| 3233 | if (options == null) { |
| 3234 | data.writeInt(0); |
| 3235 | } else { |
| 3236 | data.writeInt(1); |
| 3237 | options.writeToParcel(data, 0); |
| 3238 | } |
| 3239 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 3240 | reply.readException(); |
| 3241 | int result = reply.readInt(); |
| 3242 | reply.recycle(); |
| 3243 | data.recycle(); |
| 3244 | return result; |
| 3245 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3246 | 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] | 3247 | throws RemoteException { |
| 3248 | Parcel data = Parcel.obtain(); |
| 3249 | Parcel reply = Parcel.obtain(); |
| 3250 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3251 | data.writeStrongBinder(token); |
| 3252 | data.writeInt(resultCode); |
| 3253 | if (resultData != null) { |
| 3254 | data.writeInt(1); |
| 3255 | resultData.writeToParcel(data, 0); |
| 3256 | } else { |
| 3257 | data.writeInt(0); |
| 3258 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3259 | data.writeInt(finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3260 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3261 | reply.readException(); |
| 3262 | boolean res = reply.readInt() != 0; |
| 3263 | data.recycle(); |
| 3264 | reply.recycle(); |
| 3265 | return res; |
| 3266 | } |
| 3267 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 3268 | { |
| 3269 | Parcel data = Parcel.obtain(); |
| 3270 | Parcel reply = Parcel.obtain(); |
| 3271 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3272 | data.writeStrongBinder(token); |
| 3273 | data.writeString(resultWho); |
| 3274 | data.writeInt(requestCode); |
| 3275 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3276 | reply.readException(); |
| 3277 | data.recycle(); |
| 3278 | reply.recycle(); |
| 3279 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 3280 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 3281 | Parcel data = Parcel.obtain(); |
| 3282 | Parcel reply = Parcel.obtain(); |
| 3283 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3284 | data.writeStrongBinder(token); |
| 3285 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 3286 | reply.readException(); |
| 3287 | boolean res = reply.readInt() != 0; |
| 3288 | data.recycle(); |
| 3289 | reply.recycle(); |
| 3290 | return res; |
| 3291 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 3292 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 3293 | Parcel data = Parcel.obtain(); |
| 3294 | Parcel reply = Parcel.obtain(); |
| 3295 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3296 | data.writeStrongBinder(session.asBinder()); |
| 3297 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 3298 | reply.readException(); |
| 3299 | data.recycle(); |
| 3300 | reply.recycle(); |
| 3301 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 3302 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 3303 | Parcel data = Parcel.obtain(); |
| 3304 | Parcel reply = Parcel.obtain(); |
| 3305 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3306 | data.writeStrongBinder(token); |
| 3307 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 3308 | reply.readException(); |
| 3309 | boolean res = reply.readInt() != 0; |
| 3310 | data.recycle(); |
| 3311 | reply.recycle(); |
| 3312 | return res; |
| 3313 | } |
| 3314 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 3315 | Parcel data = Parcel.obtain(); |
| 3316 | Parcel reply = Parcel.obtain(); |
| 3317 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3318 | data.writeStrongBinder(app.asBinder()); |
| 3319 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 3320 | reply.readException(); |
| 3321 | data.recycle(); |
| 3322 | reply.recycle(); |
| 3323 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 3324 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 3325 | Parcel data = Parcel.obtain(); |
| 3326 | Parcel reply = Parcel.obtain(); |
| 3327 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3328 | data.writeStrongBinder(token); |
| 3329 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 3330 | reply.readException(); |
| 3331 | boolean res = reply.readInt() != 0; |
| 3332 | data.recycle(); |
| 3333 | reply.recycle(); |
| 3334 | return res; |
| 3335 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3336 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3337 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3338 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3339 | { |
| 3340 | Parcel data = Parcel.obtain(); |
| 3341 | Parcel reply = Parcel.obtain(); |
| 3342 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3343 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3344 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3345 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 3346 | filter.writeToParcel(data, 0); |
| 3347 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3348 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3349 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3350 | reply.readException(); |
| 3351 | Intent intent = null; |
| 3352 | int haveIntent = reply.readInt(); |
| 3353 | if (haveIntent != 0) { |
| 3354 | intent = Intent.CREATOR.createFromParcel(reply); |
| 3355 | } |
| 3356 | reply.recycle(); |
| 3357 | data.recycle(); |
| 3358 | return intent; |
| 3359 | } |
| 3360 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 3361 | { |
| 3362 | Parcel data = Parcel.obtain(); |
| 3363 | Parcel reply = Parcel.obtain(); |
| 3364 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3365 | data.writeStrongBinder(receiver.asBinder()); |
| 3366 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3367 | reply.readException(); |
| 3368 | data.recycle(); |
| 3369 | reply.recycle(); |
| 3370 | } |
| 3371 | public int broadcastIntent(IApplicationThread caller, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3372 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3373 | int resultCode, String resultData, Bundle map, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3374 | String[] requiredPermissions, int appOp, Bundle options, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3375 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3376 | { |
| 3377 | Parcel data = Parcel.obtain(); |
| 3378 | Parcel reply = Parcel.obtain(); |
| 3379 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3380 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3381 | intent.writeToParcel(data, 0); |
| 3382 | data.writeString(resolvedType); |
| 3383 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 3384 | data.writeInt(resultCode); |
| 3385 | data.writeString(resultData); |
| 3386 | data.writeBundle(map); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3387 | data.writeStringArray(requiredPermissions); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 3388 | data.writeInt(appOp); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3389 | data.writeBundle(options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3390 | data.writeInt(serialized ? 1 : 0); |
| 3391 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3392 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3393 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3394 | reply.readException(); |
| 3395 | int res = reply.readInt(); |
| 3396 | reply.recycle(); |
| 3397 | data.recycle(); |
| 3398 | return res; |
| 3399 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3400 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 3401 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3402 | { |
| 3403 | Parcel data = Parcel.obtain(); |
| 3404 | Parcel reply = Parcel.obtain(); |
| 3405 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3406 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3407 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3408 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3409 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3410 | reply.readException(); |
| 3411 | data.recycle(); |
| 3412 | reply.recycle(); |
| 3413 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3414 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 3415 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3416 | { |
| 3417 | Parcel data = Parcel.obtain(); |
| 3418 | Parcel reply = Parcel.obtain(); |
| 3419 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3420 | data.writeStrongBinder(who); |
| 3421 | data.writeInt(resultCode); |
| 3422 | data.writeString(resultData); |
| 3423 | data.writeBundle(map); |
| 3424 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3425 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3426 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3427 | reply.readException(); |
| 3428 | data.recycle(); |
| 3429 | reply.recycle(); |
| 3430 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3431 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3432 | { |
| 3433 | Parcel data = Parcel.obtain(); |
| 3434 | Parcel reply = Parcel.obtain(); |
| 3435 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3436 | data.writeStrongBinder(app.asBinder()); |
| 3437 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3438 | reply.readException(); |
| 3439 | data.recycle(); |
| 3440 | reply.recycle(); |
| 3441 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3442 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3443 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3444 | { |
| 3445 | Parcel data = Parcel.obtain(); |
| 3446 | Parcel reply = Parcel.obtain(); |
| 3447 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3448 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3449 | if (config != null) { |
| 3450 | data.writeInt(1); |
| 3451 | config.writeToParcel(data, 0); |
| 3452 | } else { |
| 3453 | data.writeInt(0); |
| 3454 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3455 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3456 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3457 | reply.readException(); |
| 3458 | data.recycle(); |
| 3459 | reply.recycle(); |
| 3460 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3461 | public void activityResumed(IBinder token) throws RemoteException |
| 3462 | { |
| 3463 | Parcel data = Parcel.obtain(); |
| 3464 | Parcel reply = Parcel.obtain(); |
| 3465 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3466 | data.writeStrongBinder(token); |
| 3467 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3468 | reply.readException(); |
| 3469 | data.recycle(); |
| 3470 | reply.recycle(); |
| 3471 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3472 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3473 | { |
| 3474 | Parcel data = Parcel.obtain(); |
| 3475 | Parcel reply = Parcel.obtain(); |
| 3476 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3477 | data.writeStrongBinder(token); |
| 3478 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3479 | reply.readException(); |
| 3480 | data.recycle(); |
| 3481 | reply.recycle(); |
| 3482 | } |
| 3483 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3484 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3485 | { |
| 3486 | Parcel data = Parcel.obtain(); |
| 3487 | Parcel reply = Parcel.obtain(); |
| 3488 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3489 | data.writeStrongBinder(token); |
| 3490 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3491 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3492 | TextUtils.writeToParcel(description, data, 0); |
| 3493 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3494 | reply.readException(); |
| 3495 | data.recycle(); |
| 3496 | reply.recycle(); |
| 3497 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3498 | public void activitySlept(IBinder token) throws RemoteException |
| 3499 | { |
| 3500 | Parcel data = Parcel.obtain(); |
| 3501 | Parcel reply = Parcel.obtain(); |
| 3502 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3503 | data.writeStrongBinder(token); |
| 3504 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3505 | reply.readException(); |
| 3506 | data.recycle(); |
| 3507 | reply.recycle(); |
| 3508 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3509 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3510 | { |
| 3511 | Parcel data = Parcel.obtain(); |
| 3512 | Parcel reply = Parcel.obtain(); |
| 3513 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3514 | data.writeStrongBinder(token); |
| 3515 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3516 | reply.readException(); |
| 3517 | data.recycle(); |
| 3518 | reply.recycle(); |
| 3519 | } |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 3520 | public void activityRelaunched(IBinder token) throws RemoteException |
| 3521 | { |
| 3522 | Parcel data = Parcel.obtain(); |
| 3523 | Parcel reply = Parcel.obtain(); |
| 3524 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3525 | data.writeStrongBinder(token); |
| 3526 | mRemote.transact(ACTIVITY_RELAUNCHED_TRANSACTION, data, reply, 0); |
| 3527 | reply.readException(); |
| 3528 | data.recycle(); |
| 3529 | reply.recycle(); |
| 3530 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3531 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3532 | { |
| 3533 | Parcel data = Parcel.obtain(); |
| 3534 | Parcel reply = Parcel.obtain(); |
| 3535 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3536 | data.writeStrongBinder(token); |
| 3537 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3538 | reply.readException(); |
| 3539 | String res = reply.readString(); |
| 3540 | data.recycle(); |
| 3541 | reply.recycle(); |
| 3542 | return res; |
| 3543 | } |
| 3544 | public ComponentName getCallingActivity(IBinder token) |
| 3545 | throws RemoteException { |
| 3546 | Parcel data = Parcel.obtain(); |
| 3547 | Parcel reply = Parcel.obtain(); |
| 3548 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3549 | data.writeStrongBinder(token); |
| 3550 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3551 | reply.readException(); |
| 3552 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3553 | data.recycle(); |
| 3554 | reply.recycle(); |
| 3555 | return res; |
| 3556 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3557 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3558 | Parcel data = Parcel.obtain(); |
| 3559 | Parcel reply = Parcel.obtain(); |
| 3560 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3561 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3562 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3563 | reply.readException(); |
| 3564 | ArrayList<IAppTask> list = null; |
| 3565 | int N = reply.readInt(); |
| 3566 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3567 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3568 | while (N > 0) { |
| 3569 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3570 | list.add(task); |
| 3571 | N--; |
| 3572 | } |
| 3573 | } |
| 3574 | data.recycle(); |
| 3575 | reply.recycle(); |
| 3576 | return list; |
| 3577 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3578 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3579 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3580 | Parcel data = Parcel.obtain(); |
| 3581 | Parcel reply = Parcel.obtain(); |
| 3582 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3583 | data.writeStrongBinder(activityToken); |
| 3584 | intent.writeToParcel(data, 0); |
| 3585 | description.writeToParcel(data, 0); |
| 3586 | thumbnail.writeToParcel(data, 0); |
| 3587 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3588 | reply.readException(); |
| 3589 | int res = reply.readInt(); |
| 3590 | data.recycle(); |
| 3591 | reply.recycle(); |
| 3592 | return res; |
| 3593 | } |
| 3594 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3595 | Parcel data = Parcel.obtain(); |
| 3596 | Parcel reply = Parcel.obtain(); |
| 3597 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3598 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3599 | reply.readException(); |
| 3600 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3601 | data.recycle(); |
| 3602 | reply.recycle(); |
| 3603 | return size; |
| 3604 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3605 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3606 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3607 | Parcel data = Parcel.obtain(); |
| 3608 | Parcel reply = Parcel.obtain(); |
| 3609 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3610 | data.writeInt(maxNum); |
| 3611 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3612 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3613 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3614 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3615 | int N = reply.readInt(); |
| 3616 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3617 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3618 | while (N > 0) { |
| 3619 | ActivityManager.RunningTaskInfo info = |
| 3620 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3621 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3622 | list.add(info); |
| 3623 | N--; |
| 3624 | } |
| 3625 | } |
| 3626 | data.recycle(); |
| 3627 | reply.recycle(); |
| 3628 | return list; |
| 3629 | } |
| 3630 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3631 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3632 | Parcel data = Parcel.obtain(); |
| 3633 | Parcel reply = Parcel.obtain(); |
| 3634 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3635 | data.writeInt(maxNum); |
| 3636 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3637 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3638 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3639 | reply.readException(); |
| 3640 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3641 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3642 | data.recycle(); |
| 3643 | reply.recycle(); |
| 3644 | return list; |
| 3645 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3646 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3647 | Parcel data = Parcel.obtain(); |
| 3648 | Parcel reply = Parcel.obtain(); |
| 3649 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3650 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3651 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3652 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3653 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3654 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3655 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3656 | } |
| 3657 | data.recycle(); |
| 3658 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3659 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3660 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3661 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3662 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3663 | Parcel data = Parcel.obtain(); |
| 3664 | Parcel reply = Parcel.obtain(); |
| 3665 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3666 | data.writeInt(maxNum); |
| 3667 | data.writeInt(flags); |
| 3668 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3669 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3670 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3671 | int N = reply.readInt(); |
| 3672 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3673 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3674 | while (N > 0) { |
| 3675 | ActivityManager.RunningServiceInfo info = |
| 3676 | ActivityManager.RunningServiceInfo.CREATOR |
| 3677 | .createFromParcel(reply); |
| 3678 | list.add(info); |
| 3679 | N--; |
| 3680 | } |
| 3681 | } |
| 3682 | data.recycle(); |
| 3683 | reply.recycle(); |
| 3684 | return list; |
| 3685 | } |
| 3686 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3687 | throws RemoteException { |
| 3688 | Parcel data = Parcel.obtain(); |
| 3689 | Parcel reply = Parcel.obtain(); |
| 3690 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3691 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3692 | reply.readException(); |
| 3693 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3694 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3695 | data.recycle(); |
| 3696 | reply.recycle(); |
| 3697 | return list; |
| 3698 | } |
| 3699 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3700 | throws RemoteException { |
| 3701 | Parcel data = Parcel.obtain(); |
| 3702 | Parcel reply = Parcel.obtain(); |
| 3703 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3704 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3705 | reply.readException(); |
| 3706 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3707 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3708 | data.recycle(); |
| 3709 | reply.recycle(); |
| 3710 | return list; |
| 3711 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3712 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3713 | throws RemoteException { |
| 3714 | Parcel data = Parcel.obtain(); |
| 3715 | Parcel reply = Parcel.obtain(); |
| 3716 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3717 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3718 | reply.readException(); |
| 3719 | ArrayList<ApplicationInfo> list |
| 3720 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3721 | data.recycle(); |
| 3722 | reply.recycle(); |
| 3723 | return list; |
| 3724 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3725 | 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] | 3726 | { |
| 3727 | Parcel data = Parcel.obtain(); |
| 3728 | Parcel reply = Parcel.obtain(); |
| 3729 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3730 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3731 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3732 | if (options != null) { |
| 3733 | data.writeInt(1); |
| 3734 | options.writeToParcel(data, 0); |
| 3735 | } else { |
| 3736 | data.writeInt(0); |
| 3737 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3738 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3739 | reply.readException(); |
| 3740 | data.recycle(); |
| 3741 | reply.recycle(); |
| 3742 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3743 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3744 | throws RemoteException { |
| 3745 | Parcel data = Parcel.obtain(); |
| 3746 | Parcel reply = Parcel.obtain(); |
| 3747 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3748 | data.writeStrongBinder(token); |
| 3749 | data.writeInt(nonRoot ? 1 : 0); |
| 3750 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3751 | reply.readException(); |
| 3752 | boolean res = reply.readInt() != 0; |
| 3753 | data.recycle(); |
| 3754 | reply.recycle(); |
| 3755 | return res; |
| 3756 | } |
| 3757 | public void moveTaskBackwards(int task) throws RemoteException |
| 3758 | { |
| 3759 | Parcel data = Parcel.obtain(); |
| 3760 | Parcel reply = Parcel.obtain(); |
| 3761 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3762 | data.writeInt(task); |
| 3763 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3764 | reply.readException(); |
| 3765 | data.recycle(); |
| 3766 | reply.recycle(); |
| 3767 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3768 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3769 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3770 | { |
| 3771 | Parcel data = Parcel.obtain(); |
| 3772 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3773 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3774 | data.writeInt(taskId); |
| 3775 | data.writeInt(stackId); |
| 3776 | data.writeInt(toTop ? 1 : 0); |
| 3777 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3778 | reply.readException(); |
| 3779 | data.recycle(); |
| 3780 | reply.recycle(); |
| 3781 | } |
| 3782 | @Override |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3783 | public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, |
| 3784 | Rect initialBounds) throws RemoteException |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3785 | { |
| 3786 | Parcel data = Parcel.obtain(); |
| 3787 | Parcel reply = Parcel.obtain(); |
| 3788 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3789 | data.writeInt(taskId); |
| 3790 | data.writeInt(createMode); |
| 3791 | data.writeInt(toTop ? 1 : 0); |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 3792 | data.writeInt(animate ? 1 : 0); |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3793 | if (initialBounds != null) { |
| 3794 | data.writeInt(1); |
| 3795 | initialBounds.writeToParcel(data, 0); |
| 3796 | } else { |
| 3797 | data.writeInt(0); |
| 3798 | } |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3799 | mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3800 | reply.readException(); |
| 3801 | data.recycle(); |
| 3802 | reply.recycle(); |
| 3803 | } |
| 3804 | @Override |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3805 | public boolean moveTopActivityToPinnedStack(int stackId, Rect r) |
| 3806 | throws RemoteException |
| 3807 | { |
| 3808 | Parcel data = Parcel.obtain(); |
| 3809 | Parcel reply = Parcel.obtain(); |
| 3810 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3811 | data.writeInt(stackId); |
| 3812 | r.writeToParcel(data, 0); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 3813 | mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3814 | reply.readException(); |
| 3815 | final boolean res = reply.readInt() != 0; |
| 3816 | data.recycle(); |
| 3817 | reply.recycle(); |
| 3818 | return res; |
| 3819 | } |
| 3820 | @Override |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3821 | public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode, |
| 3822 | boolean preserveWindows, boolean animate) throws RemoteException { |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3823 | Parcel data = Parcel.obtain(); |
| 3824 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3825 | data.writeInterfaceToken(IActivityManager.descriptor); |
Wale Ogunwale | b34a7ad | 2015-08-14 11:05:30 -0700 | [diff] [blame] | 3826 | data.writeInt(stackId); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 3827 | if (r != null) { |
| 3828 | data.writeInt(1); |
| 3829 | r.writeToParcel(data, 0); |
| 3830 | } else { |
| 3831 | data.writeInt(0); |
| 3832 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3833 | data.writeInt(allowResizeInDockedMode ? 1 : 0); |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3834 | data.writeInt(preserveWindows ? 1 : 0); |
| 3835 | data.writeInt(animate ? 1 : 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3836 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3837 | reply.readException(); |
| 3838 | data.recycle(); |
| 3839 | reply.recycle(); |
| 3840 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3841 | @Override |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 3842 | public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds, |
| 3843 | Rect tempDockedTaskInsetBounds, |
| 3844 | Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds) |
| 3845 | throws RemoteException |
| 3846 | { |
| 3847 | Parcel data = Parcel.obtain(); |
| 3848 | Parcel reply = Parcel.obtain(); |
| 3849 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3850 | if (dockedBounds != null) { |
| 3851 | data.writeInt(1); |
| 3852 | dockedBounds.writeToParcel(data, 0); |
| 3853 | } else { |
| 3854 | data.writeInt(0); |
| 3855 | } |
| 3856 | if (tempDockedTaskBounds != null) { |
| 3857 | data.writeInt(1); |
| 3858 | tempDockedTaskBounds.writeToParcel(data, 0); |
| 3859 | } else { |
| 3860 | data.writeInt(0); |
| 3861 | } |
| 3862 | if (tempDockedTaskInsetBounds != null) { |
| 3863 | data.writeInt(1); |
| 3864 | tempDockedTaskInsetBounds.writeToParcel(data, 0); |
| 3865 | } else { |
| 3866 | data.writeInt(0); |
| 3867 | } |
| 3868 | if (tempOtherTaskBounds != null) { |
| 3869 | data.writeInt(1); |
| 3870 | tempOtherTaskBounds.writeToParcel(data, 0); |
| 3871 | } else { |
| 3872 | data.writeInt(0); |
| 3873 | } |
| 3874 | if (tempOtherTaskInsetBounds != null) { |
| 3875 | data.writeInt(1); |
| 3876 | tempOtherTaskInsetBounds.writeToParcel(data, 0); |
| 3877 | } else { |
| 3878 | data.writeInt(0); |
| 3879 | } |
| 3880 | mRemote.transact(RESIZE_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3881 | reply.readException(); |
| 3882 | data.recycle(); |
| 3883 | reply.recycle(); |
| 3884 | } |
| 3885 | @Override |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 3886 | public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException |
| 3887 | { |
| 3888 | Parcel data = Parcel.obtain(); |
| 3889 | Parcel reply = Parcel.obtain(); |
| 3890 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3891 | data.writeInt(taskId); |
| 3892 | data.writeInt(stackId); |
| 3893 | data.writeInt(position); |
| 3894 | mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0); |
| 3895 | reply.readException(); |
| 3896 | data.recycle(); |
| 3897 | reply.recycle(); |
| 3898 | } |
| 3899 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3900 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3901 | { |
| 3902 | Parcel data = Parcel.obtain(); |
| 3903 | Parcel reply = Parcel.obtain(); |
| 3904 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3905 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3906 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3907 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3908 | data.recycle(); |
| 3909 | reply.recycle(); |
| 3910 | return list; |
| 3911 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3912 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3913 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3914 | { |
| 3915 | Parcel data = Parcel.obtain(); |
| 3916 | Parcel reply = Parcel.obtain(); |
| 3917 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3918 | data.writeInt(stackId); |
| 3919 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3920 | reply.readException(); |
| 3921 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3922 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3923 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3924 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3925 | } |
| 3926 | data.recycle(); |
| 3927 | reply.recycle(); |
| 3928 | return info; |
| 3929 | } |
| 3930 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 3931 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 3932 | Parcel data = Parcel.obtain(); |
| 3933 | Parcel reply = Parcel.obtain(); |
| 3934 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3935 | data.writeInt(taskId); |
| 3936 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 3937 | reply.readException(); |
| 3938 | boolean isInHomeStack = reply.readInt() > 0; |
| 3939 | data.recycle(); |
| 3940 | reply.recycle(); |
| 3941 | return isInHomeStack; |
| 3942 | } |
| 3943 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3944 | public void setFocusedStack(int stackId) throws RemoteException |
| 3945 | { |
| 3946 | Parcel data = Parcel.obtain(); |
| 3947 | Parcel reply = Parcel.obtain(); |
| 3948 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3949 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3950 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3951 | reply.readException(); |
| 3952 | data.recycle(); |
| 3953 | reply.recycle(); |
| 3954 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3955 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 3956 | public int getFocusedStackId() throws RemoteException { |
| 3957 | Parcel data = Parcel.obtain(); |
| 3958 | Parcel reply = Parcel.obtain(); |
| 3959 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3960 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 3961 | reply.readException(); |
| 3962 | int focusedStackId = reply.readInt(); |
| 3963 | data.recycle(); |
| 3964 | reply.recycle(); |
| 3965 | return focusedStackId; |
| 3966 | } |
| 3967 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 3968 | public void setFocusedTask(int taskId) throws RemoteException |
| 3969 | { |
| 3970 | Parcel data = Parcel.obtain(); |
| 3971 | Parcel reply = Parcel.obtain(); |
| 3972 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3973 | data.writeInt(taskId); |
| 3974 | mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0); |
| 3975 | reply.readException(); |
| 3976 | data.recycle(); |
| 3977 | reply.recycle(); |
| 3978 | } |
| 3979 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3980 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 3981 | { |
| 3982 | Parcel data = Parcel.obtain(); |
| 3983 | Parcel reply = Parcel.obtain(); |
| 3984 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3985 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3986 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3987 | reply.readException(); |
| 3988 | data.recycle(); |
| 3989 | reply.recycle(); |
| 3990 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3991 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 3992 | { |
| 3993 | Parcel data = Parcel.obtain(); |
| 3994 | Parcel reply = Parcel.obtain(); |
| 3995 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3996 | data.writeStrongBinder(token); |
| 3997 | data.writeInt(onlyRoot ? 1 : 0); |
| 3998 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3999 | reply.readException(); |
| 4000 | int res = reply.readInt(); |
| 4001 | data.recycle(); |
| 4002 | reply.recycle(); |
| 4003 | return res; |
| 4004 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4005 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4006 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4007 | Parcel data = Parcel.obtain(); |
| 4008 | Parcel reply = Parcel.obtain(); |
| 4009 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4010 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4011 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4012 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4013 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4014 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4015 | reply.readException(); |
| 4016 | int res = reply.readInt(); |
| 4017 | ContentProviderHolder cph = null; |
| 4018 | if (res != 0) { |
| 4019 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4020 | } |
| 4021 | data.recycle(); |
| 4022 | reply.recycle(); |
| 4023 | return cph; |
| 4024 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4025 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 4026 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4027 | Parcel data = Parcel.obtain(); |
| 4028 | Parcel reply = Parcel.obtain(); |
| 4029 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4030 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4031 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4032 | data.writeStrongBinder(token); |
| 4033 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4034 | reply.readException(); |
| 4035 | int res = reply.readInt(); |
| 4036 | ContentProviderHolder cph = null; |
| 4037 | if (res != 0) { |
| 4038 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4039 | } |
| 4040 | data.recycle(); |
| 4041 | reply.recycle(); |
| 4042 | return cph; |
| 4043 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4044 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4045 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4046 | { |
| 4047 | Parcel data = Parcel.obtain(); |
| 4048 | Parcel reply = Parcel.obtain(); |
| 4049 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4050 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4051 | data.writeTypedList(providers); |
| 4052 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 4053 | reply.readException(); |
| 4054 | data.recycle(); |
| 4055 | reply.recycle(); |
| 4056 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4057 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 4058 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4059 | Parcel data = Parcel.obtain(); |
| 4060 | Parcel reply = Parcel.obtain(); |
| 4061 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4062 | data.writeStrongBinder(connection); |
| 4063 | data.writeInt(stable); |
| 4064 | data.writeInt(unstable); |
| 4065 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4066 | reply.readException(); |
| 4067 | boolean res = reply.readInt() != 0; |
| 4068 | data.recycle(); |
| 4069 | reply.recycle(); |
| 4070 | return res; |
| 4071 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4072 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4073 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 4074 | Parcel data = Parcel.obtain(); |
| 4075 | Parcel reply = Parcel.obtain(); |
| 4076 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4077 | data.writeStrongBinder(connection); |
| 4078 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 4079 | reply.readException(); |
| 4080 | data.recycle(); |
| 4081 | reply.recycle(); |
| 4082 | } |
| 4083 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4084 | @Override |
| 4085 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 4086 | Parcel data = Parcel.obtain(); |
| 4087 | Parcel reply = Parcel.obtain(); |
| 4088 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4089 | data.writeStrongBinder(connection); |
| 4090 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 4091 | reply.readException(); |
| 4092 | data.recycle(); |
| 4093 | reply.recycle(); |
| 4094 | } |
| 4095 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4096 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 4097 | Parcel data = Parcel.obtain(); |
| 4098 | Parcel reply = Parcel.obtain(); |
| 4099 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4100 | data.writeStrongBinder(connection); |
| 4101 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4102 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4103 | reply.readException(); |
| 4104 | data.recycle(); |
| 4105 | reply.recycle(); |
| 4106 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4107 | |
| 4108 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 4109 | Parcel data = Parcel.obtain(); |
| 4110 | Parcel reply = Parcel.obtain(); |
| 4111 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4112 | data.writeString(name); |
| 4113 | data.writeStrongBinder(token); |
| 4114 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4115 | reply.readException(); |
| 4116 | data.recycle(); |
| 4117 | reply.recycle(); |
| 4118 | } |
| 4119 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 4120 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 4121 | throws RemoteException |
| 4122 | { |
| 4123 | Parcel data = Parcel.obtain(); |
| 4124 | Parcel reply = Parcel.obtain(); |
| 4125 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4126 | service.writeToParcel(data, 0); |
| 4127 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 4128 | reply.readException(); |
| 4129 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 4130 | data.recycle(); |
| 4131 | reply.recycle(); |
| 4132 | return res; |
| 4133 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4134 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4135 | public ComponentName startService(IApplicationThread caller, Intent service, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4136 | String resolvedType, String callingPackage, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4137 | { |
| 4138 | Parcel data = Parcel.obtain(); |
| 4139 | Parcel reply = Parcel.obtain(); |
| 4140 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4141 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4142 | service.writeToParcel(data, 0); |
| 4143 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4144 | data.writeString(callingPackage); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4145 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4146 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 4147 | reply.readException(); |
| 4148 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4149 | data.recycle(); |
| 4150 | reply.recycle(); |
| 4151 | return res; |
| 4152 | } |
| 4153 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4154 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4155 | { |
| 4156 | Parcel data = Parcel.obtain(); |
| 4157 | Parcel reply = Parcel.obtain(); |
| 4158 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4159 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4160 | service.writeToParcel(data, 0); |
| 4161 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4162 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4163 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 4164 | reply.readException(); |
| 4165 | int res = reply.readInt(); |
| 4166 | reply.recycle(); |
| 4167 | data.recycle(); |
| 4168 | return res; |
| 4169 | } |
| 4170 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 4171 | int startId) throws RemoteException { |
| 4172 | Parcel data = Parcel.obtain(); |
| 4173 | Parcel reply = Parcel.obtain(); |
| 4174 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4175 | ComponentName.writeToParcel(className, data); |
| 4176 | data.writeStrongBinder(token); |
| 4177 | data.writeInt(startId); |
| 4178 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 4179 | reply.readException(); |
| 4180 | boolean res = reply.readInt() != 0; |
| 4181 | data.recycle(); |
| 4182 | reply.recycle(); |
| 4183 | return res; |
| 4184 | } |
| 4185 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4186 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4187 | Parcel data = Parcel.obtain(); |
| 4188 | Parcel reply = Parcel.obtain(); |
| 4189 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4190 | ComponentName.writeToParcel(className, data); |
| 4191 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4192 | data.writeInt(id); |
| 4193 | if (notification != null) { |
| 4194 | data.writeInt(1); |
| 4195 | notification.writeToParcel(data, 0); |
| 4196 | } else { |
| 4197 | data.writeInt(0); |
| 4198 | } |
| 4199 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4200 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4201 | reply.readException(); |
| 4202 | data.recycle(); |
| 4203 | reply.recycle(); |
| 4204 | } |
| 4205 | public int bindService(IApplicationThread caller, IBinder token, |
| 4206 | Intent service, String resolvedType, IServiceConnection connection, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4207 | int flags, String callingPackage, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4208 | Parcel data = Parcel.obtain(); |
| 4209 | Parcel reply = Parcel.obtain(); |
| 4210 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4211 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4212 | data.writeStrongBinder(token); |
| 4213 | service.writeToParcel(data, 0); |
| 4214 | data.writeString(resolvedType); |
| 4215 | data.writeStrongBinder(connection.asBinder()); |
| 4216 | data.writeInt(flags); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4217 | data.writeString(callingPackage); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 4218 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4219 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4220 | reply.readException(); |
| 4221 | int res = reply.readInt(); |
| 4222 | data.recycle(); |
| 4223 | reply.recycle(); |
| 4224 | return res; |
| 4225 | } |
| 4226 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 4227 | { |
| 4228 | Parcel data = Parcel.obtain(); |
| 4229 | Parcel reply = Parcel.obtain(); |
| 4230 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4231 | data.writeStrongBinder(connection.asBinder()); |
| 4232 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4233 | reply.readException(); |
| 4234 | boolean res = reply.readInt() != 0; |
| 4235 | data.recycle(); |
| 4236 | reply.recycle(); |
| 4237 | return res; |
| 4238 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4239 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4240 | public void publishService(IBinder token, |
| 4241 | Intent intent, IBinder service) throws RemoteException { |
| 4242 | Parcel data = Parcel.obtain(); |
| 4243 | Parcel reply = Parcel.obtain(); |
| 4244 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4245 | data.writeStrongBinder(token); |
| 4246 | intent.writeToParcel(data, 0); |
| 4247 | data.writeStrongBinder(service); |
| 4248 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 4249 | reply.readException(); |
| 4250 | data.recycle(); |
| 4251 | reply.recycle(); |
| 4252 | } |
| 4253 | |
| 4254 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 4255 | throws RemoteException { |
| 4256 | Parcel data = Parcel.obtain(); |
| 4257 | Parcel reply = Parcel.obtain(); |
| 4258 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4259 | data.writeStrongBinder(token); |
| 4260 | intent.writeToParcel(data, 0); |
| 4261 | data.writeInt(doRebind ? 1 : 0); |
| 4262 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 4263 | reply.readException(); |
| 4264 | data.recycle(); |
| 4265 | reply.recycle(); |
| 4266 | } |
| 4267 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4268 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 4269 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4270 | Parcel data = Parcel.obtain(); |
| 4271 | Parcel reply = Parcel.obtain(); |
| 4272 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4273 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4274 | data.writeInt(type); |
| 4275 | data.writeInt(startId); |
| 4276 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4277 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 4278 | reply.readException(); |
| 4279 | data.recycle(); |
| 4280 | reply.recycle(); |
| 4281 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4282 | |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4283 | public IBinder peekService(Intent service, String resolvedType, String callingPackage) |
| 4284 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4285 | Parcel data = Parcel.obtain(); |
| 4286 | Parcel reply = Parcel.obtain(); |
| 4287 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4288 | service.writeToParcel(data, 0); |
| 4289 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4290 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4291 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 4292 | reply.readException(); |
| 4293 | IBinder binder = reply.readStrongBinder(); |
| 4294 | reply.recycle(); |
| 4295 | data.recycle(); |
| 4296 | return binder; |
| 4297 | } |
| 4298 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4299 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 4300 | throws RemoteException { |
| 4301 | Parcel data = Parcel.obtain(); |
| 4302 | Parcel reply = Parcel.obtain(); |
| 4303 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4304 | app.writeToParcel(data, 0); |
| 4305 | data.writeInt(backupRestoreMode); |
| 4306 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4307 | reply.readException(); |
| 4308 | boolean success = reply.readInt() != 0; |
| 4309 | reply.recycle(); |
| 4310 | data.recycle(); |
| 4311 | return success; |
| 4312 | } |
| 4313 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 4314 | public void clearPendingBackup() throws RemoteException { |
| 4315 | Parcel data = Parcel.obtain(); |
| 4316 | Parcel reply = Parcel.obtain(); |
| 4317 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4318 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 4319 | reply.recycle(); |
| 4320 | data.recycle(); |
| 4321 | } |
| 4322 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4323 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 4324 | Parcel data = Parcel.obtain(); |
| 4325 | Parcel reply = Parcel.obtain(); |
| 4326 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4327 | data.writeString(packageName); |
| 4328 | data.writeStrongBinder(agent); |
| 4329 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 4330 | reply.recycle(); |
| 4331 | data.recycle(); |
| 4332 | } |
| 4333 | |
| 4334 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 4335 | Parcel data = Parcel.obtain(); |
| 4336 | Parcel reply = Parcel.obtain(); |
| 4337 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4338 | app.writeToParcel(data, 0); |
| 4339 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4340 | reply.readException(); |
| 4341 | reply.recycle(); |
| 4342 | data.recycle(); |
| 4343 | } |
| 4344 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4345 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4346 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4347 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 4348 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4349 | Parcel data = Parcel.obtain(); |
| 4350 | Parcel reply = Parcel.obtain(); |
| 4351 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4352 | ComponentName.writeToParcel(className, data); |
| 4353 | data.writeString(profileFile); |
| 4354 | data.writeInt(flags); |
| 4355 | data.writeBundle(arguments); |
| 4356 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4357 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4358 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4359 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4360 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4361 | reply.readException(); |
| 4362 | boolean res = reply.readInt() != 0; |
| 4363 | reply.recycle(); |
| 4364 | data.recycle(); |
| 4365 | return res; |
| 4366 | } |
| 4367 | |
| 4368 | public void finishInstrumentation(IApplicationThread target, |
| 4369 | int resultCode, Bundle results) throws RemoteException { |
| 4370 | Parcel data = Parcel.obtain(); |
| 4371 | Parcel reply = Parcel.obtain(); |
| 4372 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4373 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 4374 | data.writeInt(resultCode); |
| 4375 | data.writeBundle(results); |
| 4376 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4377 | reply.readException(); |
| 4378 | data.recycle(); |
| 4379 | reply.recycle(); |
| 4380 | } |
| 4381 | public Configuration getConfiguration() throws RemoteException |
| 4382 | { |
| 4383 | Parcel data = Parcel.obtain(); |
| 4384 | Parcel reply = Parcel.obtain(); |
| 4385 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4386 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4387 | reply.readException(); |
| 4388 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 4389 | reply.recycle(); |
| 4390 | data.recycle(); |
| 4391 | return res; |
| 4392 | } |
| 4393 | public void updateConfiguration(Configuration values) throws RemoteException |
| 4394 | { |
| 4395 | Parcel data = Parcel.obtain(); |
| 4396 | Parcel reply = Parcel.obtain(); |
| 4397 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4398 | values.writeToParcel(data, 0); |
| 4399 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4400 | reply.readException(); |
| 4401 | data.recycle(); |
| 4402 | reply.recycle(); |
| 4403 | } |
| 4404 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 4405 | throws RemoteException { |
| 4406 | Parcel data = Parcel.obtain(); |
| 4407 | Parcel reply = Parcel.obtain(); |
| 4408 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4409 | data.writeStrongBinder(token); |
| 4410 | data.writeInt(requestedOrientation); |
| 4411 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4412 | reply.readException(); |
| 4413 | data.recycle(); |
| 4414 | reply.recycle(); |
| 4415 | } |
| 4416 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 4417 | Parcel data = Parcel.obtain(); |
| 4418 | Parcel reply = Parcel.obtain(); |
| 4419 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4420 | data.writeStrongBinder(token); |
| 4421 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4422 | reply.readException(); |
| 4423 | int res = reply.readInt(); |
| 4424 | data.recycle(); |
| 4425 | reply.recycle(); |
| 4426 | return res; |
| 4427 | } |
| 4428 | public ComponentName getActivityClassForToken(IBinder token) |
| 4429 | throws RemoteException { |
| 4430 | Parcel data = Parcel.obtain(); |
| 4431 | Parcel reply = Parcel.obtain(); |
| 4432 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4433 | data.writeStrongBinder(token); |
| 4434 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4435 | reply.readException(); |
| 4436 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4437 | data.recycle(); |
| 4438 | reply.recycle(); |
| 4439 | return res; |
| 4440 | } |
| 4441 | public String getPackageForToken(IBinder token) throws RemoteException |
| 4442 | { |
| 4443 | Parcel data = Parcel.obtain(); |
| 4444 | Parcel reply = Parcel.obtain(); |
| 4445 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4446 | data.writeStrongBinder(token); |
| 4447 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4448 | reply.readException(); |
| 4449 | String res = reply.readString(); |
| 4450 | data.recycle(); |
| 4451 | reply.recycle(); |
| 4452 | return res; |
| 4453 | } |
| 4454 | public IIntentSender getIntentSender(int type, |
| 4455 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4456 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4457 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4458 | Parcel data = Parcel.obtain(); |
| 4459 | Parcel reply = Parcel.obtain(); |
| 4460 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4461 | data.writeInt(type); |
| 4462 | data.writeString(packageName); |
| 4463 | data.writeStrongBinder(token); |
| 4464 | data.writeString(resultWho); |
| 4465 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4466 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4467 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4468 | data.writeTypedArray(intents, 0); |
| 4469 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4470 | } else { |
| 4471 | data.writeInt(0); |
| 4472 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4473 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4474 | if (options != null) { |
| 4475 | data.writeInt(1); |
| 4476 | options.writeToParcel(data, 0); |
| 4477 | } else { |
| 4478 | data.writeInt(0); |
| 4479 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4480 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4481 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4482 | reply.readException(); |
| 4483 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4484 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4485 | data.recycle(); |
| 4486 | reply.recycle(); |
| 4487 | return res; |
| 4488 | } |
| 4489 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 4490 | Parcel data = Parcel.obtain(); |
| 4491 | Parcel reply = Parcel.obtain(); |
| 4492 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4493 | data.writeStrongBinder(sender.asBinder()); |
| 4494 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4495 | reply.readException(); |
| 4496 | data.recycle(); |
| 4497 | reply.recycle(); |
| 4498 | } |
| 4499 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 4500 | Parcel data = Parcel.obtain(); |
| 4501 | Parcel reply = Parcel.obtain(); |
| 4502 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4503 | data.writeStrongBinder(sender.asBinder()); |
| 4504 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4505 | reply.readException(); |
| 4506 | String res = reply.readString(); |
| 4507 | data.recycle(); |
| 4508 | reply.recycle(); |
| 4509 | return res; |
| 4510 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 4511 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 4512 | Parcel data = Parcel.obtain(); |
| 4513 | Parcel reply = Parcel.obtain(); |
| 4514 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4515 | data.writeStrongBinder(sender.asBinder()); |
| 4516 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4517 | reply.readException(); |
| 4518 | int res = reply.readInt(); |
| 4519 | data.recycle(); |
| 4520 | reply.recycle(); |
| 4521 | return res; |
| 4522 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4523 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 4524 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 4525 | Parcel data = Parcel.obtain(); |
| 4526 | Parcel reply = Parcel.obtain(); |
| 4527 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4528 | data.writeInt(callingPid); |
| 4529 | data.writeInt(callingUid); |
| 4530 | data.writeInt(userId); |
| 4531 | data.writeInt(allowAll ? 1 : 0); |
| 4532 | data.writeInt(requireFull ? 1 : 0); |
| 4533 | data.writeString(name); |
| 4534 | data.writeString(callerPackage); |
| 4535 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 4536 | reply.readException(); |
| 4537 | int res = reply.readInt(); |
| 4538 | data.recycle(); |
| 4539 | reply.recycle(); |
| 4540 | return res; |
| 4541 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4542 | public void setProcessLimit(int max) throws RemoteException |
| 4543 | { |
| 4544 | Parcel data = Parcel.obtain(); |
| 4545 | Parcel reply = Parcel.obtain(); |
| 4546 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4547 | data.writeInt(max); |
| 4548 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4549 | reply.readException(); |
| 4550 | data.recycle(); |
| 4551 | reply.recycle(); |
| 4552 | } |
| 4553 | public int getProcessLimit() throws RemoteException |
| 4554 | { |
| 4555 | Parcel data = Parcel.obtain(); |
| 4556 | Parcel reply = Parcel.obtain(); |
| 4557 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4558 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4559 | reply.readException(); |
| 4560 | int res = reply.readInt(); |
| 4561 | data.recycle(); |
| 4562 | reply.recycle(); |
| 4563 | return res; |
| 4564 | } |
| 4565 | public void setProcessForeground(IBinder token, int pid, |
| 4566 | boolean isForeground) throws RemoteException { |
| 4567 | Parcel data = Parcel.obtain(); |
| 4568 | Parcel reply = Parcel.obtain(); |
| 4569 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4570 | data.writeStrongBinder(token); |
| 4571 | data.writeInt(pid); |
| 4572 | data.writeInt(isForeground ? 1 : 0); |
| 4573 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4574 | reply.readException(); |
| 4575 | data.recycle(); |
| 4576 | reply.recycle(); |
| 4577 | } |
| 4578 | public int checkPermission(String permission, int pid, int uid) |
| 4579 | throws RemoteException { |
| 4580 | Parcel data = Parcel.obtain(); |
| 4581 | Parcel reply = Parcel.obtain(); |
| 4582 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4583 | data.writeString(permission); |
| 4584 | data.writeInt(pid); |
| 4585 | data.writeInt(uid); |
| 4586 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4587 | reply.readException(); |
| 4588 | int res = reply.readInt(); |
| 4589 | data.recycle(); |
| 4590 | reply.recycle(); |
| 4591 | return res; |
| 4592 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4593 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4594 | throws RemoteException { |
| 4595 | Parcel data = Parcel.obtain(); |
| 4596 | Parcel reply = Parcel.obtain(); |
| 4597 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4598 | data.writeString(permission); |
| 4599 | data.writeInt(pid); |
| 4600 | data.writeInt(uid); |
| 4601 | data.writeStrongBinder(callerToken); |
| 4602 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4603 | reply.readException(); |
| 4604 | int res = reply.readInt(); |
| 4605 | data.recycle(); |
| 4606 | reply.recycle(); |
| 4607 | return res; |
| 4608 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4609 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4610 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4611 | Parcel data = Parcel.obtain(); |
| 4612 | Parcel reply = Parcel.obtain(); |
| 4613 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4614 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4615 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4616 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4617 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4618 | reply.readException(); |
| 4619 | boolean res = reply.readInt() != 0; |
| 4620 | data.recycle(); |
| 4621 | reply.recycle(); |
| 4622 | return res; |
| 4623 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4624 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4625 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4626 | Parcel data = Parcel.obtain(); |
| 4627 | Parcel reply = Parcel.obtain(); |
| 4628 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4629 | uri.writeToParcel(data, 0); |
| 4630 | data.writeInt(pid); |
| 4631 | data.writeInt(uid); |
| 4632 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4633 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4634 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4635 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4636 | reply.readException(); |
| 4637 | int res = reply.readInt(); |
| 4638 | data.recycle(); |
| 4639 | reply.recycle(); |
| 4640 | return res; |
| 4641 | } |
| 4642 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4643 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4644 | Parcel data = Parcel.obtain(); |
| 4645 | Parcel reply = Parcel.obtain(); |
| 4646 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4647 | data.writeStrongBinder(caller.asBinder()); |
| 4648 | data.writeString(targetPkg); |
| 4649 | uri.writeToParcel(data, 0); |
| 4650 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4651 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4652 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4653 | reply.readException(); |
| 4654 | data.recycle(); |
| 4655 | reply.recycle(); |
| 4656 | } |
| 4657 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4658 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4659 | Parcel data = Parcel.obtain(); |
| 4660 | Parcel reply = Parcel.obtain(); |
| 4661 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4662 | data.writeStrongBinder(caller.asBinder()); |
| 4663 | uri.writeToParcel(data, 0); |
| 4664 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4665 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4666 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4667 | reply.readException(); |
| 4668 | data.recycle(); |
| 4669 | reply.recycle(); |
| 4670 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4671 | |
| 4672 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4673 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4674 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4675 | Parcel data = Parcel.obtain(); |
| 4676 | Parcel reply = Parcel.obtain(); |
| 4677 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4678 | uri.writeToParcel(data, 0); |
| 4679 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4680 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4681 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4682 | reply.readException(); |
| 4683 | data.recycle(); |
| 4684 | reply.recycle(); |
| 4685 | } |
| 4686 | |
| 4687 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4688 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4689 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4690 | Parcel data = Parcel.obtain(); |
| 4691 | Parcel reply = Parcel.obtain(); |
| 4692 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4693 | uri.writeToParcel(data, 0); |
| 4694 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4695 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4696 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4697 | reply.readException(); |
| 4698 | data.recycle(); |
| 4699 | reply.recycle(); |
| 4700 | } |
| 4701 | |
| 4702 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4703 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4704 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4705 | Parcel data = Parcel.obtain(); |
| 4706 | Parcel reply = Parcel.obtain(); |
| 4707 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4708 | data.writeString(packageName); |
| 4709 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4710 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4711 | reply.readException(); |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4712 | @SuppressWarnings("unchecked") |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4713 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4714 | reply); |
| 4715 | data.recycle(); |
| 4716 | reply.recycle(); |
| 4717 | return perms; |
| 4718 | } |
| 4719 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4720 | @Override |
| 4721 | public ParceledListSlice<UriPermission> getGrantedUriPermissions(String packageName, int userId) |
| 4722 | throws RemoteException { |
| 4723 | Parcel data = Parcel.obtain(); |
| 4724 | Parcel reply = Parcel.obtain(); |
| 4725 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4726 | data.writeString(packageName); |
| 4727 | data.writeInt(userId); |
| 4728 | mRemote.transact(GET_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4729 | reply.readException(); |
| 4730 | @SuppressWarnings("unchecked") |
| 4731 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4732 | reply); |
| 4733 | data.recycle(); |
| 4734 | reply.recycle(); |
| 4735 | return perms; |
| 4736 | } |
| 4737 | |
| 4738 | @Override |
| 4739 | public void clearGrantedUriPermissions(String packageName, int userId) throws RemoteException { |
| 4740 | Parcel data = Parcel.obtain(); |
| 4741 | Parcel reply = Parcel.obtain(); |
| 4742 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4743 | data.writeString(packageName); |
| 4744 | data.writeInt(userId); |
| 4745 | mRemote.transact(CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4746 | reply.readException(); |
| 4747 | data.recycle(); |
| 4748 | reply.recycle(); |
| 4749 | } |
| 4750 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4751 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4752 | throws RemoteException { |
| 4753 | Parcel data = Parcel.obtain(); |
| 4754 | Parcel reply = Parcel.obtain(); |
| 4755 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4756 | data.writeStrongBinder(who.asBinder()); |
| 4757 | data.writeInt(waiting ? 1 : 0); |
| 4758 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4759 | reply.readException(); |
| 4760 | data.recycle(); |
| 4761 | reply.recycle(); |
| 4762 | } |
| 4763 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4764 | Parcel data = Parcel.obtain(); |
| 4765 | Parcel reply = Parcel.obtain(); |
| 4766 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4767 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4768 | reply.readException(); |
| 4769 | outInfo.readFromParcel(reply); |
| 4770 | data.recycle(); |
| 4771 | reply.recycle(); |
| 4772 | } |
| 4773 | public void unhandledBack() throws RemoteException |
| 4774 | { |
| 4775 | Parcel data = Parcel.obtain(); |
| 4776 | Parcel reply = Parcel.obtain(); |
| 4777 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4778 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4779 | reply.readException(); |
| 4780 | data.recycle(); |
| 4781 | reply.recycle(); |
| 4782 | } |
| 4783 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4784 | { |
| 4785 | Parcel data = Parcel.obtain(); |
| 4786 | Parcel reply = Parcel.obtain(); |
| 4787 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4788 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4789 | reply.readException(); |
| 4790 | ParcelFileDescriptor pfd = null; |
| 4791 | if (reply.readInt() != 0) { |
| 4792 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4793 | } |
| 4794 | data.recycle(); |
| 4795 | reply.recycle(); |
| 4796 | return pfd; |
| 4797 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4798 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4799 | { |
| 4800 | Parcel data = Parcel.obtain(); |
| 4801 | Parcel reply = Parcel.obtain(); |
| 4802 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4803 | data.writeInt(shown ? 1 : 0); |
| 4804 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4805 | reply.readException(); |
| 4806 | data.recycle(); |
| 4807 | reply.recycle(); |
| 4808 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4809 | public void setDebugApp( |
| 4810 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4811 | throws RemoteException |
| 4812 | { |
| 4813 | Parcel data = Parcel.obtain(); |
| 4814 | Parcel reply = Parcel.obtain(); |
| 4815 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4816 | data.writeString(packageName); |
| 4817 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4818 | data.writeInt(persistent ? 1 : 0); |
| 4819 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4820 | reply.readException(); |
| 4821 | data.recycle(); |
| 4822 | reply.recycle(); |
| 4823 | } |
| 4824 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4825 | { |
| 4826 | Parcel data = Parcel.obtain(); |
| 4827 | Parcel reply = Parcel.obtain(); |
| 4828 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4829 | data.writeInt(enabled ? 1 : 0); |
| 4830 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4831 | reply.readException(); |
| 4832 | data.recycle(); |
| 4833 | reply.recycle(); |
| 4834 | } |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4835 | public void setActivityController(IActivityController watcher) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4836 | { |
| 4837 | Parcel data = Parcel.obtain(); |
| 4838 | Parcel reply = Parcel.obtain(); |
| 4839 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4840 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4841 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4842 | reply.readException(); |
| 4843 | data.recycle(); |
| 4844 | reply.recycle(); |
| 4845 | } |
| 4846 | public void enterSafeMode() throws RemoteException { |
| 4847 | Parcel data = Parcel.obtain(); |
| 4848 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4849 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4850 | data.recycle(); |
| 4851 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4852 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4853 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4854 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4855 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4856 | data.writeStrongBinder(sender.asBinder()); |
| 4857 | data.writeInt(sourceUid); |
| 4858 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4859 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4860 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4861 | data.recycle(); |
| 4862 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4863 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 4864 | throws RemoteException { |
| 4865 | Parcel data = Parcel.obtain(); |
| 4866 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4867 | data.writeStrongBinder(sender.asBinder()); |
| 4868 | data.writeInt(sourceUid); |
| 4869 | data.writeString(tag); |
| 4870 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 4871 | data.recycle(); |
| 4872 | } |
| 4873 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 4874 | throws RemoteException { |
| 4875 | Parcel data = Parcel.obtain(); |
| 4876 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4877 | data.writeStrongBinder(sender.asBinder()); |
| 4878 | data.writeInt(sourceUid); |
| 4879 | data.writeString(tag); |
| 4880 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 4881 | data.recycle(); |
| 4882 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4883 | 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] | 4884 | Parcel data = Parcel.obtain(); |
| 4885 | Parcel reply = Parcel.obtain(); |
| 4886 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4887 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4888 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4889 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4890 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 4891 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4892 | boolean res = reply.readInt() != 0; |
| 4893 | data.recycle(); |
| 4894 | reply.recycle(); |
| 4895 | return res; |
| 4896 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 4897 | @Override |
| 4898 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 4899 | Parcel data = Parcel.obtain(); |
| 4900 | Parcel reply = Parcel.obtain(); |
| 4901 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4902 | data.writeString(reason); |
| 4903 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4904 | boolean res = reply.readInt() != 0; |
| 4905 | data.recycle(); |
| 4906 | reply.recycle(); |
| 4907 | return res; |
| 4908 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4909 | public boolean testIsSystemReady() |
| 4910 | { |
| 4911 | /* this base class version is never called */ |
| 4912 | return true; |
| 4913 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4914 | public void handleApplicationCrash(IBinder app, |
| 4915 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 4916 | { |
| 4917 | Parcel data = Parcel.obtain(); |
| 4918 | Parcel reply = Parcel.obtain(); |
| 4919 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4920 | data.writeStrongBinder(app); |
| 4921 | crashInfo.writeToParcel(data, 0); |
| 4922 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 4923 | reply.readException(); |
| 4924 | reply.recycle(); |
| 4925 | data.recycle(); |
| 4926 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4927 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4928 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4929 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4930 | { |
| 4931 | Parcel data = Parcel.obtain(); |
| 4932 | Parcel reply = Parcel.obtain(); |
| 4933 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4934 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4935 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4936 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4937 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4938 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4939 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4940 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4941 | reply.recycle(); |
| 4942 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4943 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4944 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4945 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4946 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4947 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4948 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4949 | { |
| 4950 | Parcel data = Parcel.obtain(); |
| 4951 | Parcel reply = Parcel.obtain(); |
| 4952 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4953 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4954 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4955 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4956 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 4957 | reply.readException(); |
| 4958 | reply.recycle(); |
| 4959 | data.recycle(); |
| 4960 | } |
| 4961 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4962 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 4963 | Parcel data = Parcel.obtain(); |
| 4964 | Parcel reply = Parcel.obtain(); |
| 4965 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4966 | data.writeInt(sig); |
| 4967 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 4968 | reply.readException(); |
| 4969 | data.recycle(); |
| 4970 | reply.recycle(); |
| 4971 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4972 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4973 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4974 | Parcel data = Parcel.obtain(); |
| 4975 | Parcel reply = Parcel.obtain(); |
| 4976 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4977 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4978 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4979 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4980 | reply.readException(); |
| 4981 | data.recycle(); |
| 4982 | reply.recycle(); |
| 4983 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4984 | |
| 4985 | public void killAllBackgroundProcesses() throws RemoteException { |
| 4986 | Parcel data = Parcel.obtain(); |
| 4987 | Parcel reply = Parcel.obtain(); |
| 4988 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4989 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4990 | reply.readException(); |
| 4991 | data.recycle(); |
| 4992 | reply.recycle(); |
| 4993 | } |
| 4994 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 4995 | public void killPackageDependents(String packageName, int userId) throws RemoteException { |
| 4996 | Parcel data = Parcel.obtain(); |
| 4997 | Parcel reply = Parcel.obtain(); |
| 4998 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4999 | data.writeString(packageName); |
| 5000 | data.writeInt(userId); |
| 5001 | mRemote.transact(KILL_PACKAGE_DEPENDENTS_TRANSACTION, data, reply, 0); |
| 5002 | reply.readException(); |
| 5003 | data.recycle(); |
| 5004 | reply.recycle(); |
| 5005 | } |
| 5006 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5007 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5008 | Parcel data = Parcel.obtain(); |
| 5009 | Parcel reply = Parcel.obtain(); |
| 5010 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5011 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5012 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5013 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5014 | reply.readException(); |
| 5015 | data.recycle(); |
| 5016 | reply.recycle(); |
| 5017 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5018 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 5019 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 5020 | throws RemoteException |
| 5021 | { |
| 5022 | Parcel data = Parcel.obtain(); |
| 5023 | Parcel reply = Parcel.obtain(); |
| 5024 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5025 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 5026 | reply.readException(); |
| 5027 | outInfo.readFromParcel(reply); |
| 5028 | reply.recycle(); |
| 5029 | data.recycle(); |
| 5030 | } |
| 5031 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5032 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 5033 | { |
| 5034 | Parcel data = Parcel.obtain(); |
| 5035 | Parcel reply = Parcel.obtain(); |
| 5036 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5037 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5038 | reply.readException(); |
| 5039 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 5040 | reply.recycle(); |
| 5041 | data.recycle(); |
| 5042 | return res; |
| 5043 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5044 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5045 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5046 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5047 | { |
| 5048 | Parcel data = Parcel.obtain(); |
| 5049 | Parcel reply = Parcel.obtain(); |
| 5050 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5051 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5052 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5053 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 5054 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5055 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5056 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5057 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5058 | } else { |
| 5059 | data.writeInt(0); |
| 5060 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5061 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 5062 | reply.readException(); |
| 5063 | boolean res = reply.readInt() != 0; |
| 5064 | reply.recycle(); |
| 5065 | data.recycle(); |
| 5066 | return res; |
| 5067 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5068 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 5069 | public boolean shutdown(int timeout) throws RemoteException |
| 5070 | { |
| 5071 | Parcel data = Parcel.obtain(); |
| 5072 | Parcel reply = Parcel.obtain(); |
| 5073 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5074 | data.writeInt(timeout); |
| 5075 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 5076 | reply.readException(); |
| 5077 | boolean res = reply.readInt() != 0; |
| 5078 | reply.recycle(); |
| 5079 | data.recycle(); |
| 5080 | return res; |
| 5081 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5082 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5083 | public void stopAppSwitches() throws RemoteException { |
| 5084 | Parcel data = Parcel.obtain(); |
| 5085 | Parcel reply = Parcel.obtain(); |
| 5086 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5087 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5088 | reply.readException(); |
| 5089 | reply.recycle(); |
| 5090 | data.recycle(); |
| 5091 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5092 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5093 | public void resumeAppSwitches() throws RemoteException { |
| 5094 | Parcel data = Parcel.obtain(); |
| 5095 | Parcel reply = Parcel.obtain(); |
| 5096 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5097 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5098 | reply.readException(); |
| 5099 | reply.recycle(); |
| 5100 | data.recycle(); |
| 5101 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 5102 | |
| 5103 | public void addPackageDependency(String packageName) throws RemoteException { |
| 5104 | Parcel data = Parcel.obtain(); |
| 5105 | Parcel reply = Parcel.obtain(); |
| 5106 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5107 | data.writeString(packageName); |
| 5108 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 5109 | reply.readException(); |
| 5110 | data.recycle(); |
| 5111 | reply.recycle(); |
| 5112 | } |
| 5113 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5114 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 5115 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5116 | Parcel data = Parcel.obtain(); |
| 5117 | Parcel reply = Parcel.obtain(); |
| 5118 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5119 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5120 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5121 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5122 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5123 | reply.readException(); |
| 5124 | data.recycle(); |
| 5125 | reply.recycle(); |
| 5126 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5127 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 5128 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 5129 | Parcel data = Parcel.obtain(); |
| 5130 | Parcel reply = Parcel.obtain(); |
| 5131 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5132 | data.writeString(reason); |
| 5133 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 5134 | reply.readException(); |
| 5135 | data.recycle(); |
| 5136 | reply.recycle(); |
| 5137 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5138 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5139 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5140 | throws RemoteException { |
| 5141 | Parcel data = Parcel.obtain(); |
| 5142 | Parcel reply = Parcel.obtain(); |
| 5143 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5144 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5145 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 5146 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5147 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5148 | data.recycle(); |
| 5149 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5150 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5151 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 5152 | |
| 5153 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 5154 | Parcel data = Parcel.obtain(); |
| 5155 | Parcel reply = Parcel.obtain(); |
| 5156 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5157 | data.writeString(processName); |
| 5158 | data.writeInt(uid); |
| 5159 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 5160 | reply.readException(); |
| 5161 | data.recycle(); |
| 5162 | reply.recycle(); |
| 5163 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5164 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 5165 | public void overridePendingTransition(IBinder token, String packageName, |
| 5166 | int enterAnim, int exitAnim) throws RemoteException { |
| 5167 | Parcel data = Parcel.obtain(); |
| 5168 | Parcel reply = Parcel.obtain(); |
| 5169 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5170 | data.writeStrongBinder(token); |
| 5171 | data.writeString(packageName); |
| 5172 | data.writeInt(enterAnim); |
| 5173 | data.writeInt(exitAnim); |
| 5174 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 5175 | reply.readException(); |
| 5176 | data.recycle(); |
| 5177 | reply.recycle(); |
| 5178 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5179 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 5180 | public boolean isUserAMonkey() throws RemoteException { |
| 5181 | Parcel data = Parcel.obtain(); |
| 5182 | Parcel reply = Parcel.obtain(); |
| 5183 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5184 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 5185 | reply.readException(); |
| 5186 | boolean res = reply.readInt() != 0; |
| 5187 | data.recycle(); |
| 5188 | reply.recycle(); |
| 5189 | return res; |
| 5190 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 5191 | |
| 5192 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 5193 | Parcel data = Parcel.obtain(); |
| 5194 | Parcel reply = Parcel.obtain(); |
| 5195 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5196 | data.writeInt(monkey ? 1 : 0); |
| 5197 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 5198 | reply.readException(); |
| 5199 | data.recycle(); |
| 5200 | reply.recycle(); |
| 5201 | } |
| 5202 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 5203 | public void finishHeavyWeightApp() throws RemoteException { |
| 5204 | Parcel data = Parcel.obtain(); |
| 5205 | Parcel reply = Parcel.obtain(); |
| 5206 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5207 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 5208 | reply.readException(); |
| 5209 | data.recycle(); |
| 5210 | reply.recycle(); |
| 5211 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5212 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5213 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5214 | throws RemoteException { |
| 5215 | Parcel data = Parcel.obtain(); |
| 5216 | Parcel reply = Parcel.obtain(); |
| 5217 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5218 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5219 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 5220 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5221 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5222 | data.recycle(); |
| 5223 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5224 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5225 | } |
| 5226 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5227 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5228 | throws RemoteException { |
| 5229 | Parcel data = Parcel.obtain(); |
| 5230 | Parcel reply = Parcel.obtain(); |
| 5231 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5232 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5233 | if (options == null) { |
| 5234 | data.writeInt(0); |
| 5235 | } else { |
| 5236 | data.writeInt(1); |
| 5237 | data.writeBundle(options.toBundle()); |
| 5238 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5239 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5240 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5241 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5242 | data.recycle(); |
| 5243 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5244 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5245 | } |
| 5246 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5247 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 5248 | Parcel data = Parcel.obtain(); |
| 5249 | Parcel reply = Parcel.obtain(); |
| 5250 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5251 | data.writeStrongBinder(token); |
| 5252 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 5253 | reply.readException(); |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 5254 | ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle()); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5255 | data.recycle(); |
| 5256 | reply.recycle(); |
| 5257 | return options; |
| 5258 | } |
| 5259 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5260 | public void setImmersive(IBinder token, boolean immersive) |
| 5261 | throws RemoteException { |
| 5262 | Parcel data = Parcel.obtain(); |
| 5263 | Parcel reply = Parcel.obtain(); |
| 5264 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5265 | data.writeStrongBinder(token); |
| 5266 | data.writeInt(immersive ? 1 : 0); |
| 5267 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 5268 | reply.readException(); |
| 5269 | data.recycle(); |
| 5270 | reply.recycle(); |
| 5271 | } |
| 5272 | |
| 5273 | public boolean isImmersive(IBinder token) |
| 5274 | throws RemoteException { |
| 5275 | Parcel data = Parcel.obtain(); |
| 5276 | Parcel reply = Parcel.obtain(); |
| 5277 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5278 | data.writeStrongBinder(token); |
| 5279 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5280 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5281 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5282 | data.recycle(); |
| 5283 | reply.recycle(); |
| 5284 | return res; |
| 5285 | } |
| 5286 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5287 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 5288 | Parcel data = Parcel.obtain(); |
| 5289 | Parcel reply = Parcel.obtain(); |
| 5290 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5291 | data.writeStrongBinder(token); |
| 5292 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 5293 | reply.readException(); |
| 5294 | boolean res = reply.readInt() == 1; |
| 5295 | data.recycle(); |
| 5296 | reply.recycle(); |
| 5297 | return res; |
| 5298 | } |
| 5299 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5300 | public boolean isTopActivityImmersive() |
| 5301 | throws RemoteException { |
| 5302 | Parcel data = Parcel.obtain(); |
| 5303 | Parcel reply = Parcel.obtain(); |
| 5304 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5305 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5306 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5307 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5308 | data.recycle(); |
| 5309 | reply.recycle(); |
| 5310 | return res; |
| 5311 | } |
| 5312 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 5313 | public void crashApplication(int uid, int initialPid, String packageName, |
| 5314 | String message) throws RemoteException { |
| 5315 | Parcel data = Parcel.obtain(); |
| 5316 | Parcel reply = Parcel.obtain(); |
| 5317 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5318 | data.writeInt(uid); |
| 5319 | data.writeInt(initialPid); |
| 5320 | data.writeString(packageName); |
| 5321 | data.writeString(message); |
| 5322 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 5323 | reply.readException(); |
| 5324 | data.recycle(); |
| 5325 | reply.recycle(); |
| 5326 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5327 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5328 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5329 | Parcel data = Parcel.obtain(); |
| 5330 | Parcel reply = Parcel.obtain(); |
| 5331 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5332 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5333 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5334 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 5335 | reply.readException(); |
| 5336 | String res = reply.readString(); |
| 5337 | data.recycle(); |
| 5338 | reply.recycle(); |
| 5339 | return res; |
| 5340 | } |
| 5341 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5342 | public IBinder newUriPermissionOwner(String name) |
| 5343 | throws RemoteException { |
| 5344 | Parcel data = Parcel.obtain(); |
| 5345 | Parcel reply = Parcel.obtain(); |
| 5346 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5347 | data.writeString(name); |
| 5348 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 5349 | reply.readException(); |
| 5350 | IBinder res = reply.readStrongBinder(); |
| 5351 | data.recycle(); |
| 5352 | reply.recycle(); |
| 5353 | return res; |
| 5354 | } |
| 5355 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 5356 | public IBinder getUriPermissionOwnerForActivity(IBinder activityToken) throws RemoteException { |
| 5357 | Parcel data = Parcel.obtain(); |
| 5358 | Parcel reply = Parcel.obtain(); |
| 5359 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5360 | data.writeStrongBinder(activityToken); |
| 5361 | mRemote.transact(GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5362 | reply.readException(); |
| 5363 | IBinder res = reply.readStrongBinder(); |
| 5364 | data.recycle(); |
| 5365 | reply.recycle(); |
| 5366 | return res; |
| 5367 | } |
| 5368 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5369 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5370 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5371 | Parcel data = Parcel.obtain(); |
| 5372 | Parcel reply = Parcel.obtain(); |
| 5373 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5374 | data.writeStrongBinder(owner); |
| 5375 | data.writeInt(fromUid); |
| 5376 | data.writeString(targetPkg); |
| 5377 | uri.writeToParcel(data, 0); |
| 5378 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5379 | data.writeInt(sourceUserId); |
| 5380 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5381 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5382 | reply.readException(); |
| 5383 | data.recycle(); |
| 5384 | reply.recycle(); |
| 5385 | } |
| 5386 | |
| 5387 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5388 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5389 | Parcel data = Parcel.obtain(); |
| 5390 | Parcel reply = Parcel.obtain(); |
| 5391 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5392 | data.writeStrongBinder(owner); |
| 5393 | if (uri != null) { |
| 5394 | data.writeInt(1); |
| 5395 | uri.writeToParcel(data, 0); |
| 5396 | } else { |
| 5397 | data.writeInt(0); |
| 5398 | } |
| 5399 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5400 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5401 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5402 | reply.readException(); |
| 5403 | data.recycle(); |
| 5404 | reply.recycle(); |
| 5405 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 5406 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5407 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5408 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5409 | Parcel data = Parcel.obtain(); |
| 5410 | Parcel reply = Parcel.obtain(); |
| 5411 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5412 | data.writeInt(callingUid); |
| 5413 | data.writeString(targetPkg); |
| 5414 | uri.writeToParcel(data, 0); |
| 5415 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5416 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5417 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5418 | reply.readException(); |
| 5419 | int res = reply.readInt(); |
| 5420 | data.recycle(); |
| 5421 | reply.recycle(); |
| 5422 | return res; |
| 5423 | } |
| 5424 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5425 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5426 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 5427 | Parcel data = Parcel.obtain(); |
| 5428 | Parcel reply = Parcel.obtain(); |
| 5429 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5430 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5431 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5432 | data.writeInt(managed ? 1 : 0); |
| 5433 | data.writeString(path); |
| 5434 | if (fd != null) { |
| 5435 | data.writeInt(1); |
| 5436 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5437 | } else { |
| 5438 | data.writeInt(0); |
| 5439 | } |
| 5440 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 5441 | reply.readException(); |
| 5442 | boolean res = reply.readInt() != 0; |
| 5443 | reply.recycle(); |
| 5444 | data.recycle(); |
| 5445 | return res; |
| 5446 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5447 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5448 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5449 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5450 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5451 | Parcel data = Parcel.obtain(); |
| 5452 | Parcel reply = Parcel.obtain(); |
| 5453 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5454 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5455 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5456 | data.writeTypedArray(intents, 0); |
| 5457 | data.writeStringArray(resolvedTypes); |
| 5458 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5459 | if (options != null) { |
| 5460 | data.writeInt(1); |
| 5461 | options.writeToParcel(data, 0); |
| 5462 | } else { |
| 5463 | data.writeInt(0); |
| 5464 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5465 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5466 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 5467 | reply.readException(); |
| 5468 | int result = reply.readInt(); |
| 5469 | reply.recycle(); |
| 5470 | data.recycle(); |
| 5471 | return result; |
| 5472 | } |
| 5473 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5474 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 5475 | Parcel data = Parcel.obtain(); |
| 5476 | Parcel reply = Parcel.obtain(); |
| 5477 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5478 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5479 | reply.readException(); |
| 5480 | int mode = reply.readInt(); |
| 5481 | reply.recycle(); |
| 5482 | data.recycle(); |
| 5483 | return mode; |
| 5484 | } |
| 5485 | |
| 5486 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 5487 | Parcel data = Parcel.obtain(); |
| 5488 | Parcel reply = Parcel.obtain(); |
| 5489 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5490 | data.writeInt(mode); |
| 5491 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5492 | reply.readException(); |
| 5493 | reply.recycle(); |
| 5494 | data.recycle(); |
| 5495 | } |
| 5496 | |
| 5497 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 5498 | Parcel data = Parcel.obtain(); |
| 5499 | Parcel reply = Parcel.obtain(); |
| 5500 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5501 | data.writeString(packageName); |
| 5502 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5503 | reply.readException(); |
| 5504 | int mode = reply.readInt(); |
| 5505 | reply.recycle(); |
| 5506 | data.recycle(); |
| 5507 | return mode; |
| 5508 | } |
| 5509 | |
| 5510 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5511 | throws RemoteException { |
| 5512 | Parcel data = Parcel.obtain(); |
| 5513 | Parcel reply = Parcel.obtain(); |
| 5514 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5515 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5516 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5517 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5518 | reply.readException(); |
| 5519 | reply.recycle(); |
| 5520 | data.recycle(); |
| 5521 | } |
| 5522 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5523 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 5524 | Parcel data = Parcel.obtain(); |
| 5525 | Parcel reply = Parcel.obtain(); |
| 5526 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5527 | data.writeString(packageName); |
| 5528 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5529 | reply.readException(); |
| 5530 | boolean ask = reply.readInt() != 0; |
| 5531 | reply.recycle(); |
| 5532 | data.recycle(); |
| 5533 | return ask; |
| 5534 | } |
| 5535 | |
| 5536 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 5537 | throws RemoteException { |
| 5538 | Parcel data = Parcel.obtain(); |
| 5539 | Parcel reply = Parcel.obtain(); |
| 5540 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5541 | data.writeString(packageName); |
| 5542 | data.writeInt(ask ? 1 : 0); |
| 5543 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5544 | reply.readException(); |
| 5545 | reply.recycle(); |
| 5546 | data.recycle(); |
| 5547 | } |
| 5548 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5549 | public boolean switchUser(int userid) throws RemoteException { |
| 5550 | Parcel data = Parcel.obtain(); |
| 5551 | Parcel reply = Parcel.obtain(); |
| 5552 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5553 | data.writeInt(userid); |
| 5554 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 5555 | reply.readException(); |
| 5556 | boolean result = reply.readInt() != 0; |
| 5557 | reply.recycle(); |
| 5558 | data.recycle(); |
| 5559 | return result; |
| 5560 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5561 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 5562 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 5563 | Parcel data = Parcel.obtain(); |
| 5564 | Parcel reply = Parcel.obtain(); |
| 5565 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5566 | data.writeInt(userid); |
| 5567 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 5568 | reply.readException(); |
| 5569 | boolean result = reply.readInt() != 0; |
| 5570 | reply.recycle(); |
| 5571 | data.recycle(); |
| 5572 | return result; |
| 5573 | } |
| 5574 | |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5575 | public boolean unlockUser(int userId, byte[] token, byte[] secret) throws RemoteException { |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5576 | Parcel data = Parcel.obtain(); |
| 5577 | Parcel reply = Parcel.obtain(); |
| 5578 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5579 | data.writeInt(userId); |
| 5580 | data.writeByteArray(token); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5581 | data.writeByteArray(secret); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5582 | mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0); |
| 5583 | reply.readException(); |
| 5584 | boolean result = reply.readInt() != 0; |
| 5585 | reply.recycle(); |
| 5586 | data.recycle(); |
| 5587 | return result; |
| 5588 | } |
| 5589 | |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5590 | public int stopUser(int userid, boolean force, IStopUserCallback callback) |
| 5591 | throws RemoteException { |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5592 | Parcel data = Parcel.obtain(); |
| 5593 | Parcel reply = Parcel.obtain(); |
| 5594 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5595 | data.writeInt(userid); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5596 | data.writeInt(force ? 1 : 0); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5597 | data.writeStrongInterface(callback); |
| 5598 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 5599 | reply.readException(); |
| 5600 | int result = reply.readInt(); |
| 5601 | reply.recycle(); |
| 5602 | data.recycle(); |
| 5603 | return result; |
| 5604 | } |
| 5605 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5606 | public UserInfo getCurrentUser() throws RemoteException { |
| 5607 | Parcel data = Parcel.obtain(); |
| 5608 | Parcel reply = Parcel.obtain(); |
| 5609 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5610 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5611 | reply.readException(); |
| 5612 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 5613 | reply.recycle(); |
| 5614 | data.recycle(); |
| 5615 | return userInfo; |
| 5616 | } |
| 5617 | |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5618 | public boolean isUserRunning(int userid, int flags) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5619 | Parcel data = Parcel.obtain(); |
| 5620 | Parcel reply = Parcel.obtain(); |
| 5621 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5622 | data.writeInt(userid); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5623 | data.writeInt(flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5624 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5625 | reply.readException(); |
| 5626 | boolean result = reply.readInt() != 0; |
| 5627 | reply.recycle(); |
| 5628 | data.recycle(); |
| 5629 | return result; |
| 5630 | } |
| 5631 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5632 | public int[] getRunningUserIds() throws RemoteException { |
| 5633 | Parcel data = Parcel.obtain(); |
| 5634 | Parcel reply = Parcel.obtain(); |
| 5635 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5636 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5637 | reply.readException(); |
| 5638 | int[] result = reply.createIntArray(); |
| 5639 | reply.recycle(); |
| 5640 | data.recycle(); |
| 5641 | return result; |
| 5642 | } |
| 5643 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5644 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5645 | Parcel data = Parcel.obtain(); |
| 5646 | Parcel reply = Parcel.obtain(); |
| 5647 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5648 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5649 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5650 | reply.readException(); |
| 5651 | boolean result = reply.readInt() != 0; |
| 5652 | reply.recycle(); |
| 5653 | data.recycle(); |
| 5654 | return result; |
| 5655 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5656 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5657 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5658 | Parcel data = Parcel.obtain(); |
| 5659 | Parcel reply = Parcel.obtain(); |
| 5660 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5661 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5662 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5663 | reply.readException(); |
| 5664 | data.recycle(); |
| 5665 | reply.recycle(); |
| 5666 | } |
| 5667 | |
| 5668 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5669 | Parcel data = Parcel.obtain(); |
| 5670 | Parcel reply = Parcel.obtain(); |
| 5671 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5672 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5673 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5674 | reply.readException(); |
| 5675 | data.recycle(); |
| 5676 | reply.recycle(); |
| 5677 | } |
| 5678 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5679 | public void registerUidObserver(IUidObserver observer, int which) throws RemoteException { |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5680 | Parcel data = Parcel.obtain(); |
| 5681 | Parcel reply = Parcel.obtain(); |
| 5682 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5683 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5684 | data.writeInt(which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5685 | mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5686 | reply.readException(); |
| 5687 | data.recycle(); |
| 5688 | reply.recycle(); |
| 5689 | } |
| 5690 | |
| 5691 | public void unregisterUidObserver(IUidObserver observer) throws RemoteException { |
| 5692 | Parcel data = Parcel.obtain(); |
| 5693 | Parcel reply = Parcel.obtain(); |
| 5694 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5695 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5696 | mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5697 | reply.readException(); |
| 5698 | data.recycle(); |
| 5699 | reply.recycle(); |
| 5700 | } |
| 5701 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5702 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5703 | Parcel data = Parcel.obtain(); |
| 5704 | Parcel reply = Parcel.obtain(); |
| 5705 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5706 | data.writeStrongBinder(sender.asBinder()); |
| 5707 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5708 | reply.readException(); |
| 5709 | boolean res = reply.readInt() != 0; |
| 5710 | data.recycle(); |
| 5711 | reply.recycle(); |
| 5712 | return res; |
| 5713 | } |
| 5714 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5715 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5716 | Parcel data = Parcel.obtain(); |
| 5717 | Parcel reply = Parcel.obtain(); |
| 5718 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5719 | data.writeStrongBinder(sender.asBinder()); |
| 5720 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5721 | reply.readException(); |
| 5722 | boolean res = reply.readInt() != 0; |
| 5723 | data.recycle(); |
| 5724 | reply.recycle(); |
| 5725 | return res; |
| 5726 | } |
| 5727 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5728 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5729 | Parcel data = Parcel.obtain(); |
| 5730 | Parcel reply = Parcel.obtain(); |
| 5731 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5732 | data.writeStrongBinder(sender.asBinder()); |
| 5733 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5734 | reply.readException(); |
| 5735 | Intent res = reply.readInt() != 0 |
| 5736 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5737 | data.recycle(); |
| 5738 | reply.recycle(); |
| 5739 | return res; |
| 5740 | } |
| 5741 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5742 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5743 | throws RemoteException { |
| 5744 | Parcel data = Parcel.obtain(); |
| 5745 | Parcel reply = Parcel.obtain(); |
| 5746 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5747 | data.writeStrongBinder(sender.asBinder()); |
| 5748 | data.writeString(prefix); |
| 5749 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5750 | reply.readException(); |
| 5751 | String res = reply.readString(); |
| 5752 | data.recycle(); |
| 5753 | reply.recycle(); |
| 5754 | return res; |
| 5755 | } |
| 5756 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5757 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5758 | { |
| 5759 | Parcel data = Parcel.obtain(); |
| 5760 | Parcel reply = Parcel.obtain(); |
| 5761 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5762 | values.writeToParcel(data, 0); |
| 5763 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5764 | reply.readException(); |
| 5765 | data.recycle(); |
| 5766 | reply.recycle(); |
| 5767 | } |
| 5768 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 5769 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 5770 | Parcel data = Parcel.obtain(); |
| 5771 | Parcel reply = Parcel.obtain(); |
| 5772 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5773 | data.writeIntArray(pids); |
| 5774 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 5775 | reply.readException(); |
| 5776 | long[] res = reply.createLongArray(); |
| 5777 | data.recycle(); |
| 5778 | reply.recycle(); |
| 5779 | return res; |
| 5780 | } |
| 5781 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5782 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5783 | Parcel data = Parcel.obtain(); |
| 5784 | Parcel reply = Parcel.obtain(); |
| 5785 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5786 | TextUtils.writeToParcel(msg, data, 0); |
| 5787 | data.writeInt(always ? 1 : 0); |
| 5788 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5789 | reply.readException(); |
| 5790 | data.recycle(); |
| 5791 | reply.recycle(); |
| 5792 | } |
| 5793 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5794 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5795 | Parcel data = Parcel.obtain(); |
| 5796 | Parcel reply = Parcel.obtain(); |
| 5797 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5798 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5799 | reply.readException(); |
| 5800 | data.recycle(); |
| 5801 | reply.recycle(); |
| 5802 | } |
| 5803 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5804 | public void keyguardGoingAway(boolean disableWindowAnimations, |
| 5805 | boolean keyguardGoingToNotificationShade) throws RemoteException { |
| 5806 | Parcel data = Parcel.obtain(); |
| 5807 | Parcel reply = Parcel.obtain(); |
| 5808 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5809 | data.writeInt(disableWindowAnimations ? 1 : 0); |
| 5810 | data.writeInt(keyguardGoingToNotificationShade ? 1 : 0); |
| 5811 | mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0); |
| 5812 | reply.readException(); |
| 5813 | data.recycle(); |
| 5814 | reply.recycle(); |
| 5815 | } |
| 5816 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5817 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5818 | throws RemoteException { |
| 5819 | Parcel data = Parcel.obtain(); |
| 5820 | Parcel reply = Parcel.obtain(); |
| 5821 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5822 | data.writeStrongBinder(token); |
| 5823 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5824 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5825 | reply.readException(); |
| 5826 | boolean result = reply.readInt() != 0; |
| 5827 | data.recycle(); |
| 5828 | reply.recycle(); |
| 5829 | return result; |
| 5830 | } |
| 5831 | |
| 5832 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5833 | throws RemoteException { |
| 5834 | Parcel data = Parcel.obtain(); |
| 5835 | Parcel reply = Parcel.obtain(); |
| 5836 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5837 | data.writeStrongBinder(token); |
| 5838 | target.writeToParcel(data, 0); |
| 5839 | data.writeInt(resultCode); |
| 5840 | if (resultData != null) { |
| 5841 | data.writeInt(1); |
| 5842 | resultData.writeToParcel(data, 0); |
| 5843 | } else { |
| 5844 | data.writeInt(0); |
| 5845 | } |
| 5846 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5847 | reply.readException(); |
| 5848 | boolean result = reply.readInt() != 0; |
| 5849 | data.recycle(); |
| 5850 | reply.recycle(); |
| 5851 | return result; |
| 5852 | } |
| 5853 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5854 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5855 | Parcel data = Parcel.obtain(); |
| 5856 | Parcel reply = Parcel.obtain(); |
| 5857 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5858 | data.writeStrongBinder(activityToken); |
| 5859 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5860 | reply.readException(); |
| 5861 | int result = reply.readInt(); |
| 5862 | data.recycle(); |
| 5863 | reply.recycle(); |
| 5864 | return result; |
| 5865 | } |
| 5866 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5867 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 5868 | Parcel data = Parcel.obtain(); |
| 5869 | Parcel reply = Parcel.obtain(); |
| 5870 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5871 | data.writeStrongBinder(activityToken); |
| 5872 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 5873 | reply.readException(); |
| 5874 | String result = reply.readString(); |
| 5875 | data.recycle(); |
| 5876 | reply.recycle(); |
| 5877 | return result; |
| 5878 | } |
| 5879 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 5880 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5881 | Parcel data = Parcel.obtain(); |
| 5882 | Parcel reply = Parcel.obtain(); |
| 5883 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5884 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5885 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5886 | reply.readException(); |
| 5887 | data.recycle(); |
| 5888 | reply.recycle(); |
| 5889 | } |
| 5890 | |
| 5891 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5892 | Parcel data = Parcel.obtain(); |
| 5893 | Parcel reply = Parcel.obtain(); |
| 5894 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5895 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5896 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5897 | reply.readException(); |
| 5898 | data.recycle(); |
| 5899 | reply.recycle(); |
| 5900 | } |
| 5901 | |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 5902 | public void requestBugReport(@ActivityManager.BugreportMode int bugreportType) |
| 5903 | throws RemoteException { |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5904 | Parcel data = Parcel.obtain(); |
| 5905 | Parcel reply = Parcel.obtain(); |
| 5906 | data.writeInterfaceToken(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 5907 | data.writeInt(bugreportType); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5908 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 5909 | reply.readException(); |
| 5910 | data.recycle(); |
| 5911 | reply.recycle(); |
| 5912 | } |
| 5913 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5914 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 5915 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5916 | Parcel data = Parcel.obtain(); |
| 5917 | Parcel reply = Parcel.obtain(); |
| 5918 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5919 | data.writeInt(pid); |
| 5920 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5921 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5922 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 5923 | reply.readException(); |
| 5924 | long res = reply.readInt(); |
| 5925 | data.recycle(); |
| 5926 | reply.recycle(); |
| 5927 | return res; |
| 5928 | } |
| 5929 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5930 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5931 | Parcel data = Parcel.obtain(); |
| 5932 | Parcel reply = Parcel.obtain(); |
| 5933 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5934 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5935 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5936 | reply.readException(); |
| 5937 | Bundle res = reply.readBundle(); |
| 5938 | data.recycle(); |
| 5939 | reply.recycle(); |
| 5940 | return res; |
| 5941 | } |
| 5942 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5943 | public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, |
| 5944 | IBinder activityToken) throws RemoteException { |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5945 | Parcel data = Parcel.obtain(); |
| 5946 | Parcel reply = Parcel.obtain(); |
| 5947 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5948 | data.writeInt(requestType); |
| 5949 | data.writeStrongBinder(receiver.asBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5950 | data.writeStrongBinder(activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5951 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 5952 | reply.readException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5953 | boolean res = reply.readInt() != 0; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5954 | data.recycle(); |
| 5955 | reply.recycle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5956 | return res; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5957 | } |
| 5958 | |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 5959 | public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 5960 | AssistContent content, Uri referrer) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5961 | Parcel data = Parcel.obtain(); |
| 5962 | Parcel reply = Parcel.obtain(); |
| 5963 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5964 | data.writeStrongBinder(token); |
| 5965 | data.writeBundle(extras); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 5966 | structure.writeToParcel(data, 0); |
| 5967 | content.writeToParcel(data, 0); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 5968 | if (referrer != null) { |
| 5969 | data.writeInt(1); |
| 5970 | referrer.writeToParcel(data, 0); |
| 5971 | } else { |
| 5972 | data.writeInt(0); |
| 5973 | } |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5974 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5975 | reply.readException(); |
| 5976 | data.recycle(); |
| 5977 | reply.recycle(); |
| 5978 | } |
| 5979 | |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 5980 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, |
| 5981 | Bundle args) throws RemoteException { |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 5982 | Parcel data = Parcel.obtain(); |
| 5983 | Parcel reply = Parcel.obtain(); |
| 5984 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5985 | intent.writeToParcel(data, 0); |
| 5986 | data.writeInt(requestType); |
| 5987 | data.writeString(hint); |
| 5988 | data.writeInt(userHandle); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 5989 | data.writeBundle(args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 5990 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 5991 | reply.readException(); |
| 5992 | boolean res = reply.readInt() != 0; |
| 5993 | data.recycle(); |
| 5994 | reply.recycle(); |
| 5995 | return res; |
| 5996 | } |
| 5997 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5998 | public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException { |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 5999 | Parcel data = Parcel.obtain(); |
| 6000 | Parcel reply = Parcel.obtain(); |
| 6001 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6002 | mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6003 | reply.readException(); |
| 6004 | boolean res = reply.readInt() != 0; |
| 6005 | data.recycle(); |
| 6006 | reply.recycle(); |
| 6007 | return res; |
| 6008 | } |
| 6009 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6010 | public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException { |
| 6011 | Parcel data = Parcel.obtain(); |
| 6012 | Parcel reply = Parcel.obtain(); |
| 6013 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6014 | data.writeStrongBinder(token); |
| 6015 | data.writeBundle(args); |
| 6016 | mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6017 | reply.readException(); |
| 6018 | boolean res = reply.readInt() != 0; |
| 6019 | data.recycle(); |
| 6020 | reply.recycle(); |
| 6021 | return res; |
| 6022 | } |
| 6023 | |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6024 | public void killUid(int appId, int userId, String reason) throws RemoteException { |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6025 | Parcel data = Parcel.obtain(); |
| 6026 | Parcel reply = Parcel.obtain(); |
| 6027 | data.writeInterfaceToken(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6028 | data.writeInt(appId); |
| 6029 | data.writeInt(userId); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6030 | data.writeString(reason); |
| 6031 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 6032 | reply.readException(); |
| 6033 | data.recycle(); |
| 6034 | reply.recycle(); |
| 6035 | } |
| 6036 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 6037 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 6038 | Parcel data = Parcel.obtain(); |
| 6039 | Parcel reply = Parcel.obtain(); |
| 6040 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6041 | data.writeStrongBinder(who); |
| 6042 | data.writeInt(allowRestart ? 1 : 0); |
| 6043 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 6044 | reply.readException(); |
| 6045 | data.recycle(); |
| 6046 | reply.recycle(); |
| 6047 | } |
| 6048 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 6049 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 6050 | Parcel data = Parcel.obtain(); |
| 6051 | Parcel reply = Parcel.obtain(); |
| 6052 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6053 | data.writeStrongBinder(token); |
| 6054 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 6055 | reply.readException(); |
| 6056 | data.recycle(); |
| 6057 | reply.recycle(); |
| 6058 | } |
| 6059 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 6060 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 6061 | Parcel data = Parcel.obtain(); |
| 6062 | Parcel reply = Parcel.obtain(); |
| 6063 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6064 | data.writeStrongBinder(token); |
| 6065 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 6066 | reply.readException(); |
| 6067 | data.recycle(); |
| 6068 | reply.recycle(); |
| 6069 | } |
| 6070 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 6071 | public void restart() throws RemoteException { |
| 6072 | Parcel data = Parcel.obtain(); |
| 6073 | Parcel reply = Parcel.obtain(); |
| 6074 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6075 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 6076 | reply.readException(); |
| 6077 | data.recycle(); |
| 6078 | reply.recycle(); |
| 6079 | } |
| 6080 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 6081 | public void performIdleMaintenance() throws RemoteException { |
| 6082 | Parcel data = Parcel.obtain(); |
| 6083 | Parcel reply = Parcel.obtain(); |
| 6084 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6085 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 6086 | reply.readException(); |
| 6087 | data.recycle(); |
| 6088 | reply.recycle(); |
| 6089 | } |
| 6090 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6091 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6092 | IActivityContainerCallback callback) throws RemoteException { |
| 6093 | Parcel data = Parcel.obtain(); |
| 6094 | Parcel reply = Parcel.obtain(); |
| 6095 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6096 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 6097 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6098 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6099 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 6100 | final int result = reply.readInt(); |
| 6101 | final IActivityContainer res; |
| 6102 | if (result == 1) { |
| 6103 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6104 | } else { |
| 6105 | res = null; |
| 6106 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6107 | data.recycle(); |
| 6108 | reply.recycle(); |
| 6109 | return res; |
| 6110 | } |
| 6111 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 6112 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 6113 | throws RemoteException { |
| 6114 | Parcel data = Parcel.obtain(); |
| 6115 | Parcel reply = Parcel.obtain(); |
| 6116 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6117 | data.writeStrongBinder(activityContainer.asBinder()); |
| 6118 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 6119 | reply.readException(); |
| 6120 | data.recycle(); |
| 6121 | reply.recycle(); |
| 6122 | } |
| 6123 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 6124 | public boolean startBinderTracking() throws RemoteException { |
| 6125 | Parcel data = Parcel.obtain(); |
| 6126 | Parcel reply = Parcel.obtain(); |
| 6127 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6128 | mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0); |
| 6129 | reply.readException(); |
| 6130 | boolean res = reply.readInt() != 0; |
| 6131 | reply.recycle(); |
| 6132 | data.recycle(); |
| 6133 | return res; |
| 6134 | } |
| 6135 | |
| 6136 | public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException { |
| 6137 | Parcel data = Parcel.obtain(); |
| 6138 | Parcel reply = Parcel.obtain(); |
| 6139 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6140 | if (fd != null) { |
| 6141 | data.writeInt(1); |
| 6142 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 6143 | } else { |
| 6144 | data.writeInt(0); |
| 6145 | } |
| 6146 | mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0); |
| 6147 | reply.readException(); |
| 6148 | boolean res = reply.readInt() != 0; |
| 6149 | reply.recycle(); |
| 6150 | data.recycle(); |
| 6151 | return res; |
| 6152 | } |
| 6153 | |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6154 | public void setVrMode(IBinder token, boolean enabled) throws RemoteException { |
| 6155 | Parcel data = Parcel.obtain(); |
| 6156 | Parcel reply = Parcel.obtain(); |
| 6157 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6158 | data.writeStrongBinder(token); |
| 6159 | data.writeInt(enabled ? 1 : 0); |
| 6160 | mRemote.transact(SET_VR_MODE_TRANSACTION, data, reply, 0); |
| 6161 | reply.readException(); |
| 6162 | data.recycle(); |
| 6163 | reply.recycle(); |
| 6164 | } |
| 6165 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6166 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 6167 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 6168 | Parcel data = Parcel.obtain(); |
| 6169 | Parcel reply = Parcel.obtain(); |
| 6170 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6171 | data.writeInt(displayId); |
| 6172 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 6173 | reply.readException(); |
| 6174 | final int result = reply.readInt(); |
| 6175 | final IActivityContainer res; |
| 6176 | if (result == 1) { |
| 6177 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6178 | } else { |
| 6179 | res = null; |
| 6180 | } |
| 6181 | data.recycle(); |
| 6182 | reply.recycle(); |
| 6183 | return res; |
| 6184 | } |
| 6185 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6186 | @Override |
| 6187 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6188 | throws RemoteException { |
| 6189 | Parcel data = Parcel.obtain(); |
| 6190 | Parcel reply = Parcel.obtain(); |
| 6191 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6192 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6193 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6194 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6195 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6196 | data.recycle(); |
| 6197 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6198 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6199 | } |
| 6200 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6201 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6202 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 6203 | Parcel data = Parcel.obtain(); |
| 6204 | Parcel reply = Parcel.obtain(); |
| 6205 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6206 | data.writeInt(taskId); |
| 6207 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 6208 | reply.readException(); |
| 6209 | data.recycle(); |
| 6210 | reply.recycle(); |
| 6211 | } |
| 6212 | |
| 6213 | @Override |
| 6214 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 6215 | Parcel data = Parcel.obtain(); |
| 6216 | Parcel reply = Parcel.obtain(); |
| 6217 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6218 | data.writeStrongBinder(token); |
| 6219 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 6220 | reply.readException(); |
| 6221 | data.recycle(); |
| 6222 | reply.recycle(); |
| 6223 | } |
| 6224 | |
| 6225 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6226 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 6227 | Parcel data = Parcel.obtain(); |
| 6228 | Parcel reply = Parcel.obtain(); |
| 6229 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6230 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6231 | reply.readException(); |
| 6232 | data.recycle(); |
| 6233 | reply.recycle(); |
| 6234 | } |
| 6235 | |
| 6236 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6237 | public void stopLockTaskMode() throws RemoteException { |
| 6238 | Parcel data = Parcel.obtain(); |
| 6239 | Parcel reply = Parcel.obtain(); |
| 6240 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6241 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6242 | reply.readException(); |
| 6243 | data.recycle(); |
| 6244 | reply.recycle(); |
| 6245 | } |
| 6246 | |
| 6247 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6248 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 6249 | Parcel data = Parcel.obtain(); |
| 6250 | Parcel reply = Parcel.obtain(); |
| 6251 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6252 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6253 | reply.readException(); |
| 6254 | data.recycle(); |
| 6255 | reply.recycle(); |
| 6256 | } |
| 6257 | |
| 6258 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6259 | public boolean isInLockTaskMode() throws RemoteException { |
| 6260 | Parcel data = Parcel.obtain(); |
| 6261 | Parcel reply = Parcel.obtain(); |
| 6262 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6263 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6264 | reply.readException(); |
| 6265 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 6266 | data.recycle(); |
| 6267 | reply.recycle(); |
| 6268 | return isInLockTaskMode; |
| 6269 | } |
| 6270 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 6271 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 6272 | public int getLockTaskModeState() throws RemoteException { |
| 6273 | Parcel data = Parcel.obtain(); |
| 6274 | Parcel reply = Parcel.obtain(); |
| 6275 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6276 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 6277 | reply.readException(); |
| 6278 | int lockTaskModeState = reply.readInt(); |
| 6279 | data.recycle(); |
| 6280 | reply.recycle(); |
| 6281 | return lockTaskModeState; |
| 6282 | } |
| 6283 | |
| 6284 | @Override |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 6285 | public void showLockTaskEscapeMessage(IBinder token) throws RemoteException { |
| 6286 | Parcel data = Parcel.obtain(); |
| 6287 | Parcel reply = Parcel.obtain(); |
| 6288 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6289 | data.writeStrongBinder(token); |
| 6290 | mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply, |
| 6291 | IBinder.FLAG_ONEWAY); |
| 6292 | reply.readException(); |
| 6293 | data.recycle(); |
| 6294 | reply.recycle(); |
| 6295 | } |
| 6296 | |
| 6297 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 6298 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6299 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6300 | Parcel data = Parcel.obtain(); |
| 6301 | Parcel reply = Parcel.obtain(); |
| 6302 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6303 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6304 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6305 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6306 | reply.readException(); |
| 6307 | data.recycle(); |
| 6308 | reply.recycle(); |
| 6309 | } |
| 6310 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6311 | @Override |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6312 | public void setTaskResizeable(int taskId, int resizeableMode) throws RemoteException { |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6313 | Parcel data = Parcel.obtain(); |
| 6314 | Parcel reply = Parcel.obtain(); |
| 6315 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6316 | data.writeInt(taskId); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6317 | data.writeInt(resizeableMode); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6318 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6319 | reply.readException(); |
| 6320 | data.recycle(); |
| 6321 | reply.recycle(); |
| 6322 | } |
| 6323 | |
| 6324 | @Override |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6325 | public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6326 | { |
| 6327 | Parcel data = Parcel.obtain(); |
| 6328 | Parcel reply = Parcel.obtain(); |
| 6329 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6330 | data.writeInt(taskId); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6331 | data.writeInt(resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6332 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6333 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6334 | reply.readException(); |
| 6335 | data.recycle(); |
| 6336 | reply.recycle(); |
| 6337 | } |
| 6338 | |
| 6339 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 6340 | public Rect getTaskBounds(int taskId) throws RemoteException |
| 6341 | { |
| 6342 | Parcel data = Parcel.obtain(); |
| 6343 | Parcel reply = Parcel.obtain(); |
| 6344 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6345 | data.writeInt(taskId); |
| 6346 | mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0); |
| 6347 | reply.readException(); |
| 6348 | Rect rect = Rect.CREATOR.createFromParcel(reply); |
| 6349 | data.recycle(); |
| 6350 | reply.recycle(); |
| 6351 | return rect; |
| 6352 | } |
| 6353 | |
| 6354 | @Override |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6355 | public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException { |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6356 | Parcel data = Parcel.obtain(); |
| 6357 | Parcel reply = Parcel.obtain(); |
| 6358 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6359 | data.writeString(filename); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6360 | data.writeInt(userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6361 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 6362 | reply.readException(); |
| 6363 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 6364 | data.recycle(); |
| 6365 | reply.recycle(); |
| 6366 | return icon; |
| 6367 | } |
| 6368 | |
| 6369 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6370 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 6371 | throws RemoteException { |
| 6372 | Parcel data = Parcel.obtain(); |
| 6373 | Parcel reply = Parcel.obtain(); |
| 6374 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6375 | if (options == null) { |
| 6376 | data.writeInt(0); |
| 6377 | } else { |
| 6378 | data.writeInt(1); |
| 6379 | data.writeBundle(options.toBundle()); |
| 6380 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6381 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6382 | reply.readException(); |
| 6383 | data.recycle(); |
| 6384 | reply.recycle(); |
| 6385 | } |
| 6386 | |
| 6387 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6388 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6389 | Parcel data = Parcel.obtain(); |
| 6390 | Parcel reply = Parcel.obtain(); |
| 6391 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6392 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6393 | data.writeInt(visible ? 1 : 0); |
| 6394 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6395 | reply.readException(); |
| 6396 | boolean success = reply.readInt() > 0; |
| 6397 | data.recycle(); |
| 6398 | reply.recycle(); |
| 6399 | return success; |
| 6400 | } |
| 6401 | |
| 6402 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6403 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6404 | Parcel data = Parcel.obtain(); |
| 6405 | Parcel reply = Parcel.obtain(); |
| 6406 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6407 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6408 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6409 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6410 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6411 | data.recycle(); |
| 6412 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6413 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6414 | } |
| 6415 | |
| 6416 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6417 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6418 | Parcel data = Parcel.obtain(); |
| 6419 | Parcel reply = Parcel.obtain(); |
| 6420 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6421 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6422 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 6423 | reply.readException(); |
| 6424 | data.recycle(); |
| 6425 | reply.recycle(); |
| 6426 | } |
| 6427 | |
| 6428 | @Override |
| 6429 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 6430 | Parcel data = Parcel.obtain(); |
| 6431 | Parcel reply = Parcel.obtain(); |
| 6432 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6433 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6434 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6435 | reply.readException(); |
| 6436 | data.recycle(); |
| 6437 | reply.recycle(); |
| 6438 | } |
| 6439 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6440 | @Override |
| 6441 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 6442 | Parcel data = Parcel.obtain(); |
| 6443 | Parcel reply = Parcel.obtain(); |
| 6444 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6445 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6446 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6447 | reply.readException(); |
| 6448 | data.recycle(); |
| 6449 | reply.recycle(); |
| 6450 | } |
| 6451 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 6452 | @Override |
| 6453 | public void bootAnimationComplete() throws RemoteException { |
| 6454 | Parcel data = Parcel.obtain(); |
| 6455 | Parcel reply = Parcel.obtain(); |
| 6456 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6457 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 6458 | reply.readException(); |
| 6459 | data.recycle(); |
| 6460 | reply.recycle(); |
| 6461 | } |
| 6462 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 6463 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 6464 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 6465 | Parcel data = Parcel.obtain(); |
| 6466 | Parcel reply = Parcel.obtain(); |
| 6467 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6468 | data.writeInt(uid); |
| 6469 | data.writeByteArray(firstPacket); |
| 6470 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 6471 | reply.readException(); |
| 6472 | data.recycle(); |
| 6473 | reply.recycle(); |
| 6474 | } |
| 6475 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6476 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6477 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 6478 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6479 | Parcel data = Parcel.obtain(); |
| 6480 | Parcel reply = Parcel.obtain(); |
| 6481 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6482 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6483 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6484 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6485 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6486 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 6487 | reply.readException(); |
| 6488 | data.recycle(); |
| 6489 | reply.recycle(); |
| 6490 | } |
| 6491 | |
| 6492 | @Override |
| 6493 | public void dumpHeapFinished(String path) throws RemoteException { |
| 6494 | Parcel data = Parcel.obtain(); |
| 6495 | Parcel reply = Parcel.obtain(); |
| 6496 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6497 | data.writeString(path); |
| 6498 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 6499 | reply.readException(); |
| 6500 | data.recycle(); |
| 6501 | reply.recycle(); |
| 6502 | } |
| 6503 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 6504 | @Override |
| 6505 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 6506 | throws RemoteException { |
| 6507 | Parcel data = Parcel.obtain(); |
| 6508 | Parcel reply = Parcel.obtain(); |
| 6509 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6510 | data.writeStrongBinder(session.asBinder()); |
| 6511 | data.writeInt(keepAwake ? 1 : 0); |
| 6512 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 6513 | reply.readException(); |
| 6514 | data.recycle(); |
| 6515 | reply.recycle(); |
| 6516 | } |
| 6517 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6518 | @Override |
| 6519 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 6520 | Parcel data = Parcel.obtain(); |
| 6521 | Parcel reply = Parcel.obtain(); |
| 6522 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6523 | data.writeInt(userId); |
| 6524 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6525 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6526 | reply.readException(); |
| 6527 | data.recycle(); |
| 6528 | reply.recycle(); |
| 6529 | } |
| 6530 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6531 | @Override |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 6532 | public void updateDeviceOwner(String packageName) throws RemoteException { |
| 6533 | Parcel data = Parcel.obtain(); |
| 6534 | Parcel reply = Parcel.obtain(); |
| 6535 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6536 | data.writeString(packageName); |
| 6537 | mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0); |
| 6538 | reply.readException(); |
| 6539 | data.recycle(); |
| 6540 | reply.recycle(); |
| 6541 | } |
| 6542 | |
| 6543 | @Override |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6544 | public int getPackageProcessState(String packageName, String callingPackage) |
| 6545 | throws RemoteException { |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6546 | Parcel data = Parcel.obtain(); |
| 6547 | Parcel reply = Parcel.obtain(); |
| 6548 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6549 | data.writeString(packageName); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6550 | data.writeString(callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6551 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 6552 | reply.readException(); |
| 6553 | int res = reply.readInt(); |
| 6554 | data.recycle(); |
| 6555 | reply.recycle(); |
| 6556 | return res; |
| 6557 | } |
| 6558 | |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 6559 | @Override |
| 6560 | public boolean setProcessMemoryTrimLevel(String process, int userId, int level) |
| 6561 | throws RemoteException { |
| 6562 | Parcel data = Parcel.obtain(); |
| 6563 | Parcel reply = Parcel.obtain(); |
| 6564 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6565 | data.writeString(process); |
| 6566 | data.writeInt(userId); |
| 6567 | data.writeInt(level); |
| 6568 | mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0); |
| 6569 | reply.readException(); |
| 6570 | int res = reply.readInt(); |
| 6571 | data.recycle(); |
| 6572 | reply.recycle(); |
| 6573 | return res != 0; |
| 6574 | } |
| 6575 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 6576 | @Override |
| 6577 | public boolean isRootVoiceInteraction(IBinder token) throws RemoteException { |
| 6578 | Parcel data = Parcel.obtain(); |
| 6579 | Parcel reply = Parcel.obtain(); |
| 6580 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6581 | data.writeStrongBinder(token); |
| 6582 | mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 6583 | reply.readException(); |
| 6584 | int res = reply.readInt(); |
| 6585 | data.recycle(); |
| 6586 | reply.recycle(); |
| 6587 | return res != 0; |
| 6588 | } |
| 6589 | |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6590 | @Override |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6591 | public void exitFreeformMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6592 | Parcel data = Parcel.obtain(); |
| 6593 | Parcel reply = Parcel.obtain(); |
| 6594 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6595 | data.writeStrongBinder(token); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6596 | mRemote.transact(EXIT_FREEFORM_MODE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6597 | reply.readException(); |
| 6598 | data.recycle(); |
| 6599 | reply.recycle(); |
| 6600 | } |
| 6601 | |
| 6602 | @Override |
| 6603 | public int getActivityStackId(IBinder token) throws RemoteException { |
| 6604 | Parcel data = Parcel.obtain(); |
| 6605 | Parcel reply = Parcel.obtain(); |
| 6606 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6607 | data.writeStrongBinder(token); |
| 6608 | mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0); |
| 6609 | reply.readException(); |
| 6610 | int stackId = reply.readInt(); |
| 6611 | data.recycle(); |
| 6612 | reply.recycle(); |
| 6613 | return stackId; |
| 6614 | } |
| 6615 | |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6616 | @Override |
| 6617 | public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration, |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6618 | int[] verticalSizeConfigurations, int[] smallestSizeConfigurations) |
| 6619 | throws RemoteException { |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6620 | Parcel data = Parcel.obtain(); |
| 6621 | Parcel reply = Parcel.obtain(); |
| 6622 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6623 | data.writeStrongBinder(token); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6624 | writeIntArray(horizontalSizeConfiguration, data); |
| 6625 | writeIntArray(verticalSizeConfigurations, data); |
| 6626 | writeIntArray(smallestSizeConfigurations, data); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6627 | mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0); |
| 6628 | reply.readException(); |
| 6629 | data.recycle(); |
| 6630 | reply.recycle(); |
| 6631 | } |
| 6632 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6633 | private static void writeIntArray(int[] array, Parcel data) { |
| 6634 | if (array == null) { |
| 6635 | data.writeInt(0); |
| 6636 | } else { |
| 6637 | data.writeInt(array.length); |
| 6638 | data.writeIntArray(array); |
| 6639 | } |
| 6640 | } |
| 6641 | |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 6642 | @Override |
| 6643 | public void suppressResizeConfigChanges(boolean suppress) throws RemoteException { |
| 6644 | Parcel data = Parcel.obtain(); |
| 6645 | Parcel reply = Parcel.obtain(); |
| 6646 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6647 | data.writeInt(suppress ? 1 : 0); |
| 6648 | mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0); |
| 6649 | reply.readException(); |
| 6650 | data.recycle(); |
| 6651 | reply.recycle(); |
| 6652 | } |
| 6653 | |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6654 | @Override |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6655 | public void moveTasksToFullscreenStack(int fromStackId, boolean onTop) throws RemoteException { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6656 | Parcel data = Parcel.obtain(); |
| 6657 | Parcel reply = Parcel.obtain(); |
| 6658 | data.writeInterfaceToken(IActivityManager.descriptor); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6659 | data.writeInt(fromStackId); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6660 | data.writeInt(onTop ? 1 : 0); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6661 | mRemote.transact(MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION, data, reply, 0); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6662 | reply.readException(); |
| 6663 | data.recycle(); |
| 6664 | reply.recycle(); |
| 6665 | } |
| 6666 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6667 | @Override |
| 6668 | public int getAppStartMode(int uid, String packageName) throws RemoteException { |
| 6669 | Parcel data = Parcel.obtain(); |
| 6670 | Parcel reply = Parcel.obtain(); |
| 6671 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6672 | data.writeInt(uid); |
| 6673 | data.writeString(packageName); |
| 6674 | mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0); |
| 6675 | reply.readException(); |
| 6676 | int res = reply.readInt(); |
| 6677 | data.recycle(); |
| 6678 | reply.recycle(); |
| 6679 | return res; |
| 6680 | } |
| 6681 | |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6682 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6683 | public boolean inMultiWindow(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6684 | Parcel data = Parcel.obtain(); |
| 6685 | Parcel reply = Parcel.obtain(); |
| 6686 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6687 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6688 | mRemote.transact(IN_MULTI_WINDOW_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6689 | reply.readException(); |
| 6690 | final boolean multiWindowMode = reply.readInt() == 1 ? true : false; |
| 6691 | data.recycle(); |
| 6692 | reply.recycle(); |
| 6693 | return multiWindowMode; |
| 6694 | } |
| 6695 | |
| 6696 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6697 | public boolean inPictureInPicture(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6698 | Parcel data = Parcel.obtain(); |
| 6699 | Parcel reply = Parcel.obtain(); |
| 6700 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6701 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6702 | mRemote.transact(IN_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6703 | reply.readException(); |
| 6704 | final boolean pipMode = reply.readInt() == 1 ? true : false; |
| 6705 | data.recycle(); |
| 6706 | reply.recycle(); |
| 6707 | return pipMode; |
| 6708 | } |
| 6709 | |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6710 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6711 | public void enterPictureInPicture(IBinder token) throws RemoteException { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6712 | Parcel data = Parcel.obtain(); |
| 6713 | Parcel reply = Parcel.obtain(); |
| 6714 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6715 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6716 | mRemote.transact(ENTER_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6717 | reply.readException(); |
| 6718 | data.recycle(); |
| 6719 | reply.recycle(); |
| 6720 | } |
| 6721 | |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 6722 | @Override |
| 6723 | public boolean isAppForeground(int uid) throws RemoteException { |
| 6724 | Parcel data = Parcel.obtain(); |
| 6725 | Parcel reply = Parcel.obtain(); |
| 6726 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6727 | data.writeInt(uid); |
| 6728 | mRemote.transact(IS_APP_FOREGROUND_TRANSACTION, data, reply, 0); |
| 6729 | final boolean isForeground = reply.readInt() == 1 ? true : false; |
| 6730 | data.recycle(); |
| 6731 | reply.recycle(); |
| 6732 | return isForeground; |
| 6733 | }; |
| 6734 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6735 | private IBinder mRemote; |
| 6736 | } |