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