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