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