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