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