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 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 318 | case START_NEXT_MATCHING_ACTIVITY_TRANSACTION: |
| 319 | { |
| 320 | data.enforceInterface(IActivityManager.descriptor); |
| 321 | IBinder callingActivity = data.readStrongBinder(); |
| 322 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 323 | Bundle options = data.readInt() != 0 |
| 324 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 325 | boolean result = startNextMatchingActivity(callingActivity, intent, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 326 | reply.writeNoException(); |
| 327 | reply.writeInt(result ? 1 : 0); |
| 328 | return true; |
| 329 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 330 | |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 331 | case START_ACTIVITY_FROM_RECENTS_TRANSACTION: |
| 332 | { |
| 333 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 334 | final int taskId = data.readInt(); |
| 335 | final int launchStackId = data.readInt(); |
| 336 | final Bundle options = |
| 337 | data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data); |
| 338 | final int result = startActivityFromRecents(taskId, launchStackId, options); |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 339 | reply.writeNoException(); |
| 340 | reply.writeInt(result); |
| 341 | return true; |
| 342 | } |
| 343 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 344 | case FINISH_ACTIVITY_TRANSACTION: { |
| 345 | data.enforceInterface(IActivityManager.descriptor); |
| 346 | IBinder token = data.readStrongBinder(); |
| 347 | Intent resultData = null; |
| 348 | int resultCode = data.readInt(); |
| 349 | if (data.readInt() != 0) { |
| 350 | resultData = Intent.CREATOR.createFromParcel(data); |
| 351 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 352 | int finishTask = data.readInt(); |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 353 | boolean res = finishActivity(token, resultCode, resultData, finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 354 | reply.writeNoException(); |
| 355 | reply.writeInt(res ? 1 : 0); |
| 356 | return true; |
| 357 | } |
| 358 | |
| 359 | case FINISH_SUB_ACTIVITY_TRANSACTION: { |
| 360 | data.enforceInterface(IActivityManager.descriptor); |
| 361 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 362 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 363 | int requestCode = data.readInt(); |
| 364 | finishSubActivity(token, resultWho, requestCode); |
| 365 | reply.writeNoException(); |
| 366 | return true; |
| 367 | } |
| 368 | |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 369 | case FINISH_ACTIVITY_AFFINITY_TRANSACTION: { |
| 370 | data.enforceInterface(IActivityManager.descriptor); |
| 371 | IBinder token = data.readStrongBinder(); |
| 372 | boolean res = finishActivityAffinity(token); |
| 373 | reply.writeNoException(); |
| 374 | reply.writeInt(res ? 1 : 0); |
| 375 | return true; |
| 376 | } |
| 377 | |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 378 | case FINISH_VOICE_TASK_TRANSACTION: { |
| 379 | data.enforceInterface(IActivityManager.descriptor); |
| 380 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 381 | data.readStrongBinder()); |
| 382 | finishVoiceTask(session); |
| 383 | reply.writeNoException(); |
| 384 | return true; |
| 385 | } |
| 386 | |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 387 | case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: { |
| 388 | data.enforceInterface(IActivityManager.descriptor); |
| 389 | IBinder token = data.readStrongBinder(); |
| 390 | boolean res = releaseActivityInstance(token); |
| 391 | reply.writeNoException(); |
| 392 | reply.writeInt(res ? 1 : 0); |
| 393 | return true; |
| 394 | } |
| 395 | |
| 396 | case RELEASE_SOME_ACTIVITIES_TRANSACTION: { |
| 397 | data.enforceInterface(IActivityManager.descriptor); |
| 398 | IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder()); |
| 399 | releaseSomeActivities(app); |
| 400 | reply.writeNoException(); |
| 401 | return true; |
| 402 | } |
| 403 | |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 404 | case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: { |
| 405 | data.enforceInterface(IActivityManager.descriptor); |
| 406 | IBinder token = data.readStrongBinder(); |
| 407 | boolean res = willActivityBeVisible(token); |
| 408 | reply.writeNoException(); |
| 409 | reply.writeInt(res ? 1 : 0); |
| 410 | return true; |
| 411 | } |
| 412 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 413 | case REGISTER_RECEIVER_TRANSACTION: |
| 414 | { |
| 415 | data.enforceInterface(IActivityManager.descriptor); |
| 416 | IBinder b = data.readStrongBinder(); |
| 417 | IApplicationThread app = |
| 418 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 419 | String packageName = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 420 | b = data.readStrongBinder(); |
| 421 | IIntentReceiver rec |
| 422 | = b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 423 | IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data); |
| 424 | String perm = data.readString(); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 425 | int userId = data.readInt(); |
| 426 | Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 427 | reply.writeNoException(); |
| 428 | if (intent != null) { |
| 429 | reply.writeInt(1); |
| 430 | intent.writeToParcel(reply, 0); |
| 431 | } else { |
| 432 | reply.writeInt(0); |
| 433 | } |
| 434 | return true; |
| 435 | } |
| 436 | |
| 437 | case UNREGISTER_RECEIVER_TRANSACTION: |
| 438 | { |
| 439 | data.enforceInterface(IActivityManager.descriptor); |
| 440 | IBinder b = data.readStrongBinder(); |
| 441 | if (b == null) { |
| 442 | return true; |
| 443 | } |
| 444 | IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b); |
| 445 | unregisterReceiver(rec); |
| 446 | reply.writeNoException(); |
| 447 | return true; |
| 448 | } |
| 449 | |
| 450 | case BROADCAST_INTENT_TRANSACTION: |
| 451 | { |
| 452 | data.enforceInterface(IActivityManager.descriptor); |
| 453 | IBinder b = data.readStrongBinder(); |
| 454 | IApplicationThread app = |
| 455 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 456 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 457 | String resolvedType = data.readString(); |
| 458 | b = data.readStrongBinder(); |
| 459 | IIntentReceiver resultTo = |
| 460 | b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 461 | int resultCode = data.readInt(); |
| 462 | String resultData = data.readString(); |
| 463 | Bundle resultExtras = data.readBundle(); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 464 | String[] perms = data.readStringArray(); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 465 | int appOp = data.readInt(); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 466 | Bundle options = data.readBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 467 | boolean serialized = data.readInt() != 0; |
| 468 | boolean sticky = data.readInt() != 0; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 469 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 470 | int res = broadcastIntent(app, intent, resolvedType, resultTo, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 471 | resultCode, resultData, resultExtras, perms, appOp, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 472 | options, serialized, sticky, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 473 | reply.writeNoException(); |
| 474 | reply.writeInt(res); |
| 475 | return true; |
| 476 | } |
| 477 | |
| 478 | case UNBROADCAST_INTENT_TRANSACTION: |
| 479 | { |
| 480 | data.enforceInterface(IActivityManager.descriptor); |
| 481 | IBinder b = data.readStrongBinder(); |
| 482 | IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 483 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 484 | int userId = data.readInt(); |
| 485 | unbroadcastIntent(app, intent, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 486 | reply.writeNoException(); |
| 487 | return true; |
| 488 | } |
| 489 | |
| 490 | case FINISH_RECEIVER_TRANSACTION: { |
| 491 | data.enforceInterface(IActivityManager.descriptor); |
| 492 | IBinder who = data.readStrongBinder(); |
| 493 | int resultCode = data.readInt(); |
| 494 | String resultData = data.readString(); |
| 495 | Bundle resultExtras = data.readBundle(); |
| 496 | boolean resultAbort = data.readInt() != 0; |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 497 | int intentFlags = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 498 | if (who != null) { |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 499 | finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 500 | } |
| 501 | reply.writeNoException(); |
| 502 | return true; |
| 503 | } |
| 504 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 505 | case ATTACH_APPLICATION_TRANSACTION: { |
| 506 | data.enforceInterface(IActivityManager.descriptor); |
| 507 | IApplicationThread app = ApplicationThreadNative.asInterface( |
| 508 | data.readStrongBinder()); |
| 509 | if (app != null) { |
| 510 | attachApplication(app); |
| 511 | } |
| 512 | reply.writeNoException(); |
| 513 | return true; |
| 514 | } |
| 515 | |
| 516 | case ACTIVITY_IDLE_TRANSACTION: { |
| 517 | data.enforceInterface(IActivityManager.descriptor); |
| 518 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 519 | Configuration config = null; |
| 520 | if (data.readInt() != 0) { |
| 521 | config = Configuration.CREATOR.createFromParcel(data); |
| 522 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 523 | boolean stopProfiling = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 524 | if (token != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 525 | activityIdle(token, config, stopProfiling); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 526 | } |
| 527 | reply.writeNoException(); |
| 528 | return true; |
| 529 | } |
| 530 | |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 531 | case ACTIVITY_RESUMED_TRANSACTION: { |
| 532 | data.enforceInterface(IActivityManager.descriptor); |
| 533 | IBinder token = data.readStrongBinder(); |
| 534 | activityResumed(token); |
| 535 | reply.writeNoException(); |
| 536 | return true; |
| 537 | } |
| 538 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 539 | case ACTIVITY_PAUSED_TRANSACTION: { |
| 540 | data.enforceInterface(IActivityManager.descriptor); |
| 541 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 542 | activityPaused(token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 543 | reply.writeNoException(); |
| 544 | return true; |
| 545 | } |
| 546 | |
| 547 | case ACTIVITY_STOPPED_TRANSACTION: { |
| 548 | data.enforceInterface(IActivityManager.descriptor); |
| 549 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 550 | Bundle map = data.readBundle(); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 551 | PersistableBundle persistentState = data.readPersistableBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 552 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 553 | activityStopped(token, map, persistentState, description); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 554 | reply.writeNoException(); |
| 555 | return true; |
| 556 | } |
| 557 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 558 | case ACTIVITY_SLEPT_TRANSACTION: { |
| 559 | data.enforceInterface(IActivityManager.descriptor); |
| 560 | IBinder token = data.readStrongBinder(); |
| 561 | activitySlept(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_DESTROYED_TRANSACTION: { |
| 567 | data.enforceInterface(IActivityManager.descriptor); |
| 568 | IBinder token = data.readStrongBinder(); |
| 569 | activityDestroyed(token); |
| 570 | reply.writeNoException(); |
| 571 | return true; |
| 572 | } |
| 573 | |
| 574 | case GET_CALLING_PACKAGE_TRANSACTION: { |
| 575 | data.enforceInterface(IActivityManager.descriptor); |
| 576 | IBinder token = data.readStrongBinder(); |
| 577 | String res = token != null ? getCallingPackage(token) : null; |
| 578 | reply.writeNoException(); |
| 579 | reply.writeString(res); |
| 580 | return true; |
| 581 | } |
| 582 | |
| 583 | case GET_CALLING_ACTIVITY_TRANSACTION: { |
| 584 | data.enforceInterface(IActivityManager.descriptor); |
| 585 | IBinder token = data.readStrongBinder(); |
| 586 | ComponentName cn = getCallingActivity(token); |
| 587 | reply.writeNoException(); |
| 588 | ComponentName.writeToParcel(cn, reply); |
| 589 | return true; |
| 590 | } |
| 591 | |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 592 | case GET_APP_TASKS_TRANSACTION: { |
| 593 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 594 | String callingPackage = data.readString(); |
| 595 | List<IAppTask> list = getAppTasks(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 596 | reply.writeNoException(); |
| 597 | int N = list != null ? list.size() : -1; |
| 598 | reply.writeInt(N); |
| 599 | int i; |
| 600 | for (i=0; i<N; i++) { |
| 601 | IAppTask task = list.get(i); |
| 602 | reply.writeStrongBinder(task.asBinder()); |
| 603 | } |
| 604 | return true; |
| 605 | } |
| 606 | |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 607 | case ADD_APP_TASK_TRANSACTION: { |
| 608 | data.enforceInterface(IActivityManager.descriptor); |
| 609 | IBinder activityToken = data.readStrongBinder(); |
| 610 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 611 | ActivityManager.TaskDescription descr |
| 612 | = ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 613 | Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data); |
| 614 | int res = addAppTask(activityToken, intent, descr, thumbnail); |
| 615 | reply.writeNoException(); |
| 616 | reply.writeInt(res); |
| 617 | return true; |
| 618 | } |
| 619 | |
| 620 | case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: { |
| 621 | data.enforceInterface(IActivityManager.descriptor); |
| 622 | Point size = getAppTaskThumbnailSize(); |
| 623 | reply.writeNoException(); |
| 624 | size.writeToParcel(reply, 0); |
| 625 | return true; |
| 626 | } |
| 627 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 628 | case GET_TASKS_TRANSACTION: { |
| 629 | data.enforceInterface(IActivityManager.descriptor); |
| 630 | int maxNum = data.readInt(); |
| 631 | int fl = data.readInt(); |
Dianne Hackborn | 0923328 | 2014-04-30 11:33:59 -0700 | [diff] [blame] | 632 | List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 633 | reply.writeNoException(); |
| 634 | int N = list != null ? list.size() : -1; |
| 635 | reply.writeInt(N); |
| 636 | int i; |
| 637 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 638 | ActivityManager.RunningTaskInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 639 | info.writeToParcel(reply, 0); |
| 640 | } |
| 641 | return true; |
| 642 | } |
| 643 | |
| 644 | case GET_RECENT_TASKS_TRANSACTION: { |
| 645 | data.enforceInterface(IActivityManager.descriptor); |
| 646 | int maxNum = data.readInt(); |
| 647 | int fl = data.readInt(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 648 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 649 | List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 650 | fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 651 | reply.writeNoException(); |
| 652 | reply.writeTypedList(list); |
| 653 | return true; |
| 654 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 655 | |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 656 | case GET_TASK_THUMBNAIL_TRANSACTION: { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 657 | data.enforceInterface(IActivityManager.descriptor); |
| 658 | int id = data.readInt(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 659 | ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 660 | reply.writeNoException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 661 | if (taskThumbnail != null) { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 662 | reply.writeInt(1); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 663 | taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 664 | } else { |
| 665 | reply.writeInt(0); |
| 666 | } |
| 667 | return true; |
| 668 | } |
| 669 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 670 | case GET_SERVICES_TRANSACTION: { |
| 671 | data.enforceInterface(IActivityManager.descriptor); |
| 672 | int maxNum = data.readInt(); |
| 673 | int fl = data.readInt(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 674 | List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 675 | reply.writeNoException(); |
| 676 | int N = list != null ? list.size() : -1; |
| 677 | reply.writeInt(N); |
| 678 | int i; |
| 679 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 680 | ActivityManager.RunningServiceInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 681 | info.writeToParcel(reply, 0); |
| 682 | } |
| 683 | return true; |
| 684 | } |
| 685 | |
| 686 | case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: { |
| 687 | data.enforceInterface(IActivityManager.descriptor); |
| 688 | List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState(); |
| 689 | reply.writeNoException(); |
| 690 | reply.writeTypedList(list); |
| 691 | return true; |
| 692 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 693 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 694 | case GET_RUNNING_APP_PROCESSES_TRANSACTION: { |
| 695 | data.enforceInterface(IActivityManager.descriptor); |
| 696 | List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses(); |
| 697 | reply.writeNoException(); |
| 698 | reply.writeTypedList(list); |
| 699 | return true; |
| 700 | } |
| 701 | |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 702 | case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: { |
| 703 | data.enforceInterface(IActivityManager.descriptor); |
| 704 | List<ApplicationInfo> list = getRunningExternalApplications(); |
| 705 | reply.writeNoException(); |
| 706 | reply.writeTypedList(list); |
| 707 | return true; |
| 708 | } |
| 709 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 710 | case MOVE_TASK_TO_FRONT_TRANSACTION: { |
| 711 | data.enforceInterface(IActivityManager.descriptor); |
| 712 | int task = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 713 | int fl = data.readInt(); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 714 | Bundle options = data.readInt() != 0 |
| 715 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 716 | moveTaskToFront(task, fl, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 717 | reply.writeNoException(); |
| 718 | return true; |
| 719 | } |
| 720 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 721 | case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: { |
| 722 | data.enforceInterface(IActivityManager.descriptor); |
| 723 | IBinder token = data.readStrongBinder(); |
| 724 | boolean nonRoot = data.readInt() != 0; |
| 725 | boolean res = moveActivityTaskToBack(token, nonRoot); |
| 726 | reply.writeNoException(); |
| 727 | reply.writeInt(res ? 1 : 0); |
| 728 | return true; |
| 729 | } |
| 730 | |
| 731 | case MOVE_TASK_BACKWARDS_TRANSACTION: { |
| 732 | data.enforceInterface(IActivityManager.descriptor); |
| 733 | int task = data.readInt(); |
| 734 | moveTaskBackwards(task); |
| 735 | reply.writeNoException(); |
| 736 | return true; |
| 737 | } |
| 738 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 739 | case MOVE_TASK_TO_STACK_TRANSACTION: { |
| 740 | data.enforceInterface(IActivityManager.descriptor); |
| 741 | int taskId = data.readInt(); |
| 742 | int stackId = data.readInt(); |
| 743 | boolean toTop = data.readInt() != 0; |
| 744 | moveTaskToStack(taskId, stackId, toTop); |
| 745 | reply.writeNoException(); |
| 746 | return true; |
| 747 | } |
| 748 | |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 749 | case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: { |
| 750 | data.enforceInterface(IActivityManager.descriptor); |
| 751 | int taskId = data.readInt(); |
| 752 | int createMode = data.readInt(); |
| 753 | boolean toTop = data.readInt() != 0; |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 754 | boolean animate = data.readInt() != 0; |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 755 | Rect bounds = null; |
| 756 | boolean hasBounds = data.readInt() != 0; |
| 757 | if (hasBounds) { |
| 758 | bounds = Rect.CREATOR.createFromParcel(data); |
| 759 | } |
| 760 | moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 761 | reply.writeNoException(); |
| 762 | return true; |
| 763 | } |
| 764 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 765 | case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: { |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 766 | data.enforceInterface(IActivityManager.descriptor); |
| 767 | final int stackId = data.readInt(); |
| 768 | final Rect r = Rect.CREATOR.createFromParcel(data); |
| 769 | final boolean res = moveTopActivityToPinnedStack(stackId, r); |
| 770 | reply.writeNoException(); |
| 771 | reply.writeInt(res ? 1 : 0); |
| 772 | return true; |
| 773 | } |
| 774 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 775 | case RESIZE_STACK_TRANSACTION: { |
| 776 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 777 | final int stackId = data.readInt(); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 778 | final boolean hasRect = data.readInt() != 0; |
| 779 | Rect r = null; |
| 780 | if (hasRect) { |
| 781 | r = Rect.CREATOR.createFromParcel(data); |
| 782 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 783 | final boolean allowResizeInDockedMode = data.readInt() == 1; |
| 784 | resizeStack(stackId, r, allowResizeInDockedMode); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 785 | reply.writeNoException(); |
| 786 | return true; |
| 787 | } |
| 788 | |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 789 | case POSITION_TASK_IN_STACK_TRANSACTION: { |
| 790 | data.enforceInterface(IActivityManager.descriptor); |
| 791 | int taskId = data.readInt(); |
| 792 | int stackId = data.readInt(); |
| 793 | int position = data.readInt(); |
| 794 | positionTaskInStack(taskId, stackId, position); |
| 795 | reply.writeNoException(); |
| 796 | return true; |
| 797 | } |
| 798 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 799 | case GET_ALL_STACK_INFOS_TRANSACTION: { |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 800 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 801 | List<StackInfo> list = getAllStackInfos(); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 802 | reply.writeNoException(); |
| 803 | reply.writeTypedList(list); |
| 804 | return true; |
| 805 | } |
| 806 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 807 | case GET_STACK_INFO_TRANSACTION: { |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 808 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 809 | int stackId = data.readInt(); |
| 810 | StackInfo info = getStackInfo(stackId); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 811 | reply.writeNoException(); |
| 812 | if (info != null) { |
| 813 | reply.writeInt(1); |
| 814 | info.writeToParcel(reply, 0); |
| 815 | } else { |
| 816 | reply.writeInt(0); |
| 817 | } |
| 818 | return true; |
| 819 | } |
| 820 | |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 821 | case IS_IN_HOME_STACK_TRANSACTION: { |
| 822 | data.enforceInterface(IActivityManager.descriptor); |
| 823 | int taskId = data.readInt(); |
| 824 | boolean isInHomeStack = isInHomeStack(taskId); |
| 825 | reply.writeNoException(); |
| 826 | reply.writeInt(isInHomeStack ? 1 : 0); |
| 827 | return true; |
| 828 | } |
| 829 | |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 830 | case SET_FOCUSED_STACK_TRANSACTION: { |
| 831 | data.enforceInterface(IActivityManager.descriptor); |
| 832 | int stackId = data.readInt(); |
| 833 | setFocusedStack(stackId); |
| 834 | reply.writeNoException(); |
| 835 | return true; |
| 836 | } |
| 837 | |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 838 | case GET_FOCUSED_STACK_ID_TRANSACTION: { |
| 839 | data.enforceInterface(IActivityManager.descriptor); |
| 840 | int focusedStackId = getFocusedStackId(); |
| 841 | reply.writeNoException(); |
| 842 | reply.writeInt(focusedStackId); |
| 843 | return true; |
| 844 | } |
| 845 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 846 | case SET_FOCUSED_TASK_TRANSACTION: { |
| 847 | data.enforceInterface(IActivityManager.descriptor); |
| 848 | int taskId = data.readInt(); |
Skuhne | f36bb0c | 2015-08-26 14:26:17 -0700 | [diff] [blame] | 849 | setFocusedTask(taskId); |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 850 | reply.writeNoException(); |
| 851 | return true; |
| 852 | } |
| 853 | |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 854 | case REGISTER_TASK_STACK_LISTENER_TRANSACTION: { |
| 855 | data.enforceInterface(IActivityManager.descriptor); |
| 856 | IBinder token = data.readStrongBinder(); |
| 857 | registerTaskStackListener(ITaskStackListener.Stub.asInterface(token)); |
| 858 | reply.writeNoException(); |
| 859 | return true; |
| 860 | } |
| 861 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 862 | case GET_TASK_FOR_ACTIVITY_TRANSACTION: { |
| 863 | data.enforceInterface(IActivityManager.descriptor); |
| 864 | IBinder token = data.readStrongBinder(); |
| 865 | boolean onlyRoot = data.readInt() != 0; |
| 866 | int res = token != null |
| 867 | ? getTaskForActivity(token, onlyRoot) : -1; |
| 868 | reply.writeNoException(); |
| 869 | reply.writeInt(res); |
| 870 | return true; |
| 871 | } |
| 872 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 873 | case GET_CONTENT_PROVIDER_TRANSACTION: { |
| 874 | data.enforceInterface(IActivityManager.descriptor); |
| 875 | IBinder b = data.readStrongBinder(); |
| 876 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 877 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 878 | int userId = data.readInt(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 879 | boolean stable = data.readInt() != 0; |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 880 | ContentProviderHolder cph = getContentProvider(app, name, userId, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 881 | reply.writeNoException(); |
| 882 | if (cph != null) { |
| 883 | reply.writeInt(1); |
| 884 | cph.writeToParcel(reply, 0); |
| 885 | } else { |
| 886 | reply.writeInt(0); |
| 887 | } |
| 888 | return true; |
| 889 | } |
| 890 | |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 891 | case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 892 | data.enforceInterface(IActivityManager.descriptor); |
| 893 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 894 | int userId = data.readInt(); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 895 | IBinder token = data.readStrongBinder(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 896 | ContentProviderHolder cph = getContentProviderExternal(name, userId, token); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 897 | reply.writeNoException(); |
| 898 | if (cph != null) { |
| 899 | reply.writeInt(1); |
| 900 | cph.writeToParcel(reply, 0); |
| 901 | } else { |
| 902 | reply.writeInt(0); |
| 903 | } |
| 904 | return true; |
| 905 | } |
| 906 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 907 | case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: { |
| 908 | data.enforceInterface(IActivityManager.descriptor); |
| 909 | IBinder b = data.readStrongBinder(); |
| 910 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 911 | ArrayList<ContentProviderHolder> providers = |
| 912 | data.createTypedArrayList(ContentProviderHolder.CREATOR); |
| 913 | publishContentProviders(app, providers); |
| 914 | reply.writeNoException(); |
| 915 | return true; |
| 916 | } |
| 917 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 918 | case REF_CONTENT_PROVIDER_TRANSACTION: { |
| 919 | data.enforceInterface(IActivityManager.descriptor); |
| 920 | IBinder b = data.readStrongBinder(); |
| 921 | int stable = data.readInt(); |
| 922 | int unstable = data.readInt(); |
| 923 | boolean res = refContentProvider(b, stable, unstable); |
| 924 | reply.writeNoException(); |
| 925 | reply.writeInt(res ? 1 : 0); |
| 926 | return true; |
| 927 | } |
| 928 | |
| 929 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: { |
| 930 | data.enforceInterface(IActivityManager.descriptor); |
| 931 | IBinder b = data.readStrongBinder(); |
| 932 | unstableProviderDied(b); |
| 933 | reply.writeNoException(); |
| 934 | return true; |
| 935 | } |
| 936 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 937 | case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: { |
| 938 | data.enforceInterface(IActivityManager.descriptor); |
| 939 | IBinder b = data.readStrongBinder(); |
| 940 | appNotRespondingViaProvider(b); |
| 941 | reply.writeNoException(); |
| 942 | return true; |
| 943 | } |
| 944 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 945 | case REMOVE_CONTENT_PROVIDER_TRANSACTION: { |
| 946 | data.enforceInterface(IActivityManager.descriptor); |
| 947 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 948 | boolean stable = data.readInt() != 0; |
| 949 | removeContentProvider(b, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 950 | reply.writeNoException(); |
| 951 | return true; |
| 952 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 953 | |
| 954 | case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 955 | data.enforceInterface(IActivityManager.descriptor); |
| 956 | String name = data.readString(); |
| 957 | IBinder token = data.readStrongBinder(); |
| 958 | removeContentProviderExternal(name, token); |
| 959 | reply.writeNoException(); |
| 960 | return true; |
| 961 | } |
| 962 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 963 | case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: { |
| 964 | data.enforceInterface(IActivityManager.descriptor); |
| 965 | ComponentName comp = ComponentName.CREATOR.createFromParcel(data); |
| 966 | PendingIntent pi = getRunningServiceControlPanel(comp); |
| 967 | reply.writeNoException(); |
| 968 | PendingIntent.writePendingIntentOrNullToParcel(pi, reply); |
| 969 | return true; |
| 970 | } |
| 971 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 972 | case START_SERVICE_TRANSACTION: { |
| 973 | data.enforceInterface(IActivityManager.descriptor); |
| 974 | IBinder b = data.readStrongBinder(); |
| 975 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 976 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 977 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 978 | String callingPackage = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 979 | int userId = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 980 | ComponentName cn = startService(app, service, resolvedType, callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 981 | reply.writeNoException(); |
| 982 | ComponentName.writeToParcel(cn, reply); |
| 983 | return true; |
| 984 | } |
| 985 | |
| 986 | case STOP_SERVICE_TRANSACTION: { |
| 987 | data.enforceInterface(IActivityManager.descriptor); |
| 988 | IBinder b = data.readStrongBinder(); |
| 989 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 990 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 991 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 992 | int userId = data.readInt(); |
| 993 | int res = stopService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 994 | reply.writeNoException(); |
| 995 | reply.writeInt(res); |
| 996 | return true; |
| 997 | } |
| 998 | |
| 999 | case STOP_SERVICE_TOKEN_TRANSACTION: { |
| 1000 | data.enforceInterface(IActivityManager.descriptor); |
| 1001 | ComponentName className = ComponentName.readFromParcel(data); |
| 1002 | IBinder token = data.readStrongBinder(); |
| 1003 | int startId = data.readInt(); |
| 1004 | boolean res = stopServiceToken(className, token, startId); |
| 1005 | reply.writeNoException(); |
| 1006 | reply.writeInt(res ? 1 : 0); |
| 1007 | return true; |
| 1008 | } |
| 1009 | |
| 1010 | case SET_SERVICE_FOREGROUND_TRANSACTION: { |
| 1011 | data.enforceInterface(IActivityManager.descriptor); |
| 1012 | ComponentName className = ComponentName.readFromParcel(data); |
| 1013 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 1014 | int id = data.readInt(); |
| 1015 | Notification notification = null; |
| 1016 | if (data.readInt() != 0) { |
| 1017 | notification = Notification.CREATOR.createFromParcel(data); |
| 1018 | } |
| 1019 | boolean removeNotification = data.readInt() != 0; |
| 1020 | setServiceForeground(className, token, id, notification, removeNotification); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1021 | reply.writeNoException(); |
| 1022 | return true; |
| 1023 | } |
| 1024 | |
| 1025 | case BIND_SERVICE_TRANSACTION: { |
| 1026 | data.enforceInterface(IActivityManager.descriptor); |
| 1027 | IBinder b = data.readStrongBinder(); |
| 1028 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1029 | IBinder token = data.readStrongBinder(); |
| 1030 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1031 | String resolvedType = data.readString(); |
| 1032 | b = data.readStrongBinder(); |
| 1033 | int fl = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1034 | String callingPackage = data.readString(); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 1035 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1036 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1037 | int res = bindService(app, token, service, resolvedType, conn, fl, |
| 1038 | callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1039 | reply.writeNoException(); |
| 1040 | reply.writeInt(res); |
| 1041 | return true; |
| 1042 | } |
| 1043 | |
| 1044 | case UNBIND_SERVICE_TRANSACTION: { |
| 1045 | data.enforceInterface(IActivityManager.descriptor); |
| 1046 | IBinder b = data.readStrongBinder(); |
| 1047 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
| 1048 | boolean res = unbindService(conn); |
| 1049 | reply.writeNoException(); |
| 1050 | reply.writeInt(res ? 1 : 0); |
| 1051 | return true; |
| 1052 | } |
| 1053 | |
| 1054 | case PUBLISH_SERVICE_TRANSACTION: { |
| 1055 | data.enforceInterface(IActivityManager.descriptor); |
| 1056 | IBinder token = data.readStrongBinder(); |
| 1057 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1058 | IBinder service = data.readStrongBinder(); |
| 1059 | publishService(token, intent, service); |
| 1060 | reply.writeNoException(); |
| 1061 | return true; |
| 1062 | } |
| 1063 | |
| 1064 | case UNBIND_FINISHED_TRANSACTION: { |
| 1065 | data.enforceInterface(IActivityManager.descriptor); |
| 1066 | IBinder token = data.readStrongBinder(); |
| 1067 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1068 | boolean doRebind = data.readInt() != 0; |
| 1069 | unbindFinished(token, intent, doRebind); |
| 1070 | reply.writeNoException(); |
| 1071 | return true; |
| 1072 | } |
| 1073 | |
| 1074 | case SERVICE_DONE_EXECUTING_TRANSACTION: { |
| 1075 | data.enforceInterface(IActivityManager.descriptor); |
| 1076 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 1077 | int type = data.readInt(); |
| 1078 | int startId = data.readInt(); |
| 1079 | int res = data.readInt(); |
| 1080 | serviceDoneExecuting(token, type, startId, res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1081 | reply.writeNoException(); |
| 1082 | return true; |
| 1083 | } |
| 1084 | |
| 1085 | case START_INSTRUMENTATION_TRANSACTION: { |
| 1086 | data.enforceInterface(IActivityManager.descriptor); |
| 1087 | ComponentName className = ComponentName.readFromParcel(data); |
| 1088 | String profileFile = data.readString(); |
| 1089 | int fl = data.readInt(); |
| 1090 | Bundle arguments = data.readBundle(); |
| 1091 | IBinder b = data.readStrongBinder(); |
| 1092 | IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 1093 | b = data.readStrongBinder(); |
| 1094 | IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1095 | int userId = data.readInt(); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 1096 | String abiOverride = data.readString(); |
| 1097 | boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId, |
| 1098 | abiOverride); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1099 | reply.writeNoException(); |
| 1100 | reply.writeInt(res ? 1 : 0); |
| 1101 | return true; |
| 1102 | } |
| 1103 | |
| 1104 | |
| 1105 | case FINISH_INSTRUMENTATION_TRANSACTION: { |
| 1106 | data.enforceInterface(IActivityManager.descriptor); |
| 1107 | IBinder b = data.readStrongBinder(); |
| 1108 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1109 | int resultCode = data.readInt(); |
| 1110 | Bundle results = data.readBundle(); |
| 1111 | finishInstrumentation(app, resultCode, results); |
| 1112 | reply.writeNoException(); |
| 1113 | return true; |
| 1114 | } |
| 1115 | |
| 1116 | case GET_CONFIGURATION_TRANSACTION: { |
| 1117 | data.enforceInterface(IActivityManager.descriptor); |
| 1118 | Configuration config = getConfiguration(); |
| 1119 | reply.writeNoException(); |
| 1120 | config.writeToParcel(reply, 0); |
| 1121 | return true; |
| 1122 | } |
| 1123 | |
| 1124 | case UPDATE_CONFIGURATION_TRANSACTION: { |
| 1125 | data.enforceInterface(IActivityManager.descriptor); |
| 1126 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 1127 | updateConfiguration(config); |
| 1128 | reply.writeNoException(); |
| 1129 | return true; |
| 1130 | } |
| 1131 | |
| 1132 | case SET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1133 | data.enforceInterface(IActivityManager.descriptor); |
| 1134 | IBinder token = data.readStrongBinder(); |
| 1135 | int requestedOrientation = data.readInt(); |
| 1136 | setRequestedOrientation(token, requestedOrientation); |
| 1137 | reply.writeNoException(); |
| 1138 | return true; |
| 1139 | } |
| 1140 | |
| 1141 | case GET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1142 | data.enforceInterface(IActivityManager.descriptor); |
| 1143 | IBinder token = data.readStrongBinder(); |
| 1144 | int req = getRequestedOrientation(token); |
| 1145 | reply.writeNoException(); |
| 1146 | reply.writeInt(req); |
| 1147 | return true; |
| 1148 | } |
| 1149 | |
| 1150 | case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: { |
| 1151 | data.enforceInterface(IActivityManager.descriptor); |
| 1152 | IBinder token = data.readStrongBinder(); |
| 1153 | ComponentName cn = getActivityClassForToken(token); |
| 1154 | reply.writeNoException(); |
| 1155 | ComponentName.writeToParcel(cn, reply); |
| 1156 | return true; |
| 1157 | } |
| 1158 | |
| 1159 | case GET_PACKAGE_FOR_TOKEN_TRANSACTION: { |
| 1160 | data.enforceInterface(IActivityManager.descriptor); |
| 1161 | IBinder token = data.readStrongBinder(); |
| 1162 | reply.writeNoException(); |
| 1163 | reply.writeString(getPackageForToken(token)); |
| 1164 | return true; |
| 1165 | } |
| 1166 | |
| 1167 | case GET_INTENT_SENDER_TRANSACTION: { |
| 1168 | data.enforceInterface(IActivityManager.descriptor); |
| 1169 | int type = data.readInt(); |
| 1170 | String packageName = data.readString(); |
| 1171 | IBinder token = data.readStrongBinder(); |
| 1172 | String resultWho = data.readString(); |
| 1173 | int requestCode = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1174 | Intent[] requestIntents; |
| 1175 | String[] requestResolvedTypes; |
| 1176 | if (data.readInt() != 0) { |
| 1177 | requestIntents = data.createTypedArray(Intent.CREATOR); |
| 1178 | requestResolvedTypes = data.createStringArray(); |
| 1179 | } else { |
| 1180 | requestIntents = null; |
| 1181 | requestResolvedTypes = null; |
| 1182 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1183 | int fl = data.readInt(); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 1184 | Bundle options = data.readInt() != 0 |
| 1185 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1186 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1187 | IIntentSender res = getIntentSender(type, packageName, token, |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1188 | resultWho, requestCode, requestIntents, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1189 | requestResolvedTypes, fl, options, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1190 | reply.writeNoException(); |
| 1191 | reply.writeStrongBinder(res != null ? res.asBinder() : null); |
| 1192 | return true; |
| 1193 | } |
| 1194 | |
| 1195 | case CANCEL_INTENT_SENDER_TRANSACTION: { |
| 1196 | data.enforceInterface(IActivityManager.descriptor); |
| 1197 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1198 | data.readStrongBinder()); |
| 1199 | cancelIntentSender(r); |
| 1200 | reply.writeNoException(); |
| 1201 | return true; |
| 1202 | } |
| 1203 | |
| 1204 | case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: { |
| 1205 | data.enforceInterface(IActivityManager.descriptor); |
| 1206 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1207 | data.readStrongBinder()); |
| 1208 | String res = getPackageForIntentSender(r); |
| 1209 | reply.writeNoException(); |
| 1210 | reply.writeString(res); |
| 1211 | return true; |
| 1212 | } |
| 1213 | |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 1214 | case GET_UID_FOR_INTENT_SENDER_TRANSACTION: { |
| 1215 | data.enforceInterface(IActivityManager.descriptor); |
| 1216 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1217 | data.readStrongBinder()); |
| 1218 | int res = getUidForIntentSender(r); |
| 1219 | reply.writeNoException(); |
| 1220 | reply.writeInt(res); |
| 1221 | return true; |
| 1222 | } |
| 1223 | |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1224 | case HANDLE_INCOMING_USER_TRANSACTION: { |
| 1225 | data.enforceInterface(IActivityManager.descriptor); |
| 1226 | int callingPid = data.readInt(); |
| 1227 | int callingUid = data.readInt(); |
| 1228 | int userId = data.readInt(); |
| 1229 | boolean allowAll = data.readInt() != 0 ; |
| 1230 | boolean requireFull = data.readInt() != 0; |
| 1231 | String name = data.readString(); |
| 1232 | String callerPackage = data.readString(); |
| 1233 | int res = handleIncomingUser(callingPid, callingUid, userId, allowAll, |
| 1234 | requireFull, name, callerPackage); |
| 1235 | reply.writeNoException(); |
| 1236 | reply.writeInt(res); |
| 1237 | return true; |
| 1238 | } |
| 1239 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1240 | case SET_PROCESS_LIMIT_TRANSACTION: { |
| 1241 | data.enforceInterface(IActivityManager.descriptor); |
| 1242 | int max = data.readInt(); |
| 1243 | setProcessLimit(max); |
| 1244 | reply.writeNoException(); |
| 1245 | return true; |
| 1246 | } |
| 1247 | |
| 1248 | case GET_PROCESS_LIMIT_TRANSACTION: { |
| 1249 | data.enforceInterface(IActivityManager.descriptor); |
| 1250 | int limit = getProcessLimit(); |
| 1251 | reply.writeNoException(); |
| 1252 | reply.writeInt(limit); |
| 1253 | return true; |
| 1254 | } |
| 1255 | |
| 1256 | case SET_PROCESS_FOREGROUND_TRANSACTION: { |
| 1257 | data.enforceInterface(IActivityManager.descriptor); |
| 1258 | IBinder token = data.readStrongBinder(); |
| 1259 | int pid = data.readInt(); |
| 1260 | boolean isForeground = data.readInt() != 0; |
| 1261 | setProcessForeground(token, pid, isForeground); |
| 1262 | reply.writeNoException(); |
| 1263 | return true; |
| 1264 | } |
| 1265 | |
| 1266 | case CHECK_PERMISSION_TRANSACTION: { |
| 1267 | data.enforceInterface(IActivityManager.descriptor); |
| 1268 | String perm = data.readString(); |
| 1269 | int pid = data.readInt(); |
| 1270 | int uid = data.readInt(); |
| 1271 | int res = checkPermission(perm, pid, uid); |
| 1272 | reply.writeNoException(); |
| 1273 | reply.writeInt(res); |
| 1274 | return true; |
| 1275 | } |
| 1276 | |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1277 | case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: { |
| 1278 | data.enforceInterface(IActivityManager.descriptor); |
| 1279 | String perm = data.readString(); |
| 1280 | int pid = data.readInt(); |
| 1281 | int uid = data.readInt(); |
| 1282 | IBinder token = data.readStrongBinder(); |
| 1283 | int res = checkPermissionWithToken(perm, pid, uid, token); |
| 1284 | reply.writeNoException(); |
| 1285 | reply.writeInt(res); |
| 1286 | return true; |
| 1287 | } |
| 1288 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1289 | case CHECK_URI_PERMISSION_TRANSACTION: { |
| 1290 | data.enforceInterface(IActivityManager.descriptor); |
| 1291 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1292 | int pid = data.readInt(); |
| 1293 | int uid = data.readInt(); |
| 1294 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1295 | int userId = data.readInt(); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1296 | IBinder callerToken = data.readStrongBinder(); |
| 1297 | int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1298 | reply.writeNoException(); |
| 1299 | reply.writeInt(res); |
| 1300 | return true; |
| 1301 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1302 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1303 | case CLEAR_APP_DATA_TRANSACTION: { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1304 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1305 | String packageName = data.readString(); |
| 1306 | IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface( |
| 1307 | data.readStrongBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 1308 | int userId = data.readInt(); |
| 1309 | boolean res = clearApplicationUserData(packageName, observer, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1310 | reply.writeNoException(); |
| 1311 | reply.writeInt(res ? 1 : 0); |
| 1312 | return true; |
| 1313 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1314 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1315 | case GRANT_URI_PERMISSION_TRANSACTION: { |
| 1316 | data.enforceInterface(IActivityManager.descriptor); |
| 1317 | IBinder b = data.readStrongBinder(); |
| 1318 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1319 | String targetPkg = data.readString(); |
| 1320 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1321 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1322 | int userId = data.readInt(); |
| 1323 | grantUriPermission(app, targetPkg, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1324 | reply.writeNoException(); |
| 1325 | return true; |
| 1326 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1327 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1328 | case REVOKE_URI_PERMISSION_TRANSACTION: { |
| 1329 | data.enforceInterface(IActivityManager.descriptor); |
| 1330 | IBinder b = data.readStrongBinder(); |
| 1331 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1332 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1333 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1334 | int userId = data.readInt(); |
| 1335 | revokeUriPermission(app, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1336 | reply.writeNoException(); |
| 1337 | return true; |
| 1338 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1339 | |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1340 | case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1341 | data.enforceInterface(IActivityManager.descriptor); |
| 1342 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1343 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1344 | int userId = data.readInt(); |
| 1345 | takePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1346 | reply.writeNoException(); |
| 1347 | return true; |
| 1348 | } |
| 1349 | |
| 1350 | case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1351 | data.enforceInterface(IActivityManager.descriptor); |
| 1352 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1353 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1354 | int userId = data.readInt(); |
| 1355 | releasePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1356 | reply.writeNoException(); |
| 1357 | return true; |
| 1358 | } |
| 1359 | |
| 1360 | case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: { |
| 1361 | data.enforceInterface(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 1362 | final String packageName = data.readString(); |
| 1363 | final boolean incoming = data.readInt() != 0; |
| 1364 | final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions( |
| 1365 | packageName, incoming); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1366 | reply.writeNoException(); |
| 1367 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1368 | return true; |
| 1369 | } |
| 1370 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1371 | case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: { |
| 1372 | data.enforceInterface(IActivityManager.descriptor); |
| 1373 | IBinder b = data.readStrongBinder(); |
| 1374 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1375 | boolean waiting = data.readInt() != 0; |
| 1376 | showWaitingForDebugger(app, waiting); |
| 1377 | reply.writeNoException(); |
| 1378 | return true; |
| 1379 | } |
| 1380 | |
| 1381 | case GET_MEMORY_INFO_TRANSACTION: { |
| 1382 | data.enforceInterface(IActivityManager.descriptor); |
| 1383 | ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); |
| 1384 | getMemoryInfo(mi); |
| 1385 | reply.writeNoException(); |
| 1386 | mi.writeToParcel(reply, 0); |
| 1387 | return true; |
| 1388 | } |
| 1389 | |
| 1390 | case UNHANDLED_BACK_TRANSACTION: { |
| 1391 | data.enforceInterface(IActivityManager.descriptor); |
| 1392 | unhandledBack(); |
| 1393 | reply.writeNoException(); |
| 1394 | return true; |
| 1395 | } |
| 1396 | |
| 1397 | case OPEN_CONTENT_URI_TRANSACTION: { |
| 1398 | data.enforceInterface(IActivityManager.descriptor); |
| 1399 | Uri uri = Uri.parse(data.readString()); |
| 1400 | ParcelFileDescriptor pfd = openContentUri(uri); |
| 1401 | reply.writeNoException(); |
| 1402 | if (pfd != null) { |
| 1403 | reply.writeInt(1); |
| 1404 | pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1405 | } else { |
| 1406 | reply.writeInt(0); |
| 1407 | } |
| 1408 | return true; |
| 1409 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1410 | |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1411 | case SET_LOCK_SCREEN_SHOWN_TRANSACTION: { |
| 1412 | data.enforceInterface(IActivityManager.descriptor); |
| 1413 | setLockScreenShown(data.readInt() != 0); |
| 1414 | reply.writeNoException(); |
| 1415 | return true; |
| 1416 | } |
| 1417 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1418 | case SET_DEBUG_APP_TRANSACTION: { |
| 1419 | data.enforceInterface(IActivityManager.descriptor); |
| 1420 | String pn = data.readString(); |
| 1421 | boolean wfd = data.readInt() != 0; |
| 1422 | boolean per = data.readInt() != 0; |
| 1423 | setDebugApp(pn, wfd, per); |
| 1424 | reply.writeNoException(); |
| 1425 | return true; |
| 1426 | } |
| 1427 | |
| 1428 | case SET_ALWAYS_FINISH_TRANSACTION: { |
| 1429 | data.enforceInterface(IActivityManager.descriptor); |
| 1430 | boolean enabled = data.readInt() != 0; |
| 1431 | setAlwaysFinish(enabled); |
| 1432 | reply.writeNoException(); |
| 1433 | return true; |
| 1434 | } |
| 1435 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1436 | case SET_ACTIVITY_CONTROLLER_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1437 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1438 | IActivityController watcher = IActivityController.Stub.asInterface( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1439 | data.readStrongBinder()); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1440 | setActivityController(watcher); |
Sungmin Choi | cdb86bb | 2012-12-20 14:08:59 +0900 | [diff] [blame] | 1441 | reply.writeNoException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1442 | return true; |
| 1443 | } |
| 1444 | |
| 1445 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1446 | data.enforceInterface(IActivityManager.descriptor); |
| 1447 | enterSafeMode(); |
| 1448 | reply.writeNoException(); |
| 1449 | return true; |
| 1450 | } |
| 1451 | |
| 1452 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1453 | data.enforceInterface(IActivityManager.descriptor); |
| 1454 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1455 | data.readStrongBinder()); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 1456 | int sourceUid = data.readInt(); |
| 1457 | String sourcePkg = data.readString(); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 1458 | String tag = data.readString(); |
| 1459 | noteWakeupAlarm(is, sourceUid, sourcePkg, tag); |
| 1460 | reply.writeNoException(); |
| 1461 | return true; |
| 1462 | } |
| 1463 | |
| 1464 | case NOTE_ALARM_START_TRANSACTION: { |
| 1465 | data.enforceInterface(IActivityManager.descriptor); |
| 1466 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1467 | data.readStrongBinder()); |
| 1468 | int sourceUid = data.readInt(); |
| 1469 | String tag = data.readString(); |
| 1470 | noteAlarmStart(is, sourceUid, tag); |
| 1471 | reply.writeNoException(); |
| 1472 | return true; |
| 1473 | } |
| 1474 | |
| 1475 | case NOTE_ALARM_FINISH_TRANSACTION: { |
| 1476 | data.enforceInterface(IActivityManager.descriptor); |
| 1477 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1478 | data.readStrongBinder()); |
| 1479 | int sourceUid = data.readInt(); |
| 1480 | String tag = data.readString(); |
| 1481 | noteAlarmFinish(is, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1482 | reply.writeNoException(); |
| 1483 | return true; |
| 1484 | } |
| 1485 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1486 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1487 | data.enforceInterface(IActivityManager.descriptor); |
| 1488 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1489 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1490 | boolean secure = data.readInt() != 0; |
| 1491 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1492 | reply.writeNoException(); |
| 1493 | reply.writeInt(res ? 1 : 0); |
| 1494 | return true; |
| 1495 | } |
| 1496 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1497 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1498 | data.enforceInterface(IActivityManager.descriptor); |
| 1499 | String reason = data.readString(); |
| 1500 | boolean res = killProcessesBelowForeground(reason); |
| 1501 | reply.writeNoException(); |
| 1502 | reply.writeInt(res ? 1 : 0); |
| 1503 | return true; |
| 1504 | } |
| 1505 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1506 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1507 | data.enforceInterface(IActivityManager.descriptor); |
| 1508 | IBinder app = data.readStrongBinder(); |
| 1509 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1510 | handleApplicationCrash(app, ci); |
| 1511 | reply.writeNoException(); |
| 1512 | return true; |
| 1513 | } |
| 1514 | |
| 1515 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1516 | data.enforceInterface(IActivityManager.descriptor); |
| 1517 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1518 | String tag = data.readString(); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1519 | boolean system = data.readInt() != 0; |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1520 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1521 | boolean res = handleApplicationWtf(app, tag, system, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1522 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1523 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1524 | return true; |
| 1525 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1526 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1527 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1528 | data.enforceInterface(IActivityManager.descriptor); |
| 1529 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1530 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1531 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1532 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1533 | reply.writeNoException(); |
| 1534 | return true; |
| 1535 | } |
| 1536 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1537 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1538 | data.enforceInterface(IActivityManager.descriptor); |
| 1539 | int sig = data.readInt(); |
| 1540 | signalPersistentProcesses(sig); |
| 1541 | reply.writeNoException(); |
| 1542 | return true; |
| 1543 | } |
| 1544 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1545 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1546 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1547 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1548 | int userId = data.readInt(); |
| 1549 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1550 | reply.writeNoException(); |
| 1551 | return true; |
| 1552 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1553 | |
| 1554 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1555 | data.enforceInterface(IActivityManager.descriptor); |
| 1556 | killAllBackgroundProcesses(); |
| 1557 | reply.writeNoException(); |
| 1558 | return true; |
| 1559 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1560 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame^] | 1561 | case KILL_PACKAGE_DEPENDENTS_TRANSACTION: { |
| 1562 | data.enforceInterface(IActivityManager.descriptor); |
| 1563 | String packageName = data.readString(); |
| 1564 | int userId = data.readInt(); |
| 1565 | killPackageDependents(packageName, userId); |
| 1566 | reply.writeNoException(); |
| 1567 | return true; |
| 1568 | } |
| 1569 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1570 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1571 | data.enforceInterface(IActivityManager.descriptor); |
| 1572 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1573 | int userId = data.readInt(); |
| 1574 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1575 | reply.writeNoException(); |
| 1576 | return true; |
| 1577 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1578 | |
| 1579 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1580 | data.enforceInterface(IActivityManager.descriptor); |
| 1581 | ActivityManager.RunningAppProcessInfo info = |
| 1582 | new ActivityManager.RunningAppProcessInfo(); |
| 1583 | getMyMemoryState(info); |
| 1584 | reply.writeNoException(); |
| 1585 | info.writeToParcel(reply, 0); |
| 1586 | return true; |
| 1587 | } |
| 1588 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1589 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1590 | data.enforceInterface(IActivityManager.descriptor); |
| 1591 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1592 | reply.writeNoException(); |
| 1593 | config.writeToParcel(reply, 0); |
| 1594 | return true; |
| 1595 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1596 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1597 | case PROFILE_CONTROL_TRANSACTION: { |
| 1598 | data.enforceInterface(IActivityManager.descriptor); |
| 1599 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1600 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1601 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1602 | int profileType = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1603 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 1604 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
| 1605 | boolean res = profileControl(process, userId, start, profilerInfo, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1606 | reply.writeNoException(); |
| 1607 | reply.writeInt(res ? 1 : 0); |
| 1608 | return true; |
| 1609 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1610 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1611 | case SHUTDOWN_TRANSACTION: { |
| 1612 | data.enforceInterface(IActivityManager.descriptor); |
| 1613 | boolean res = shutdown(data.readInt()); |
| 1614 | reply.writeNoException(); |
| 1615 | reply.writeInt(res ? 1 : 0); |
| 1616 | return true; |
| 1617 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1618 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1619 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1620 | data.enforceInterface(IActivityManager.descriptor); |
| 1621 | stopAppSwitches(); |
| 1622 | reply.writeNoException(); |
| 1623 | return true; |
| 1624 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1625 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1626 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1627 | data.enforceInterface(IActivityManager.descriptor); |
| 1628 | resumeAppSwitches(); |
| 1629 | reply.writeNoException(); |
| 1630 | return true; |
| 1631 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1632 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1633 | case PEEK_SERVICE_TRANSACTION: { |
| 1634 | data.enforceInterface(IActivityManager.descriptor); |
| 1635 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1636 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1637 | String callingPackage = data.readString(); |
| 1638 | IBinder binder = peekService(service, resolvedType, callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1639 | reply.writeNoException(); |
| 1640 | reply.writeStrongBinder(binder); |
| 1641 | return true; |
| 1642 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1643 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1644 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1645 | data.enforceInterface(IActivityManager.descriptor); |
| 1646 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1647 | int backupRestoreMode = data.readInt(); |
| 1648 | boolean success = bindBackupAgent(info, backupRestoreMode); |
| 1649 | reply.writeNoException(); |
| 1650 | reply.writeInt(success ? 1 : 0); |
| 1651 | return true; |
| 1652 | } |
| 1653 | |
| 1654 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1655 | data.enforceInterface(IActivityManager.descriptor); |
| 1656 | String packageName = data.readString(); |
| 1657 | IBinder agent = data.readStrongBinder(); |
| 1658 | backupAgentCreated(packageName, agent); |
| 1659 | reply.writeNoException(); |
| 1660 | return true; |
| 1661 | } |
| 1662 | |
| 1663 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1664 | data.enforceInterface(IActivityManager.descriptor); |
| 1665 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1666 | unbindBackupAgent(info); |
| 1667 | reply.writeNoException(); |
| 1668 | return true; |
| 1669 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1670 | |
| 1671 | case ADD_PACKAGE_DEPENDENCY_TRANSACTION: { |
| 1672 | data.enforceInterface(IActivityManager.descriptor); |
| 1673 | String packageName = data.readString(); |
| 1674 | addPackageDependency(packageName); |
| 1675 | reply.writeNoException(); |
| 1676 | return true; |
| 1677 | } |
| 1678 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1679 | case KILL_APPLICATION_WITH_APPID_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1680 | data.enforceInterface(IActivityManager.descriptor); |
| 1681 | String pkg = data.readString(); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1682 | int appid = data.readInt(); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 1683 | String reason = data.readString(); |
| 1684 | killApplicationWithAppId(pkg, appid, reason); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1685 | reply.writeNoException(); |
| 1686 | return true; |
| 1687 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1688 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1689 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1690 | data.enforceInterface(IActivityManager.descriptor); |
| 1691 | String reason = data.readString(); |
| 1692 | closeSystemDialogs(reason); |
| 1693 | reply.writeNoException(); |
| 1694 | return true; |
| 1695 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1696 | |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1697 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1698 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1699 | int[] pids = data.createIntArray(); |
| 1700 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1701 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1702 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1703 | return true; |
| 1704 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1705 | |
| 1706 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1707 | data.enforceInterface(IActivityManager.descriptor); |
| 1708 | String processName = data.readString(); |
| 1709 | int uid = data.readInt(); |
| 1710 | killApplicationProcess(processName, uid); |
| 1711 | reply.writeNoException(); |
| 1712 | return true; |
| 1713 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1714 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1715 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1716 | data.enforceInterface(IActivityManager.descriptor); |
| 1717 | IBinder token = data.readStrongBinder(); |
| 1718 | String packageName = data.readString(); |
| 1719 | int enterAnim = data.readInt(); |
| 1720 | int exitAnim = data.readInt(); |
| 1721 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1722 | reply.writeNoException(); |
| 1723 | return true; |
| 1724 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1725 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1726 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1727 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1728 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1729 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1730 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1731 | return true; |
| 1732 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1733 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1734 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1735 | data.enforceInterface(IActivityManager.descriptor); |
| 1736 | final boolean monkey = (data.readInt() == 1); |
| 1737 | setUserIsMonkey(monkey); |
| 1738 | reply.writeNoException(); |
| 1739 | return true; |
| 1740 | } |
| 1741 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1742 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1743 | data.enforceInterface(IActivityManager.descriptor); |
| 1744 | finishHeavyWeightApp(); |
| 1745 | reply.writeNoException(); |
| 1746 | return true; |
| 1747 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1748 | |
| 1749 | case IS_IMMERSIVE_TRANSACTION: { |
| 1750 | data.enforceInterface(IActivityManager.descriptor); |
| 1751 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1752 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1753 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1754 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1755 | return true; |
| 1756 | } |
| 1757 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 1758 | case IS_TOP_OF_TASK_TRANSACTION: { |
| 1759 | data.enforceInterface(IActivityManager.descriptor); |
| 1760 | IBinder token = data.readStrongBinder(); |
| 1761 | final boolean isTopOfTask = isTopOfTask(token); |
| 1762 | reply.writeNoException(); |
| 1763 | reply.writeInt(isTopOfTask ? 1 : 0); |
| 1764 | return true; |
| 1765 | } |
| 1766 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1767 | case CONVERT_FROM_TRANSLUCENT_TRANSACTION: { |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1768 | data.enforceInterface(IActivityManager.descriptor); |
| 1769 | IBinder token = data.readStrongBinder(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1770 | boolean converted = convertFromTranslucent(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1771 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1772 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1773 | return true; |
| 1774 | } |
| 1775 | |
| 1776 | case CONVERT_TO_TRANSLUCENT_TRANSACTION: { |
| 1777 | data.enforceInterface(IActivityManager.descriptor); |
| 1778 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1779 | final Bundle bundle; |
| 1780 | if (data.readInt() == 0) { |
| 1781 | bundle = null; |
| 1782 | } else { |
| 1783 | bundle = data.readBundle(); |
| 1784 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 1785 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1786 | boolean converted = convertToTranslucent(token, options); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1787 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1788 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1789 | return true; |
| 1790 | } |
| 1791 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1792 | case GET_ACTIVITY_OPTIONS_TRANSACTION: { |
| 1793 | data.enforceInterface(IActivityManager.descriptor); |
| 1794 | IBinder token = data.readStrongBinder(); |
| 1795 | final ActivityOptions options = getActivityOptions(token); |
| 1796 | reply.writeNoException(); |
| 1797 | reply.writeBundle(options == null ? null : options.toBundle()); |
| 1798 | return true; |
| 1799 | } |
| 1800 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1801 | case SET_IMMERSIVE_TRANSACTION: { |
| 1802 | data.enforceInterface(IActivityManager.descriptor); |
| 1803 | IBinder token = data.readStrongBinder(); |
| 1804 | boolean imm = data.readInt() == 1; |
| 1805 | setImmersive(token, imm); |
| 1806 | reply.writeNoException(); |
| 1807 | return true; |
| 1808 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1809 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1810 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1811 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1812 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1813 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1814 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1815 | return true; |
| 1816 | } |
| 1817 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1818 | case CRASH_APPLICATION_TRANSACTION: { |
| 1819 | data.enforceInterface(IActivityManager.descriptor); |
| 1820 | int uid = data.readInt(); |
| 1821 | int initialPid = data.readInt(); |
| 1822 | String packageName = data.readString(); |
| 1823 | String message = data.readString(); |
| 1824 | crashApplication(uid, initialPid, packageName, message); |
| 1825 | reply.writeNoException(); |
| 1826 | return true; |
| 1827 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1828 | |
| 1829 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1830 | data.enforceInterface(IActivityManager.descriptor); |
| 1831 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1832 | int userId = data.readInt(); |
| 1833 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1834 | reply.writeNoException(); |
| 1835 | reply.writeString(type); |
| 1836 | return true; |
| 1837 | } |
| 1838 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1839 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1840 | data.enforceInterface(IActivityManager.descriptor); |
| 1841 | String name = data.readString(); |
| 1842 | IBinder perm = newUriPermissionOwner(name); |
| 1843 | reply.writeNoException(); |
| 1844 | reply.writeStrongBinder(perm); |
| 1845 | return true; |
| 1846 | } |
| 1847 | |
| 1848 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1849 | data.enforceInterface(IActivityManager.descriptor); |
| 1850 | IBinder owner = data.readStrongBinder(); |
| 1851 | int fromUid = data.readInt(); |
| 1852 | String targetPkg = data.readString(); |
| 1853 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1854 | int mode = data.readInt(); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 1855 | int sourceUserId = data.readInt(); |
| 1856 | int targetUserId = data.readInt(); |
| 1857 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId, |
| 1858 | targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1859 | reply.writeNoException(); |
| 1860 | return true; |
| 1861 | } |
| 1862 | |
| 1863 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1864 | data.enforceInterface(IActivityManager.descriptor); |
| 1865 | IBinder owner = data.readStrongBinder(); |
| 1866 | Uri uri = null; |
| 1867 | if (data.readInt() != 0) { |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1868 | uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1869 | } |
| 1870 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1871 | int userId = data.readInt(); |
| 1872 | revokeUriPermissionFromOwner(owner, uri, mode, userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1873 | reply.writeNoException(); |
| 1874 | return true; |
| 1875 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1876 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1877 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 1878 | data.enforceInterface(IActivityManager.descriptor); |
| 1879 | int callingUid = data.readInt(); |
| 1880 | String targetPkg = data.readString(); |
| 1881 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1882 | int modeFlags = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1883 | int userId = data.readInt(); |
| 1884 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1885 | reply.writeNoException(); |
| 1886 | reply.writeInt(res); |
| 1887 | return true; |
| 1888 | } |
| 1889 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1890 | case DUMP_HEAP_TRANSACTION: { |
| 1891 | data.enforceInterface(IActivityManager.descriptor); |
| 1892 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 1893 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1894 | boolean managed = data.readInt() != 0; |
| 1895 | String path = data.readString(); |
| 1896 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 1897 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1898 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1899 | reply.writeNoException(); |
| 1900 | reply.writeInt(res ? 1 : 0); |
| 1901 | return true; |
| 1902 | } |
| 1903 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1904 | case START_ACTIVITIES_TRANSACTION: |
| 1905 | { |
| 1906 | data.enforceInterface(IActivityManager.descriptor); |
| 1907 | IBinder b = data.readStrongBinder(); |
| 1908 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1909 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1910 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 1911 | String[] resolvedTypes = data.createStringArray(); |
| 1912 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 1913 | Bundle options = data.readInt() != 0 |
| 1914 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 1915 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1916 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 1917 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1918 | reply.writeNoException(); |
| 1919 | reply.writeInt(result); |
| 1920 | return true; |
| 1921 | } |
| 1922 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 1923 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1924 | { |
| 1925 | data.enforceInterface(IActivityManager.descriptor); |
| 1926 | int mode = getFrontActivityScreenCompatMode(); |
| 1927 | reply.writeNoException(); |
| 1928 | reply.writeInt(mode); |
| 1929 | return true; |
| 1930 | } |
| 1931 | |
| 1932 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1933 | { |
| 1934 | data.enforceInterface(IActivityManager.descriptor); |
| 1935 | int mode = data.readInt(); |
| 1936 | setFrontActivityScreenCompatMode(mode); |
| 1937 | reply.writeNoException(); |
| 1938 | reply.writeInt(mode); |
| 1939 | return true; |
| 1940 | } |
| 1941 | |
| 1942 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1943 | { |
| 1944 | data.enforceInterface(IActivityManager.descriptor); |
| 1945 | String pkg = data.readString(); |
| 1946 | int mode = getPackageScreenCompatMode(pkg); |
| 1947 | reply.writeNoException(); |
| 1948 | reply.writeInt(mode); |
| 1949 | return true; |
| 1950 | } |
| 1951 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1952 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1953 | { |
| 1954 | data.enforceInterface(IActivityManager.descriptor); |
| 1955 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 1956 | int mode = data.readInt(); |
| 1957 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1958 | reply.writeNoException(); |
| 1959 | return true; |
| 1960 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1961 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1962 | case SWITCH_USER_TRANSACTION: { |
| 1963 | data.enforceInterface(IActivityManager.descriptor); |
| 1964 | int userid = data.readInt(); |
| 1965 | boolean result = switchUser(userid); |
| 1966 | reply.writeNoException(); |
| 1967 | reply.writeInt(result ? 1 : 0); |
| 1968 | return true; |
| 1969 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 1970 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 1971 | case START_USER_IN_BACKGROUND_TRANSACTION: { |
| 1972 | data.enforceInterface(IActivityManager.descriptor); |
| 1973 | int userid = data.readInt(); |
| 1974 | boolean result = startUserInBackground(userid); |
| 1975 | reply.writeNoException(); |
| 1976 | reply.writeInt(result ? 1 : 0); |
| 1977 | return true; |
| 1978 | } |
| 1979 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 1980 | case UNLOCK_USER_TRANSACTION: { |
| 1981 | data.enforceInterface(IActivityManager.descriptor); |
| 1982 | int userId = data.readInt(); |
| 1983 | byte[] token = data.createByteArray(); |
| 1984 | boolean result = unlockUser(userId, token); |
| 1985 | reply.writeNoException(); |
| 1986 | reply.writeInt(result ? 1 : 0); |
| 1987 | return true; |
| 1988 | } |
| 1989 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 1990 | case STOP_USER_TRANSACTION: { |
| 1991 | data.enforceInterface(IActivityManager.descriptor); |
| 1992 | int userid = data.readInt(); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 1993 | boolean force = data.readInt() != 0; |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 1994 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 1995 | data.readStrongBinder()); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 1996 | int result = stopUser(userid, force, callback); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 1997 | reply.writeNoException(); |
| 1998 | reply.writeInt(result); |
| 1999 | return true; |
| 2000 | } |
| 2001 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2002 | case GET_CURRENT_USER_TRANSACTION: { |
| 2003 | data.enforceInterface(IActivityManager.descriptor); |
| 2004 | UserInfo userInfo = getCurrentUser(); |
| 2005 | reply.writeNoException(); |
| 2006 | userInfo.writeToParcel(reply, 0); |
| 2007 | return true; |
| 2008 | } |
| 2009 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2010 | case IS_USER_RUNNING_TRANSACTION: { |
| 2011 | data.enforceInterface(IActivityManager.descriptor); |
| 2012 | int userid = data.readInt(); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 2013 | int _flags = data.readInt(); |
| 2014 | boolean result = isUserRunning(userid, _flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2015 | reply.writeNoException(); |
| 2016 | reply.writeInt(result ? 1 : 0); |
| 2017 | return true; |
| 2018 | } |
| 2019 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 2020 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 2021 | data.enforceInterface(IActivityManager.descriptor); |
| 2022 | int[] result = getRunningUserIds(); |
| 2023 | reply.writeNoException(); |
| 2024 | reply.writeIntArray(result); |
| 2025 | return true; |
| 2026 | } |
| 2027 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2028 | case REMOVE_TASK_TRANSACTION: |
| 2029 | { |
| 2030 | data.enforceInterface(IActivityManager.descriptor); |
| 2031 | int taskId = data.readInt(); |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 2032 | boolean result = removeTask(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2033 | reply.writeNoException(); |
| 2034 | reply.writeInt(result ? 1 : 0); |
| 2035 | return true; |
| 2036 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2037 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 2038 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2039 | data.enforceInterface(IActivityManager.descriptor); |
| 2040 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2041 | data.readStrongBinder()); |
| 2042 | registerProcessObserver(observer); |
| 2043 | return true; |
| 2044 | } |
| 2045 | |
| 2046 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2047 | data.enforceInterface(IActivityManager.descriptor); |
| 2048 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2049 | data.readStrongBinder()); |
| 2050 | unregisterProcessObserver(observer); |
| 2051 | return true; |
| 2052 | } |
| 2053 | |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2054 | case REGISTER_UID_OBSERVER_TRANSACTION: { |
| 2055 | data.enforceInterface(IActivityManager.descriptor); |
| 2056 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2057 | data.readStrongBinder()); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2058 | int which = data.readInt(); |
| 2059 | registerUidObserver(observer, which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2060 | return true; |
| 2061 | } |
| 2062 | |
| 2063 | case UNREGISTER_UID_OBSERVER_TRANSACTION: { |
| 2064 | data.enforceInterface(IActivityManager.descriptor); |
| 2065 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2066 | data.readStrongBinder()); |
| 2067 | unregisterUidObserver(observer); |
| 2068 | return true; |
| 2069 | } |
| 2070 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 2071 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2072 | { |
| 2073 | data.enforceInterface(IActivityManager.descriptor); |
| 2074 | String pkg = data.readString(); |
| 2075 | boolean ask = getPackageAskScreenCompat(pkg); |
| 2076 | reply.writeNoException(); |
| 2077 | reply.writeInt(ask ? 1 : 0); |
| 2078 | return true; |
| 2079 | } |
| 2080 | |
| 2081 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2082 | { |
| 2083 | data.enforceInterface(IActivityManager.descriptor); |
| 2084 | String pkg = data.readString(); |
| 2085 | boolean ask = data.readInt() != 0; |
| 2086 | setPackageAskScreenCompat(pkg, ask); |
| 2087 | reply.writeNoException(); |
| 2088 | return true; |
| 2089 | } |
| 2090 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2091 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 2092 | data.enforceInterface(IActivityManager.descriptor); |
| 2093 | IIntentSender r = IIntentSender.Stub.asInterface( |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2094 | data.readStrongBinder()); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2095 | boolean res = isIntentSenderTargetedToPackage(r); |
| 2096 | reply.writeNoException(); |
| 2097 | reply.writeInt(res ? 1 : 0); |
| 2098 | return true; |
| 2099 | } |
| 2100 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 2101 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 2102 | data.enforceInterface(IActivityManager.descriptor); |
| 2103 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2104 | data.readStrongBinder()); |
| 2105 | boolean res = isIntentSenderAnActivity(r); |
| 2106 | reply.writeNoException(); |
| 2107 | reply.writeInt(res ? 1 : 0); |
| 2108 | return true; |
| 2109 | } |
| 2110 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 2111 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 2112 | data.enforceInterface(IActivityManager.descriptor); |
| 2113 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2114 | data.readStrongBinder()); |
| 2115 | Intent intent = getIntentForIntentSender(r); |
| 2116 | reply.writeNoException(); |
| 2117 | if (intent != null) { |
| 2118 | reply.writeInt(1); |
| 2119 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2120 | } else { |
| 2121 | reply.writeInt(0); |
| 2122 | } |
| 2123 | return true; |
| 2124 | } |
| 2125 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 2126 | case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { |
| 2127 | data.enforceInterface(IActivityManager.descriptor); |
| 2128 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2129 | data.readStrongBinder()); |
| 2130 | String prefix = data.readString(); |
| 2131 | String tag = getTagForIntentSender(r, prefix); |
| 2132 | reply.writeNoException(); |
| 2133 | reply.writeString(tag); |
| 2134 | return true; |
| 2135 | } |
| 2136 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2137 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 2138 | data.enforceInterface(IActivityManager.descriptor); |
| 2139 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 2140 | updatePersistentConfiguration(config); |
| 2141 | reply.writeNoException(); |
| 2142 | return true; |
| 2143 | } |
| 2144 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 2145 | case GET_PROCESS_PSS_TRANSACTION: { |
| 2146 | data.enforceInterface(IActivityManager.descriptor); |
| 2147 | int[] pids = data.createIntArray(); |
| 2148 | long[] pss = getProcessPss(pids); |
| 2149 | reply.writeNoException(); |
| 2150 | reply.writeLongArray(pss); |
| 2151 | return true; |
| 2152 | } |
| 2153 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 2154 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 2155 | data.enforceInterface(IActivityManager.descriptor); |
| 2156 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 2157 | boolean always = data.readInt() != 0; |
| 2158 | showBootMessage(msg, always); |
| 2159 | reply.writeNoException(); |
| 2160 | return true; |
| 2161 | } |
| 2162 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2163 | case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2164 | data.enforceInterface(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2165 | keyguardWaitingForActivityDrawn(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2166 | reply.writeNoException(); |
| 2167 | return true; |
| 2168 | } |
| 2169 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2170 | case KEYGUARD_GOING_AWAY_TRANSACTION: { |
| 2171 | data.enforceInterface(IActivityManager.descriptor); |
| 2172 | keyguardGoingAway(data.readInt() != 0, data.readInt() != 0); |
| 2173 | reply.writeNoException(); |
| 2174 | return true; |
| 2175 | } |
| 2176 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2177 | case SHOULD_UP_RECREATE_TASK_TRANSACTION: { |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2178 | data.enforceInterface(IActivityManager.descriptor); |
| 2179 | IBinder token = data.readStrongBinder(); |
| 2180 | String destAffinity = data.readString(); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2181 | boolean res = shouldUpRecreateTask(token, destAffinity); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2182 | reply.writeNoException(); |
| 2183 | reply.writeInt(res ? 1 : 0); |
| 2184 | return true; |
| 2185 | } |
| 2186 | |
| 2187 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 2188 | data.enforceInterface(IActivityManager.descriptor); |
| 2189 | IBinder token = data.readStrongBinder(); |
| 2190 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 2191 | int resultCode = data.readInt(); |
| 2192 | Intent resultData = null; |
| 2193 | if (data.readInt() != 0) { |
| 2194 | resultData = Intent.CREATOR.createFromParcel(data); |
| 2195 | } |
| 2196 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 2197 | reply.writeNoException(); |
| 2198 | reply.writeInt(res ? 1 : 0); |
| 2199 | return true; |
| 2200 | } |
| 2201 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 2202 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 2203 | data.enforceInterface(IActivityManager.descriptor); |
| 2204 | IBinder token = data.readStrongBinder(); |
| 2205 | int res = getLaunchedFromUid(token); |
| 2206 | reply.writeNoException(); |
| 2207 | reply.writeInt(res); |
| 2208 | return true; |
| 2209 | } |
| 2210 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2211 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 2212 | data.enforceInterface(IActivityManager.descriptor); |
| 2213 | IBinder token = data.readStrongBinder(); |
| 2214 | String res = getLaunchedFromPackage(token); |
| 2215 | reply.writeNoException(); |
| 2216 | reply.writeString(res); |
| 2217 | return true; |
| 2218 | } |
| 2219 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2220 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2221 | data.enforceInterface(IActivityManager.descriptor); |
| 2222 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2223 | data.readStrongBinder()); |
| 2224 | registerUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2225 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2226 | return true; |
| 2227 | } |
| 2228 | |
| 2229 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2230 | data.enforceInterface(IActivityManager.descriptor); |
| 2231 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2232 | data.readStrongBinder()); |
| 2233 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2234 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2235 | return true; |
| 2236 | } |
| 2237 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2238 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 2239 | data.enforceInterface(IActivityManager.descriptor); |
Felipe Leme | 4cc8633 | 2015-12-04 16:37:28 -0800 | [diff] [blame] | 2240 | boolean progress = data.readInt() != 0; |
| 2241 | requestBugReport(progress); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2242 | reply.writeNoException(); |
| 2243 | return true; |
| 2244 | } |
| 2245 | |
| 2246 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 2247 | data.enforceInterface(IActivityManager.descriptor); |
| 2248 | int pid = data.readInt(); |
| 2249 | boolean aboveSystem = data.readInt() != 0; |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 2250 | String reason = data.readString(); |
| 2251 | long res = inputDispatchingTimedOut(pid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2252 | reply.writeNoException(); |
| 2253 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2254 | return true; |
| 2255 | } |
| 2256 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2257 | case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2258 | data.enforceInterface(IActivityManager.descriptor); |
| 2259 | int requestType = data.readInt(); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2260 | Bundle res = getAssistContextExtras(requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2261 | reply.writeNoException(); |
| 2262 | reply.writeBundle(res); |
| 2263 | return true; |
| 2264 | } |
| 2265 | |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2266 | case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
| 2267 | data.enforceInterface(IActivityManager.descriptor); |
| 2268 | int requestType = data.readInt(); |
| 2269 | IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2270 | IBinder activityToken = data.readStrongBinder(); |
| 2271 | boolean res = requestAssistContextExtras(requestType, receiver, activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2272 | reply.writeNoException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2273 | reply.writeInt(res ? 1 : 0); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2274 | return true; |
| 2275 | } |
| 2276 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2277 | case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2278 | data.enforceInterface(IActivityManager.descriptor); |
| 2279 | IBinder token = data.readStrongBinder(); |
| 2280 | Bundle extras = data.readBundle(); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 2281 | AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data); |
| 2282 | AssistContent content = AssistContent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 2283 | Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null; |
| 2284 | reportAssistContextExtras(token, extras, structure, content, referrer); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2285 | reply.writeNoException(); |
| 2286 | return true; |
| 2287 | } |
| 2288 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2289 | case LAUNCH_ASSIST_INTENT_TRANSACTION: { |
| 2290 | data.enforceInterface(IActivityManager.descriptor); |
| 2291 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2292 | int requestType = data.readInt(); |
| 2293 | String hint = data.readString(); |
| 2294 | int userHandle = data.readInt(); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 2295 | Bundle args = data.readBundle(); |
| 2296 | boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2297 | reply.writeNoException(); |
| 2298 | reply.writeInt(res ? 1 : 0); |
| 2299 | return true; |
| 2300 | } |
| 2301 | |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2302 | case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: { |
| 2303 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2304 | boolean res = isAssistDataAllowedOnCurrentActivity(); |
| 2305 | reply.writeNoException(); |
| 2306 | reply.writeInt(res ? 1 : 0); |
| 2307 | return true; |
| 2308 | } |
| 2309 | |
| 2310 | case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: { |
| 2311 | data.enforceInterface(IActivityManager.descriptor); |
| 2312 | IBinder token = data.readStrongBinder(); |
| 2313 | Bundle args = data.readBundle(); |
| 2314 | boolean res = showAssistFromActivity(token, args); |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2315 | reply.writeNoException(); |
| 2316 | reply.writeInt(res ? 1 : 0); |
| 2317 | return true; |
| 2318 | } |
| 2319 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2320 | case KILL_UID_TRANSACTION: { |
| 2321 | data.enforceInterface(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2322 | int appId = data.readInt(); |
| 2323 | int userId = data.readInt(); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2324 | String reason = data.readString(); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2325 | killUid(appId, userId, reason); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2326 | reply.writeNoException(); |
| 2327 | return true; |
| 2328 | } |
| 2329 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2330 | case HANG_TRANSACTION: { |
| 2331 | data.enforceInterface(IActivityManager.descriptor); |
| 2332 | IBinder who = data.readStrongBinder(); |
| 2333 | boolean allowRestart = data.readInt() != 0; |
| 2334 | hang(who, allowRestart); |
| 2335 | reply.writeNoException(); |
| 2336 | return true; |
| 2337 | } |
| 2338 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2339 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2340 | data.enforceInterface(IActivityManager.descriptor); |
| 2341 | IBinder token = data.readStrongBinder(); |
| 2342 | reportActivityFullyDrawn(token); |
| 2343 | reply.writeNoException(); |
| 2344 | return true; |
| 2345 | } |
| 2346 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2347 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2348 | data.enforceInterface(IActivityManager.descriptor); |
| 2349 | IBinder token = data.readStrongBinder(); |
| 2350 | notifyActivityDrawn(token); |
| 2351 | reply.writeNoException(); |
| 2352 | return true; |
| 2353 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2354 | |
| 2355 | case RESTART_TRANSACTION: { |
| 2356 | data.enforceInterface(IActivityManager.descriptor); |
| 2357 | restart(); |
| 2358 | reply.writeNoException(); |
| 2359 | return true; |
| 2360 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2361 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2362 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2363 | data.enforceInterface(IActivityManager.descriptor); |
| 2364 | performIdleMaintenance(); |
| 2365 | reply.writeNoException(); |
| 2366 | return true; |
| 2367 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2368 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2369 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2370 | data.enforceInterface(IActivityManager.descriptor); |
| 2371 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2372 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2373 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2374 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2375 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2376 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2377 | if (activityContainer != null) { |
| 2378 | reply.writeInt(1); |
| 2379 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2380 | } else { |
| 2381 | reply.writeInt(0); |
| 2382 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2383 | return true; |
| 2384 | } |
| 2385 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2386 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2387 | data.enforceInterface(IActivityManager.descriptor); |
| 2388 | IActivityContainer activityContainer = |
| 2389 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2390 | deleteActivityContainer(activityContainer); |
| 2391 | reply.writeNoException(); |
| 2392 | return true; |
| 2393 | } |
| 2394 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2395 | case CREATE_STACK_ON_DISPLAY: { |
| 2396 | data.enforceInterface(IActivityManager.descriptor); |
| 2397 | int displayId = data.readInt(); |
| 2398 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2399 | reply.writeNoException(); |
| 2400 | if (activityContainer != null) { |
| 2401 | reply.writeInt(1); |
| 2402 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2403 | } else { |
| 2404 | reply.writeInt(0); |
| 2405 | } |
| 2406 | return true; |
| 2407 | } |
| 2408 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2409 | case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: { |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2410 | data.enforceInterface(IActivityManager.descriptor); |
| 2411 | IBinder activityToken = data.readStrongBinder(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2412 | int displayId = getActivityDisplayId(activityToken); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2413 | reply.writeNoException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2414 | reply.writeInt(displayId); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2415 | return true; |
| 2416 | } |
| 2417 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2418 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2419 | data.enforceInterface(IActivityManager.descriptor); |
| 2420 | final int taskId = data.readInt(); |
| 2421 | startLockTaskMode(taskId); |
| 2422 | reply.writeNoException(); |
| 2423 | return true; |
| 2424 | } |
| 2425 | |
| 2426 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2427 | data.enforceInterface(IActivityManager.descriptor); |
| 2428 | IBinder token = data.readStrongBinder(); |
| 2429 | startLockTaskMode(token); |
| 2430 | reply.writeNoException(); |
| 2431 | return true; |
| 2432 | } |
| 2433 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2434 | case START_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2435 | data.enforceInterface(IActivityManager.descriptor); |
| 2436 | startLockTaskModeOnCurrent(); |
| 2437 | reply.writeNoException(); |
| 2438 | return true; |
| 2439 | } |
| 2440 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2441 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2442 | data.enforceInterface(IActivityManager.descriptor); |
| 2443 | stopLockTaskMode(); |
| 2444 | reply.writeNoException(); |
| 2445 | return true; |
| 2446 | } |
| 2447 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2448 | case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2449 | data.enforceInterface(IActivityManager.descriptor); |
| 2450 | stopLockTaskModeOnCurrent(); |
| 2451 | reply.writeNoException(); |
| 2452 | return true; |
| 2453 | } |
| 2454 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2455 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2456 | data.enforceInterface(IActivityManager.descriptor); |
| 2457 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2458 | reply.writeNoException(); |
| 2459 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2460 | return true; |
| 2461 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2462 | |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 2463 | case GET_LOCK_TASK_MODE_STATE_TRANSACTION: { |
| 2464 | data.enforceInterface(IActivityManager.descriptor); |
| 2465 | final int lockTaskModeState = getLockTaskModeState(); |
| 2466 | reply.writeNoException(); |
| 2467 | reply.writeInt(lockTaskModeState); |
| 2468 | return true; |
| 2469 | } |
| 2470 | |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 2471 | case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: { |
| 2472 | data.enforceInterface(IActivityManager.descriptor); |
| 2473 | final IBinder token = data.readStrongBinder(); |
| 2474 | showLockTaskEscapeMessage(token); |
| 2475 | reply.writeNoException(); |
| 2476 | return true; |
| 2477 | } |
| 2478 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2479 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2480 | data.enforceInterface(IActivityManager.descriptor); |
| 2481 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2482 | ActivityManager.TaskDescription values = |
| 2483 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2484 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2485 | reply.writeNoException(); |
| 2486 | return true; |
| 2487 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2488 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2489 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2490 | data.enforceInterface(IActivityManager.descriptor); |
| 2491 | int taskId = data.readInt(); |
| 2492 | boolean resizeable = (data.readInt() == 1) ? true : false; |
| 2493 | setTaskResizeable(taskId, resizeable); |
| 2494 | reply.writeNoException(); |
| 2495 | return true; |
| 2496 | } |
| 2497 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2498 | case RESIZE_TASK_TRANSACTION: { |
| 2499 | data.enforceInterface(IActivityManager.descriptor); |
| 2500 | int taskId = data.readInt(); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2501 | int resizeMode = data.readInt(); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2502 | Rect r = Rect.CREATOR.createFromParcel(data); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2503 | resizeTask(taskId, r, resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2504 | reply.writeNoException(); |
| 2505 | return true; |
| 2506 | } |
| 2507 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 2508 | case GET_TASK_BOUNDS_TRANSACTION: { |
| 2509 | data.enforceInterface(IActivityManager.descriptor); |
| 2510 | int taskId = data.readInt(); |
| 2511 | Rect r = getTaskBounds(taskId); |
| 2512 | reply.writeNoException(); |
| 2513 | r.writeToParcel(reply, 0); |
| 2514 | return true; |
| 2515 | } |
| 2516 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2517 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2518 | data.enforceInterface(IActivityManager.descriptor); |
| 2519 | String filename = data.readString(); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 2520 | int userId = data.readInt(); |
| 2521 | Bitmap icon = getTaskDescriptionIcon(filename, userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2522 | reply.writeNoException(); |
| 2523 | if (icon == null) { |
| 2524 | reply.writeInt(0); |
| 2525 | } else { |
| 2526 | reply.writeInt(1); |
| 2527 | icon.writeToParcel(reply, 0); |
| 2528 | } |
| 2529 | return true; |
| 2530 | } |
| 2531 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2532 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2533 | data.enforceInterface(IActivityManager.descriptor); |
| 2534 | final Bundle bundle; |
| 2535 | if (data.readInt() == 0) { |
| 2536 | bundle = null; |
| 2537 | } else { |
| 2538 | bundle = data.readBundle(); |
| 2539 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 2540 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2541 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2542 | reply.writeNoException(); |
| 2543 | return true; |
| 2544 | } |
| 2545 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2546 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2547 | data.enforceInterface(IActivityManager.descriptor); |
| 2548 | IBinder token = data.readStrongBinder(); |
| 2549 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2550 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2551 | reply.writeNoException(); |
| 2552 | reply.writeInt(success ? 1 : 0); |
| 2553 | return true; |
| 2554 | } |
| 2555 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2556 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2557 | data.enforceInterface(IActivityManager.descriptor); |
| 2558 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2559 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2560 | reply.writeNoException(); |
| 2561 | reply.writeInt(enabled ? 1 : 0); |
| 2562 | return true; |
| 2563 | } |
| 2564 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2565 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2566 | data.enforceInterface(IActivityManager.descriptor); |
| 2567 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2568 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2569 | reply.writeNoException(); |
| 2570 | return true; |
| 2571 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2572 | |
| 2573 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2574 | data.enforceInterface(IActivityManager.descriptor); |
| 2575 | IBinder token = data.readStrongBinder(); |
| 2576 | notifyLaunchTaskBehindComplete(token); |
| 2577 | reply.writeNoException(); |
| 2578 | return true; |
| 2579 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2580 | |
| 2581 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2582 | data.enforceInterface(IActivityManager.descriptor); |
| 2583 | IBinder token = data.readStrongBinder(); |
| 2584 | notifyEnterAnimationComplete(token); |
| 2585 | reply.writeNoException(); |
| 2586 | return true; |
| 2587 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2588 | |
| 2589 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2590 | data.enforceInterface(IActivityManager.descriptor); |
| 2591 | bootAnimationComplete(); |
| 2592 | reply.writeNoException(); |
| 2593 | return true; |
| 2594 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2595 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2596 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2597 | data.enforceInterface(IActivityManager.descriptor); |
| 2598 | final int uid = data.readInt(); |
| 2599 | final byte[] firstPacket = data.createByteArray(); |
| 2600 | notifyCleartextNetwork(uid, firstPacket); |
| 2601 | reply.writeNoException(); |
| 2602 | return true; |
| 2603 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2604 | |
| 2605 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2606 | data.enforceInterface(IActivityManager.descriptor); |
| 2607 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2608 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2609 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2610 | String reportPackage = data.readString(); |
| 2611 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2612 | reply.writeNoException(); |
| 2613 | return true; |
| 2614 | } |
| 2615 | |
| 2616 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2617 | data.enforceInterface(IActivityManager.descriptor); |
| 2618 | String path = data.readString(); |
| 2619 | dumpHeapFinished(path); |
| 2620 | reply.writeNoException(); |
| 2621 | return true; |
| 2622 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2623 | |
| 2624 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2625 | data.enforceInterface(IActivityManager.descriptor); |
| 2626 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2627 | data.readStrongBinder()); |
| 2628 | boolean keepAwake = data.readInt() != 0; |
| 2629 | setVoiceKeepAwake(session, keepAwake); |
| 2630 | reply.writeNoException(); |
| 2631 | return true; |
| 2632 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2633 | |
| 2634 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2635 | data.enforceInterface(IActivityManager.descriptor); |
| 2636 | int userId = data.readInt(); |
| 2637 | String[] packages = data.readStringArray(); |
| 2638 | updateLockTaskPackages(userId, packages); |
| 2639 | reply.writeNoException(); |
| 2640 | return true; |
| 2641 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2642 | |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 2643 | case UPDATE_DEVICE_OWNER_TRANSACTION: { |
| 2644 | data.enforceInterface(IActivityManager.descriptor); |
| 2645 | String packageName = data.readString(); |
| 2646 | updateDeviceOwner(packageName); |
| 2647 | reply.writeNoException(); |
| 2648 | return true; |
| 2649 | } |
| 2650 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2651 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2652 | data.enforceInterface(IActivityManager.descriptor); |
| 2653 | String pkg = data.readString(); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 2654 | String callingPackage = data.readString(); |
| 2655 | int res = getPackageProcessState(pkg, callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2656 | reply.writeNoException(); |
| 2657 | reply.writeInt(res); |
| 2658 | return true; |
| 2659 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2660 | |
| 2661 | case SET_PROCESS_MEMORY_TRIM_TRANSACTION: { |
| 2662 | data.enforceInterface(IActivityManager.descriptor); |
| 2663 | String process = data.readString(); |
| 2664 | int userId = data.readInt(); |
| 2665 | int level = data.readInt(); |
| 2666 | boolean res = setProcessMemoryTrimLevel(process, userId, level); |
| 2667 | reply.writeNoException(); |
| 2668 | reply.writeInt(res ? 1 : 0); |
| 2669 | return true; |
| 2670 | } |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2671 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 2672 | case IS_ROOT_VOICE_INTERACTION_TRANSACTION: { |
| 2673 | data.enforceInterface(IActivityManager.descriptor); |
| 2674 | IBinder token = data.readStrongBinder(); |
| 2675 | boolean res = isRootVoiceInteraction(token); |
| 2676 | reply.writeNoException(); |
| 2677 | reply.writeInt(res ? 1 : 0); |
| 2678 | return true; |
| 2679 | } |
Ian Pedowitz | a371084 | 2015-08-03 23:36:15 -0700 | [diff] [blame] | 2680 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2681 | case START_BINDER_TRACKING_TRANSACTION: { |
| 2682 | data.enforceInterface(IActivityManager.descriptor); |
| 2683 | boolean res = startBinderTracking(); |
| 2684 | reply.writeNoException(); |
| 2685 | reply.writeInt(res ? 1 : 0); |
| 2686 | return true; |
| 2687 | } |
| 2688 | |
| 2689 | case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: { |
| 2690 | data.enforceInterface(IActivityManager.descriptor); |
| 2691 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 2692 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
| 2693 | boolean res = stopBinderTrackingAndDump(fd); |
| 2694 | reply.writeNoException(); |
| 2695 | reply.writeInt(res ? 1 : 0); |
| 2696 | return true; |
| 2697 | } |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2698 | case GET_ACTIVITY_STACK_ID_TRANSACTION: { |
| 2699 | data.enforceInterface(IActivityManager.descriptor); |
| 2700 | IBinder token = data.readStrongBinder(); |
| 2701 | int stackId = getActivityStackId(token); |
| 2702 | reply.writeNoException(); |
| 2703 | reply.writeInt(stackId); |
| 2704 | return true; |
| 2705 | } |
| 2706 | case MOVE_ACTIVITY_TO_STACK_TRANSACTION: { |
| 2707 | data.enforceInterface(IActivityManager.descriptor); |
| 2708 | IBinder token = data.readStrongBinder(); |
| 2709 | int stackId = data.readInt(); |
| 2710 | moveActivityToStack(token, stackId); |
| 2711 | reply.writeNoException(); |
| 2712 | return true; |
| 2713 | } |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2714 | case REPORT_SIZE_CONFIGURATIONS: { |
| 2715 | data.enforceInterface(IActivityManager.descriptor); |
| 2716 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2717 | int[] horizontal = readIntArray(data); |
| 2718 | int[] vertical = readIntArray(data); |
| 2719 | int[] smallest = readIntArray(data); |
| 2720 | reportSizeConfigurations(token, horizontal, vertical, smallest); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2721 | return true; |
| 2722 | } |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 2723 | case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: { |
| 2724 | data.enforceInterface(IActivityManager.descriptor); |
| 2725 | final boolean suppress = data.readInt() == 1; |
| 2726 | suppressResizeConfigChanges(suppress); |
| 2727 | reply.writeNoException(); |
| 2728 | return true; |
| 2729 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2730 | case REMOVE_STACK_TRANSACTION: { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2731 | data.enforceInterface(IActivityManager.descriptor); |
| 2732 | final int stackId = data.readInt(); |
| 2733 | removeStack(stackId); |
| 2734 | reply.writeNoException(); |
| 2735 | return true; |
| 2736 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2737 | case GET_APP_START_MODE_TRANSACTION: { |
| 2738 | data.enforceInterface(IActivityManager.descriptor); |
| 2739 | final int uid = data.readInt(); |
| 2740 | final String pkg = data.readString(); |
| 2741 | int res = getAppStartMode(uid, pkg); |
| 2742 | reply.writeNoException(); |
| 2743 | reply.writeInt(res); |
| 2744 | return true; |
| 2745 | } |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2746 | case IN_MULTI_WINDOW_MODE_TRANSACTION: { |
| 2747 | data.enforceInterface(IActivityManager.descriptor); |
| 2748 | final IBinder token = data.readStrongBinder(); |
| 2749 | final boolean multiWindowMode = inMultiWindowMode(token); |
| 2750 | reply.writeNoException(); |
| 2751 | reply.writeInt(multiWindowMode ? 1 : 0); |
| 2752 | return true; |
| 2753 | } |
| 2754 | case IN_PICTURE_IN_PICTURE_MODE_TRANSACTION: { |
| 2755 | data.enforceInterface(IActivityManager.descriptor); |
| 2756 | final IBinder token = data.readStrongBinder(); |
| 2757 | final boolean pipMode = inPictureInPictureMode(token); |
| 2758 | reply.writeNoException(); |
| 2759 | reply.writeInt(pipMode ? 1 : 0); |
| 2760 | return true; |
| 2761 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2762 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2763 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2764 | return super.onTransact(code, data, reply, flags); |
| 2765 | } |
| 2766 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2767 | private int[] readIntArray(Parcel data) { |
| 2768 | int[] smallest = null; |
| 2769 | int smallestSize = data.readInt(); |
| 2770 | if (smallestSize > 0) { |
| 2771 | smallest = new int[smallestSize]; |
| 2772 | data.readIntArray(smallest); |
| 2773 | } |
| 2774 | return smallest; |
| 2775 | } |
| 2776 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2777 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2778 | return this; |
| 2779 | } |
| 2780 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2781 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2782 | protected IActivityManager create() { |
| 2783 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2784 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2785 | Log.v("ActivityManager", "default service binder = " + b); |
| 2786 | } |
| 2787 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2788 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2789 | Log.v("ActivityManager", "default service = " + am); |
| 2790 | } |
| 2791 | return am; |
| 2792 | } |
| 2793 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2794 | } |
| 2795 | |
| 2796 | class ActivityManagerProxy implements IActivityManager |
| 2797 | { |
| 2798 | public ActivityManagerProxy(IBinder remote) |
| 2799 | { |
| 2800 | mRemote = remote; |
| 2801 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2802 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2803 | public IBinder asBinder() |
| 2804 | { |
| 2805 | return mRemote; |
| 2806 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2807 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2808 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2809 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2810 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2811 | Parcel data = Parcel.obtain(); |
| 2812 | Parcel reply = Parcel.obtain(); |
| 2813 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2814 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2815 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2816 | intent.writeToParcel(data, 0); |
| 2817 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2818 | data.writeStrongBinder(resultTo); |
| 2819 | data.writeString(resultWho); |
| 2820 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2821 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2822 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2823 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2824 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2825 | } else { |
| 2826 | data.writeInt(0); |
| 2827 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2828 | if (options != null) { |
| 2829 | data.writeInt(1); |
| 2830 | options.writeToParcel(data, 0); |
| 2831 | } else { |
| 2832 | data.writeInt(0); |
| 2833 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2834 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2835 | reply.readException(); |
| 2836 | int result = reply.readInt(); |
| 2837 | reply.recycle(); |
| 2838 | data.recycle(); |
| 2839 | return result; |
| 2840 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2841 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2842 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2843 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2844 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2845 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2846 | Parcel data = Parcel.obtain(); |
| 2847 | Parcel reply = Parcel.obtain(); |
| 2848 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2849 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2850 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2851 | intent.writeToParcel(data, 0); |
| 2852 | data.writeString(resolvedType); |
| 2853 | data.writeStrongBinder(resultTo); |
| 2854 | data.writeString(resultWho); |
| 2855 | data.writeInt(requestCode); |
| 2856 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2857 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2858 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2859 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2860 | } else { |
| 2861 | data.writeInt(0); |
| 2862 | } |
| 2863 | if (options != null) { |
| 2864 | data.writeInt(1); |
| 2865 | options.writeToParcel(data, 0); |
| 2866 | } else { |
| 2867 | data.writeInt(0); |
| 2868 | } |
| 2869 | data.writeInt(userId); |
| 2870 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 2871 | reply.readException(); |
| 2872 | int result = reply.readInt(); |
| 2873 | reply.recycle(); |
| 2874 | data.recycle(); |
| 2875 | return result; |
| 2876 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2877 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 2878 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 2879 | int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, |
| 2880 | int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2881 | Parcel data = Parcel.obtain(); |
| 2882 | Parcel reply = Parcel.obtain(); |
| 2883 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2884 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2885 | data.writeString(callingPackage); |
| 2886 | intent.writeToParcel(data, 0); |
| 2887 | data.writeString(resolvedType); |
| 2888 | data.writeStrongBinder(resultTo); |
| 2889 | data.writeString(resultWho); |
| 2890 | data.writeInt(requestCode); |
| 2891 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2892 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2893 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2894 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2895 | } else { |
| 2896 | data.writeInt(0); |
| 2897 | } |
| 2898 | if (options != null) { |
| 2899 | data.writeInt(1); |
| 2900 | options.writeToParcel(data, 0); |
| 2901 | } else { |
| 2902 | data.writeInt(0); |
| 2903 | } |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 2904 | data.writeInt(ignoreTargetSecurity ? 1 : 0); |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 2905 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2906 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 2907 | reply.readException(); |
| 2908 | int result = reply.readInt(); |
| 2909 | reply.recycle(); |
| 2910 | data.recycle(); |
| 2911 | return result; |
| 2912 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2913 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 2914 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2915 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2916 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2917 | Parcel data = Parcel.obtain(); |
| 2918 | Parcel reply = Parcel.obtain(); |
| 2919 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2920 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2921 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2922 | intent.writeToParcel(data, 0); |
| 2923 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2924 | data.writeStrongBinder(resultTo); |
| 2925 | data.writeString(resultWho); |
| 2926 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2927 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2928 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2929 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2930 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2931 | } else { |
| 2932 | data.writeInt(0); |
| 2933 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2934 | if (options != null) { |
| 2935 | data.writeInt(1); |
| 2936 | options.writeToParcel(data, 0); |
| 2937 | } else { |
| 2938 | data.writeInt(0); |
| 2939 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2940 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2941 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 2942 | reply.readException(); |
| 2943 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 2944 | reply.recycle(); |
| 2945 | data.recycle(); |
| 2946 | return result; |
| 2947 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2948 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 2949 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2950 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2951 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2952 | Parcel data = Parcel.obtain(); |
| 2953 | Parcel reply = Parcel.obtain(); |
| 2954 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2955 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2956 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2957 | intent.writeToParcel(data, 0); |
| 2958 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2959 | data.writeStrongBinder(resultTo); |
| 2960 | data.writeString(resultWho); |
| 2961 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2962 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2963 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2964 | if (options != null) { |
| 2965 | data.writeInt(1); |
| 2966 | options.writeToParcel(data, 0); |
| 2967 | } else { |
| 2968 | data.writeInt(0); |
| 2969 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2970 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2971 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2972 | reply.readException(); |
| 2973 | int result = reply.readInt(); |
| 2974 | reply.recycle(); |
| 2975 | data.recycle(); |
| 2976 | return result; |
| 2977 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2978 | public int startActivityIntentSender(IApplicationThread caller, |
| 2979 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2980 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2981 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2982 | Parcel data = Parcel.obtain(); |
| 2983 | Parcel reply = Parcel.obtain(); |
| 2984 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2985 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2986 | intent.writeToParcel(data, 0); |
| 2987 | if (fillInIntent != null) { |
| 2988 | data.writeInt(1); |
| 2989 | fillInIntent.writeToParcel(data, 0); |
| 2990 | } else { |
| 2991 | data.writeInt(0); |
| 2992 | } |
| 2993 | data.writeString(resolvedType); |
| 2994 | data.writeStrongBinder(resultTo); |
| 2995 | data.writeString(resultWho); |
| 2996 | data.writeInt(requestCode); |
| 2997 | data.writeInt(flagsMask); |
| 2998 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2999 | if (options != null) { |
| 3000 | data.writeInt(1); |
| 3001 | options.writeToParcel(data, 0); |
| 3002 | } else { |
| 3003 | data.writeInt(0); |
| 3004 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3005 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3006 | reply.readException(); |
| 3007 | int result = reply.readInt(); |
| 3008 | reply.recycle(); |
| 3009 | data.recycle(); |
| 3010 | return result; |
| 3011 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3012 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 3013 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3014 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 3015 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3016 | Parcel data = Parcel.obtain(); |
| 3017 | Parcel reply = Parcel.obtain(); |
| 3018 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3019 | data.writeString(callingPackage); |
| 3020 | data.writeInt(callingPid); |
| 3021 | data.writeInt(callingUid); |
| 3022 | intent.writeToParcel(data, 0); |
| 3023 | data.writeString(resolvedType); |
| 3024 | data.writeStrongBinder(session.asBinder()); |
| 3025 | data.writeStrongBinder(interactor.asBinder()); |
| 3026 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3027 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3028 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3029 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3030 | } else { |
| 3031 | data.writeInt(0); |
| 3032 | } |
| 3033 | if (options != null) { |
| 3034 | data.writeInt(1); |
| 3035 | options.writeToParcel(data, 0); |
| 3036 | } else { |
| 3037 | data.writeInt(0); |
| 3038 | } |
| 3039 | data.writeInt(userId); |
| 3040 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3041 | reply.readException(); |
| 3042 | int result = reply.readInt(); |
| 3043 | reply.recycle(); |
| 3044 | data.recycle(); |
| 3045 | return result; |
| 3046 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3047 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3048 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3049 | Parcel data = Parcel.obtain(); |
| 3050 | Parcel reply = Parcel.obtain(); |
| 3051 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3052 | data.writeStrongBinder(callingActivity); |
| 3053 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3054 | if (options != null) { |
| 3055 | data.writeInt(1); |
| 3056 | options.writeToParcel(data, 0); |
| 3057 | } else { |
| 3058 | data.writeInt(0); |
| 3059 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3060 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3061 | reply.readException(); |
| 3062 | int result = reply.readInt(); |
| 3063 | reply.recycle(); |
| 3064 | data.recycle(); |
| 3065 | return result != 0; |
| 3066 | } |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3067 | public int startActivityFromRecents(int taskId, int launchStackId, Bundle options) |
| 3068 | throws RemoteException { |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3069 | Parcel data = Parcel.obtain(); |
| 3070 | Parcel reply = Parcel.obtain(); |
| 3071 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3072 | data.writeInt(taskId); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3073 | data.writeInt(launchStackId); |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3074 | if (options == null) { |
| 3075 | data.writeInt(0); |
| 3076 | } else { |
| 3077 | data.writeInt(1); |
| 3078 | options.writeToParcel(data, 0); |
| 3079 | } |
| 3080 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 3081 | reply.readException(); |
| 3082 | int result = reply.readInt(); |
| 3083 | reply.recycle(); |
| 3084 | data.recycle(); |
| 3085 | return result; |
| 3086 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3087 | 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] | 3088 | throws RemoteException { |
| 3089 | Parcel data = Parcel.obtain(); |
| 3090 | Parcel reply = Parcel.obtain(); |
| 3091 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3092 | data.writeStrongBinder(token); |
| 3093 | data.writeInt(resultCode); |
| 3094 | if (resultData != null) { |
| 3095 | data.writeInt(1); |
| 3096 | resultData.writeToParcel(data, 0); |
| 3097 | } else { |
| 3098 | data.writeInt(0); |
| 3099 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3100 | data.writeInt(finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3101 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3102 | reply.readException(); |
| 3103 | boolean res = reply.readInt() != 0; |
| 3104 | data.recycle(); |
| 3105 | reply.recycle(); |
| 3106 | return res; |
| 3107 | } |
| 3108 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 3109 | { |
| 3110 | Parcel data = Parcel.obtain(); |
| 3111 | Parcel reply = Parcel.obtain(); |
| 3112 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3113 | data.writeStrongBinder(token); |
| 3114 | data.writeString(resultWho); |
| 3115 | data.writeInt(requestCode); |
| 3116 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3117 | reply.readException(); |
| 3118 | data.recycle(); |
| 3119 | reply.recycle(); |
| 3120 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 3121 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 3122 | Parcel data = Parcel.obtain(); |
| 3123 | Parcel reply = Parcel.obtain(); |
| 3124 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3125 | data.writeStrongBinder(token); |
| 3126 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 3127 | reply.readException(); |
| 3128 | boolean res = reply.readInt() != 0; |
| 3129 | data.recycle(); |
| 3130 | reply.recycle(); |
| 3131 | return res; |
| 3132 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 3133 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 3134 | Parcel data = Parcel.obtain(); |
| 3135 | Parcel reply = Parcel.obtain(); |
| 3136 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3137 | data.writeStrongBinder(session.asBinder()); |
| 3138 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 3139 | reply.readException(); |
| 3140 | data.recycle(); |
| 3141 | reply.recycle(); |
| 3142 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 3143 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 3144 | Parcel data = Parcel.obtain(); |
| 3145 | Parcel reply = Parcel.obtain(); |
| 3146 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3147 | data.writeStrongBinder(token); |
| 3148 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 3149 | reply.readException(); |
| 3150 | boolean res = reply.readInt() != 0; |
| 3151 | data.recycle(); |
| 3152 | reply.recycle(); |
| 3153 | return res; |
| 3154 | } |
| 3155 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 3156 | Parcel data = Parcel.obtain(); |
| 3157 | Parcel reply = Parcel.obtain(); |
| 3158 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3159 | data.writeStrongBinder(app.asBinder()); |
| 3160 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 3161 | reply.readException(); |
| 3162 | data.recycle(); |
| 3163 | reply.recycle(); |
| 3164 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 3165 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 3166 | Parcel data = Parcel.obtain(); |
| 3167 | Parcel reply = Parcel.obtain(); |
| 3168 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3169 | data.writeStrongBinder(token); |
| 3170 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 3171 | reply.readException(); |
| 3172 | boolean res = reply.readInt() != 0; |
| 3173 | data.recycle(); |
| 3174 | reply.recycle(); |
| 3175 | return res; |
| 3176 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3177 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3178 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3179 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3180 | { |
| 3181 | Parcel data = Parcel.obtain(); |
| 3182 | Parcel reply = Parcel.obtain(); |
| 3183 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3184 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3185 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3186 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 3187 | filter.writeToParcel(data, 0); |
| 3188 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3189 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3190 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3191 | reply.readException(); |
| 3192 | Intent intent = null; |
| 3193 | int haveIntent = reply.readInt(); |
| 3194 | if (haveIntent != 0) { |
| 3195 | intent = Intent.CREATOR.createFromParcel(reply); |
| 3196 | } |
| 3197 | reply.recycle(); |
| 3198 | data.recycle(); |
| 3199 | return intent; |
| 3200 | } |
| 3201 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 3202 | { |
| 3203 | Parcel data = Parcel.obtain(); |
| 3204 | Parcel reply = Parcel.obtain(); |
| 3205 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3206 | data.writeStrongBinder(receiver.asBinder()); |
| 3207 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3208 | reply.readException(); |
| 3209 | data.recycle(); |
| 3210 | reply.recycle(); |
| 3211 | } |
| 3212 | public int broadcastIntent(IApplicationThread caller, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3213 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3214 | int resultCode, String resultData, Bundle map, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3215 | String[] requiredPermissions, int appOp, Bundle options, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3216 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3217 | { |
| 3218 | Parcel data = Parcel.obtain(); |
| 3219 | Parcel reply = Parcel.obtain(); |
| 3220 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3221 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3222 | intent.writeToParcel(data, 0); |
| 3223 | data.writeString(resolvedType); |
| 3224 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 3225 | data.writeInt(resultCode); |
| 3226 | data.writeString(resultData); |
| 3227 | data.writeBundle(map); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3228 | data.writeStringArray(requiredPermissions); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 3229 | data.writeInt(appOp); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3230 | data.writeBundle(options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3231 | data.writeInt(serialized ? 1 : 0); |
| 3232 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3233 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3234 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3235 | reply.readException(); |
| 3236 | int res = reply.readInt(); |
| 3237 | reply.recycle(); |
| 3238 | data.recycle(); |
| 3239 | return res; |
| 3240 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3241 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 3242 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3243 | { |
| 3244 | Parcel data = Parcel.obtain(); |
| 3245 | Parcel reply = Parcel.obtain(); |
| 3246 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3247 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3248 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3249 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3250 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3251 | reply.readException(); |
| 3252 | data.recycle(); |
| 3253 | reply.recycle(); |
| 3254 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3255 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 3256 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3257 | { |
| 3258 | Parcel data = Parcel.obtain(); |
| 3259 | Parcel reply = Parcel.obtain(); |
| 3260 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3261 | data.writeStrongBinder(who); |
| 3262 | data.writeInt(resultCode); |
| 3263 | data.writeString(resultData); |
| 3264 | data.writeBundle(map); |
| 3265 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3266 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3267 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3268 | reply.readException(); |
| 3269 | data.recycle(); |
| 3270 | reply.recycle(); |
| 3271 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3272 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3273 | { |
| 3274 | Parcel data = Parcel.obtain(); |
| 3275 | Parcel reply = Parcel.obtain(); |
| 3276 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3277 | data.writeStrongBinder(app.asBinder()); |
| 3278 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3279 | reply.readException(); |
| 3280 | data.recycle(); |
| 3281 | reply.recycle(); |
| 3282 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3283 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3284 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3285 | { |
| 3286 | Parcel data = Parcel.obtain(); |
| 3287 | Parcel reply = Parcel.obtain(); |
| 3288 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3289 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3290 | if (config != null) { |
| 3291 | data.writeInt(1); |
| 3292 | config.writeToParcel(data, 0); |
| 3293 | } else { |
| 3294 | data.writeInt(0); |
| 3295 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3296 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3297 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3298 | reply.readException(); |
| 3299 | data.recycle(); |
| 3300 | reply.recycle(); |
| 3301 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3302 | public void activityResumed(IBinder token) throws RemoteException |
| 3303 | { |
| 3304 | Parcel data = Parcel.obtain(); |
| 3305 | Parcel reply = Parcel.obtain(); |
| 3306 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3307 | data.writeStrongBinder(token); |
| 3308 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3309 | reply.readException(); |
| 3310 | data.recycle(); |
| 3311 | reply.recycle(); |
| 3312 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3313 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3314 | { |
| 3315 | Parcel data = Parcel.obtain(); |
| 3316 | Parcel reply = Parcel.obtain(); |
| 3317 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3318 | data.writeStrongBinder(token); |
| 3319 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3320 | reply.readException(); |
| 3321 | data.recycle(); |
| 3322 | reply.recycle(); |
| 3323 | } |
| 3324 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3325 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3326 | { |
| 3327 | Parcel data = Parcel.obtain(); |
| 3328 | Parcel reply = Parcel.obtain(); |
| 3329 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3330 | data.writeStrongBinder(token); |
| 3331 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3332 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3333 | TextUtils.writeToParcel(description, data, 0); |
| 3334 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3335 | reply.readException(); |
| 3336 | data.recycle(); |
| 3337 | reply.recycle(); |
| 3338 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3339 | public void activitySlept(IBinder token) throws RemoteException |
| 3340 | { |
| 3341 | Parcel data = Parcel.obtain(); |
| 3342 | Parcel reply = Parcel.obtain(); |
| 3343 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3344 | data.writeStrongBinder(token); |
| 3345 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3346 | reply.readException(); |
| 3347 | data.recycle(); |
| 3348 | reply.recycle(); |
| 3349 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3350 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3351 | { |
| 3352 | Parcel data = Parcel.obtain(); |
| 3353 | Parcel reply = Parcel.obtain(); |
| 3354 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3355 | data.writeStrongBinder(token); |
| 3356 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3357 | reply.readException(); |
| 3358 | data.recycle(); |
| 3359 | reply.recycle(); |
| 3360 | } |
| 3361 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3362 | { |
| 3363 | Parcel data = Parcel.obtain(); |
| 3364 | Parcel reply = Parcel.obtain(); |
| 3365 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3366 | data.writeStrongBinder(token); |
| 3367 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3368 | reply.readException(); |
| 3369 | String res = reply.readString(); |
| 3370 | data.recycle(); |
| 3371 | reply.recycle(); |
| 3372 | return res; |
| 3373 | } |
| 3374 | public ComponentName getCallingActivity(IBinder token) |
| 3375 | throws RemoteException { |
| 3376 | Parcel data = Parcel.obtain(); |
| 3377 | Parcel reply = Parcel.obtain(); |
| 3378 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3379 | data.writeStrongBinder(token); |
| 3380 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3381 | reply.readException(); |
| 3382 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3383 | data.recycle(); |
| 3384 | reply.recycle(); |
| 3385 | return res; |
| 3386 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3387 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3388 | Parcel data = Parcel.obtain(); |
| 3389 | Parcel reply = Parcel.obtain(); |
| 3390 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3391 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3392 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3393 | reply.readException(); |
| 3394 | ArrayList<IAppTask> list = null; |
| 3395 | int N = reply.readInt(); |
| 3396 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3397 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3398 | while (N > 0) { |
| 3399 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3400 | list.add(task); |
| 3401 | N--; |
| 3402 | } |
| 3403 | } |
| 3404 | data.recycle(); |
| 3405 | reply.recycle(); |
| 3406 | return list; |
| 3407 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3408 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3409 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3410 | Parcel data = Parcel.obtain(); |
| 3411 | Parcel reply = Parcel.obtain(); |
| 3412 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3413 | data.writeStrongBinder(activityToken); |
| 3414 | intent.writeToParcel(data, 0); |
| 3415 | description.writeToParcel(data, 0); |
| 3416 | thumbnail.writeToParcel(data, 0); |
| 3417 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3418 | reply.readException(); |
| 3419 | int res = reply.readInt(); |
| 3420 | data.recycle(); |
| 3421 | reply.recycle(); |
| 3422 | return res; |
| 3423 | } |
| 3424 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3425 | Parcel data = Parcel.obtain(); |
| 3426 | Parcel reply = Parcel.obtain(); |
| 3427 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3428 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3429 | reply.readException(); |
| 3430 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3431 | data.recycle(); |
| 3432 | reply.recycle(); |
| 3433 | return size; |
| 3434 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3435 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3436 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3437 | Parcel data = Parcel.obtain(); |
| 3438 | Parcel reply = Parcel.obtain(); |
| 3439 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3440 | data.writeInt(maxNum); |
| 3441 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3442 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3443 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3444 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3445 | int N = reply.readInt(); |
| 3446 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3447 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3448 | while (N > 0) { |
| 3449 | ActivityManager.RunningTaskInfo info = |
| 3450 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3451 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3452 | list.add(info); |
| 3453 | N--; |
| 3454 | } |
| 3455 | } |
| 3456 | data.recycle(); |
| 3457 | reply.recycle(); |
| 3458 | return list; |
| 3459 | } |
| 3460 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3461 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3462 | Parcel data = Parcel.obtain(); |
| 3463 | Parcel reply = Parcel.obtain(); |
| 3464 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3465 | data.writeInt(maxNum); |
| 3466 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3467 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3468 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3469 | reply.readException(); |
| 3470 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3471 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3472 | data.recycle(); |
| 3473 | reply.recycle(); |
| 3474 | return list; |
| 3475 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3476 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3477 | Parcel data = Parcel.obtain(); |
| 3478 | Parcel reply = Parcel.obtain(); |
| 3479 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3480 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3481 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3482 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3483 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3484 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3485 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3486 | } |
| 3487 | data.recycle(); |
| 3488 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3489 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3490 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3491 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3492 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3493 | Parcel data = Parcel.obtain(); |
| 3494 | Parcel reply = Parcel.obtain(); |
| 3495 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3496 | data.writeInt(maxNum); |
| 3497 | data.writeInt(flags); |
| 3498 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3499 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3500 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3501 | int N = reply.readInt(); |
| 3502 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3503 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3504 | while (N > 0) { |
| 3505 | ActivityManager.RunningServiceInfo info = |
| 3506 | ActivityManager.RunningServiceInfo.CREATOR |
| 3507 | .createFromParcel(reply); |
| 3508 | list.add(info); |
| 3509 | N--; |
| 3510 | } |
| 3511 | } |
| 3512 | data.recycle(); |
| 3513 | reply.recycle(); |
| 3514 | return list; |
| 3515 | } |
| 3516 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3517 | throws RemoteException { |
| 3518 | Parcel data = Parcel.obtain(); |
| 3519 | Parcel reply = Parcel.obtain(); |
| 3520 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3521 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3522 | reply.readException(); |
| 3523 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3524 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3525 | data.recycle(); |
| 3526 | reply.recycle(); |
| 3527 | return list; |
| 3528 | } |
| 3529 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3530 | throws RemoteException { |
| 3531 | Parcel data = Parcel.obtain(); |
| 3532 | Parcel reply = Parcel.obtain(); |
| 3533 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3534 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3535 | reply.readException(); |
| 3536 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3537 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3538 | data.recycle(); |
| 3539 | reply.recycle(); |
| 3540 | return list; |
| 3541 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3542 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3543 | throws RemoteException { |
| 3544 | Parcel data = Parcel.obtain(); |
| 3545 | Parcel reply = Parcel.obtain(); |
| 3546 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3547 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3548 | reply.readException(); |
| 3549 | ArrayList<ApplicationInfo> list |
| 3550 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3551 | data.recycle(); |
| 3552 | reply.recycle(); |
| 3553 | return list; |
| 3554 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3555 | 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] | 3556 | { |
| 3557 | Parcel data = Parcel.obtain(); |
| 3558 | Parcel reply = Parcel.obtain(); |
| 3559 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3560 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3561 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3562 | if (options != null) { |
| 3563 | data.writeInt(1); |
| 3564 | options.writeToParcel(data, 0); |
| 3565 | } else { |
| 3566 | data.writeInt(0); |
| 3567 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3568 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3569 | reply.readException(); |
| 3570 | data.recycle(); |
| 3571 | reply.recycle(); |
| 3572 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3573 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3574 | throws RemoteException { |
| 3575 | Parcel data = Parcel.obtain(); |
| 3576 | Parcel reply = Parcel.obtain(); |
| 3577 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3578 | data.writeStrongBinder(token); |
| 3579 | data.writeInt(nonRoot ? 1 : 0); |
| 3580 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3581 | reply.readException(); |
| 3582 | boolean res = reply.readInt() != 0; |
| 3583 | data.recycle(); |
| 3584 | reply.recycle(); |
| 3585 | return res; |
| 3586 | } |
| 3587 | public void moveTaskBackwards(int task) throws RemoteException |
| 3588 | { |
| 3589 | Parcel data = Parcel.obtain(); |
| 3590 | Parcel reply = Parcel.obtain(); |
| 3591 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3592 | data.writeInt(task); |
| 3593 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3594 | reply.readException(); |
| 3595 | data.recycle(); |
| 3596 | reply.recycle(); |
| 3597 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3598 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3599 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3600 | { |
| 3601 | Parcel data = Parcel.obtain(); |
| 3602 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3603 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3604 | data.writeInt(taskId); |
| 3605 | data.writeInt(stackId); |
| 3606 | data.writeInt(toTop ? 1 : 0); |
| 3607 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3608 | reply.readException(); |
| 3609 | data.recycle(); |
| 3610 | reply.recycle(); |
| 3611 | } |
| 3612 | @Override |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3613 | public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, |
| 3614 | Rect initialBounds) throws RemoteException |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3615 | { |
| 3616 | Parcel data = Parcel.obtain(); |
| 3617 | Parcel reply = Parcel.obtain(); |
| 3618 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3619 | data.writeInt(taskId); |
| 3620 | data.writeInt(createMode); |
| 3621 | data.writeInt(toTop ? 1 : 0); |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 3622 | data.writeInt(animate ? 1 : 0); |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3623 | if (initialBounds != null) { |
| 3624 | data.writeInt(1); |
| 3625 | initialBounds.writeToParcel(data, 0); |
| 3626 | } else { |
| 3627 | data.writeInt(0); |
| 3628 | } |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3629 | mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3630 | reply.readException(); |
| 3631 | data.recycle(); |
| 3632 | reply.recycle(); |
| 3633 | } |
| 3634 | @Override |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3635 | public boolean moveTopActivityToPinnedStack(int stackId, Rect r) |
| 3636 | throws RemoteException |
| 3637 | { |
| 3638 | Parcel data = Parcel.obtain(); |
| 3639 | Parcel reply = Parcel.obtain(); |
| 3640 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3641 | data.writeInt(stackId); |
| 3642 | r.writeToParcel(data, 0); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 3643 | mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3644 | reply.readException(); |
| 3645 | final boolean res = reply.readInt() != 0; |
| 3646 | data.recycle(); |
| 3647 | reply.recycle(); |
| 3648 | return res; |
| 3649 | } |
| 3650 | @Override |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3651 | public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode) |
| 3652 | throws RemoteException |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3653 | { |
| 3654 | Parcel data = Parcel.obtain(); |
| 3655 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3656 | data.writeInterfaceToken(IActivityManager.descriptor); |
Wale Ogunwale | b34a7ad | 2015-08-14 11:05:30 -0700 | [diff] [blame] | 3657 | data.writeInt(stackId); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 3658 | if (r != null) { |
| 3659 | data.writeInt(1); |
| 3660 | r.writeToParcel(data, 0); |
| 3661 | } else { |
| 3662 | data.writeInt(0); |
| 3663 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3664 | data.writeInt(allowResizeInDockedMode ? 1 : 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3665 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3666 | reply.readException(); |
| 3667 | data.recycle(); |
| 3668 | reply.recycle(); |
| 3669 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3670 | @Override |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 3671 | public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException |
| 3672 | { |
| 3673 | Parcel data = Parcel.obtain(); |
| 3674 | Parcel reply = Parcel.obtain(); |
| 3675 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3676 | data.writeInt(taskId); |
| 3677 | data.writeInt(stackId); |
| 3678 | data.writeInt(position); |
| 3679 | mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0); |
| 3680 | reply.readException(); |
| 3681 | data.recycle(); |
| 3682 | reply.recycle(); |
| 3683 | } |
| 3684 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3685 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3686 | { |
| 3687 | Parcel data = Parcel.obtain(); |
| 3688 | Parcel reply = Parcel.obtain(); |
| 3689 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3690 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3691 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3692 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3693 | data.recycle(); |
| 3694 | reply.recycle(); |
| 3695 | return list; |
| 3696 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3697 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3698 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3699 | { |
| 3700 | Parcel data = Parcel.obtain(); |
| 3701 | Parcel reply = Parcel.obtain(); |
| 3702 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3703 | data.writeInt(stackId); |
| 3704 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3705 | reply.readException(); |
| 3706 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3707 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3708 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3709 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3710 | } |
| 3711 | data.recycle(); |
| 3712 | reply.recycle(); |
| 3713 | return info; |
| 3714 | } |
| 3715 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 3716 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 3717 | Parcel data = Parcel.obtain(); |
| 3718 | Parcel reply = Parcel.obtain(); |
| 3719 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3720 | data.writeInt(taskId); |
| 3721 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 3722 | reply.readException(); |
| 3723 | boolean isInHomeStack = reply.readInt() > 0; |
| 3724 | data.recycle(); |
| 3725 | reply.recycle(); |
| 3726 | return isInHomeStack; |
| 3727 | } |
| 3728 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3729 | public void setFocusedStack(int stackId) throws RemoteException |
| 3730 | { |
| 3731 | Parcel data = Parcel.obtain(); |
| 3732 | Parcel reply = Parcel.obtain(); |
| 3733 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3734 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3735 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3736 | reply.readException(); |
| 3737 | data.recycle(); |
| 3738 | reply.recycle(); |
| 3739 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3740 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 3741 | public int getFocusedStackId() throws RemoteException { |
| 3742 | Parcel data = Parcel.obtain(); |
| 3743 | Parcel reply = Parcel.obtain(); |
| 3744 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3745 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 3746 | reply.readException(); |
| 3747 | int focusedStackId = reply.readInt(); |
| 3748 | data.recycle(); |
| 3749 | reply.recycle(); |
| 3750 | return focusedStackId; |
| 3751 | } |
| 3752 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 3753 | public void setFocusedTask(int taskId) throws RemoteException |
| 3754 | { |
| 3755 | Parcel data = Parcel.obtain(); |
| 3756 | Parcel reply = Parcel.obtain(); |
| 3757 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3758 | data.writeInt(taskId); |
| 3759 | mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0); |
| 3760 | reply.readException(); |
| 3761 | data.recycle(); |
| 3762 | reply.recycle(); |
| 3763 | } |
| 3764 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3765 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 3766 | { |
| 3767 | Parcel data = Parcel.obtain(); |
| 3768 | Parcel reply = Parcel.obtain(); |
| 3769 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3770 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3771 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3772 | reply.readException(); |
| 3773 | data.recycle(); |
| 3774 | reply.recycle(); |
| 3775 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3776 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 3777 | { |
| 3778 | Parcel data = Parcel.obtain(); |
| 3779 | Parcel reply = Parcel.obtain(); |
| 3780 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3781 | data.writeStrongBinder(token); |
| 3782 | data.writeInt(onlyRoot ? 1 : 0); |
| 3783 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3784 | reply.readException(); |
| 3785 | int res = reply.readInt(); |
| 3786 | data.recycle(); |
| 3787 | reply.recycle(); |
| 3788 | return res; |
| 3789 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3790 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3791 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3792 | Parcel data = Parcel.obtain(); |
| 3793 | Parcel reply = Parcel.obtain(); |
| 3794 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3795 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3796 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3797 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3798 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3799 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3800 | reply.readException(); |
| 3801 | int res = reply.readInt(); |
| 3802 | ContentProviderHolder cph = null; |
| 3803 | if (res != 0) { |
| 3804 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 3805 | } |
| 3806 | data.recycle(); |
| 3807 | reply.recycle(); |
| 3808 | return cph; |
| 3809 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3810 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 3811 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3812 | Parcel data = Parcel.obtain(); |
| 3813 | Parcel reply = Parcel.obtain(); |
| 3814 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3815 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3816 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3817 | data.writeStrongBinder(token); |
| 3818 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3819 | reply.readException(); |
| 3820 | int res = reply.readInt(); |
| 3821 | ContentProviderHolder cph = null; |
| 3822 | if (res != 0) { |
| 3823 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 3824 | } |
| 3825 | data.recycle(); |
| 3826 | reply.recycle(); |
| 3827 | return cph; |
| 3828 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3829 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3830 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3831 | { |
| 3832 | Parcel data = Parcel.obtain(); |
| 3833 | Parcel reply = Parcel.obtain(); |
| 3834 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3835 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3836 | data.writeTypedList(providers); |
| 3837 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 3838 | reply.readException(); |
| 3839 | data.recycle(); |
| 3840 | reply.recycle(); |
| 3841 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3842 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 3843 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3844 | Parcel data = Parcel.obtain(); |
| 3845 | Parcel reply = Parcel.obtain(); |
| 3846 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3847 | data.writeStrongBinder(connection); |
| 3848 | data.writeInt(stable); |
| 3849 | data.writeInt(unstable); |
| 3850 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3851 | reply.readException(); |
| 3852 | boolean res = reply.readInt() != 0; |
| 3853 | data.recycle(); |
| 3854 | reply.recycle(); |
| 3855 | return res; |
| 3856 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3857 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3858 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 3859 | Parcel data = Parcel.obtain(); |
| 3860 | Parcel reply = Parcel.obtain(); |
| 3861 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3862 | data.writeStrongBinder(connection); |
| 3863 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 3864 | reply.readException(); |
| 3865 | data.recycle(); |
| 3866 | reply.recycle(); |
| 3867 | } |
| 3868 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3869 | @Override |
| 3870 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 3871 | Parcel data = Parcel.obtain(); |
| 3872 | Parcel reply = Parcel.obtain(); |
| 3873 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3874 | data.writeStrongBinder(connection); |
| 3875 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 3876 | reply.readException(); |
| 3877 | data.recycle(); |
| 3878 | reply.recycle(); |
| 3879 | } |
| 3880 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3881 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 3882 | Parcel data = Parcel.obtain(); |
| 3883 | Parcel reply = Parcel.obtain(); |
| 3884 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3885 | data.writeStrongBinder(connection); |
| 3886 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3887 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3888 | reply.readException(); |
| 3889 | data.recycle(); |
| 3890 | reply.recycle(); |
| 3891 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3892 | |
| 3893 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 3894 | Parcel data = Parcel.obtain(); |
| 3895 | Parcel reply = Parcel.obtain(); |
| 3896 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3897 | data.writeString(name); |
| 3898 | data.writeStrongBinder(token); |
| 3899 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3900 | reply.readException(); |
| 3901 | data.recycle(); |
| 3902 | reply.recycle(); |
| 3903 | } |
| 3904 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 3905 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 3906 | throws RemoteException |
| 3907 | { |
| 3908 | Parcel data = Parcel.obtain(); |
| 3909 | Parcel reply = Parcel.obtain(); |
| 3910 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3911 | service.writeToParcel(data, 0); |
| 3912 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 3913 | reply.readException(); |
| 3914 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 3915 | data.recycle(); |
| 3916 | reply.recycle(); |
| 3917 | return res; |
| 3918 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 3919 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3920 | public ComponentName startService(IApplicationThread caller, Intent service, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3921 | String resolvedType, String callingPackage, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3922 | { |
| 3923 | Parcel data = Parcel.obtain(); |
| 3924 | Parcel reply = Parcel.obtain(); |
| 3925 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3926 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3927 | service.writeToParcel(data, 0); |
| 3928 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3929 | data.writeString(callingPackage); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3930 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3931 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 3932 | reply.readException(); |
| 3933 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3934 | data.recycle(); |
| 3935 | reply.recycle(); |
| 3936 | return res; |
| 3937 | } |
| 3938 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3939 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3940 | { |
| 3941 | Parcel data = Parcel.obtain(); |
| 3942 | Parcel reply = Parcel.obtain(); |
| 3943 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3944 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3945 | service.writeToParcel(data, 0); |
| 3946 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3947 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3948 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 3949 | reply.readException(); |
| 3950 | int res = reply.readInt(); |
| 3951 | reply.recycle(); |
| 3952 | data.recycle(); |
| 3953 | return res; |
| 3954 | } |
| 3955 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 3956 | int startId) throws RemoteException { |
| 3957 | Parcel data = Parcel.obtain(); |
| 3958 | Parcel reply = Parcel.obtain(); |
| 3959 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3960 | ComponentName.writeToParcel(className, data); |
| 3961 | data.writeStrongBinder(token); |
| 3962 | data.writeInt(startId); |
| 3963 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 3964 | reply.readException(); |
| 3965 | boolean res = reply.readInt() != 0; |
| 3966 | data.recycle(); |
| 3967 | reply.recycle(); |
| 3968 | return res; |
| 3969 | } |
| 3970 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3971 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3972 | Parcel data = Parcel.obtain(); |
| 3973 | Parcel reply = Parcel.obtain(); |
| 3974 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3975 | ComponentName.writeToParcel(className, data); |
| 3976 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3977 | data.writeInt(id); |
| 3978 | if (notification != null) { |
| 3979 | data.writeInt(1); |
| 3980 | notification.writeToParcel(data, 0); |
| 3981 | } else { |
| 3982 | data.writeInt(0); |
| 3983 | } |
| 3984 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3985 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3986 | reply.readException(); |
| 3987 | data.recycle(); |
| 3988 | reply.recycle(); |
| 3989 | } |
| 3990 | public int bindService(IApplicationThread caller, IBinder token, |
| 3991 | Intent service, String resolvedType, IServiceConnection connection, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3992 | int flags, String callingPackage, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3993 | Parcel data = Parcel.obtain(); |
| 3994 | Parcel reply = Parcel.obtain(); |
| 3995 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3996 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3997 | data.writeStrongBinder(token); |
| 3998 | service.writeToParcel(data, 0); |
| 3999 | data.writeString(resolvedType); |
| 4000 | data.writeStrongBinder(connection.asBinder()); |
| 4001 | data.writeInt(flags); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4002 | data.writeString(callingPackage); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 4003 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4004 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4005 | reply.readException(); |
| 4006 | int res = reply.readInt(); |
| 4007 | data.recycle(); |
| 4008 | reply.recycle(); |
| 4009 | return res; |
| 4010 | } |
| 4011 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 4012 | { |
| 4013 | Parcel data = Parcel.obtain(); |
| 4014 | Parcel reply = Parcel.obtain(); |
| 4015 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4016 | data.writeStrongBinder(connection.asBinder()); |
| 4017 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4018 | reply.readException(); |
| 4019 | boolean res = reply.readInt() != 0; |
| 4020 | data.recycle(); |
| 4021 | reply.recycle(); |
| 4022 | return res; |
| 4023 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4024 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4025 | public void publishService(IBinder token, |
| 4026 | Intent intent, IBinder service) throws RemoteException { |
| 4027 | Parcel data = Parcel.obtain(); |
| 4028 | Parcel reply = Parcel.obtain(); |
| 4029 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4030 | data.writeStrongBinder(token); |
| 4031 | intent.writeToParcel(data, 0); |
| 4032 | data.writeStrongBinder(service); |
| 4033 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 4034 | reply.readException(); |
| 4035 | data.recycle(); |
| 4036 | reply.recycle(); |
| 4037 | } |
| 4038 | |
| 4039 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 4040 | throws RemoteException { |
| 4041 | Parcel data = Parcel.obtain(); |
| 4042 | Parcel reply = Parcel.obtain(); |
| 4043 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4044 | data.writeStrongBinder(token); |
| 4045 | intent.writeToParcel(data, 0); |
| 4046 | data.writeInt(doRebind ? 1 : 0); |
| 4047 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 4048 | reply.readException(); |
| 4049 | data.recycle(); |
| 4050 | reply.recycle(); |
| 4051 | } |
| 4052 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4053 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 4054 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4055 | Parcel data = Parcel.obtain(); |
| 4056 | Parcel reply = Parcel.obtain(); |
| 4057 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4058 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4059 | data.writeInt(type); |
| 4060 | data.writeInt(startId); |
| 4061 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4062 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 4063 | reply.readException(); |
| 4064 | data.recycle(); |
| 4065 | reply.recycle(); |
| 4066 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4067 | |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4068 | public IBinder peekService(Intent service, String resolvedType, String callingPackage) |
| 4069 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4070 | Parcel data = Parcel.obtain(); |
| 4071 | Parcel reply = Parcel.obtain(); |
| 4072 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4073 | service.writeToParcel(data, 0); |
| 4074 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4075 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4076 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 4077 | reply.readException(); |
| 4078 | IBinder binder = reply.readStrongBinder(); |
| 4079 | reply.recycle(); |
| 4080 | data.recycle(); |
| 4081 | return binder; |
| 4082 | } |
| 4083 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4084 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 4085 | throws RemoteException { |
| 4086 | Parcel data = Parcel.obtain(); |
| 4087 | Parcel reply = Parcel.obtain(); |
| 4088 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4089 | app.writeToParcel(data, 0); |
| 4090 | data.writeInt(backupRestoreMode); |
| 4091 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4092 | reply.readException(); |
| 4093 | boolean success = reply.readInt() != 0; |
| 4094 | reply.recycle(); |
| 4095 | data.recycle(); |
| 4096 | return success; |
| 4097 | } |
| 4098 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 4099 | public void clearPendingBackup() throws RemoteException { |
| 4100 | Parcel data = Parcel.obtain(); |
| 4101 | Parcel reply = Parcel.obtain(); |
| 4102 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4103 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 4104 | reply.recycle(); |
| 4105 | data.recycle(); |
| 4106 | } |
| 4107 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4108 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 4109 | Parcel data = Parcel.obtain(); |
| 4110 | Parcel reply = Parcel.obtain(); |
| 4111 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4112 | data.writeString(packageName); |
| 4113 | data.writeStrongBinder(agent); |
| 4114 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 4115 | reply.recycle(); |
| 4116 | data.recycle(); |
| 4117 | } |
| 4118 | |
| 4119 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 4120 | Parcel data = Parcel.obtain(); |
| 4121 | Parcel reply = Parcel.obtain(); |
| 4122 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4123 | app.writeToParcel(data, 0); |
| 4124 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4125 | reply.readException(); |
| 4126 | reply.recycle(); |
| 4127 | data.recycle(); |
| 4128 | } |
| 4129 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4130 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4131 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4132 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 4133 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4134 | Parcel data = Parcel.obtain(); |
| 4135 | Parcel reply = Parcel.obtain(); |
| 4136 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4137 | ComponentName.writeToParcel(className, data); |
| 4138 | data.writeString(profileFile); |
| 4139 | data.writeInt(flags); |
| 4140 | data.writeBundle(arguments); |
| 4141 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4142 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4143 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4144 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4145 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4146 | reply.readException(); |
| 4147 | boolean res = reply.readInt() != 0; |
| 4148 | reply.recycle(); |
| 4149 | data.recycle(); |
| 4150 | return res; |
| 4151 | } |
| 4152 | |
| 4153 | public void finishInstrumentation(IApplicationThread target, |
| 4154 | int resultCode, Bundle results) throws RemoteException { |
| 4155 | Parcel data = Parcel.obtain(); |
| 4156 | Parcel reply = Parcel.obtain(); |
| 4157 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4158 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 4159 | data.writeInt(resultCode); |
| 4160 | data.writeBundle(results); |
| 4161 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4162 | reply.readException(); |
| 4163 | data.recycle(); |
| 4164 | reply.recycle(); |
| 4165 | } |
| 4166 | public Configuration getConfiguration() throws RemoteException |
| 4167 | { |
| 4168 | Parcel data = Parcel.obtain(); |
| 4169 | Parcel reply = Parcel.obtain(); |
| 4170 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4171 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4172 | reply.readException(); |
| 4173 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 4174 | reply.recycle(); |
| 4175 | data.recycle(); |
| 4176 | return res; |
| 4177 | } |
| 4178 | public void updateConfiguration(Configuration values) throws RemoteException |
| 4179 | { |
| 4180 | Parcel data = Parcel.obtain(); |
| 4181 | Parcel reply = Parcel.obtain(); |
| 4182 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4183 | values.writeToParcel(data, 0); |
| 4184 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4185 | reply.readException(); |
| 4186 | data.recycle(); |
| 4187 | reply.recycle(); |
| 4188 | } |
| 4189 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 4190 | throws RemoteException { |
| 4191 | Parcel data = Parcel.obtain(); |
| 4192 | Parcel reply = Parcel.obtain(); |
| 4193 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4194 | data.writeStrongBinder(token); |
| 4195 | data.writeInt(requestedOrientation); |
| 4196 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4197 | reply.readException(); |
| 4198 | data.recycle(); |
| 4199 | reply.recycle(); |
| 4200 | } |
| 4201 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 4202 | Parcel data = Parcel.obtain(); |
| 4203 | Parcel reply = Parcel.obtain(); |
| 4204 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4205 | data.writeStrongBinder(token); |
| 4206 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4207 | reply.readException(); |
| 4208 | int res = reply.readInt(); |
| 4209 | data.recycle(); |
| 4210 | reply.recycle(); |
| 4211 | return res; |
| 4212 | } |
| 4213 | public ComponentName getActivityClassForToken(IBinder token) |
| 4214 | throws RemoteException { |
| 4215 | Parcel data = Parcel.obtain(); |
| 4216 | Parcel reply = Parcel.obtain(); |
| 4217 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4218 | data.writeStrongBinder(token); |
| 4219 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4220 | reply.readException(); |
| 4221 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4222 | data.recycle(); |
| 4223 | reply.recycle(); |
| 4224 | return res; |
| 4225 | } |
| 4226 | public String getPackageForToken(IBinder token) throws RemoteException |
| 4227 | { |
| 4228 | Parcel data = Parcel.obtain(); |
| 4229 | Parcel reply = Parcel.obtain(); |
| 4230 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4231 | data.writeStrongBinder(token); |
| 4232 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4233 | reply.readException(); |
| 4234 | String res = reply.readString(); |
| 4235 | data.recycle(); |
| 4236 | reply.recycle(); |
| 4237 | return res; |
| 4238 | } |
| 4239 | public IIntentSender getIntentSender(int type, |
| 4240 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4241 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4242 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4243 | Parcel data = Parcel.obtain(); |
| 4244 | Parcel reply = Parcel.obtain(); |
| 4245 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4246 | data.writeInt(type); |
| 4247 | data.writeString(packageName); |
| 4248 | data.writeStrongBinder(token); |
| 4249 | data.writeString(resultWho); |
| 4250 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4251 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4252 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4253 | data.writeTypedArray(intents, 0); |
| 4254 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4255 | } else { |
| 4256 | data.writeInt(0); |
| 4257 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4258 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4259 | if (options != null) { |
| 4260 | data.writeInt(1); |
| 4261 | options.writeToParcel(data, 0); |
| 4262 | } else { |
| 4263 | data.writeInt(0); |
| 4264 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4265 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4266 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4267 | reply.readException(); |
| 4268 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4269 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4270 | data.recycle(); |
| 4271 | reply.recycle(); |
| 4272 | return res; |
| 4273 | } |
| 4274 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 4275 | Parcel data = Parcel.obtain(); |
| 4276 | Parcel reply = Parcel.obtain(); |
| 4277 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4278 | data.writeStrongBinder(sender.asBinder()); |
| 4279 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4280 | reply.readException(); |
| 4281 | data.recycle(); |
| 4282 | reply.recycle(); |
| 4283 | } |
| 4284 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 4285 | Parcel data = Parcel.obtain(); |
| 4286 | Parcel reply = Parcel.obtain(); |
| 4287 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4288 | data.writeStrongBinder(sender.asBinder()); |
| 4289 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4290 | reply.readException(); |
| 4291 | String res = reply.readString(); |
| 4292 | data.recycle(); |
| 4293 | reply.recycle(); |
| 4294 | return res; |
| 4295 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 4296 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 4297 | Parcel data = Parcel.obtain(); |
| 4298 | Parcel reply = Parcel.obtain(); |
| 4299 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4300 | data.writeStrongBinder(sender.asBinder()); |
| 4301 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4302 | reply.readException(); |
| 4303 | int res = reply.readInt(); |
| 4304 | data.recycle(); |
| 4305 | reply.recycle(); |
| 4306 | return res; |
| 4307 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4308 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 4309 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 4310 | Parcel data = Parcel.obtain(); |
| 4311 | Parcel reply = Parcel.obtain(); |
| 4312 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4313 | data.writeInt(callingPid); |
| 4314 | data.writeInt(callingUid); |
| 4315 | data.writeInt(userId); |
| 4316 | data.writeInt(allowAll ? 1 : 0); |
| 4317 | data.writeInt(requireFull ? 1 : 0); |
| 4318 | data.writeString(name); |
| 4319 | data.writeString(callerPackage); |
| 4320 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 4321 | reply.readException(); |
| 4322 | int res = reply.readInt(); |
| 4323 | data.recycle(); |
| 4324 | reply.recycle(); |
| 4325 | return res; |
| 4326 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4327 | public void setProcessLimit(int max) throws RemoteException |
| 4328 | { |
| 4329 | Parcel data = Parcel.obtain(); |
| 4330 | Parcel reply = Parcel.obtain(); |
| 4331 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4332 | data.writeInt(max); |
| 4333 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4334 | reply.readException(); |
| 4335 | data.recycle(); |
| 4336 | reply.recycle(); |
| 4337 | } |
| 4338 | public int getProcessLimit() throws RemoteException |
| 4339 | { |
| 4340 | Parcel data = Parcel.obtain(); |
| 4341 | Parcel reply = Parcel.obtain(); |
| 4342 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4343 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4344 | reply.readException(); |
| 4345 | int res = reply.readInt(); |
| 4346 | data.recycle(); |
| 4347 | reply.recycle(); |
| 4348 | return res; |
| 4349 | } |
| 4350 | public void setProcessForeground(IBinder token, int pid, |
| 4351 | boolean isForeground) throws RemoteException { |
| 4352 | Parcel data = Parcel.obtain(); |
| 4353 | Parcel reply = Parcel.obtain(); |
| 4354 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4355 | data.writeStrongBinder(token); |
| 4356 | data.writeInt(pid); |
| 4357 | data.writeInt(isForeground ? 1 : 0); |
| 4358 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4359 | reply.readException(); |
| 4360 | data.recycle(); |
| 4361 | reply.recycle(); |
| 4362 | } |
| 4363 | public int checkPermission(String permission, int pid, int uid) |
| 4364 | throws RemoteException { |
| 4365 | Parcel data = Parcel.obtain(); |
| 4366 | Parcel reply = Parcel.obtain(); |
| 4367 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4368 | data.writeString(permission); |
| 4369 | data.writeInt(pid); |
| 4370 | data.writeInt(uid); |
| 4371 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4372 | reply.readException(); |
| 4373 | int res = reply.readInt(); |
| 4374 | data.recycle(); |
| 4375 | reply.recycle(); |
| 4376 | return res; |
| 4377 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4378 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4379 | throws RemoteException { |
| 4380 | Parcel data = Parcel.obtain(); |
| 4381 | Parcel reply = Parcel.obtain(); |
| 4382 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4383 | data.writeString(permission); |
| 4384 | data.writeInt(pid); |
| 4385 | data.writeInt(uid); |
| 4386 | data.writeStrongBinder(callerToken); |
| 4387 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4388 | reply.readException(); |
| 4389 | int res = reply.readInt(); |
| 4390 | data.recycle(); |
| 4391 | reply.recycle(); |
| 4392 | return res; |
| 4393 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4394 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4395 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4396 | Parcel data = Parcel.obtain(); |
| 4397 | Parcel reply = Parcel.obtain(); |
| 4398 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4399 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4400 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4401 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4402 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4403 | reply.readException(); |
| 4404 | boolean res = reply.readInt() != 0; |
| 4405 | data.recycle(); |
| 4406 | reply.recycle(); |
| 4407 | return res; |
| 4408 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4409 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4410 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4411 | Parcel data = Parcel.obtain(); |
| 4412 | Parcel reply = Parcel.obtain(); |
| 4413 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4414 | uri.writeToParcel(data, 0); |
| 4415 | data.writeInt(pid); |
| 4416 | data.writeInt(uid); |
| 4417 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4418 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4419 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4420 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4421 | reply.readException(); |
| 4422 | int res = reply.readInt(); |
| 4423 | data.recycle(); |
| 4424 | reply.recycle(); |
| 4425 | return res; |
| 4426 | } |
| 4427 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4428 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4429 | Parcel data = Parcel.obtain(); |
| 4430 | Parcel reply = Parcel.obtain(); |
| 4431 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4432 | data.writeStrongBinder(caller.asBinder()); |
| 4433 | data.writeString(targetPkg); |
| 4434 | uri.writeToParcel(data, 0); |
| 4435 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4436 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4437 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4438 | reply.readException(); |
| 4439 | data.recycle(); |
| 4440 | reply.recycle(); |
| 4441 | } |
| 4442 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4443 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4444 | Parcel data = Parcel.obtain(); |
| 4445 | Parcel reply = Parcel.obtain(); |
| 4446 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4447 | data.writeStrongBinder(caller.asBinder()); |
| 4448 | uri.writeToParcel(data, 0); |
| 4449 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4450 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4451 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4452 | reply.readException(); |
| 4453 | data.recycle(); |
| 4454 | reply.recycle(); |
| 4455 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4456 | |
| 4457 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4458 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4459 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4460 | Parcel data = Parcel.obtain(); |
| 4461 | Parcel reply = Parcel.obtain(); |
| 4462 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4463 | uri.writeToParcel(data, 0); |
| 4464 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4465 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4466 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4467 | reply.readException(); |
| 4468 | data.recycle(); |
| 4469 | reply.recycle(); |
| 4470 | } |
| 4471 | |
| 4472 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4473 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4474 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4475 | Parcel data = Parcel.obtain(); |
| 4476 | Parcel reply = Parcel.obtain(); |
| 4477 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4478 | uri.writeToParcel(data, 0); |
| 4479 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4480 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4481 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4482 | reply.readException(); |
| 4483 | data.recycle(); |
| 4484 | reply.recycle(); |
| 4485 | } |
| 4486 | |
| 4487 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4488 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4489 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4490 | Parcel data = Parcel.obtain(); |
| 4491 | Parcel reply = Parcel.obtain(); |
| 4492 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4493 | data.writeString(packageName); |
| 4494 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4495 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4496 | reply.readException(); |
| 4497 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4498 | reply); |
| 4499 | data.recycle(); |
| 4500 | reply.recycle(); |
| 4501 | return perms; |
| 4502 | } |
| 4503 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4504 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4505 | throws RemoteException { |
| 4506 | Parcel data = Parcel.obtain(); |
| 4507 | Parcel reply = Parcel.obtain(); |
| 4508 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4509 | data.writeStrongBinder(who.asBinder()); |
| 4510 | data.writeInt(waiting ? 1 : 0); |
| 4511 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4512 | reply.readException(); |
| 4513 | data.recycle(); |
| 4514 | reply.recycle(); |
| 4515 | } |
| 4516 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4517 | Parcel data = Parcel.obtain(); |
| 4518 | Parcel reply = Parcel.obtain(); |
| 4519 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4520 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4521 | reply.readException(); |
| 4522 | outInfo.readFromParcel(reply); |
| 4523 | data.recycle(); |
| 4524 | reply.recycle(); |
| 4525 | } |
| 4526 | public void unhandledBack() throws RemoteException |
| 4527 | { |
| 4528 | Parcel data = Parcel.obtain(); |
| 4529 | Parcel reply = Parcel.obtain(); |
| 4530 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4531 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4532 | reply.readException(); |
| 4533 | data.recycle(); |
| 4534 | reply.recycle(); |
| 4535 | } |
| 4536 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4537 | { |
| 4538 | Parcel data = Parcel.obtain(); |
| 4539 | Parcel reply = Parcel.obtain(); |
| 4540 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4541 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4542 | reply.readException(); |
| 4543 | ParcelFileDescriptor pfd = null; |
| 4544 | if (reply.readInt() != 0) { |
| 4545 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4546 | } |
| 4547 | data.recycle(); |
| 4548 | reply.recycle(); |
| 4549 | return pfd; |
| 4550 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4551 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4552 | { |
| 4553 | Parcel data = Parcel.obtain(); |
| 4554 | Parcel reply = Parcel.obtain(); |
| 4555 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4556 | data.writeInt(shown ? 1 : 0); |
| 4557 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4558 | reply.readException(); |
| 4559 | data.recycle(); |
| 4560 | reply.recycle(); |
| 4561 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4562 | public void setDebugApp( |
| 4563 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4564 | throws RemoteException |
| 4565 | { |
| 4566 | Parcel data = Parcel.obtain(); |
| 4567 | Parcel reply = Parcel.obtain(); |
| 4568 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4569 | data.writeString(packageName); |
| 4570 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4571 | data.writeInt(persistent ? 1 : 0); |
| 4572 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4573 | reply.readException(); |
| 4574 | data.recycle(); |
| 4575 | reply.recycle(); |
| 4576 | } |
| 4577 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4578 | { |
| 4579 | Parcel data = Parcel.obtain(); |
| 4580 | Parcel reply = Parcel.obtain(); |
| 4581 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4582 | data.writeInt(enabled ? 1 : 0); |
| 4583 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4584 | reply.readException(); |
| 4585 | data.recycle(); |
| 4586 | reply.recycle(); |
| 4587 | } |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4588 | public void setActivityController(IActivityController watcher) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4589 | { |
| 4590 | Parcel data = Parcel.obtain(); |
| 4591 | Parcel reply = Parcel.obtain(); |
| 4592 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4593 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4594 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4595 | reply.readException(); |
| 4596 | data.recycle(); |
| 4597 | reply.recycle(); |
| 4598 | } |
| 4599 | public void enterSafeMode() throws RemoteException { |
| 4600 | Parcel data = Parcel.obtain(); |
| 4601 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4602 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4603 | data.recycle(); |
| 4604 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4605 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4606 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4607 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4608 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4609 | data.writeStrongBinder(sender.asBinder()); |
| 4610 | data.writeInt(sourceUid); |
| 4611 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4612 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4613 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4614 | data.recycle(); |
| 4615 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4616 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 4617 | throws RemoteException { |
| 4618 | Parcel data = Parcel.obtain(); |
| 4619 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4620 | data.writeStrongBinder(sender.asBinder()); |
| 4621 | data.writeInt(sourceUid); |
| 4622 | data.writeString(tag); |
| 4623 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 4624 | data.recycle(); |
| 4625 | } |
| 4626 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 4627 | throws RemoteException { |
| 4628 | Parcel data = Parcel.obtain(); |
| 4629 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4630 | data.writeStrongBinder(sender.asBinder()); |
| 4631 | data.writeInt(sourceUid); |
| 4632 | data.writeString(tag); |
| 4633 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 4634 | data.recycle(); |
| 4635 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4636 | 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] | 4637 | Parcel data = Parcel.obtain(); |
| 4638 | Parcel reply = Parcel.obtain(); |
| 4639 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4640 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4641 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4642 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4643 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 4644 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4645 | boolean res = reply.readInt() != 0; |
| 4646 | data.recycle(); |
| 4647 | reply.recycle(); |
| 4648 | return res; |
| 4649 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 4650 | @Override |
| 4651 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 4652 | Parcel data = Parcel.obtain(); |
| 4653 | Parcel reply = Parcel.obtain(); |
| 4654 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4655 | data.writeString(reason); |
| 4656 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4657 | boolean res = reply.readInt() != 0; |
| 4658 | data.recycle(); |
| 4659 | reply.recycle(); |
| 4660 | return res; |
| 4661 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4662 | public boolean testIsSystemReady() |
| 4663 | { |
| 4664 | /* this base class version is never called */ |
| 4665 | return true; |
| 4666 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4667 | public void handleApplicationCrash(IBinder app, |
| 4668 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 4669 | { |
| 4670 | Parcel data = Parcel.obtain(); |
| 4671 | Parcel reply = Parcel.obtain(); |
| 4672 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4673 | data.writeStrongBinder(app); |
| 4674 | crashInfo.writeToParcel(data, 0); |
| 4675 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 4676 | reply.readException(); |
| 4677 | reply.recycle(); |
| 4678 | data.recycle(); |
| 4679 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4680 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4681 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4682 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4683 | { |
| 4684 | Parcel data = Parcel.obtain(); |
| 4685 | Parcel reply = Parcel.obtain(); |
| 4686 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4687 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4688 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4689 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4690 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4691 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4692 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4693 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4694 | reply.recycle(); |
| 4695 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4696 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4697 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4698 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4699 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4700 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4701 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4702 | { |
| 4703 | Parcel data = Parcel.obtain(); |
| 4704 | Parcel reply = Parcel.obtain(); |
| 4705 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4706 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4707 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4708 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4709 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 4710 | reply.readException(); |
| 4711 | reply.recycle(); |
| 4712 | data.recycle(); |
| 4713 | } |
| 4714 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4715 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 4716 | Parcel data = Parcel.obtain(); |
| 4717 | Parcel reply = Parcel.obtain(); |
| 4718 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4719 | data.writeInt(sig); |
| 4720 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 4721 | reply.readException(); |
| 4722 | data.recycle(); |
| 4723 | reply.recycle(); |
| 4724 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4725 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4726 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4727 | Parcel data = Parcel.obtain(); |
| 4728 | Parcel reply = Parcel.obtain(); |
| 4729 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4730 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4731 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4732 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4733 | reply.readException(); |
| 4734 | data.recycle(); |
| 4735 | reply.recycle(); |
| 4736 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4737 | |
| 4738 | public void killAllBackgroundProcesses() throws RemoteException { |
| 4739 | Parcel data = Parcel.obtain(); |
| 4740 | Parcel reply = Parcel.obtain(); |
| 4741 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4742 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4743 | reply.readException(); |
| 4744 | data.recycle(); |
| 4745 | reply.recycle(); |
| 4746 | } |
| 4747 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame^] | 4748 | public void killPackageDependents(String packageName, int userId) throws RemoteException { |
| 4749 | Parcel data = Parcel.obtain(); |
| 4750 | Parcel reply = Parcel.obtain(); |
| 4751 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4752 | data.writeString(packageName); |
| 4753 | data.writeInt(userId); |
| 4754 | mRemote.transact(KILL_PACKAGE_DEPENDENTS_TRANSACTION, data, reply, 0); |
| 4755 | reply.readException(); |
| 4756 | data.recycle(); |
| 4757 | reply.recycle(); |
| 4758 | } |
| 4759 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4760 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4761 | Parcel data = Parcel.obtain(); |
| 4762 | Parcel reply = Parcel.obtain(); |
| 4763 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4764 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4765 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4766 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4767 | reply.readException(); |
| 4768 | data.recycle(); |
| 4769 | reply.recycle(); |
| 4770 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4771 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 4772 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 4773 | throws RemoteException |
| 4774 | { |
| 4775 | Parcel data = Parcel.obtain(); |
| 4776 | Parcel reply = Parcel.obtain(); |
| 4777 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4778 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 4779 | reply.readException(); |
| 4780 | outInfo.readFromParcel(reply); |
| 4781 | reply.recycle(); |
| 4782 | data.recycle(); |
| 4783 | } |
| 4784 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4785 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 4786 | { |
| 4787 | Parcel data = Parcel.obtain(); |
| 4788 | Parcel reply = Parcel.obtain(); |
| 4789 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4790 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4791 | reply.readException(); |
| 4792 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 4793 | reply.recycle(); |
| 4794 | data.recycle(); |
| 4795 | return res; |
| 4796 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4797 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4798 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4799 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4800 | { |
| 4801 | Parcel data = Parcel.obtain(); |
| 4802 | Parcel reply = Parcel.obtain(); |
| 4803 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4804 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4805 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4806 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 4807 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4808 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 4809 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4810 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 4811 | } else { |
| 4812 | data.writeInt(0); |
| 4813 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4814 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 4815 | reply.readException(); |
| 4816 | boolean res = reply.readInt() != 0; |
| 4817 | reply.recycle(); |
| 4818 | data.recycle(); |
| 4819 | return res; |
| 4820 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4821 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 4822 | public boolean shutdown(int timeout) throws RemoteException |
| 4823 | { |
| 4824 | Parcel data = Parcel.obtain(); |
| 4825 | Parcel reply = Parcel.obtain(); |
| 4826 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4827 | data.writeInt(timeout); |
| 4828 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 4829 | reply.readException(); |
| 4830 | boolean res = reply.readInt() != 0; |
| 4831 | reply.recycle(); |
| 4832 | data.recycle(); |
| 4833 | return res; |
| 4834 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4835 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 4836 | public void stopAppSwitches() throws RemoteException { |
| 4837 | Parcel data = Parcel.obtain(); |
| 4838 | Parcel reply = Parcel.obtain(); |
| 4839 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4840 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 4841 | reply.readException(); |
| 4842 | reply.recycle(); |
| 4843 | data.recycle(); |
| 4844 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4845 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 4846 | public void resumeAppSwitches() throws RemoteException { |
| 4847 | Parcel data = Parcel.obtain(); |
| 4848 | Parcel reply = Parcel.obtain(); |
| 4849 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4850 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 4851 | reply.readException(); |
| 4852 | reply.recycle(); |
| 4853 | data.recycle(); |
| 4854 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 4855 | |
| 4856 | public void addPackageDependency(String packageName) throws RemoteException { |
| 4857 | Parcel data = Parcel.obtain(); |
| 4858 | Parcel reply = Parcel.obtain(); |
| 4859 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4860 | data.writeString(packageName); |
| 4861 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 4862 | reply.readException(); |
| 4863 | data.recycle(); |
| 4864 | reply.recycle(); |
| 4865 | } |
| 4866 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 4867 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 4868 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 4869 | Parcel data = Parcel.obtain(); |
| 4870 | Parcel reply = Parcel.obtain(); |
| 4871 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4872 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4873 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 4874 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4875 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 4876 | reply.readException(); |
| 4877 | data.recycle(); |
| 4878 | reply.recycle(); |
| 4879 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4880 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 4881 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 4882 | Parcel data = Parcel.obtain(); |
| 4883 | Parcel reply = Parcel.obtain(); |
| 4884 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4885 | data.writeString(reason); |
| 4886 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 4887 | reply.readException(); |
| 4888 | data.recycle(); |
| 4889 | reply.recycle(); |
| 4890 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4891 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4892 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4893 | throws RemoteException { |
| 4894 | Parcel data = Parcel.obtain(); |
| 4895 | Parcel reply = Parcel.obtain(); |
| 4896 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4897 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4898 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4899 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4900 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4901 | data.recycle(); |
| 4902 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4903 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4904 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 4905 | |
| 4906 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 4907 | Parcel data = Parcel.obtain(); |
| 4908 | Parcel reply = Parcel.obtain(); |
| 4909 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4910 | data.writeString(processName); |
| 4911 | data.writeInt(uid); |
| 4912 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 4913 | reply.readException(); |
| 4914 | data.recycle(); |
| 4915 | reply.recycle(); |
| 4916 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4917 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 4918 | public void overridePendingTransition(IBinder token, String packageName, |
| 4919 | int enterAnim, int exitAnim) throws RemoteException { |
| 4920 | Parcel data = Parcel.obtain(); |
| 4921 | Parcel reply = Parcel.obtain(); |
| 4922 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4923 | data.writeStrongBinder(token); |
| 4924 | data.writeString(packageName); |
| 4925 | data.writeInt(enterAnim); |
| 4926 | data.writeInt(exitAnim); |
| 4927 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 4928 | reply.readException(); |
| 4929 | data.recycle(); |
| 4930 | reply.recycle(); |
| 4931 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4932 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 4933 | public boolean isUserAMonkey() throws RemoteException { |
| 4934 | Parcel data = Parcel.obtain(); |
| 4935 | Parcel reply = Parcel.obtain(); |
| 4936 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4937 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 4938 | reply.readException(); |
| 4939 | boolean res = reply.readInt() != 0; |
| 4940 | data.recycle(); |
| 4941 | reply.recycle(); |
| 4942 | return res; |
| 4943 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 4944 | |
| 4945 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 4946 | Parcel data = Parcel.obtain(); |
| 4947 | Parcel reply = Parcel.obtain(); |
| 4948 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4949 | data.writeInt(monkey ? 1 : 0); |
| 4950 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 4951 | reply.readException(); |
| 4952 | data.recycle(); |
| 4953 | reply.recycle(); |
| 4954 | } |
| 4955 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 4956 | public void finishHeavyWeightApp() throws RemoteException { |
| 4957 | Parcel data = Parcel.obtain(); |
| 4958 | Parcel reply = Parcel.obtain(); |
| 4959 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4960 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 4961 | reply.readException(); |
| 4962 | data.recycle(); |
| 4963 | reply.recycle(); |
| 4964 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4965 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4966 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4967 | throws RemoteException { |
| 4968 | Parcel data = Parcel.obtain(); |
| 4969 | Parcel reply = Parcel.obtain(); |
| 4970 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4971 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4972 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 4973 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4974 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4975 | data.recycle(); |
| 4976 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4977 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4978 | } |
| 4979 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4980 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4981 | throws RemoteException { |
| 4982 | Parcel data = Parcel.obtain(); |
| 4983 | Parcel reply = Parcel.obtain(); |
| 4984 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4985 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4986 | if (options == null) { |
| 4987 | data.writeInt(0); |
| 4988 | } else { |
| 4989 | data.writeInt(1); |
| 4990 | data.writeBundle(options.toBundle()); |
| 4991 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4992 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4993 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4994 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4995 | data.recycle(); |
| 4996 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4997 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4998 | } |
| 4999 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5000 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 5001 | Parcel data = Parcel.obtain(); |
| 5002 | Parcel reply = Parcel.obtain(); |
| 5003 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5004 | data.writeStrongBinder(token); |
| 5005 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 5006 | reply.readException(); |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 5007 | ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle()); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5008 | data.recycle(); |
| 5009 | reply.recycle(); |
| 5010 | return options; |
| 5011 | } |
| 5012 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5013 | public void setImmersive(IBinder token, boolean immersive) |
| 5014 | throws RemoteException { |
| 5015 | Parcel data = Parcel.obtain(); |
| 5016 | Parcel reply = Parcel.obtain(); |
| 5017 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5018 | data.writeStrongBinder(token); |
| 5019 | data.writeInt(immersive ? 1 : 0); |
| 5020 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 5021 | reply.readException(); |
| 5022 | data.recycle(); |
| 5023 | reply.recycle(); |
| 5024 | } |
| 5025 | |
| 5026 | public boolean isImmersive(IBinder token) |
| 5027 | throws RemoteException { |
| 5028 | Parcel data = Parcel.obtain(); |
| 5029 | Parcel reply = Parcel.obtain(); |
| 5030 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5031 | data.writeStrongBinder(token); |
| 5032 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5033 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5034 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5035 | data.recycle(); |
| 5036 | reply.recycle(); |
| 5037 | return res; |
| 5038 | } |
| 5039 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5040 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 5041 | Parcel data = Parcel.obtain(); |
| 5042 | Parcel reply = Parcel.obtain(); |
| 5043 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5044 | data.writeStrongBinder(token); |
| 5045 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 5046 | reply.readException(); |
| 5047 | boolean res = reply.readInt() == 1; |
| 5048 | data.recycle(); |
| 5049 | reply.recycle(); |
| 5050 | return res; |
| 5051 | } |
| 5052 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5053 | public boolean isTopActivityImmersive() |
| 5054 | throws RemoteException { |
| 5055 | Parcel data = Parcel.obtain(); |
| 5056 | Parcel reply = Parcel.obtain(); |
| 5057 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5058 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5059 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5060 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5061 | data.recycle(); |
| 5062 | reply.recycle(); |
| 5063 | return res; |
| 5064 | } |
| 5065 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 5066 | public void crashApplication(int uid, int initialPid, String packageName, |
| 5067 | String message) throws RemoteException { |
| 5068 | Parcel data = Parcel.obtain(); |
| 5069 | Parcel reply = Parcel.obtain(); |
| 5070 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5071 | data.writeInt(uid); |
| 5072 | data.writeInt(initialPid); |
| 5073 | data.writeString(packageName); |
| 5074 | data.writeString(message); |
| 5075 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 5076 | reply.readException(); |
| 5077 | data.recycle(); |
| 5078 | reply.recycle(); |
| 5079 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5080 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5081 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5082 | Parcel data = Parcel.obtain(); |
| 5083 | Parcel reply = Parcel.obtain(); |
| 5084 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5085 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5086 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5087 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 5088 | reply.readException(); |
| 5089 | String res = reply.readString(); |
| 5090 | data.recycle(); |
| 5091 | reply.recycle(); |
| 5092 | return res; |
| 5093 | } |
| 5094 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5095 | public IBinder newUriPermissionOwner(String name) |
| 5096 | throws RemoteException { |
| 5097 | Parcel data = Parcel.obtain(); |
| 5098 | Parcel reply = Parcel.obtain(); |
| 5099 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5100 | data.writeString(name); |
| 5101 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 5102 | reply.readException(); |
| 5103 | IBinder res = reply.readStrongBinder(); |
| 5104 | data.recycle(); |
| 5105 | reply.recycle(); |
| 5106 | return res; |
| 5107 | } |
| 5108 | |
| 5109 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5110 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5111 | Parcel data = Parcel.obtain(); |
| 5112 | Parcel reply = Parcel.obtain(); |
| 5113 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5114 | data.writeStrongBinder(owner); |
| 5115 | data.writeInt(fromUid); |
| 5116 | data.writeString(targetPkg); |
| 5117 | uri.writeToParcel(data, 0); |
| 5118 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5119 | data.writeInt(sourceUserId); |
| 5120 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5121 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5122 | reply.readException(); |
| 5123 | data.recycle(); |
| 5124 | reply.recycle(); |
| 5125 | } |
| 5126 | |
| 5127 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5128 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5129 | Parcel data = Parcel.obtain(); |
| 5130 | Parcel reply = Parcel.obtain(); |
| 5131 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5132 | data.writeStrongBinder(owner); |
| 5133 | if (uri != null) { |
| 5134 | data.writeInt(1); |
| 5135 | uri.writeToParcel(data, 0); |
| 5136 | } else { |
| 5137 | data.writeInt(0); |
| 5138 | } |
| 5139 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5140 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5141 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5142 | reply.readException(); |
| 5143 | data.recycle(); |
| 5144 | reply.recycle(); |
| 5145 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 5146 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5147 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5148 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5149 | Parcel data = Parcel.obtain(); |
| 5150 | Parcel reply = Parcel.obtain(); |
| 5151 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5152 | data.writeInt(callingUid); |
| 5153 | data.writeString(targetPkg); |
| 5154 | uri.writeToParcel(data, 0); |
| 5155 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5156 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5157 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5158 | reply.readException(); |
| 5159 | int res = reply.readInt(); |
| 5160 | data.recycle(); |
| 5161 | reply.recycle(); |
| 5162 | return res; |
| 5163 | } |
| 5164 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5165 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5166 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 5167 | Parcel data = Parcel.obtain(); |
| 5168 | Parcel reply = Parcel.obtain(); |
| 5169 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5170 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5171 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5172 | data.writeInt(managed ? 1 : 0); |
| 5173 | data.writeString(path); |
| 5174 | if (fd != null) { |
| 5175 | data.writeInt(1); |
| 5176 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5177 | } else { |
| 5178 | data.writeInt(0); |
| 5179 | } |
| 5180 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 5181 | reply.readException(); |
| 5182 | boolean res = reply.readInt() != 0; |
| 5183 | reply.recycle(); |
| 5184 | data.recycle(); |
| 5185 | return res; |
| 5186 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5187 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5188 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5189 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5190 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5191 | Parcel data = Parcel.obtain(); |
| 5192 | Parcel reply = Parcel.obtain(); |
| 5193 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5194 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5195 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5196 | data.writeTypedArray(intents, 0); |
| 5197 | data.writeStringArray(resolvedTypes); |
| 5198 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5199 | if (options != null) { |
| 5200 | data.writeInt(1); |
| 5201 | options.writeToParcel(data, 0); |
| 5202 | } else { |
| 5203 | data.writeInt(0); |
| 5204 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5205 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5206 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 5207 | reply.readException(); |
| 5208 | int result = reply.readInt(); |
| 5209 | reply.recycle(); |
| 5210 | data.recycle(); |
| 5211 | return result; |
| 5212 | } |
| 5213 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5214 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 5215 | Parcel data = Parcel.obtain(); |
| 5216 | Parcel reply = Parcel.obtain(); |
| 5217 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5218 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5219 | reply.readException(); |
| 5220 | int mode = reply.readInt(); |
| 5221 | reply.recycle(); |
| 5222 | data.recycle(); |
| 5223 | return mode; |
| 5224 | } |
| 5225 | |
| 5226 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 5227 | Parcel data = Parcel.obtain(); |
| 5228 | Parcel reply = Parcel.obtain(); |
| 5229 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5230 | data.writeInt(mode); |
| 5231 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5232 | reply.readException(); |
| 5233 | reply.recycle(); |
| 5234 | data.recycle(); |
| 5235 | } |
| 5236 | |
| 5237 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 5238 | Parcel data = Parcel.obtain(); |
| 5239 | Parcel reply = Parcel.obtain(); |
| 5240 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5241 | data.writeString(packageName); |
| 5242 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5243 | reply.readException(); |
| 5244 | int mode = reply.readInt(); |
| 5245 | reply.recycle(); |
| 5246 | data.recycle(); |
| 5247 | return mode; |
| 5248 | } |
| 5249 | |
| 5250 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5251 | throws RemoteException { |
| 5252 | Parcel data = Parcel.obtain(); |
| 5253 | Parcel reply = Parcel.obtain(); |
| 5254 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5255 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5256 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5257 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5258 | reply.readException(); |
| 5259 | reply.recycle(); |
| 5260 | data.recycle(); |
| 5261 | } |
| 5262 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5263 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 5264 | Parcel data = Parcel.obtain(); |
| 5265 | Parcel reply = Parcel.obtain(); |
| 5266 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5267 | data.writeString(packageName); |
| 5268 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5269 | reply.readException(); |
| 5270 | boolean ask = reply.readInt() != 0; |
| 5271 | reply.recycle(); |
| 5272 | data.recycle(); |
| 5273 | return ask; |
| 5274 | } |
| 5275 | |
| 5276 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 5277 | throws RemoteException { |
| 5278 | Parcel data = Parcel.obtain(); |
| 5279 | Parcel reply = Parcel.obtain(); |
| 5280 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5281 | data.writeString(packageName); |
| 5282 | data.writeInt(ask ? 1 : 0); |
| 5283 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5284 | reply.readException(); |
| 5285 | reply.recycle(); |
| 5286 | data.recycle(); |
| 5287 | } |
| 5288 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5289 | public boolean switchUser(int userid) throws RemoteException { |
| 5290 | Parcel data = Parcel.obtain(); |
| 5291 | Parcel reply = Parcel.obtain(); |
| 5292 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5293 | data.writeInt(userid); |
| 5294 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 5295 | reply.readException(); |
| 5296 | boolean result = reply.readInt() != 0; |
| 5297 | reply.recycle(); |
| 5298 | data.recycle(); |
| 5299 | return result; |
| 5300 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5301 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 5302 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 5303 | Parcel data = Parcel.obtain(); |
| 5304 | Parcel reply = Parcel.obtain(); |
| 5305 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5306 | data.writeInt(userid); |
| 5307 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 5308 | reply.readException(); |
| 5309 | boolean result = reply.readInt() != 0; |
| 5310 | reply.recycle(); |
| 5311 | data.recycle(); |
| 5312 | return result; |
| 5313 | } |
| 5314 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5315 | public boolean unlockUser(int userId, byte[] token) throws RemoteException { |
| 5316 | Parcel data = Parcel.obtain(); |
| 5317 | Parcel reply = Parcel.obtain(); |
| 5318 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5319 | data.writeInt(userId); |
| 5320 | data.writeByteArray(token); |
| 5321 | mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0); |
| 5322 | reply.readException(); |
| 5323 | boolean result = reply.readInt() != 0; |
| 5324 | reply.recycle(); |
| 5325 | data.recycle(); |
| 5326 | return result; |
| 5327 | } |
| 5328 | |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5329 | public int stopUser(int userid, boolean force, IStopUserCallback callback) |
| 5330 | throws RemoteException { |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5331 | Parcel data = Parcel.obtain(); |
| 5332 | Parcel reply = Parcel.obtain(); |
| 5333 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5334 | data.writeInt(userid); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5335 | data.writeInt(force ? 1 : 0); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5336 | data.writeStrongInterface(callback); |
| 5337 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 5338 | reply.readException(); |
| 5339 | int result = reply.readInt(); |
| 5340 | reply.recycle(); |
| 5341 | data.recycle(); |
| 5342 | return result; |
| 5343 | } |
| 5344 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5345 | public UserInfo getCurrentUser() throws RemoteException { |
| 5346 | Parcel data = Parcel.obtain(); |
| 5347 | Parcel reply = Parcel.obtain(); |
| 5348 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5349 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5350 | reply.readException(); |
| 5351 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 5352 | reply.recycle(); |
| 5353 | data.recycle(); |
| 5354 | return userInfo; |
| 5355 | } |
| 5356 | |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5357 | public boolean isUserRunning(int userid, int flags) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5358 | Parcel data = Parcel.obtain(); |
| 5359 | Parcel reply = Parcel.obtain(); |
| 5360 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5361 | data.writeInt(userid); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5362 | data.writeInt(flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5363 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5364 | reply.readException(); |
| 5365 | boolean result = reply.readInt() != 0; |
| 5366 | reply.recycle(); |
| 5367 | data.recycle(); |
| 5368 | return result; |
| 5369 | } |
| 5370 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5371 | public int[] getRunningUserIds() throws RemoteException { |
| 5372 | Parcel data = Parcel.obtain(); |
| 5373 | Parcel reply = Parcel.obtain(); |
| 5374 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5375 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5376 | reply.readException(); |
| 5377 | int[] result = reply.createIntArray(); |
| 5378 | reply.recycle(); |
| 5379 | data.recycle(); |
| 5380 | return result; |
| 5381 | } |
| 5382 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5383 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5384 | Parcel data = Parcel.obtain(); |
| 5385 | Parcel reply = Parcel.obtain(); |
| 5386 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5387 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5388 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5389 | reply.readException(); |
| 5390 | boolean result = reply.readInt() != 0; |
| 5391 | reply.recycle(); |
| 5392 | data.recycle(); |
| 5393 | return result; |
| 5394 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5395 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5396 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5397 | Parcel data = Parcel.obtain(); |
| 5398 | Parcel reply = Parcel.obtain(); |
| 5399 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5400 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5401 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5402 | reply.readException(); |
| 5403 | data.recycle(); |
| 5404 | reply.recycle(); |
| 5405 | } |
| 5406 | |
| 5407 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5408 | Parcel data = Parcel.obtain(); |
| 5409 | Parcel reply = Parcel.obtain(); |
| 5410 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5411 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5412 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5413 | reply.readException(); |
| 5414 | data.recycle(); |
| 5415 | reply.recycle(); |
| 5416 | } |
| 5417 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5418 | public void registerUidObserver(IUidObserver observer, int which) throws RemoteException { |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5419 | Parcel data = Parcel.obtain(); |
| 5420 | Parcel reply = Parcel.obtain(); |
| 5421 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5422 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5423 | data.writeInt(which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5424 | mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5425 | reply.readException(); |
| 5426 | data.recycle(); |
| 5427 | reply.recycle(); |
| 5428 | } |
| 5429 | |
| 5430 | public void unregisterUidObserver(IUidObserver observer) throws RemoteException { |
| 5431 | Parcel data = Parcel.obtain(); |
| 5432 | Parcel reply = Parcel.obtain(); |
| 5433 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5434 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5435 | mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5436 | reply.readException(); |
| 5437 | data.recycle(); |
| 5438 | reply.recycle(); |
| 5439 | } |
| 5440 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5441 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5442 | Parcel data = Parcel.obtain(); |
| 5443 | Parcel reply = Parcel.obtain(); |
| 5444 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5445 | data.writeStrongBinder(sender.asBinder()); |
| 5446 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5447 | reply.readException(); |
| 5448 | boolean res = reply.readInt() != 0; |
| 5449 | data.recycle(); |
| 5450 | reply.recycle(); |
| 5451 | return res; |
| 5452 | } |
| 5453 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5454 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5455 | Parcel data = Parcel.obtain(); |
| 5456 | Parcel reply = Parcel.obtain(); |
| 5457 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5458 | data.writeStrongBinder(sender.asBinder()); |
| 5459 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5460 | reply.readException(); |
| 5461 | boolean res = reply.readInt() != 0; |
| 5462 | data.recycle(); |
| 5463 | reply.recycle(); |
| 5464 | return res; |
| 5465 | } |
| 5466 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5467 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5468 | Parcel data = Parcel.obtain(); |
| 5469 | Parcel reply = Parcel.obtain(); |
| 5470 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5471 | data.writeStrongBinder(sender.asBinder()); |
| 5472 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5473 | reply.readException(); |
| 5474 | Intent res = reply.readInt() != 0 |
| 5475 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5476 | data.recycle(); |
| 5477 | reply.recycle(); |
| 5478 | return res; |
| 5479 | } |
| 5480 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5481 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5482 | throws RemoteException { |
| 5483 | Parcel data = Parcel.obtain(); |
| 5484 | Parcel reply = Parcel.obtain(); |
| 5485 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5486 | data.writeStrongBinder(sender.asBinder()); |
| 5487 | data.writeString(prefix); |
| 5488 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5489 | reply.readException(); |
| 5490 | String res = reply.readString(); |
| 5491 | data.recycle(); |
| 5492 | reply.recycle(); |
| 5493 | return res; |
| 5494 | } |
| 5495 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5496 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5497 | { |
| 5498 | Parcel data = Parcel.obtain(); |
| 5499 | Parcel reply = Parcel.obtain(); |
| 5500 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5501 | values.writeToParcel(data, 0); |
| 5502 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5503 | reply.readException(); |
| 5504 | data.recycle(); |
| 5505 | reply.recycle(); |
| 5506 | } |
| 5507 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 5508 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 5509 | Parcel data = Parcel.obtain(); |
| 5510 | Parcel reply = Parcel.obtain(); |
| 5511 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5512 | data.writeIntArray(pids); |
| 5513 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 5514 | reply.readException(); |
| 5515 | long[] res = reply.createLongArray(); |
| 5516 | data.recycle(); |
| 5517 | reply.recycle(); |
| 5518 | return res; |
| 5519 | } |
| 5520 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5521 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5522 | Parcel data = Parcel.obtain(); |
| 5523 | Parcel reply = Parcel.obtain(); |
| 5524 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5525 | TextUtils.writeToParcel(msg, data, 0); |
| 5526 | data.writeInt(always ? 1 : 0); |
| 5527 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5528 | reply.readException(); |
| 5529 | data.recycle(); |
| 5530 | reply.recycle(); |
| 5531 | } |
| 5532 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5533 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5534 | Parcel data = Parcel.obtain(); |
| 5535 | Parcel reply = Parcel.obtain(); |
| 5536 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5537 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5538 | reply.readException(); |
| 5539 | data.recycle(); |
| 5540 | reply.recycle(); |
| 5541 | } |
| 5542 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5543 | public void keyguardGoingAway(boolean disableWindowAnimations, |
| 5544 | boolean keyguardGoingToNotificationShade) throws RemoteException { |
| 5545 | Parcel data = Parcel.obtain(); |
| 5546 | Parcel reply = Parcel.obtain(); |
| 5547 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5548 | data.writeInt(disableWindowAnimations ? 1 : 0); |
| 5549 | data.writeInt(keyguardGoingToNotificationShade ? 1 : 0); |
| 5550 | mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0); |
| 5551 | reply.readException(); |
| 5552 | data.recycle(); |
| 5553 | reply.recycle(); |
| 5554 | } |
| 5555 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5556 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5557 | throws RemoteException { |
| 5558 | Parcel data = Parcel.obtain(); |
| 5559 | Parcel reply = Parcel.obtain(); |
| 5560 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5561 | data.writeStrongBinder(token); |
| 5562 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5563 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5564 | reply.readException(); |
| 5565 | boolean result = reply.readInt() != 0; |
| 5566 | data.recycle(); |
| 5567 | reply.recycle(); |
| 5568 | return result; |
| 5569 | } |
| 5570 | |
| 5571 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5572 | throws RemoteException { |
| 5573 | Parcel data = Parcel.obtain(); |
| 5574 | Parcel reply = Parcel.obtain(); |
| 5575 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5576 | data.writeStrongBinder(token); |
| 5577 | target.writeToParcel(data, 0); |
| 5578 | data.writeInt(resultCode); |
| 5579 | if (resultData != null) { |
| 5580 | data.writeInt(1); |
| 5581 | resultData.writeToParcel(data, 0); |
| 5582 | } else { |
| 5583 | data.writeInt(0); |
| 5584 | } |
| 5585 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5586 | reply.readException(); |
| 5587 | boolean result = reply.readInt() != 0; |
| 5588 | data.recycle(); |
| 5589 | reply.recycle(); |
| 5590 | return result; |
| 5591 | } |
| 5592 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5593 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5594 | Parcel data = Parcel.obtain(); |
| 5595 | Parcel reply = Parcel.obtain(); |
| 5596 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5597 | data.writeStrongBinder(activityToken); |
| 5598 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5599 | reply.readException(); |
| 5600 | int result = reply.readInt(); |
| 5601 | data.recycle(); |
| 5602 | reply.recycle(); |
| 5603 | return result; |
| 5604 | } |
| 5605 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5606 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 5607 | Parcel data = Parcel.obtain(); |
| 5608 | Parcel reply = Parcel.obtain(); |
| 5609 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5610 | data.writeStrongBinder(activityToken); |
| 5611 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 5612 | reply.readException(); |
| 5613 | String result = reply.readString(); |
| 5614 | data.recycle(); |
| 5615 | reply.recycle(); |
| 5616 | return result; |
| 5617 | } |
| 5618 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 5619 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5620 | Parcel data = Parcel.obtain(); |
| 5621 | Parcel reply = Parcel.obtain(); |
| 5622 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5623 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5624 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5625 | reply.readException(); |
| 5626 | data.recycle(); |
| 5627 | reply.recycle(); |
| 5628 | } |
| 5629 | |
| 5630 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5631 | Parcel data = Parcel.obtain(); |
| 5632 | Parcel reply = Parcel.obtain(); |
| 5633 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5634 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5635 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5636 | reply.readException(); |
| 5637 | data.recycle(); |
| 5638 | reply.recycle(); |
| 5639 | } |
| 5640 | |
Felipe Leme | 4cc8633 | 2015-12-04 16:37:28 -0800 | [diff] [blame] | 5641 | public void requestBugReport(boolean progress) throws RemoteException { |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5642 | Parcel data = Parcel.obtain(); |
| 5643 | Parcel reply = Parcel.obtain(); |
| 5644 | data.writeInterfaceToken(IActivityManager.descriptor); |
Felipe Leme | 4cc8633 | 2015-12-04 16:37:28 -0800 | [diff] [blame] | 5645 | data.writeInt(progress ? 1 : 0); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5646 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 5647 | reply.readException(); |
| 5648 | data.recycle(); |
| 5649 | reply.recycle(); |
| 5650 | } |
| 5651 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5652 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 5653 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5654 | Parcel data = Parcel.obtain(); |
| 5655 | Parcel reply = Parcel.obtain(); |
| 5656 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5657 | data.writeInt(pid); |
| 5658 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5659 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5660 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 5661 | reply.readException(); |
| 5662 | long res = reply.readInt(); |
| 5663 | data.recycle(); |
| 5664 | reply.recycle(); |
| 5665 | return res; |
| 5666 | } |
| 5667 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5668 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5669 | Parcel data = Parcel.obtain(); |
| 5670 | Parcel reply = Parcel.obtain(); |
| 5671 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5672 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5673 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5674 | reply.readException(); |
| 5675 | Bundle res = reply.readBundle(); |
| 5676 | data.recycle(); |
| 5677 | reply.recycle(); |
| 5678 | return res; |
| 5679 | } |
| 5680 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5681 | public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, |
| 5682 | IBinder activityToken) throws RemoteException { |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5683 | Parcel data = Parcel.obtain(); |
| 5684 | Parcel reply = Parcel.obtain(); |
| 5685 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5686 | data.writeInt(requestType); |
| 5687 | data.writeStrongBinder(receiver.asBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5688 | data.writeStrongBinder(activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5689 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 5690 | reply.readException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5691 | boolean res = reply.readInt() != 0; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5692 | data.recycle(); |
| 5693 | reply.recycle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5694 | return res; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5695 | } |
| 5696 | |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 5697 | public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 5698 | AssistContent content, Uri referrer) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5699 | Parcel data = Parcel.obtain(); |
| 5700 | Parcel reply = Parcel.obtain(); |
| 5701 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5702 | data.writeStrongBinder(token); |
| 5703 | data.writeBundle(extras); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 5704 | structure.writeToParcel(data, 0); |
| 5705 | content.writeToParcel(data, 0); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 5706 | if (referrer != null) { |
| 5707 | data.writeInt(1); |
| 5708 | referrer.writeToParcel(data, 0); |
| 5709 | } else { |
| 5710 | data.writeInt(0); |
| 5711 | } |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5712 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5713 | reply.readException(); |
| 5714 | data.recycle(); |
| 5715 | reply.recycle(); |
| 5716 | } |
| 5717 | |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 5718 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, |
| 5719 | Bundle args) throws RemoteException { |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 5720 | Parcel data = Parcel.obtain(); |
| 5721 | Parcel reply = Parcel.obtain(); |
| 5722 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5723 | intent.writeToParcel(data, 0); |
| 5724 | data.writeInt(requestType); |
| 5725 | data.writeString(hint); |
| 5726 | data.writeInt(userHandle); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 5727 | data.writeBundle(args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 5728 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 5729 | reply.readException(); |
| 5730 | boolean res = reply.readInt() != 0; |
| 5731 | data.recycle(); |
| 5732 | reply.recycle(); |
| 5733 | return res; |
| 5734 | } |
| 5735 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5736 | public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException { |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 5737 | Parcel data = Parcel.obtain(); |
| 5738 | Parcel reply = Parcel.obtain(); |
| 5739 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5740 | mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5741 | reply.readException(); |
| 5742 | boolean res = reply.readInt() != 0; |
| 5743 | data.recycle(); |
| 5744 | reply.recycle(); |
| 5745 | return res; |
| 5746 | } |
| 5747 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5748 | public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException { |
| 5749 | Parcel data = Parcel.obtain(); |
| 5750 | Parcel reply = Parcel.obtain(); |
| 5751 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5752 | data.writeStrongBinder(token); |
| 5753 | data.writeBundle(args); |
| 5754 | mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5755 | reply.readException(); |
| 5756 | boolean res = reply.readInt() != 0; |
| 5757 | data.recycle(); |
| 5758 | reply.recycle(); |
| 5759 | return res; |
| 5760 | } |
| 5761 | |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 5762 | public void killUid(int appId, int userId, String reason) throws RemoteException { |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5763 | Parcel data = Parcel.obtain(); |
| 5764 | Parcel reply = Parcel.obtain(); |
| 5765 | data.writeInterfaceToken(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 5766 | data.writeInt(appId); |
| 5767 | data.writeInt(userId); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5768 | data.writeString(reason); |
| 5769 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 5770 | reply.readException(); |
| 5771 | data.recycle(); |
| 5772 | reply.recycle(); |
| 5773 | } |
| 5774 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 5775 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 5776 | Parcel data = Parcel.obtain(); |
| 5777 | Parcel reply = Parcel.obtain(); |
| 5778 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5779 | data.writeStrongBinder(who); |
| 5780 | data.writeInt(allowRestart ? 1 : 0); |
| 5781 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 5782 | reply.readException(); |
| 5783 | data.recycle(); |
| 5784 | reply.recycle(); |
| 5785 | } |
| 5786 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 5787 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 5788 | Parcel data = Parcel.obtain(); |
| 5789 | Parcel reply = Parcel.obtain(); |
| 5790 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5791 | data.writeStrongBinder(token); |
| 5792 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 5793 | reply.readException(); |
| 5794 | data.recycle(); |
| 5795 | reply.recycle(); |
| 5796 | } |
| 5797 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5798 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 5799 | Parcel data = Parcel.obtain(); |
| 5800 | Parcel reply = Parcel.obtain(); |
| 5801 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5802 | data.writeStrongBinder(token); |
| 5803 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 5804 | reply.readException(); |
| 5805 | data.recycle(); |
| 5806 | reply.recycle(); |
| 5807 | } |
| 5808 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 5809 | public void restart() throws RemoteException { |
| 5810 | Parcel data = Parcel.obtain(); |
| 5811 | Parcel reply = Parcel.obtain(); |
| 5812 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5813 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 5814 | reply.readException(); |
| 5815 | data.recycle(); |
| 5816 | reply.recycle(); |
| 5817 | } |
| 5818 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 5819 | public void performIdleMaintenance() throws RemoteException { |
| 5820 | Parcel data = Parcel.obtain(); |
| 5821 | Parcel reply = Parcel.obtain(); |
| 5822 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5823 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 5824 | reply.readException(); |
| 5825 | data.recycle(); |
| 5826 | reply.recycle(); |
| 5827 | } |
| 5828 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 5829 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5830 | IActivityContainerCallback callback) throws RemoteException { |
| 5831 | Parcel data = Parcel.obtain(); |
| 5832 | Parcel reply = Parcel.obtain(); |
| 5833 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5834 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 5835 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 5836 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5837 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 5838 | final int result = reply.readInt(); |
| 5839 | final IActivityContainer res; |
| 5840 | if (result == 1) { |
| 5841 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5842 | } else { |
| 5843 | res = null; |
| 5844 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5845 | data.recycle(); |
| 5846 | reply.recycle(); |
| 5847 | return res; |
| 5848 | } |
| 5849 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 5850 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 5851 | throws RemoteException { |
| 5852 | Parcel data = Parcel.obtain(); |
| 5853 | Parcel reply = Parcel.obtain(); |
| 5854 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5855 | data.writeStrongBinder(activityContainer.asBinder()); |
| 5856 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 5857 | reply.readException(); |
| 5858 | data.recycle(); |
| 5859 | reply.recycle(); |
| 5860 | } |
| 5861 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 5862 | public boolean startBinderTracking() throws RemoteException { |
| 5863 | Parcel data = Parcel.obtain(); |
| 5864 | Parcel reply = Parcel.obtain(); |
| 5865 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5866 | mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0); |
| 5867 | reply.readException(); |
| 5868 | boolean res = reply.readInt() != 0; |
| 5869 | reply.recycle(); |
| 5870 | data.recycle(); |
| 5871 | return res; |
| 5872 | } |
| 5873 | |
| 5874 | public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException { |
| 5875 | Parcel data = Parcel.obtain(); |
| 5876 | Parcel reply = Parcel.obtain(); |
| 5877 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5878 | if (fd != null) { |
| 5879 | data.writeInt(1); |
| 5880 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5881 | } else { |
| 5882 | data.writeInt(0); |
| 5883 | } |
| 5884 | mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0); |
| 5885 | reply.readException(); |
| 5886 | boolean res = reply.readInt() != 0; |
| 5887 | reply.recycle(); |
| 5888 | data.recycle(); |
| 5889 | return res; |
| 5890 | } |
| 5891 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5892 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 5893 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 5894 | Parcel data = Parcel.obtain(); |
| 5895 | Parcel reply = Parcel.obtain(); |
| 5896 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5897 | data.writeInt(displayId); |
| 5898 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 5899 | reply.readException(); |
| 5900 | final int result = reply.readInt(); |
| 5901 | final IActivityContainer res; |
| 5902 | if (result == 1) { |
| 5903 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5904 | } else { |
| 5905 | res = null; |
| 5906 | } |
| 5907 | data.recycle(); |
| 5908 | reply.recycle(); |
| 5909 | return res; |
| 5910 | } |
| 5911 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5912 | @Override |
| 5913 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5914 | throws RemoteException { |
| 5915 | Parcel data = Parcel.obtain(); |
| 5916 | Parcel reply = Parcel.obtain(); |
| 5917 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5918 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5919 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5920 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5921 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5922 | data.recycle(); |
| 5923 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5924 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5925 | } |
| 5926 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5927 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5928 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 5929 | Parcel data = Parcel.obtain(); |
| 5930 | Parcel reply = Parcel.obtain(); |
| 5931 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5932 | data.writeInt(taskId); |
| 5933 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 5934 | reply.readException(); |
| 5935 | data.recycle(); |
| 5936 | reply.recycle(); |
| 5937 | } |
| 5938 | |
| 5939 | @Override |
| 5940 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 5941 | Parcel data = Parcel.obtain(); |
| 5942 | Parcel reply = Parcel.obtain(); |
| 5943 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5944 | data.writeStrongBinder(token); |
| 5945 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 5946 | reply.readException(); |
| 5947 | data.recycle(); |
| 5948 | reply.recycle(); |
| 5949 | } |
| 5950 | |
| 5951 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5952 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 5953 | Parcel data = Parcel.obtain(); |
| 5954 | Parcel reply = Parcel.obtain(); |
| 5955 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5956 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5957 | reply.readException(); |
| 5958 | data.recycle(); |
| 5959 | reply.recycle(); |
| 5960 | } |
| 5961 | |
| 5962 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5963 | public void stopLockTaskMode() throws RemoteException { |
| 5964 | Parcel data = Parcel.obtain(); |
| 5965 | Parcel reply = Parcel.obtain(); |
| 5966 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5967 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 5968 | reply.readException(); |
| 5969 | data.recycle(); |
| 5970 | reply.recycle(); |
| 5971 | } |
| 5972 | |
| 5973 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5974 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 5975 | Parcel data = Parcel.obtain(); |
| 5976 | Parcel reply = Parcel.obtain(); |
| 5977 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5978 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5979 | reply.readException(); |
| 5980 | data.recycle(); |
| 5981 | reply.recycle(); |
| 5982 | } |
| 5983 | |
| 5984 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5985 | public boolean isInLockTaskMode() throws RemoteException { |
| 5986 | Parcel data = Parcel.obtain(); |
| 5987 | Parcel reply = Parcel.obtain(); |
| 5988 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5989 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 5990 | reply.readException(); |
| 5991 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 5992 | data.recycle(); |
| 5993 | reply.recycle(); |
| 5994 | return isInLockTaskMode; |
| 5995 | } |
| 5996 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 5997 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 5998 | public int getLockTaskModeState() throws RemoteException { |
| 5999 | Parcel data = Parcel.obtain(); |
| 6000 | Parcel reply = Parcel.obtain(); |
| 6001 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6002 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 6003 | reply.readException(); |
| 6004 | int lockTaskModeState = reply.readInt(); |
| 6005 | data.recycle(); |
| 6006 | reply.recycle(); |
| 6007 | return lockTaskModeState; |
| 6008 | } |
| 6009 | |
| 6010 | @Override |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 6011 | public void showLockTaskEscapeMessage(IBinder token) throws RemoteException { |
| 6012 | Parcel data = Parcel.obtain(); |
| 6013 | Parcel reply = Parcel.obtain(); |
| 6014 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6015 | data.writeStrongBinder(token); |
| 6016 | mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply, |
| 6017 | IBinder.FLAG_ONEWAY); |
| 6018 | reply.readException(); |
| 6019 | data.recycle(); |
| 6020 | reply.recycle(); |
| 6021 | } |
| 6022 | |
| 6023 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 6024 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6025 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6026 | Parcel data = Parcel.obtain(); |
| 6027 | Parcel reply = Parcel.obtain(); |
| 6028 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6029 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6030 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6031 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6032 | reply.readException(); |
| 6033 | data.recycle(); |
| 6034 | reply.recycle(); |
| 6035 | } |
| 6036 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6037 | @Override |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6038 | public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException { |
| 6039 | Parcel data = Parcel.obtain(); |
| 6040 | Parcel reply = Parcel.obtain(); |
| 6041 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6042 | data.writeInt(taskId); |
| 6043 | data.writeInt(resizeable ? 1 : 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6044 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6045 | reply.readException(); |
| 6046 | data.recycle(); |
| 6047 | reply.recycle(); |
| 6048 | } |
| 6049 | |
| 6050 | @Override |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6051 | public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6052 | { |
| 6053 | Parcel data = Parcel.obtain(); |
| 6054 | Parcel reply = Parcel.obtain(); |
| 6055 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6056 | data.writeInt(taskId); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6057 | data.writeInt(resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6058 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6059 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6060 | reply.readException(); |
| 6061 | data.recycle(); |
| 6062 | reply.recycle(); |
| 6063 | } |
| 6064 | |
| 6065 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 6066 | public Rect getTaskBounds(int taskId) throws RemoteException |
| 6067 | { |
| 6068 | Parcel data = Parcel.obtain(); |
| 6069 | Parcel reply = Parcel.obtain(); |
| 6070 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6071 | data.writeInt(taskId); |
| 6072 | mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0); |
| 6073 | reply.readException(); |
| 6074 | Rect rect = Rect.CREATOR.createFromParcel(reply); |
| 6075 | data.recycle(); |
| 6076 | reply.recycle(); |
| 6077 | return rect; |
| 6078 | } |
| 6079 | |
| 6080 | @Override |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6081 | public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException { |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6082 | Parcel data = Parcel.obtain(); |
| 6083 | Parcel reply = Parcel.obtain(); |
| 6084 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6085 | data.writeString(filename); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6086 | data.writeInt(userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6087 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 6088 | reply.readException(); |
| 6089 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 6090 | data.recycle(); |
| 6091 | reply.recycle(); |
| 6092 | return icon; |
| 6093 | } |
| 6094 | |
| 6095 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6096 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 6097 | throws RemoteException { |
| 6098 | Parcel data = Parcel.obtain(); |
| 6099 | Parcel reply = Parcel.obtain(); |
| 6100 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6101 | if (options == null) { |
| 6102 | data.writeInt(0); |
| 6103 | } else { |
| 6104 | data.writeInt(1); |
| 6105 | data.writeBundle(options.toBundle()); |
| 6106 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6107 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6108 | reply.readException(); |
| 6109 | data.recycle(); |
| 6110 | reply.recycle(); |
| 6111 | } |
| 6112 | |
| 6113 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6114 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6115 | Parcel data = Parcel.obtain(); |
| 6116 | Parcel reply = Parcel.obtain(); |
| 6117 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6118 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6119 | data.writeInt(visible ? 1 : 0); |
| 6120 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6121 | reply.readException(); |
| 6122 | boolean success = reply.readInt() > 0; |
| 6123 | data.recycle(); |
| 6124 | reply.recycle(); |
| 6125 | return success; |
| 6126 | } |
| 6127 | |
| 6128 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6129 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6130 | Parcel data = Parcel.obtain(); |
| 6131 | Parcel reply = Parcel.obtain(); |
| 6132 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6133 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6134 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6135 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6136 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6137 | data.recycle(); |
| 6138 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6139 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6140 | } |
| 6141 | |
| 6142 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6143 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6144 | Parcel data = Parcel.obtain(); |
| 6145 | Parcel reply = Parcel.obtain(); |
| 6146 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6147 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6148 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 6149 | reply.readException(); |
| 6150 | data.recycle(); |
| 6151 | reply.recycle(); |
| 6152 | } |
| 6153 | |
| 6154 | @Override |
| 6155 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 6156 | Parcel data = Parcel.obtain(); |
| 6157 | Parcel reply = Parcel.obtain(); |
| 6158 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6159 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6160 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6161 | reply.readException(); |
| 6162 | data.recycle(); |
| 6163 | reply.recycle(); |
| 6164 | } |
| 6165 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6166 | @Override |
| 6167 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 6168 | Parcel data = Parcel.obtain(); |
| 6169 | Parcel reply = Parcel.obtain(); |
| 6170 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6171 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6172 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6173 | reply.readException(); |
| 6174 | data.recycle(); |
| 6175 | reply.recycle(); |
| 6176 | } |
| 6177 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 6178 | @Override |
| 6179 | public void bootAnimationComplete() throws RemoteException { |
| 6180 | Parcel data = Parcel.obtain(); |
| 6181 | Parcel reply = Parcel.obtain(); |
| 6182 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6183 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 6184 | reply.readException(); |
| 6185 | data.recycle(); |
| 6186 | reply.recycle(); |
| 6187 | } |
| 6188 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 6189 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 6190 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 6191 | Parcel data = Parcel.obtain(); |
| 6192 | Parcel reply = Parcel.obtain(); |
| 6193 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6194 | data.writeInt(uid); |
| 6195 | data.writeByteArray(firstPacket); |
| 6196 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 6197 | reply.readException(); |
| 6198 | data.recycle(); |
| 6199 | reply.recycle(); |
| 6200 | } |
| 6201 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6202 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6203 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 6204 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6205 | Parcel data = Parcel.obtain(); |
| 6206 | Parcel reply = Parcel.obtain(); |
| 6207 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6208 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6209 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6210 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6211 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6212 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 6213 | reply.readException(); |
| 6214 | data.recycle(); |
| 6215 | reply.recycle(); |
| 6216 | } |
| 6217 | |
| 6218 | @Override |
| 6219 | public void dumpHeapFinished(String path) throws RemoteException { |
| 6220 | Parcel data = Parcel.obtain(); |
| 6221 | Parcel reply = Parcel.obtain(); |
| 6222 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6223 | data.writeString(path); |
| 6224 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 6225 | reply.readException(); |
| 6226 | data.recycle(); |
| 6227 | reply.recycle(); |
| 6228 | } |
| 6229 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 6230 | @Override |
| 6231 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 6232 | throws RemoteException { |
| 6233 | Parcel data = Parcel.obtain(); |
| 6234 | Parcel reply = Parcel.obtain(); |
| 6235 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6236 | data.writeStrongBinder(session.asBinder()); |
| 6237 | data.writeInt(keepAwake ? 1 : 0); |
| 6238 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 6239 | reply.readException(); |
| 6240 | data.recycle(); |
| 6241 | reply.recycle(); |
| 6242 | } |
| 6243 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6244 | @Override |
| 6245 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 6246 | Parcel data = Parcel.obtain(); |
| 6247 | Parcel reply = Parcel.obtain(); |
| 6248 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6249 | data.writeInt(userId); |
| 6250 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6251 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6252 | reply.readException(); |
| 6253 | data.recycle(); |
| 6254 | reply.recycle(); |
| 6255 | } |
| 6256 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6257 | @Override |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 6258 | public void updateDeviceOwner(String packageName) throws RemoteException { |
| 6259 | Parcel data = Parcel.obtain(); |
| 6260 | Parcel reply = Parcel.obtain(); |
| 6261 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6262 | data.writeString(packageName); |
| 6263 | mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0); |
| 6264 | reply.readException(); |
| 6265 | data.recycle(); |
| 6266 | reply.recycle(); |
| 6267 | } |
| 6268 | |
| 6269 | @Override |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6270 | public int getPackageProcessState(String packageName, String callingPackage) |
| 6271 | throws RemoteException { |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6272 | Parcel data = Parcel.obtain(); |
| 6273 | Parcel reply = Parcel.obtain(); |
| 6274 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6275 | data.writeString(packageName); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6276 | data.writeString(callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6277 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 6278 | reply.readException(); |
| 6279 | int res = reply.readInt(); |
| 6280 | data.recycle(); |
| 6281 | reply.recycle(); |
| 6282 | return res; |
| 6283 | } |
| 6284 | |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 6285 | @Override |
| 6286 | public boolean setProcessMemoryTrimLevel(String process, int userId, int level) |
| 6287 | throws RemoteException { |
| 6288 | Parcel data = Parcel.obtain(); |
| 6289 | Parcel reply = Parcel.obtain(); |
| 6290 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6291 | data.writeString(process); |
| 6292 | data.writeInt(userId); |
| 6293 | data.writeInt(level); |
| 6294 | mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0); |
| 6295 | reply.readException(); |
| 6296 | int res = reply.readInt(); |
| 6297 | data.recycle(); |
| 6298 | reply.recycle(); |
| 6299 | return res != 0; |
| 6300 | } |
| 6301 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 6302 | @Override |
| 6303 | public boolean isRootVoiceInteraction(IBinder token) throws RemoteException { |
| 6304 | Parcel data = Parcel.obtain(); |
| 6305 | Parcel reply = Parcel.obtain(); |
| 6306 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6307 | data.writeStrongBinder(token); |
| 6308 | mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 6309 | reply.readException(); |
| 6310 | int res = reply.readInt(); |
| 6311 | data.recycle(); |
| 6312 | reply.recycle(); |
| 6313 | return res != 0; |
| 6314 | } |
| 6315 | |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6316 | @Override |
| 6317 | public void moveActivityToStack(IBinder token, int stackId) throws RemoteException { |
| 6318 | Parcel data = Parcel.obtain(); |
| 6319 | Parcel reply = Parcel.obtain(); |
| 6320 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6321 | data.writeStrongBinder(token); |
| 6322 | data.writeInt(stackId); |
| 6323 | mRemote.transact(MOVE_ACTIVITY_TO_STACK_TRANSACTION, data, reply, 0); |
| 6324 | reply.readException(); |
| 6325 | data.recycle(); |
| 6326 | reply.recycle(); |
| 6327 | } |
| 6328 | |
| 6329 | @Override |
| 6330 | public int getActivityStackId(IBinder token) throws RemoteException { |
| 6331 | Parcel data = Parcel.obtain(); |
| 6332 | Parcel reply = Parcel.obtain(); |
| 6333 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6334 | data.writeStrongBinder(token); |
| 6335 | mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0); |
| 6336 | reply.readException(); |
| 6337 | int stackId = reply.readInt(); |
| 6338 | data.recycle(); |
| 6339 | reply.recycle(); |
| 6340 | return stackId; |
| 6341 | } |
| 6342 | |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6343 | @Override |
| 6344 | public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration, |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6345 | int[] verticalSizeConfigurations, int[] smallestSizeConfigurations) |
| 6346 | throws RemoteException { |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6347 | Parcel data = Parcel.obtain(); |
| 6348 | Parcel reply = Parcel.obtain(); |
| 6349 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6350 | data.writeStrongBinder(token); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6351 | writeIntArray(horizontalSizeConfiguration, data); |
| 6352 | writeIntArray(verticalSizeConfigurations, data); |
| 6353 | writeIntArray(smallestSizeConfigurations, data); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6354 | mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0); |
| 6355 | reply.readException(); |
| 6356 | data.recycle(); |
| 6357 | reply.recycle(); |
| 6358 | } |
| 6359 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6360 | private static void writeIntArray(int[] array, Parcel data) { |
| 6361 | if (array == null) { |
| 6362 | data.writeInt(0); |
| 6363 | } else { |
| 6364 | data.writeInt(array.length); |
| 6365 | data.writeIntArray(array); |
| 6366 | } |
| 6367 | } |
| 6368 | |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 6369 | @Override |
| 6370 | public void suppressResizeConfigChanges(boolean suppress) throws RemoteException { |
| 6371 | Parcel data = Parcel.obtain(); |
| 6372 | Parcel reply = Parcel.obtain(); |
| 6373 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6374 | data.writeInt(suppress ? 1 : 0); |
| 6375 | mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0); |
| 6376 | reply.readException(); |
| 6377 | data.recycle(); |
| 6378 | reply.recycle(); |
| 6379 | } |
| 6380 | |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6381 | @Override |
| 6382 | public void removeStack(int stackId) throws RemoteException { |
| 6383 | Parcel data = Parcel.obtain(); |
| 6384 | Parcel reply = Parcel.obtain(); |
| 6385 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6386 | data.writeInt(stackId); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6387 | mRemote.transact(REMOVE_STACK_TRANSACTION, data, reply, 0); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6388 | reply.readException(); |
| 6389 | data.recycle(); |
| 6390 | reply.recycle(); |
| 6391 | } |
| 6392 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6393 | @Override |
| 6394 | public int getAppStartMode(int uid, String packageName) throws RemoteException { |
| 6395 | Parcel data = Parcel.obtain(); |
| 6396 | Parcel reply = Parcel.obtain(); |
| 6397 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6398 | data.writeInt(uid); |
| 6399 | data.writeString(packageName); |
| 6400 | mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0); |
| 6401 | reply.readException(); |
| 6402 | int res = reply.readInt(); |
| 6403 | data.recycle(); |
| 6404 | reply.recycle(); |
| 6405 | return res; |
| 6406 | } |
| 6407 | |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6408 | @Override |
| 6409 | public boolean inMultiWindowMode(IBinder token) throws RemoteException { |
| 6410 | Parcel data = Parcel.obtain(); |
| 6411 | Parcel reply = Parcel.obtain(); |
| 6412 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6413 | data.writeStrongBinder(token); |
| 6414 | mRemote.transact(IN_MULTI_WINDOW_MODE_TRANSACTION, data, reply, 0); |
| 6415 | reply.readException(); |
| 6416 | final boolean multiWindowMode = reply.readInt() == 1 ? true : false; |
| 6417 | data.recycle(); |
| 6418 | reply.recycle(); |
| 6419 | return multiWindowMode; |
| 6420 | } |
| 6421 | |
| 6422 | @Override |
| 6423 | public boolean inPictureInPictureMode(IBinder token) throws RemoteException { |
| 6424 | Parcel data = Parcel.obtain(); |
| 6425 | Parcel reply = Parcel.obtain(); |
| 6426 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6427 | data.writeStrongBinder(token); |
| 6428 | mRemote.transact(IN_PICTURE_IN_PICTURE_MODE_TRANSACTION, data, reply, 0); |
| 6429 | reply.readException(); |
| 6430 | final boolean pipMode = reply.readInt() == 1 ? true : false; |
| 6431 | data.recycle(); |
| 6432 | reply.recycle(); |
| 6433 | return pipMode; |
| 6434 | } |
| 6435 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6436 | private IBinder mRemote; |
| 6437 | } |