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