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