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 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2348 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2349 | data.enforceInterface(IActivityManager.descriptor); |
| 2350 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2351 | ActivityManager.TaskDescription values = |
| 2352 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2353 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2354 | reply.writeNoException(); |
| 2355 | return true; |
| 2356 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2357 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2358 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2359 | data.enforceInterface(IActivityManager.descriptor); |
| 2360 | int taskId = data.readInt(); |
| 2361 | boolean resizeable = (data.readInt() == 1) ? true : false; |
| 2362 | setTaskResizeable(taskId, resizeable); |
| 2363 | reply.writeNoException(); |
| 2364 | return true; |
| 2365 | } |
| 2366 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2367 | case RESIZE_TASK_TRANSACTION: { |
| 2368 | data.enforceInterface(IActivityManager.descriptor); |
| 2369 | int taskId = data.readInt(); |
| 2370 | Rect r = Rect.CREATOR.createFromParcel(data); |
| 2371 | resizeTask(taskId, r); |
| 2372 | reply.writeNoException(); |
| 2373 | return true; |
| 2374 | } |
| 2375 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2376 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2377 | data.enforceInterface(IActivityManager.descriptor); |
| 2378 | String filename = data.readString(); |
| 2379 | Bitmap icon = getTaskDescriptionIcon(filename); |
| 2380 | reply.writeNoException(); |
| 2381 | if (icon == null) { |
| 2382 | reply.writeInt(0); |
| 2383 | } else { |
| 2384 | reply.writeInt(1); |
| 2385 | icon.writeToParcel(reply, 0); |
| 2386 | } |
| 2387 | return true; |
| 2388 | } |
| 2389 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2390 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2391 | data.enforceInterface(IActivityManager.descriptor); |
| 2392 | final Bundle bundle; |
| 2393 | if (data.readInt() == 0) { |
| 2394 | bundle = null; |
| 2395 | } else { |
| 2396 | bundle = data.readBundle(); |
| 2397 | } |
| 2398 | final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle); |
| 2399 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2400 | reply.writeNoException(); |
| 2401 | return true; |
| 2402 | } |
| 2403 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2404 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2405 | data.enforceInterface(IActivityManager.descriptor); |
| 2406 | IBinder token = data.readStrongBinder(); |
| 2407 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2408 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2409 | reply.writeNoException(); |
| 2410 | reply.writeInt(success ? 1 : 0); |
| 2411 | return true; |
| 2412 | } |
| 2413 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2414 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2415 | data.enforceInterface(IActivityManager.descriptor); |
| 2416 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2417 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2418 | reply.writeNoException(); |
| 2419 | reply.writeInt(enabled ? 1 : 0); |
| 2420 | return true; |
| 2421 | } |
| 2422 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2423 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2424 | data.enforceInterface(IActivityManager.descriptor); |
| 2425 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2426 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2427 | reply.writeNoException(); |
| 2428 | return true; |
| 2429 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2430 | |
| 2431 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2432 | data.enforceInterface(IActivityManager.descriptor); |
| 2433 | IBinder token = data.readStrongBinder(); |
| 2434 | notifyLaunchTaskBehindComplete(token); |
| 2435 | reply.writeNoException(); |
| 2436 | return true; |
| 2437 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2438 | |
| 2439 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2440 | data.enforceInterface(IActivityManager.descriptor); |
| 2441 | IBinder token = data.readStrongBinder(); |
| 2442 | notifyEnterAnimationComplete(token); |
| 2443 | reply.writeNoException(); |
| 2444 | return true; |
| 2445 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2446 | |
| 2447 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2448 | data.enforceInterface(IActivityManager.descriptor); |
| 2449 | bootAnimationComplete(); |
| 2450 | reply.writeNoException(); |
| 2451 | return true; |
| 2452 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2453 | |
| 2454 | case SYSTEM_BACKUP_RESTORED: { |
| 2455 | data.enforceInterface(IActivityManager.descriptor); |
| 2456 | systemBackupRestored(); |
| 2457 | reply.writeNoException(); |
| 2458 | return true; |
| 2459 | } |
Jeff Sharkey | c2ae6fb | 2015-01-15 21:27:13 -0800 | [diff] [blame] | 2460 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2461 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2462 | data.enforceInterface(IActivityManager.descriptor); |
| 2463 | final int uid = data.readInt(); |
| 2464 | final byte[] firstPacket = data.createByteArray(); |
| 2465 | notifyCleartextNetwork(uid, firstPacket); |
| 2466 | reply.writeNoException(); |
| 2467 | return true; |
| 2468 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2469 | |
| 2470 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2471 | data.enforceInterface(IActivityManager.descriptor); |
| 2472 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2473 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2474 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2475 | String reportPackage = data.readString(); |
| 2476 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2477 | reply.writeNoException(); |
| 2478 | return true; |
| 2479 | } |
| 2480 | |
| 2481 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2482 | data.enforceInterface(IActivityManager.descriptor); |
| 2483 | String path = data.readString(); |
| 2484 | dumpHeapFinished(path); |
| 2485 | reply.writeNoException(); |
| 2486 | return true; |
| 2487 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2488 | |
| 2489 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2490 | data.enforceInterface(IActivityManager.descriptor); |
| 2491 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2492 | data.readStrongBinder()); |
| 2493 | boolean keepAwake = data.readInt() != 0; |
| 2494 | setVoiceKeepAwake(session, keepAwake); |
| 2495 | reply.writeNoException(); |
| 2496 | return true; |
| 2497 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2498 | |
| 2499 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2500 | data.enforceInterface(IActivityManager.descriptor); |
| 2501 | int userId = data.readInt(); |
| 2502 | String[] packages = data.readStringArray(); |
| 2503 | updateLockTaskPackages(userId, packages); |
| 2504 | reply.writeNoException(); |
| 2505 | return true; |
| 2506 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2507 | |
| 2508 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2509 | data.enforceInterface(IActivityManager.descriptor); |
| 2510 | String pkg = data.readString(); |
| 2511 | int res = getPackageProcessState(pkg); |
| 2512 | reply.writeNoException(); |
| 2513 | reply.writeInt(res); |
| 2514 | return true; |
| 2515 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2516 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2517 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2518 | return super.onTransact(code, data, reply, flags); |
| 2519 | } |
| 2520 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2521 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2522 | return this; |
| 2523 | } |
| 2524 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2525 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2526 | protected IActivityManager create() { |
| 2527 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2528 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2529 | Log.v("ActivityManager", "default service binder = " + b); |
| 2530 | } |
| 2531 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2532 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2533 | Log.v("ActivityManager", "default service = " + am); |
| 2534 | } |
| 2535 | return am; |
| 2536 | } |
| 2537 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2538 | } |
| 2539 | |
| 2540 | class ActivityManagerProxy implements IActivityManager |
| 2541 | { |
| 2542 | public ActivityManagerProxy(IBinder remote) |
| 2543 | { |
| 2544 | mRemote = remote; |
| 2545 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2546 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2547 | public IBinder asBinder() |
| 2548 | { |
| 2549 | return mRemote; |
| 2550 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2551 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2552 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2553 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2554 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2555 | Parcel data = Parcel.obtain(); |
| 2556 | Parcel reply = Parcel.obtain(); |
| 2557 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2558 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2559 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2560 | intent.writeToParcel(data, 0); |
| 2561 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2562 | data.writeStrongBinder(resultTo); |
| 2563 | data.writeString(resultWho); |
| 2564 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2565 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2566 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2567 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2568 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2569 | } else { |
| 2570 | data.writeInt(0); |
| 2571 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2572 | if (options != null) { |
| 2573 | data.writeInt(1); |
| 2574 | options.writeToParcel(data, 0); |
| 2575 | } else { |
| 2576 | data.writeInt(0); |
| 2577 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2578 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2579 | reply.readException(); |
| 2580 | int result = reply.readInt(); |
| 2581 | reply.recycle(); |
| 2582 | data.recycle(); |
| 2583 | return result; |
| 2584 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2585 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2586 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2587 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2588 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2589 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2590 | Parcel data = Parcel.obtain(); |
| 2591 | Parcel reply = Parcel.obtain(); |
| 2592 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2593 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2594 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2595 | intent.writeToParcel(data, 0); |
| 2596 | data.writeString(resolvedType); |
| 2597 | data.writeStrongBinder(resultTo); |
| 2598 | data.writeString(resultWho); |
| 2599 | data.writeInt(requestCode); |
| 2600 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2601 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2602 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2603 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2604 | } else { |
| 2605 | data.writeInt(0); |
| 2606 | } |
| 2607 | if (options != null) { |
| 2608 | data.writeInt(1); |
| 2609 | options.writeToParcel(data, 0); |
| 2610 | } else { |
| 2611 | data.writeInt(0); |
| 2612 | } |
| 2613 | data.writeInt(userId); |
| 2614 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 2615 | reply.readException(); |
| 2616 | int result = reply.readInt(); |
| 2617 | reply.recycle(); |
| 2618 | data.recycle(); |
| 2619 | return result; |
| 2620 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2621 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 2622 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 2623 | int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2624 | Parcel data = Parcel.obtain(); |
| 2625 | Parcel reply = Parcel.obtain(); |
| 2626 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2627 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2628 | data.writeString(callingPackage); |
| 2629 | intent.writeToParcel(data, 0); |
| 2630 | data.writeString(resolvedType); |
| 2631 | data.writeStrongBinder(resultTo); |
| 2632 | data.writeString(resultWho); |
| 2633 | data.writeInt(requestCode); |
| 2634 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2635 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2636 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2637 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2638 | } else { |
| 2639 | data.writeInt(0); |
| 2640 | } |
| 2641 | if (options != null) { |
| 2642 | data.writeInt(1); |
| 2643 | options.writeToParcel(data, 0); |
| 2644 | } else { |
| 2645 | data.writeInt(0); |
| 2646 | } |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 2647 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2648 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 2649 | reply.readException(); |
| 2650 | int result = reply.readInt(); |
| 2651 | reply.recycle(); |
| 2652 | data.recycle(); |
| 2653 | return result; |
| 2654 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2655 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 2656 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2657 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2658 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2659 | Parcel data = Parcel.obtain(); |
| 2660 | Parcel reply = Parcel.obtain(); |
| 2661 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2662 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2663 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2664 | intent.writeToParcel(data, 0); |
| 2665 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2666 | data.writeStrongBinder(resultTo); |
| 2667 | data.writeString(resultWho); |
| 2668 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2669 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2670 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2671 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2672 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2673 | } else { |
| 2674 | data.writeInt(0); |
| 2675 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2676 | if (options != null) { |
| 2677 | data.writeInt(1); |
| 2678 | options.writeToParcel(data, 0); |
| 2679 | } else { |
| 2680 | data.writeInt(0); |
| 2681 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2682 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2683 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 2684 | reply.readException(); |
| 2685 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 2686 | reply.recycle(); |
| 2687 | data.recycle(); |
| 2688 | return result; |
| 2689 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2690 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 2691 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2692 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2693 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2694 | Parcel data = Parcel.obtain(); |
| 2695 | Parcel reply = Parcel.obtain(); |
| 2696 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2697 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2698 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2699 | intent.writeToParcel(data, 0); |
| 2700 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2701 | data.writeStrongBinder(resultTo); |
| 2702 | data.writeString(resultWho); |
| 2703 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2704 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2705 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2706 | if (options != null) { |
| 2707 | data.writeInt(1); |
| 2708 | options.writeToParcel(data, 0); |
| 2709 | } else { |
| 2710 | data.writeInt(0); |
| 2711 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2712 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2713 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2714 | reply.readException(); |
| 2715 | int result = reply.readInt(); |
| 2716 | reply.recycle(); |
| 2717 | data.recycle(); |
| 2718 | return result; |
| 2719 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2720 | public int startActivityIntentSender(IApplicationThread caller, |
| 2721 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2722 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2723 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2724 | Parcel data = Parcel.obtain(); |
| 2725 | Parcel reply = Parcel.obtain(); |
| 2726 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2727 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2728 | intent.writeToParcel(data, 0); |
| 2729 | if (fillInIntent != null) { |
| 2730 | data.writeInt(1); |
| 2731 | fillInIntent.writeToParcel(data, 0); |
| 2732 | } else { |
| 2733 | data.writeInt(0); |
| 2734 | } |
| 2735 | data.writeString(resolvedType); |
| 2736 | data.writeStrongBinder(resultTo); |
| 2737 | data.writeString(resultWho); |
| 2738 | data.writeInt(requestCode); |
| 2739 | data.writeInt(flagsMask); |
| 2740 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2741 | if (options != null) { |
| 2742 | data.writeInt(1); |
| 2743 | options.writeToParcel(data, 0); |
| 2744 | } else { |
| 2745 | data.writeInt(0); |
| 2746 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2747 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2748 | reply.readException(); |
| 2749 | int result = reply.readInt(); |
| 2750 | reply.recycle(); |
| 2751 | data.recycle(); |
| 2752 | return result; |
| 2753 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2754 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 2755 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2756 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 2757 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2758 | Parcel data = Parcel.obtain(); |
| 2759 | Parcel reply = Parcel.obtain(); |
| 2760 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2761 | data.writeString(callingPackage); |
| 2762 | data.writeInt(callingPid); |
| 2763 | data.writeInt(callingUid); |
| 2764 | intent.writeToParcel(data, 0); |
| 2765 | data.writeString(resolvedType); |
| 2766 | data.writeStrongBinder(session.asBinder()); |
| 2767 | data.writeStrongBinder(interactor.asBinder()); |
| 2768 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2769 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2770 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2771 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2772 | } else { |
| 2773 | data.writeInt(0); |
| 2774 | } |
| 2775 | if (options != null) { |
| 2776 | data.writeInt(1); |
| 2777 | options.writeToParcel(data, 0); |
| 2778 | } else { |
| 2779 | data.writeInt(0); |
| 2780 | } |
| 2781 | data.writeInt(userId); |
| 2782 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2783 | reply.readException(); |
| 2784 | int result = reply.readInt(); |
| 2785 | reply.recycle(); |
| 2786 | data.recycle(); |
| 2787 | return result; |
| 2788 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2789 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2790 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2791 | Parcel data = Parcel.obtain(); |
| 2792 | Parcel reply = Parcel.obtain(); |
| 2793 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2794 | data.writeStrongBinder(callingActivity); |
| 2795 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2796 | if (options != null) { |
| 2797 | data.writeInt(1); |
| 2798 | options.writeToParcel(data, 0); |
| 2799 | } else { |
| 2800 | data.writeInt(0); |
| 2801 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2802 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2803 | reply.readException(); |
| 2804 | int result = reply.readInt(); |
| 2805 | reply.recycle(); |
| 2806 | data.recycle(); |
| 2807 | return result != 0; |
| 2808 | } |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 2809 | public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException { |
| 2810 | Parcel data = Parcel.obtain(); |
| 2811 | Parcel reply = Parcel.obtain(); |
| 2812 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2813 | data.writeInt(taskId); |
| 2814 | if (options == null) { |
| 2815 | data.writeInt(0); |
| 2816 | } else { |
| 2817 | data.writeInt(1); |
| 2818 | options.writeToParcel(data, 0); |
| 2819 | } |
| 2820 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 2821 | reply.readException(); |
| 2822 | int result = reply.readInt(); |
| 2823 | reply.recycle(); |
| 2824 | data.recycle(); |
| 2825 | return result; |
| 2826 | } |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 2827 | 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] | 2828 | throws RemoteException { |
| 2829 | Parcel data = Parcel.obtain(); |
| 2830 | Parcel reply = Parcel.obtain(); |
| 2831 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2832 | data.writeStrongBinder(token); |
| 2833 | data.writeInt(resultCode); |
| 2834 | if (resultData != null) { |
| 2835 | data.writeInt(1); |
| 2836 | resultData.writeToParcel(data, 0); |
| 2837 | } else { |
| 2838 | data.writeInt(0); |
| 2839 | } |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 2840 | data.writeInt(finishTask ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2841 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2842 | reply.readException(); |
| 2843 | boolean res = reply.readInt() != 0; |
| 2844 | data.recycle(); |
| 2845 | reply.recycle(); |
| 2846 | return res; |
| 2847 | } |
| 2848 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 2849 | { |
| 2850 | Parcel data = Parcel.obtain(); |
| 2851 | Parcel reply = Parcel.obtain(); |
| 2852 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2853 | data.writeStrongBinder(token); |
| 2854 | data.writeString(resultWho); |
| 2855 | data.writeInt(requestCode); |
| 2856 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2857 | reply.readException(); |
| 2858 | data.recycle(); |
| 2859 | reply.recycle(); |
| 2860 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 2861 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 2862 | Parcel data = Parcel.obtain(); |
| 2863 | Parcel reply = Parcel.obtain(); |
| 2864 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2865 | data.writeStrongBinder(token); |
| 2866 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 2867 | reply.readException(); |
| 2868 | boolean res = reply.readInt() != 0; |
| 2869 | data.recycle(); |
| 2870 | reply.recycle(); |
| 2871 | return res; |
| 2872 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 2873 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 2874 | Parcel data = Parcel.obtain(); |
| 2875 | Parcel reply = Parcel.obtain(); |
| 2876 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2877 | data.writeStrongBinder(session.asBinder()); |
| 2878 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 2879 | reply.readException(); |
| 2880 | data.recycle(); |
| 2881 | reply.recycle(); |
| 2882 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 2883 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 2884 | Parcel data = Parcel.obtain(); |
| 2885 | Parcel reply = Parcel.obtain(); |
| 2886 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2887 | data.writeStrongBinder(token); |
| 2888 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 2889 | reply.readException(); |
| 2890 | boolean res = reply.readInt() != 0; |
| 2891 | data.recycle(); |
| 2892 | reply.recycle(); |
| 2893 | return res; |
| 2894 | } |
| 2895 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 2896 | Parcel data = Parcel.obtain(); |
| 2897 | Parcel reply = Parcel.obtain(); |
| 2898 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2899 | data.writeStrongBinder(app.asBinder()); |
| 2900 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 2901 | reply.readException(); |
| 2902 | data.recycle(); |
| 2903 | reply.recycle(); |
| 2904 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 2905 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 2906 | Parcel data = Parcel.obtain(); |
| 2907 | Parcel reply = Parcel.obtain(); |
| 2908 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2909 | data.writeStrongBinder(token); |
| 2910 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 2911 | reply.readException(); |
| 2912 | boolean res = reply.readInt() != 0; |
| 2913 | data.recycle(); |
| 2914 | reply.recycle(); |
| 2915 | return res; |
| 2916 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2917 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2918 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 2919 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2920 | { |
| 2921 | Parcel data = Parcel.obtain(); |
| 2922 | Parcel reply = Parcel.obtain(); |
| 2923 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2924 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2925 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2926 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 2927 | filter.writeToParcel(data, 0); |
| 2928 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 2929 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2930 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 2931 | reply.readException(); |
| 2932 | Intent intent = null; |
| 2933 | int haveIntent = reply.readInt(); |
| 2934 | if (haveIntent != 0) { |
| 2935 | intent = Intent.CREATOR.createFromParcel(reply); |
| 2936 | } |
| 2937 | reply.recycle(); |
| 2938 | data.recycle(); |
| 2939 | return intent; |
| 2940 | } |
| 2941 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 2942 | { |
| 2943 | Parcel data = Parcel.obtain(); |
| 2944 | Parcel reply = Parcel.obtain(); |
| 2945 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2946 | data.writeStrongBinder(receiver.asBinder()); |
| 2947 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 2948 | reply.readException(); |
| 2949 | data.recycle(); |
| 2950 | reply.recycle(); |
| 2951 | } |
| 2952 | public int broadcastIntent(IApplicationThread caller, |
| 2953 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
| 2954 | int resultCode, String resultData, Bundle map, |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 2955 | String requiredPermission, int appOp, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2956 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2957 | { |
| 2958 | Parcel data = Parcel.obtain(); |
| 2959 | Parcel reply = Parcel.obtain(); |
| 2960 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2961 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2962 | intent.writeToParcel(data, 0); |
| 2963 | data.writeString(resolvedType); |
| 2964 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 2965 | data.writeInt(resultCode); |
| 2966 | data.writeString(resultData); |
| 2967 | data.writeBundle(map); |
| 2968 | data.writeString(requiredPermission); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 2969 | data.writeInt(appOp); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2970 | data.writeInt(serialized ? 1 : 0); |
| 2971 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2972 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2973 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 2974 | reply.readException(); |
| 2975 | int res = reply.readInt(); |
| 2976 | reply.recycle(); |
| 2977 | data.recycle(); |
| 2978 | return res; |
| 2979 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2980 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 2981 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2982 | { |
| 2983 | Parcel data = Parcel.obtain(); |
| 2984 | Parcel reply = Parcel.obtain(); |
| 2985 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2986 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2987 | intent.writeToParcel(data, 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(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 2990 | reply.readException(); |
| 2991 | data.recycle(); |
| 2992 | reply.recycle(); |
| 2993 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 2994 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 2995 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2996 | { |
| 2997 | Parcel data = Parcel.obtain(); |
| 2998 | Parcel reply = Parcel.obtain(); |
| 2999 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3000 | data.writeStrongBinder(who); |
| 3001 | data.writeInt(resultCode); |
| 3002 | data.writeString(resultData); |
| 3003 | data.writeBundle(map); |
| 3004 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3005 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3006 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3007 | reply.readException(); |
| 3008 | data.recycle(); |
| 3009 | reply.recycle(); |
| 3010 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3011 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3012 | { |
| 3013 | Parcel data = Parcel.obtain(); |
| 3014 | Parcel reply = Parcel.obtain(); |
| 3015 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3016 | data.writeStrongBinder(app.asBinder()); |
| 3017 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3018 | reply.readException(); |
| 3019 | data.recycle(); |
| 3020 | reply.recycle(); |
| 3021 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3022 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3023 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3024 | { |
| 3025 | Parcel data = Parcel.obtain(); |
| 3026 | Parcel reply = Parcel.obtain(); |
| 3027 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3028 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3029 | if (config != null) { |
| 3030 | data.writeInt(1); |
| 3031 | config.writeToParcel(data, 0); |
| 3032 | } else { |
| 3033 | data.writeInt(0); |
| 3034 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3035 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3036 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3037 | reply.readException(); |
| 3038 | data.recycle(); |
| 3039 | reply.recycle(); |
| 3040 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3041 | public void activityResumed(IBinder token) throws RemoteException |
| 3042 | { |
| 3043 | Parcel data = Parcel.obtain(); |
| 3044 | Parcel reply = Parcel.obtain(); |
| 3045 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3046 | data.writeStrongBinder(token); |
| 3047 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3048 | reply.readException(); |
| 3049 | data.recycle(); |
| 3050 | reply.recycle(); |
| 3051 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3052 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3053 | { |
| 3054 | Parcel data = Parcel.obtain(); |
| 3055 | Parcel reply = Parcel.obtain(); |
| 3056 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3057 | data.writeStrongBinder(token); |
| 3058 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3059 | reply.readException(); |
| 3060 | data.recycle(); |
| 3061 | reply.recycle(); |
| 3062 | } |
| 3063 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3064 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3065 | { |
| 3066 | Parcel data = Parcel.obtain(); |
| 3067 | Parcel reply = Parcel.obtain(); |
| 3068 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3069 | data.writeStrongBinder(token); |
| 3070 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3071 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3072 | TextUtils.writeToParcel(description, data, 0); |
| 3073 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3074 | reply.readException(); |
| 3075 | data.recycle(); |
| 3076 | reply.recycle(); |
| 3077 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3078 | public void activitySlept(IBinder token) throws RemoteException |
| 3079 | { |
| 3080 | Parcel data = Parcel.obtain(); |
| 3081 | Parcel reply = Parcel.obtain(); |
| 3082 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3083 | data.writeStrongBinder(token); |
| 3084 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3085 | reply.readException(); |
| 3086 | data.recycle(); |
| 3087 | reply.recycle(); |
| 3088 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3089 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3090 | { |
| 3091 | Parcel data = Parcel.obtain(); |
| 3092 | Parcel reply = Parcel.obtain(); |
| 3093 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3094 | data.writeStrongBinder(token); |
| 3095 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3096 | reply.readException(); |
| 3097 | data.recycle(); |
| 3098 | reply.recycle(); |
| 3099 | } |
| 3100 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3101 | { |
| 3102 | Parcel data = Parcel.obtain(); |
| 3103 | Parcel reply = Parcel.obtain(); |
| 3104 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3105 | data.writeStrongBinder(token); |
| 3106 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3107 | reply.readException(); |
| 3108 | String res = reply.readString(); |
| 3109 | data.recycle(); |
| 3110 | reply.recycle(); |
| 3111 | return res; |
| 3112 | } |
| 3113 | public ComponentName getCallingActivity(IBinder token) |
| 3114 | throws RemoteException { |
| 3115 | Parcel data = Parcel.obtain(); |
| 3116 | Parcel reply = Parcel.obtain(); |
| 3117 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3118 | data.writeStrongBinder(token); |
| 3119 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3120 | reply.readException(); |
| 3121 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3122 | data.recycle(); |
| 3123 | reply.recycle(); |
| 3124 | return res; |
| 3125 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3126 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3127 | Parcel data = Parcel.obtain(); |
| 3128 | Parcel reply = Parcel.obtain(); |
| 3129 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3130 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3131 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3132 | reply.readException(); |
| 3133 | ArrayList<IAppTask> list = null; |
| 3134 | int N = reply.readInt(); |
| 3135 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3136 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3137 | while (N > 0) { |
| 3138 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3139 | list.add(task); |
| 3140 | N--; |
| 3141 | } |
| 3142 | } |
| 3143 | data.recycle(); |
| 3144 | reply.recycle(); |
| 3145 | return list; |
| 3146 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3147 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3148 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3149 | Parcel data = Parcel.obtain(); |
| 3150 | Parcel reply = Parcel.obtain(); |
| 3151 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3152 | data.writeStrongBinder(activityToken); |
| 3153 | intent.writeToParcel(data, 0); |
| 3154 | description.writeToParcel(data, 0); |
| 3155 | thumbnail.writeToParcel(data, 0); |
| 3156 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3157 | reply.readException(); |
| 3158 | int res = reply.readInt(); |
| 3159 | data.recycle(); |
| 3160 | reply.recycle(); |
| 3161 | return res; |
| 3162 | } |
| 3163 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3164 | Parcel data = Parcel.obtain(); |
| 3165 | Parcel reply = Parcel.obtain(); |
| 3166 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3167 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3168 | reply.readException(); |
| 3169 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3170 | data.recycle(); |
| 3171 | reply.recycle(); |
| 3172 | return size; |
| 3173 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3174 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3175 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3176 | Parcel data = Parcel.obtain(); |
| 3177 | Parcel reply = Parcel.obtain(); |
| 3178 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3179 | data.writeInt(maxNum); |
| 3180 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3181 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3182 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3183 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3184 | int N = reply.readInt(); |
| 3185 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3186 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3187 | while (N > 0) { |
| 3188 | ActivityManager.RunningTaskInfo info = |
| 3189 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3190 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3191 | list.add(info); |
| 3192 | N--; |
| 3193 | } |
| 3194 | } |
| 3195 | data.recycle(); |
| 3196 | reply.recycle(); |
| 3197 | return list; |
| 3198 | } |
| 3199 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3200 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3201 | Parcel data = Parcel.obtain(); |
| 3202 | Parcel reply = Parcel.obtain(); |
| 3203 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3204 | data.writeInt(maxNum); |
| 3205 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3206 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3207 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3208 | reply.readException(); |
| 3209 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3210 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3211 | data.recycle(); |
| 3212 | reply.recycle(); |
| 3213 | return list; |
| 3214 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3215 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3216 | Parcel data = Parcel.obtain(); |
| 3217 | Parcel reply = Parcel.obtain(); |
| 3218 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3219 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3220 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3221 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3222 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3223 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3224 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3225 | } |
| 3226 | data.recycle(); |
| 3227 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3228 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3229 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3230 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3231 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3232 | Parcel data = Parcel.obtain(); |
| 3233 | Parcel reply = Parcel.obtain(); |
| 3234 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3235 | data.writeInt(maxNum); |
| 3236 | data.writeInt(flags); |
| 3237 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3238 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3239 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3240 | int N = reply.readInt(); |
| 3241 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3242 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3243 | while (N > 0) { |
| 3244 | ActivityManager.RunningServiceInfo info = |
| 3245 | ActivityManager.RunningServiceInfo.CREATOR |
| 3246 | .createFromParcel(reply); |
| 3247 | list.add(info); |
| 3248 | N--; |
| 3249 | } |
| 3250 | } |
| 3251 | data.recycle(); |
| 3252 | reply.recycle(); |
| 3253 | return list; |
| 3254 | } |
| 3255 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3256 | throws RemoteException { |
| 3257 | Parcel data = Parcel.obtain(); |
| 3258 | Parcel reply = Parcel.obtain(); |
| 3259 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3260 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3261 | reply.readException(); |
| 3262 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3263 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3264 | data.recycle(); |
| 3265 | reply.recycle(); |
| 3266 | return list; |
| 3267 | } |
| 3268 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3269 | throws RemoteException { |
| 3270 | Parcel data = Parcel.obtain(); |
| 3271 | Parcel reply = Parcel.obtain(); |
| 3272 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3273 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3274 | reply.readException(); |
| 3275 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3276 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3277 | data.recycle(); |
| 3278 | reply.recycle(); |
| 3279 | return list; |
| 3280 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3281 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3282 | throws RemoteException { |
| 3283 | Parcel data = Parcel.obtain(); |
| 3284 | Parcel reply = Parcel.obtain(); |
| 3285 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3286 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3287 | reply.readException(); |
| 3288 | ArrayList<ApplicationInfo> list |
| 3289 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3290 | data.recycle(); |
| 3291 | reply.recycle(); |
| 3292 | return list; |
| 3293 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3294 | 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] | 3295 | { |
| 3296 | Parcel data = Parcel.obtain(); |
| 3297 | Parcel reply = Parcel.obtain(); |
| 3298 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3299 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3300 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3301 | if (options != null) { |
| 3302 | data.writeInt(1); |
| 3303 | options.writeToParcel(data, 0); |
| 3304 | } else { |
| 3305 | data.writeInt(0); |
| 3306 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3307 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3308 | reply.readException(); |
| 3309 | data.recycle(); |
| 3310 | reply.recycle(); |
| 3311 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3312 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3313 | throws RemoteException { |
| 3314 | Parcel data = Parcel.obtain(); |
| 3315 | Parcel reply = Parcel.obtain(); |
| 3316 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3317 | data.writeStrongBinder(token); |
| 3318 | data.writeInt(nonRoot ? 1 : 0); |
| 3319 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3320 | reply.readException(); |
| 3321 | boolean res = reply.readInt() != 0; |
| 3322 | data.recycle(); |
| 3323 | reply.recycle(); |
| 3324 | return res; |
| 3325 | } |
| 3326 | public void moveTaskBackwards(int task) throws RemoteException |
| 3327 | { |
| 3328 | Parcel data = Parcel.obtain(); |
| 3329 | Parcel reply = Parcel.obtain(); |
| 3330 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3331 | data.writeInt(task); |
| 3332 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3333 | reply.readException(); |
| 3334 | data.recycle(); |
| 3335 | reply.recycle(); |
| 3336 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3337 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3338 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3339 | { |
| 3340 | Parcel data = Parcel.obtain(); |
| 3341 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3342 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3343 | data.writeInt(taskId); |
| 3344 | data.writeInt(stackId); |
| 3345 | data.writeInt(toTop ? 1 : 0); |
| 3346 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3347 | reply.readException(); |
| 3348 | data.recycle(); |
| 3349 | reply.recycle(); |
| 3350 | } |
| 3351 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3352 | public void resizeStack(int stackBoxId, Rect r) throws RemoteException |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3353 | { |
| 3354 | Parcel data = Parcel.obtain(); |
| 3355 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3356 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | 5a44915 | 2013-05-24 15:49:29 -0700 | [diff] [blame] | 3357 | data.writeInt(stackBoxId); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3358 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3359 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3360 | reply.readException(); |
| 3361 | data.recycle(); |
| 3362 | reply.recycle(); |
| 3363 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3364 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3365 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3366 | { |
| 3367 | Parcel data = Parcel.obtain(); |
| 3368 | Parcel reply = Parcel.obtain(); |
| 3369 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3370 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3371 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3372 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3373 | data.recycle(); |
| 3374 | reply.recycle(); |
| 3375 | return list; |
| 3376 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3377 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3378 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3379 | { |
| 3380 | Parcel data = Parcel.obtain(); |
| 3381 | Parcel reply = Parcel.obtain(); |
| 3382 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3383 | data.writeInt(stackId); |
| 3384 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3385 | reply.readException(); |
| 3386 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3387 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3388 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3389 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3390 | } |
| 3391 | data.recycle(); |
| 3392 | reply.recycle(); |
| 3393 | return info; |
| 3394 | } |
| 3395 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 3396 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 3397 | Parcel data = Parcel.obtain(); |
| 3398 | Parcel reply = Parcel.obtain(); |
| 3399 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3400 | data.writeInt(taskId); |
| 3401 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 3402 | reply.readException(); |
| 3403 | boolean isInHomeStack = reply.readInt() > 0; |
| 3404 | data.recycle(); |
| 3405 | reply.recycle(); |
| 3406 | return isInHomeStack; |
| 3407 | } |
| 3408 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3409 | public void setFocusedStack(int stackId) throws RemoteException |
| 3410 | { |
| 3411 | Parcel data = Parcel.obtain(); |
| 3412 | Parcel reply = Parcel.obtain(); |
| 3413 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3414 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3415 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3416 | reply.readException(); |
| 3417 | data.recycle(); |
| 3418 | reply.recycle(); |
| 3419 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3420 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 3421 | public int getFocusedStackId() throws RemoteException { |
| 3422 | Parcel data = Parcel.obtain(); |
| 3423 | Parcel reply = Parcel.obtain(); |
| 3424 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3425 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 3426 | reply.readException(); |
| 3427 | int focusedStackId = reply.readInt(); |
| 3428 | data.recycle(); |
| 3429 | reply.recycle(); |
| 3430 | return focusedStackId; |
| 3431 | } |
| 3432 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3433 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 3434 | { |
| 3435 | Parcel data = Parcel.obtain(); |
| 3436 | Parcel reply = Parcel.obtain(); |
| 3437 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3438 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3439 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3440 | reply.readException(); |
| 3441 | data.recycle(); |
| 3442 | reply.recycle(); |
| 3443 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3444 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 3445 | { |
| 3446 | Parcel data = Parcel.obtain(); |
| 3447 | Parcel reply = Parcel.obtain(); |
| 3448 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3449 | data.writeStrongBinder(token); |
| 3450 | data.writeInt(onlyRoot ? 1 : 0); |
| 3451 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3452 | reply.readException(); |
| 3453 | int res = reply.readInt(); |
| 3454 | data.recycle(); |
| 3455 | reply.recycle(); |
| 3456 | return res; |
| 3457 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3458 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3459 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3460 | Parcel data = Parcel.obtain(); |
| 3461 | Parcel reply = Parcel.obtain(); |
| 3462 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3463 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3464 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3465 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3466 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3467 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3468 | reply.readException(); |
| 3469 | int res = reply.readInt(); |
| 3470 | ContentProviderHolder cph = null; |
| 3471 | if (res != 0) { |
| 3472 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 3473 | } |
| 3474 | data.recycle(); |
| 3475 | reply.recycle(); |
| 3476 | return cph; |
| 3477 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3478 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 3479 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3480 | Parcel data = Parcel.obtain(); |
| 3481 | Parcel reply = Parcel.obtain(); |
| 3482 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3483 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3484 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3485 | data.writeStrongBinder(token); |
| 3486 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3487 | reply.readException(); |
| 3488 | int res = reply.readInt(); |
| 3489 | ContentProviderHolder cph = null; |
| 3490 | if (res != 0) { |
| 3491 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 3492 | } |
| 3493 | data.recycle(); |
| 3494 | reply.recycle(); |
| 3495 | return cph; |
| 3496 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3497 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3498 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3499 | { |
| 3500 | Parcel data = Parcel.obtain(); |
| 3501 | Parcel reply = Parcel.obtain(); |
| 3502 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3503 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3504 | data.writeTypedList(providers); |
| 3505 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 3506 | reply.readException(); |
| 3507 | data.recycle(); |
| 3508 | reply.recycle(); |
| 3509 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3510 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 3511 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3512 | Parcel data = Parcel.obtain(); |
| 3513 | Parcel reply = Parcel.obtain(); |
| 3514 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3515 | data.writeStrongBinder(connection); |
| 3516 | data.writeInt(stable); |
| 3517 | data.writeInt(unstable); |
| 3518 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3519 | reply.readException(); |
| 3520 | boolean res = reply.readInt() != 0; |
| 3521 | data.recycle(); |
| 3522 | reply.recycle(); |
| 3523 | return res; |
| 3524 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3525 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3526 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 3527 | Parcel data = Parcel.obtain(); |
| 3528 | Parcel reply = Parcel.obtain(); |
| 3529 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3530 | data.writeStrongBinder(connection); |
| 3531 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 3532 | reply.readException(); |
| 3533 | data.recycle(); |
| 3534 | reply.recycle(); |
| 3535 | } |
| 3536 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3537 | @Override |
| 3538 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 3539 | Parcel data = Parcel.obtain(); |
| 3540 | Parcel reply = Parcel.obtain(); |
| 3541 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3542 | data.writeStrongBinder(connection); |
| 3543 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 3544 | reply.readException(); |
| 3545 | data.recycle(); |
| 3546 | reply.recycle(); |
| 3547 | } |
| 3548 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3549 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 3550 | Parcel data = Parcel.obtain(); |
| 3551 | Parcel reply = Parcel.obtain(); |
| 3552 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3553 | data.writeStrongBinder(connection); |
| 3554 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3555 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3556 | reply.readException(); |
| 3557 | data.recycle(); |
| 3558 | reply.recycle(); |
| 3559 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3560 | |
| 3561 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 3562 | Parcel data = Parcel.obtain(); |
| 3563 | Parcel reply = Parcel.obtain(); |
| 3564 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3565 | data.writeString(name); |
| 3566 | data.writeStrongBinder(token); |
| 3567 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3568 | reply.readException(); |
| 3569 | data.recycle(); |
| 3570 | reply.recycle(); |
| 3571 | } |
| 3572 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 3573 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 3574 | throws RemoteException |
| 3575 | { |
| 3576 | Parcel data = Parcel.obtain(); |
| 3577 | Parcel reply = Parcel.obtain(); |
| 3578 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3579 | service.writeToParcel(data, 0); |
| 3580 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 3581 | reply.readException(); |
| 3582 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 3583 | data.recycle(); |
| 3584 | reply.recycle(); |
| 3585 | return res; |
| 3586 | } |
| 3587 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3588 | public ComponentName startService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3589 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3590 | { |
| 3591 | Parcel data = Parcel.obtain(); |
| 3592 | Parcel reply = Parcel.obtain(); |
| 3593 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3594 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3595 | service.writeToParcel(data, 0); |
| 3596 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3597 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3598 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 3599 | reply.readException(); |
| 3600 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3601 | data.recycle(); |
| 3602 | reply.recycle(); |
| 3603 | return res; |
| 3604 | } |
| 3605 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3606 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3607 | { |
| 3608 | Parcel data = Parcel.obtain(); |
| 3609 | Parcel reply = Parcel.obtain(); |
| 3610 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3611 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3612 | service.writeToParcel(data, 0); |
| 3613 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3614 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3615 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 3616 | reply.readException(); |
| 3617 | int res = reply.readInt(); |
| 3618 | reply.recycle(); |
| 3619 | data.recycle(); |
| 3620 | return res; |
| 3621 | } |
| 3622 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 3623 | int startId) throws RemoteException { |
| 3624 | Parcel data = Parcel.obtain(); |
| 3625 | Parcel reply = Parcel.obtain(); |
| 3626 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3627 | ComponentName.writeToParcel(className, data); |
| 3628 | data.writeStrongBinder(token); |
| 3629 | data.writeInt(startId); |
| 3630 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 3631 | reply.readException(); |
| 3632 | boolean res = reply.readInt() != 0; |
| 3633 | data.recycle(); |
| 3634 | reply.recycle(); |
| 3635 | return res; |
| 3636 | } |
| 3637 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3638 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3639 | Parcel data = Parcel.obtain(); |
| 3640 | Parcel reply = Parcel.obtain(); |
| 3641 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3642 | ComponentName.writeToParcel(className, data); |
| 3643 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3644 | data.writeInt(id); |
| 3645 | if (notification != null) { |
| 3646 | data.writeInt(1); |
| 3647 | notification.writeToParcel(data, 0); |
| 3648 | } else { |
| 3649 | data.writeInt(0); |
| 3650 | } |
| 3651 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3652 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3653 | reply.readException(); |
| 3654 | data.recycle(); |
| 3655 | reply.recycle(); |
| 3656 | } |
| 3657 | public int bindService(IApplicationThread caller, IBinder token, |
| 3658 | Intent service, String resolvedType, IServiceConnection connection, |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 3659 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3660 | Parcel data = Parcel.obtain(); |
| 3661 | Parcel reply = Parcel.obtain(); |
| 3662 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3663 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3664 | data.writeStrongBinder(token); |
| 3665 | service.writeToParcel(data, 0); |
| 3666 | data.writeString(resolvedType); |
| 3667 | data.writeStrongBinder(connection.asBinder()); |
| 3668 | data.writeInt(flags); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 3669 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3670 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 3671 | reply.readException(); |
| 3672 | int res = reply.readInt(); |
| 3673 | data.recycle(); |
| 3674 | reply.recycle(); |
| 3675 | return res; |
| 3676 | } |
| 3677 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 3678 | { |
| 3679 | Parcel data = Parcel.obtain(); |
| 3680 | Parcel reply = Parcel.obtain(); |
| 3681 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3682 | data.writeStrongBinder(connection.asBinder()); |
| 3683 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 3684 | reply.readException(); |
| 3685 | boolean res = reply.readInt() != 0; |
| 3686 | data.recycle(); |
| 3687 | reply.recycle(); |
| 3688 | return res; |
| 3689 | } |
| 3690 | |
| 3691 | public void publishService(IBinder token, |
| 3692 | Intent intent, IBinder service) throws RemoteException { |
| 3693 | Parcel data = Parcel.obtain(); |
| 3694 | Parcel reply = Parcel.obtain(); |
| 3695 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3696 | data.writeStrongBinder(token); |
| 3697 | intent.writeToParcel(data, 0); |
| 3698 | data.writeStrongBinder(service); |
| 3699 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 3700 | reply.readException(); |
| 3701 | data.recycle(); |
| 3702 | reply.recycle(); |
| 3703 | } |
| 3704 | |
| 3705 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 3706 | throws RemoteException { |
| 3707 | Parcel data = Parcel.obtain(); |
| 3708 | Parcel reply = Parcel.obtain(); |
| 3709 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3710 | data.writeStrongBinder(token); |
| 3711 | intent.writeToParcel(data, 0); |
| 3712 | data.writeInt(doRebind ? 1 : 0); |
| 3713 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 3714 | reply.readException(); |
| 3715 | data.recycle(); |
| 3716 | reply.recycle(); |
| 3717 | } |
| 3718 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 3719 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 3720 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3721 | Parcel data = Parcel.obtain(); |
| 3722 | Parcel reply = Parcel.obtain(); |
| 3723 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3724 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 3725 | data.writeInt(type); |
| 3726 | data.writeInt(startId); |
| 3727 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3728 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3729 | reply.readException(); |
| 3730 | data.recycle(); |
| 3731 | reply.recycle(); |
| 3732 | } |
| 3733 | |
| 3734 | public IBinder peekService(Intent service, String resolvedType) throws RemoteException { |
| 3735 | Parcel data = Parcel.obtain(); |
| 3736 | Parcel reply = Parcel.obtain(); |
| 3737 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3738 | service.writeToParcel(data, 0); |
| 3739 | data.writeString(resolvedType); |
| 3740 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 3741 | reply.readException(); |
| 3742 | IBinder binder = reply.readStrongBinder(); |
| 3743 | reply.recycle(); |
| 3744 | data.recycle(); |
| 3745 | return binder; |
| 3746 | } |
| 3747 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 3748 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 3749 | throws RemoteException { |
| 3750 | Parcel data = Parcel.obtain(); |
| 3751 | Parcel reply = Parcel.obtain(); |
| 3752 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3753 | app.writeToParcel(data, 0); |
| 3754 | data.writeInt(backupRestoreMode); |
| 3755 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 3756 | reply.readException(); |
| 3757 | boolean success = reply.readInt() != 0; |
| 3758 | reply.recycle(); |
| 3759 | data.recycle(); |
| 3760 | return success; |
| 3761 | } |
| 3762 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 3763 | public void clearPendingBackup() throws RemoteException { |
| 3764 | Parcel data = Parcel.obtain(); |
| 3765 | Parcel reply = Parcel.obtain(); |
| 3766 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3767 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 3768 | reply.recycle(); |
| 3769 | data.recycle(); |
| 3770 | } |
| 3771 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 3772 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 3773 | Parcel data = Parcel.obtain(); |
| 3774 | Parcel reply = Parcel.obtain(); |
| 3775 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3776 | data.writeString(packageName); |
| 3777 | data.writeStrongBinder(agent); |
| 3778 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 3779 | reply.recycle(); |
| 3780 | data.recycle(); |
| 3781 | } |
| 3782 | |
| 3783 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 3784 | Parcel data = Parcel.obtain(); |
| 3785 | Parcel reply = Parcel.obtain(); |
| 3786 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3787 | app.writeToParcel(data, 0); |
| 3788 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 3789 | reply.readException(); |
| 3790 | reply.recycle(); |
| 3791 | data.recycle(); |
| 3792 | } |
| 3793 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3794 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 3795 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 3796 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 3797 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3798 | Parcel data = Parcel.obtain(); |
| 3799 | Parcel reply = Parcel.obtain(); |
| 3800 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3801 | ComponentName.writeToParcel(className, data); |
| 3802 | data.writeString(profileFile); |
| 3803 | data.writeInt(flags); |
| 3804 | data.writeBundle(arguments); |
| 3805 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 3806 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3807 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 3808 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3809 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 3810 | reply.readException(); |
| 3811 | boolean res = reply.readInt() != 0; |
| 3812 | reply.recycle(); |
| 3813 | data.recycle(); |
| 3814 | return res; |
| 3815 | } |
| 3816 | |
| 3817 | public void finishInstrumentation(IApplicationThread target, |
| 3818 | int resultCode, Bundle results) throws RemoteException { |
| 3819 | Parcel data = Parcel.obtain(); |
| 3820 | Parcel reply = Parcel.obtain(); |
| 3821 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3822 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 3823 | data.writeInt(resultCode); |
| 3824 | data.writeBundle(results); |
| 3825 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 3826 | reply.readException(); |
| 3827 | data.recycle(); |
| 3828 | reply.recycle(); |
| 3829 | } |
| 3830 | public Configuration getConfiguration() throws RemoteException |
| 3831 | { |
| 3832 | Parcel data = Parcel.obtain(); |
| 3833 | Parcel reply = Parcel.obtain(); |
| 3834 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3835 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 3836 | reply.readException(); |
| 3837 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 3838 | reply.recycle(); |
| 3839 | data.recycle(); |
| 3840 | return res; |
| 3841 | } |
| 3842 | public void updateConfiguration(Configuration values) throws RemoteException |
| 3843 | { |
| 3844 | Parcel data = Parcel.obtain(); |
| 3845 | Parcel reply = Parcel.obtain(); |
| 3846 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3847 | values.writeToParcel(data, 0); |
| 3848 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 3849 | reply.readException(); |
| 3850 | data.recycle(); |
| 3851 | reply.recycle(); |
| 3852 | } |
| 3853 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 3854 | throws RemoteException { |
| 3855 | Parcel data = Parcel.obtain(); |
| 3856 | Parcel reply = Parcel.obtain(); |
| 3857 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3858 | data.writeStrongBinder(token); |
| 3859 | data.writeInt(requestedOrientation); |
| 3860 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 3861 | reply.readException(); |
| 3862 | data.recycle(); |
| 3863 | reply.recycle(); |
| 3864 | } |
| 3865 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 3866 | Parcel data = Parcel.obtain(); |
| 3867 | Parcel reply = Parcel.obtain(); |
| 3868 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3869 | data.writeStrongBinder(token); |
| 3870 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 3871 | reply.readException(); |
| 3872 | int res = reply.readInt(); |
| 3873 | data.recycle(); |
| 3874 | reply.recycle(); |
| 3875 | return res; |
| 3876 | } |
| 3877 | public ComponentName getActivityClassForToken(IBinder token) |
| 3878 | throws RemoteException { |
| 3879 | Parcel data = Parcel.obtain(); |
| 3880 | Parcel reply = Parcel.obtain(); |
| 3881 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3882 | data.writeStrongBinder(token); |
| 3883 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 3884 | reply.readException(); |
| 3885 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3886 | data.recycle(); |
| 3887 | reply.recycle(); |
| 3888 | return res; |
| 3889 | } |
| 3890 | public String getPackageForToken(IBinder token) throws RemoteException |
| 3891 | { |
| 3892 | Parcel data = Parcel.obtain(); |
| 3893 | Parcel reply = Parcel.obtain(); |
| 3894 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3895 | data.writeStrongBinder(token); |
| 3896 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 3897 | reply.readException(); |
| 3898 | String res = reply.readString(); |
| 3899 | data.recycle(); |
| 3900 | reply.recycle(); |
| 3901 | return res; |
| 3902 | } |
| 3903 | public IIntentSender getIntentSender(int type, |
| 3904 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 3905 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3906 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3907 | Parcel data = Parcel.obtain(); |
| 3908 | Parcel reply = Parcel.obtain(); |
| 3909 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3910 | data.writeInt(type); |
| 3911 | data.writeString(packageName); |
| 3912 | data.writeStrongBinder(token); |
| 3913 | data.writeString(resultWho); |
| 3914 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3915 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3916 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3917 | data.writeTypedArray(intents, 0); |
| 3918 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3919 | } else { |
| 3920 | data.writeInt(0); |
| 3921 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3922 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 3923 | if (options != null) { |
| 3924 | data.writeInt(1); |
| 3925 | options.writeToParcel(data, 0); |
| 3926 | } else { |
| 3927 | data.writeInt(0); |
| 3928 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3929 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3930 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3931 | reply.readException(); |
| 3932 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 3933 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3934 | data.recycle(); |
| 3935 | reply.recycle(); |
| 3936 | return res; |
| 3937 | } |
| 3938 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 3939 | Parcel data = Parcel.obtain(); |
| 3940 | Parcel reply = Parcel.obtain(); |
| 3941 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3942 | data.writeStrongBinder(sender.asBinder()); |
| 3943 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3944 | reply.readException(); |
| 3945 | data.recycle(); |
| 3946 | reply.recycle(); |
| 3947 | } |
| 3948 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 3949 | Parcel data = Parcel.obtain(); |
| 3950 | Parcel reply = Parcel.obtain(); |
| 3951 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3952 | data.writeStrongBinder(sender.asBinder()); |
| 3953 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3954 | reply.readException(); |
| 3955 | String res = reply.readString(); |
| 3956 | data.recycle(); |
| 3957 | reply.recycle(); |
| 3958 | return res; |
| 3959 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 3960 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 3961 | Parcel data = Parcel.obtain(); |
| 3962 | Parcel reply = Parcel.obtain(); |
| 3963 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3964 | data.writeStrongBinder(sender.asBinder()); |
| 3965 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3966 | reply.readException(); |
| 3967 | int res = reply.readInt(); |
| 3968 | data.recycle(); |
| 3969 | reply.recycle(); |
| 3970 | return res; |
| 3971 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3972 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 3973 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 3974 | Parcel data = Parcel.obtain(); |
| 3975 | Parcel reply = Parcel.obtain(); |
| 3976 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3977 | data.writeInt(callingPid); |
| 3978 | data.writeInt(callingUid); |
| 3979 | data.writeInt(userId); |
| 3980 | data.writeInt(allowAll ? 1 : 0); |
| 3981 | data.writeInt(requireFull ? 1 : 0); |
| 3982 | data.writeString(name); |
| 3983 | data.writeString(callerPackage); |
| 3984 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 3985 | reply.readException(); |
| 3986 | int res = reply.readInt(); |
| 3987 | data.recycle(); |
| 3988 | reply.recycle(); |
| 3989 | return res; |
| 3990 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3991 | public void setProcessLimit(int max) throws RemoteException |
| 3992 | { |
| 3993 | Parcel data = Parcel.obtain(); |
| 3994 | Parcel reply = Parcel.obtain(); |
| 3995 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3996 | data.writeInt(max); |
| 3997 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 3998 | reply.readException(); |
| 3999 | data.recycle(); |
| 4000 | reply.recycle(); |
| 4001 | } |
| 4002 | public int getProcessLimit() throws RemoteException |
| 4003 | { |
| 4004 | Parcel data = Parcel.obtain(); |
| 4005 | Parcel reply = Parcel.obtain(); |
| 4006 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4007 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4008 | reply.readException(); |
| 4009 | int res = reply.readInt(); |
| 4010 | data.recycle(); |
| 4011 | reply.recycle(); |
| 4012 | return res; |
| 4013 | } |
| 4014 | public void setProcessForeground(IBinder token, int pid, |
| 4015 | boolean isForeground) throws RemoteException { |
| 4016 | Parcel data = Parcel.obtain(); |
| 4017 | Parcel reply = Parcel.obtain(); |
| 4018 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4019 | data.writeStrongBinder(token); |
| 4020 | data.writeInt(pid); |
| 4021 | data.writeInt(isForeground ? 1 : 0); |
| 4022 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4023 | reply.readException(); |
| 4024 | data.recycle(); |
| 4025 | reply.recycle(); |
| 4026 | } |
| 4027 | public int checkPermission(String permission, int pid, int uid) |
| 4028 | throws RemoteException { |
| 4029 | Parcel data = Parcel.obtain(); |
| 4030 | Parcel reply = Parcel.obtain(); |
| 4031 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4032 | data.writeString(permission); |
| 4033 | data.writeInt(pid); |
| 4034 | data.writeInt(uid); |
| 4035 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4036 | reply.readException(); |
| 4037 | int res = reply.readInt(); |
| 4038 | data.recycle(); |
| 4039 | reply.recycle(); |
| 4040 | return res; |
| 4041 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4042 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4043 | throws RemoteException { |
| 4044 | Parcel data = Parcel.obtain(); |
| 4045 | Parcel reply = Parcel.obtain(); |
| 4046 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4047 | data.writeString(permission); |
| 4048 | data.writeInt(pid); |
| 4049 | data.writeInt(uid); |
| 4050 | data.writeStrongBinder(callerToken); |
| 4051 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4052 | reply.readException(); |
| 4053 | int res = reply.readInt(); |
| 4054 | data.recycle(); |
| 4055 | reply.recycle(); |
| 4056 | return res; |
| 4057 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4058 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4059 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4060 | Parcel data = Parcel.obtain(); |
| 4061 | Parcel reply = Parcel.obtain(); |
| 4062 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4063 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4064 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4065 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4066 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4067 | reply.readException(); |
| 4068 | boolean res = reply.readInt() != 0; |
| 4069 | data.recycle(); |
| 4070 | reply.recycle(); |
| 4071 | return res; |
| 4072 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4073 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4074 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4075 | Parcel data = Parcel.obtain(); |
| 4076 | Parcel reply = Parcel.obtain(); |
| 4077 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4078 | uri.writeToParcel(data, 0); |
| 4079 | data.writeInt(pid); |
| 4080 | data.writeInt(uid); |
| 4081 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4082 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4083 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4084 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4085 | reply.readException(); |
| 4086 | int res = reply.readInt(); |
| 4087 | data.recycle(); |
| 4088 | reply.recycle(); |
| 4089 | return res; |
| 4090 | } |
| 4091 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4092 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4093 | Parcel data = Parcel.obtain(); |
| 4094 | Parcel reply = Parcel.obtain(); |
| 4095 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4096 | data.writeStrongBinder(caller.asBinder()); |
| 4097 | data.writeString(targetPkg); |
| 4098 | uri.writeToParcel(data, 0); |
| 4099 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4100 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4101 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4102 | reply.readException(); |
| 4103 | data.recycle(); |
| 4104 | reply.recycle(); |
| 4105 | } |
| 4106 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4107 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4108 | Parcel data = Parcel.obtain(); |
| 4109 | Parcel reply = Parcel.obtain(); |
| 4110 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4111 | data.writeStrongBinder(caller.asBinder()); |
| 4112 | uri.writeToParcel(data, 0); |
| 4113 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4114 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4115 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4116 | reply.readException(); |
| 4117 | data.recycle(); |
| 4118 | reply.recycle(); |
| 4119 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4120 | |
| 4121 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4122 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4123 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4124 | Parcel data = Parcel.obtain(); |
| 4125 | Parcel reply = Parcel.obtain(); |
| 4126 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4127 | uri.writeToParcel(data, 0); |
| 4128 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4129 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4130 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4131 | reply.readException(); |
| 4132 | data.recycle(); |
| 4133 | reply.recycle(); |
| 4134 | } |
| 4135 | |
| 4136 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4137 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4138 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4139 | Parcel data = Parcel.obtain(); |
| 4140 | Parcel reply = Parcel.obtain(); |
| 4141 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4142 | uri.writeToParcel(data, 0); |
| 4143 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4144 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4145 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4146 | reply.readException(); |
| 4147 | data.recycle(); |
| 4148 | reply.recycle(); |
| 4149 | } |
| 4150 | |
| 4151 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4152 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4153 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4154 | Parcel data = Parcel.obtain(); |
| 4155 | Parcel reply = Parcel.obtain(); |
| 4156 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4157 | data.writeString(packageName); |
| 4158 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4159 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4160 | reply.readException(); |
| 4161 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4162 | reply); |
| 4163 | data.recycle(); |
| 4164 | reply.recycle(); |
| 4165 | return perms; |
| 4166 | } |
| 4167 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4168 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4169 | throws RemoteException { |
| 4170 | Parcel data = Parcel.obtain(); |
| 4171 | Parcel reply = Parcel.obtain(); |
| 4172 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4173 | data.writeStrongBinder(who.asBinder()); |
| 4174 | data.writeInt(waiting ? 1 : 0); |
| 4175 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4176 | reply.readException(); |
| 4177 | data.recycle(); |
| 4178 | reply.recycle(); |
| 4179 | } |
| 4180 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4181 | Parcel data = Parcel.obtain(); |
| 4182 | Parcel reply = Parcel.obtain(); |
| 4183 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4184 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4185 | reply.readException(); |
| 4186 | outInfo.readFromParcel(reply); |
| 4187 | data.recycle(); |
| 4188 | reply.recycle(); |
| 4189 | } |
| 4190 | public void unhandledBack() throws RemoteException |
| 4191 | { |
| 4192 | Parcel data = Parcel.obtain(); |
| 4193 | Parcel reply = Parcel.obtain(); |
| 4194 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4195 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4196 | reply.readException(); |
| 4197 | data.recycle(); |
| 4198 | reply.recycle(); |
| 4199 | } |
| 4200 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4201 | { |
| 4202 | Parcel data = Parcel.obtain(); |
| 4203 | Parcel reply = Parcel.obtain(); |
| 4204 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4205 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4206 | reply.readException(); |
| 4207 | ParcelFileDescriptor pfd = null; |
| 4208 | if (reply.readInt() != 0) { |
| 4209 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4210 | } |
| 4211 | data.recycle(); |
| 4212 | reply.recycle(); |
| 4213 | return pfd; |
| 4214 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4215 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4216 | { |
| 4217 | Parcel data = Parcel.obtain(); |
| 4218 | Parcel reply = Parcel.obtain(); |
| 4219 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4220 | data.writeInt(shown ? 1 : 0); |
| 4221 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4222 | reply.readException(); |
| 4223 | data.recycle(); |
| 4224 | reply.recycle(); |
| 4225 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4226 | public void setDebugApp( |
| 4227 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4228 | throws RemoteException |
| 4229 | { |
| 4230 | Parcel data = Parcel.obtain(); |
| 4231 | Parcel reply = Parcel.obtain(); |
| 4232 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4233 | data.writeString(packageName); |
| 4234 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4235 | data.writeInt(persistent ? 1 : 0); |
| 4236 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4237 | reply.readException(); |
| 4238 | data.recycle(); |
| 4239 | reply.recycle(); |
| 4240 | } |
| 4241 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4242 | { |
| 4243 | Parcel data = Parcel.obtain(); |
| 4244 | Parcel reply = Parcel.obtain(); |
| 4245 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4246 | data.writeInt(enabled ? 1 : 0); |
| 4247 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4248 | reply.readException(); |
| 4249 | data.recycle(); |
| 4250 | reply.recycle(); |
| 4251 | } |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4252 | public void setActivityController(IActivityController watcher) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4253 | { |
| 4254 | Parcel data = Parcel.obtain(); |
| 4255 | Parcel reply = Parcel.obtain(); |
| 4256 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4257 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4258 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4259 | reply.readException(); |
| 4260 | data.recycle(); |
| 4261 | reply.recycle(); |
| 4262 | } |
| 4263 | public void enterSafeMode() throws RemoteException { |
| 4264 | Parcel data = Parcel.obtain(); |
| 4265 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4266 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4267 | data.recycle(); |
| 4268 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4269 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4270 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4271 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4272 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4273 | data.writeStrongBinder(sender.asBinder()); |
| 4274 | data.writeInt(sourceUid); |
| 4275 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4276 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4277 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4278 | data.recycle(); |
| 4279 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4280 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 4281 | throws RemoteException { |
| 4282 | Parcel data = Parcel.obtain(); |
| 4283 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4284 | data.writeStrongBinder(sender.asBinder()); |
| 4285 | data.writeInt(sourceUid); |
| 4286 | data.writeString(tag); |
| 4287 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 4288 | data.recycle(); |
| 4289 | } |
| 4290 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 4291 | throws RemoteException { |
| 4292 | Parcel data = Parcel.obtain(); |
| 4293 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4294 | data.writeStrongBinder(sender.asBinder()); |
| 4295 | data.writeInt(sourceUid); |
| 4296 | data.writeString(tag); |
| 4297 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 4298 | data.recycle(); |
| 4299 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4300 | 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] | 4301 | Parcel data = Parcel.obtain(); |
| 4302 | Parcel reply = Parcel.obtain(); |
| 4303 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4304 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4305 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4306 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4307 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 4308 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4309 | boolean res = reply.readInt() != 0; |
| 4310 | data.recycle(); |
| 4311 | reply.recycle(); |
| 4312 | return res; |
| 4313 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 4314 | @Override |
| 4315 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 4316 | Parcel data = Parcel.obtain(); |
| 4317 | Parcel reply = Parcel.obtain(); |
| 4318 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4319 | data.writeString(reason); |
| 4320 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4321 | boolean res = reply.readInt() != 0; |
| 4322 | data.recycle(); |
| 4323 | reply.recycle(); |
| 4324 | return res; |
| 4325 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4326 | public boolean testIsSystemReady() |
| 4327 | { |
| 4328 | /* this base class version is never called */ |
| 4329 | return true; |
| 4330 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4331 | public void handleApplicationCrash(IBinder app, |
| 4332 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 4333 | { |
| 4334 | Parcel data = Parcel.obtain(); |
| 4335 | Parcel reply = Parcel.obtain(); |
| 4336 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4337 | data.writeStrongBinder(app); |
| 4338 | crashInfo.writeToParcel(data, 0); |
| 4339 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 4340 | reply.readException(); |
| 4341 | reply.recycle(); |
| 4342 | data.recycle(); |
| 4343 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4344 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4345 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4346 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4347 | { |
| 4348 | Parcel data = Parcel.obtain(); |
| 4349 | Parcel reply = Parcel.obtain(); |
| 4350 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4351 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4352 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4353 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4354 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4355 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4356 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4357 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4358 | reply.recycle(); |
| 4359 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4360 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4361 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4362 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4363 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4364 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4365 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4366 | { |
| 4367 | Parcel data = Parcel.obtain(); |
| 4368 | Parcel reply = Parcel.obtain(); |
| 4369 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4370 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4371 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4372 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4373 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 4374 | reply.readException(); |
| 4375 | reply.recycle(); |
| 4376 | data.recycle(); |
| 4377 | } |
| 4378 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4379 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 4380 | Parcel data = Parcel.obtain(); |
| 4381 | Parcel reply = Parcel.obtain(); |
| 4382 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4383 | data.writeInt(sig); |
| 4384 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 4385 | reply.readException(); |
| 4386 | data.recycle(); |
| 4387 | reply.recycle(); |
| 4388 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4389 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4390 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4391 | Parcel data = Parcel.obtain(); |
| 4392 | Parcel reply = Parcel.obtain(); |
| 4393 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4394 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4395 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4396 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4397 | reply.readException(); |
| 4398 | data.recycle(); |
| 4399 | reply.recycle(); |
| 4400 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4401 | |
| 4402 | public void killAllBackgroundProcesses() throws RemoteException { |
| 4403 | Parcel data = Parcel.obtain(); |
| 4404 | Parcel reply = Parcel.obtain(); |
| 4405 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4406 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4407 | reply.readException(); |
| 4408 | data.recycle(); |
| 4409 | reply.recycle(); |
| 4410 | } |
| 4411 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4412 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4413 | Parcel data = Parcel.obtain(); |
| 4414 | Parcel reply = Parcel.obtain(); |
| 4415 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4416 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4417 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4418 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4419 | reply.readException(); |
| 4420 | data.recycle(); |
| 4421 | reply.recycle(); |
| 4422 | } |
| 4423 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 4424 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 4425 | throws RemoteException |
| 4426 | { |
| 4427 | Parcel data = Parcel.obtain(); |
| 4428 | Parcel reply = Parcel.obtain(); |
| 4429 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4430 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 4431 | reply.readException(); |
| 4432 | outInfo.readFromParcel(reply); |
| 4433 | reply.recycle(); |
| 4434 | data.recycle(); |
| 4435 | } |
| 4436 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4437 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 4438 | { |
| 4439 | Parcel data = Parcel.obtain(); |
| 4440 | Parcel reply = Parcel.obtain(); |
| 4441 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4442 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4443 | reply.readException(); |
| 4444 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 4445 | reply.recycle(); |
| 4446 | data.recycle(); |
| 4447 | return res; |
| 4448 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4449 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4450 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4451 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4452 | { |
| 4453 | Parcel data = Parcel.obtain(); |
| 4454 | Parcel reply = Parcel.obtain(); |
| 4455 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4456 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4457 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4458 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 4459 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4460 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 4461 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4462 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 4463 | } else { |
| 4464 | data.writeInt(0); |
| 4465 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4466 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 4467 | reply.readException(); |
| 4468 | boolean res = reply.readInt() != 0; |
| 4469 | reply.recycle(); |
| 4470 | data.recycle(); |
| 4471 | return res; |
| 4472 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4473 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 4474 | public boolean shutdown(int timeout) throws RemoteException |
| 4475 | { |
| 4476 | Parcel data = Parcel.obtain(); |
| 4477 | Parcel reply = Parcel.obtain(); |
| 4478 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4479 | data.writeInt(timeout); |
| 4480 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 4481 | reply.readException(); |
| 4482 | boolean res = reply.readInt() != 0; |
| 4483 | reply.recycle(); |
| 4484 | data.recycle(); |
| 4485 | return res; |
| 4486 | } |
| 4487 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 4488 | public void stopAppSwitches() throws RemoteException { |
| 4489 | Parcel data = Parcel.obtain(); |
| 4490 | Parcel reply = Parcel.obtain(); |
| 4491 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4492 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 4493 | reply.readException(); |
| 4494 | reply.recycle(); |
| 4495 | data.recycle(); |
| 4496 | } |
| 4497 | |
| 4498 | public void resumeAppSwitches() throws RemoteException { |
| 4499 | Parcel data = Parcel.obtain(); |
| 4500 | Parcel reply = Parcel.obtain(); |
| 4501 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4502 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 4503 | reply.readException(); |
| 4504 | reply.recycle(); |
| 4505 | data.recycle(); |
| 4506 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 4507 | |
| 4508 | public void addPackageDependency(String packageName) throws RemoteException { |
| 4509 | Parcel data = Parcel.obtain(); |
| 4510 | Parcel reply = Parcel.obtain(); |
| 4511 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4512 | data.writeString(packageName); |
| 4513 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 4514 | reply.readException(); |
| 4515 | data.recycle(); |
| 4516 | reply.recycle(); |
| 4517 | } |
| 4518 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 4519 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 4520 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 4521 | Parcel data = Parcel.obtain(); |
| 4522 | Parcel reply = Parcel.obtain(); |
| 4523 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4524 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4525 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 4526 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4527 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 4528 | reply.readException(); |
| 4529 | data.recycle(); |
| 4530 | reply.recycle(); |
| 4531 | } |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 4532 | |
| 4533 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 4534 | Parcel data = Parcel.obtain(); |
| 4535 | Parcel reply = Parcel.obtain(); |
| 4536 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4537 | data.writeString(reason); |
| 4538 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 4539 | reply.readException(); |
| 4540 | data.recycle(); |
| 4541 | reply.recycle(); |
| 4542 | } |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4543 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4544 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4545 | throws RemoteException { |
| 4546 | Parcel data = Parcel.obtain(); |
| 4547 | Parcel reply = Parcel.obtain(); |
| 4548 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4549 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4550 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4551 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4552 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4553 | data.recycle(); |
| 4554 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4555 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4556 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 4557 | |
| 4558 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 4559 | Parcel data = Parcel.obtain(); |
| 4560 | Parcel reply = Parcel.obtain(); |
| 4561 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4562 | data.writeString(processName); |
| 4563 | data.writeInt(uid); |
| 4564 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 4565 | reply.readException(); |
| 4566 | data.recycle(); |
| 4567 | reply.recycle(); |
| 4568 | } |
| 4569 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 4570 | public void overridePendingTransition(IBinder token, String packageName, |
| 4571 | int enterAnim, int exitAnim) throws RemoteException { |
| 4572 | Parcel data = Parcel.obtain(); |
| 4573 | Parcel reply = Parcel.obtain(); |
| 4574 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4575 | data.writeStrongBinder(token); |
| 4576 | data.writeString(packageName); |
| 4577 | data.writeInt(enterAnim); |
| 4578 | data.writeInt(exitAnim); |
| 4579 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 4580 | reply.readException(); |
| 4581 | data.recycle(); |
| 4582 | reply.recycle(); |
| 4583 | } |
| 4584 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 4585 | public boolean isUserAMonkey() throws RemoteException { |
| 4586 | Parcel data = Parcel.obtain(); |
| 4587 | Parcel reply = Parcel.obtain(); |
| 4588 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4589 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 4590 | reply.readException(); |
| 4591 | boolean res = reply.readInt() != 0; |
| 4592 | data.recycle(); |
| 4593 | reply.recycle(); |
| 4594 | return res; |
| 4595 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 4596 | |
| 4597 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 4598 | Parcel data = Parcel.obtain(); |
| 4599 | Parcel reply = Parcel.obtain(); |
| 4600 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4601 | data.writeInt(monkey ? 1 : 0); |
| 4602 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 4603 | reply.readException(); |
| 4604 | data.recycle(); |
| 4605 | reply.recycle(); |
| 4606 | } |
| 4607 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 4608 | public void finishHeavyWeightApp() throws RemoteException { |
| 4609 | Parcel data = Parcel.obtain(); |
| 4610 | Parcel reply = Parcel.obtain(); |
| 4611 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4612 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 4613 | reply.readException(); |
| 4614 | data.recycle(); |
| 4615 | reply.recycle(); |
| 4616 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4617 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4618 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4619 | throws RemoteException { |
| 4620 | Parcel data = Parcel.obtain(); |
| 4621 | Parcel reply = Parcel.obtain(); |
| 4622 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4623 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4624 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 4625 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4626 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4627 | data.recycle(); |
| 4628 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4629 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4630 | } |
| 4631 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4632 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4633 | throws RemoteException { |
| 4634 | Parcel data = Parcel.obtain(); |
| 4635 | Parcel reply = Parcel.obtain(); |
| 4636 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4637 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4638 | if (options == null) { |
| 4639 | data.writeInt(0); |
| 4640 | } else { |
| 4641 | data.writeInt(1); |
| 4642 | data.writeBundle(options.toBundle()); |
| 4643 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4644 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4645 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4646 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4647 | data.recycle(); |
| 4648 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4649 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4650 | } |
| 4651 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4652 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 4653 | Parcel data = Parcel.obtain(); |
| 4654 | Parcel reply = Parcel.obtain(); |
| 4655 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4656 | data.writeStrongBinder(token); |
| 4657 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 4658 | reply.readException(); |
| 4659 | Bundle bundle = reply.readBundle(); |
| 4660 | ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle); |
| 4661 | data.recycle(); |
| 4662 | reply.recycle(); |
| 4663 | return options; |
| 4664 | } |
| 4665 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4666 | public void setImmersive(IBinder token, boolean immersive) |
| 4667 | throws RemoteException { |
| 4668 | Parcel data = Parcel.obtain(); |
| 4669 | Parcel reply = Parcel.obtain(); |
| 4670 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4671 | data.writeStrongBinder(token); |
| 4672 | data.writeInt(immersive ? 1 : 0); |
| 4673 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 4674 | reply.readException(); |
| 4675 | data.recycle(); |
| 4676 | reply.recycle(); |
| 4677 | } |
| 4678 | |
| 4679 | public boolean isImmersive(IBinder token) |
| 4680 | throws RemoteException { |
| 4681 | Parcel data = Parcel.obtain(); |
| 4682 | Parcel reply = Parcel.obtain(); |
| 4683 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4684 | data.writeStrongBinder(token); |
| 4685 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4686 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4687 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4688 | data.recycle(); |
| 4689 | reply.recycle(); |
| 4690 | return res; |
| 4691 | } |
| 4692 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 4693 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 4694 | Parcel data = Parcel.obtain(); |
| 4695 | Parcel reply = Parcel.obtain(); |
| 4696 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4697 | data.writeStrongBinder(token); |
| 4698 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 4699 | reply.readException(); |
| 4700 | boolean res = reply.readInt() == 1; |
| 4701 | data.recycle(); |
| 4702 | reply.recycle(); |
| 4703 | return res; |
| 4704 | } |
| 4705 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4706 | public boolean isTopActivityImmersive() |
| 4707 | throws RemoteException { |
| 4708 | Parcel data = Parcel.obtain(); |
| 4709 | Parcel reply = Parcel.obtain(); |
| 4710 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4711 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4712 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4713 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4714 | data.recycle(); |
| 4715 | reply.recycle(); |
| 4716 | return res; |
| 4717 | } |
| 4718 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 4719 | public void crashApplication(int uid, int initialPid, String packageName, |
| 4720 | String message) throws RemoteException { |
| 4721 | Parcel data = Parcel.obtain(); |
| 4722 | Parcel reply = Parcel.obtain(); |
| 4723 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4724 | data.writeInt(uid); |
| 4725 | data.writeInt(initialPid); |
| 4726 | data.writeString(packageName); |
| 4727 | data.writeString(message); |
| 4728 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 4729 | reply.readException(); |
| 4730 | data.recycle(); |
| 4731 | reply.recycle(); |
| 4732 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4733 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4734 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 4735 | Parcel data = Parcel.obtain(); |
| 4736 | Parcel reply = Parcel.obtain(); |
| 4737 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4738 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4739 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 4740 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 4741 | reply.readException(); |
| 4742 | String res = reply.readString(); |
| 4743 | data.recycle(); |
| 4744 | reply.recycle(); |
| 4745 | return res; |
| 4746 | } |
| 4747 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4748 | public IBinder newUriPermissionOwner(String name) |
| 4749 | throws RemoteException { |
| 4750 | Parcel data = Parcel.obtain(); |
| 4751 | Parcel reply = Parcel.obtain(); |
| 4752 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4753 | data.writeString(name); |
| 4754 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 4755 | reply.readException(); |
| 4756 | IBinder res = reply.readStrongBinder(); |
| 4757 | data.recycle(); |
| 4758 | reply.recycle(); |
| 4759 | return res; |
| 4760 | } |
| 4761 | |
| 4762 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 4763 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4764 | Parcel data = Parcel.obtain(); |
| 4765 | Parcel reply = Parcel.obtain(); |
| 4766 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4767 | data.writeStrongBinder(owner); |
| 4768 | data.writeInt(fromUid); |
| 4769 | data.writeString(targetPkg); |
| 4770 | uri.writeToParcel(data, 0); |
| 4771 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 4772 | data.writeInt(sourceUserId); |
| 4773 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4774 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4775 | reply.readException(); |
| 4776 | data.recycle(); |
| 4777 | reply.recycle(); |
| 4778 | } |
| 4779 | |
| 4780 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4781 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4782 | Parcel data = Parcel.obtain(); |
| 4783 | Parcel reply = Parcel.obtain(); |
| 4784 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4785 | data.writeStrongBinder(owner); |
| 4786 | if (uri != null) { |
| 4787 | data.writeInt(1); |
| 4788 | uri.writeToParcel(data, 0); |
| 4789 | } else { |
| 4790 | data.writeInt(0); |
| 4791 | } |
| 4792 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4793 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4794 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4795 | reply.readException(); |
| 4796 | data.recycle(); |
| 4797 | reply.recycle(); |
| 4798 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 4799 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 4800 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4801 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 4802 | Parcel data = Parcel.obtain(); |
| 4803 | Parcel reply = Parcel.obtain(); |
| 4804 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4805 | data.writeInt(callingUid); |
| 4806 | data.writeString(targetPkg); |
| 4807 | uri.writeToParcel(data, 0); |
| 4808 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4809 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 4810 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4811 | reply.readException(); |
| 4812 | int res = reply.readInt(); |
| 4813 | data.recycle(); |
| 4814 | reply.recycle(); |
| 4815 | return res; |
| 4816 | } |
| 4817 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4818 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4819 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 4820 | Parcel data = Parcel.obtain(); |
| 4821 | Parcel reply = Parcel.obtain(); |
| 4822 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4823 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4824 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 4825 | data.writeInt(managed ? 1 : 0); |
| 4826 | data.writeString(path); |
| 4827 | if (fd != null) { |
| 4828 | data.writeInt(1); |
| 4829 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 4830 | } else { |
| 4831 | data.writeInt(0); |
| 4832 | } |
| 4833 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 4834 | reply.readException(); |
| 4835 | boolean res = reply.readInt() != 0; |
| 4836 | reply.recycle(); |
| 4837 | data.recycle(); |
| 4838 | return res; |
| 4839 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 4840 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 4841 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 4842 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 4843 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4844 | Parcel data = Parcel.obtain(); |
| 4845 | Parcel reply = Parcel.obtain(); |
| 4846 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4847 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 4848 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4849 | data.writeTypedArray(intents, 0); |
| 4850 | data.writeStringArray(resolvedTypes); |
| 4851 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 4852 | if (options != null) { |
| 4853 | data.writeInt(1); |
| 4854 | options.writeToParcel(data, 0); |
| 4855 | } else { |
| 4856 | data.writeInt(0); |
| 4857 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 4858 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4859 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 4860 | reply.readException(); |
| 4861 | int result = reply.readInt(); |
| 4862 | reply.recycle(); |
| 4863 | data.recycle(); |
| 4864 | return result; |
| 4865 | } |
| 4866 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4867 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 4868 | Parcel data = Parcel.obtain(); |
| 4869 | Parcel reply = Parcel.obtain(); |
| 4870 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4871 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4872 | reply.readException(); |
| 4873 | int mode = reply.readInt(); |
| 4874 | reply.recycle(); |
| 4875 | data.recycle(); |
| 4876 | return mode; |
| 4877 | } |
| 4878 | |
| 4879 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 4880 | Parcel data = Parcel.obtain(); |
| 4881 | Parcel reply = Parcel.obtain(); |
| 4882 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4883 | data.writeInt(mode); |
| 4884 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4885 | reply.readException(); |
| 4886 | reply.recycle(); |
| 4887 | data.recycle(); |
| 4888 | } |
| 4889 | |
| 4890 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 4891 | Parcel data = Parcel.obtain(); |
| 4892 | Parcel reply = Parcel.obtain(); |
| 4893 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 4894 | data.writeString(packageName); |
| 4895 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4896 | reply.readException(); |
| 4897 | int mode = reply.readInt(); |
| 4898 | reply.recycle(); |
| 4899 | data.recycle(); |
| 4900 | return mode; |
| 4901 | } |
| 4902 | |
| 4903 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 4904 | throws RemoteException { |
| 4905 | Parcel data = Parcel.obtain(); |
| 4906 | Parcel reply = Parcel.obtain(); |
| 4907 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4908 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 4909 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 4910 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 4911 | reply.readException(); |
| 4912 | reply.recycle(); |
| 4913 | data.recycle(); |
| 4914 | } |
| 4915 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 4916 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 4917 | Parcel data = Parcel.obtain(); |
| 4918 | Parcel reply = Parcel.obtain(); |
| 4919 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4920 | data.writeString(packageName); |
| 4921 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 4922 | reply.readException(); |
| 4923 | boolean ask = reply.readInt() != 0; |
| 4924 | reply.recycle(); |
| 4925 | data.recycle(); |
| 4926 | return ask; |
| 4927 | } |
| 4928 | |
| 4929 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 4930 | throws RemoteException { |
| 4931 | Parcel data = Parcel.obtain(); |
| 4932 | Parcel reply = Parcel.obtain(); |
| 4933 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4934 | data.writeString(packageName); |
| 4935 | data.writeInt(ask ? 1 : 0); |
| 4936 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 4937 | reply.readException(); |
| 4938 | reply.recycle(); |
| 4939 | data.recycle(); |
| 4940 | } |
| 4941 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4942 | public boolean switchUser(int userid) throws RemoteException { |
| 4943 | Parcel data = Parcel.obtain(); |
| 4944 | Parcel reply = Parcel.obtain(); |
| 4945 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4946 | data.writeInt(userid); |
| 4947 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 4948 | reply.readException(); |
| 4949 | boolean result = reply.readInt() != 0; |
| 4950 | reply.recycle(); |
| 4951 | data.recycle(); |
| 4952 | return result; |
| 4953 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 4954 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 4955 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 4956 | Parcel data = Parcel.obtain(); |
| 4957 | Parcel reply = Parcel.obtain(); |
| 4958 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4959 | data.writeInt(userid); |
| 4960 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 4961 | reply.readException(); |
| 4962 | boolean result = reply.readInt() != 0; |
| 4963 | reply.recycle(); |
| 4964 | data.recycle(); |
| 4965 | return result; |
| 4966 | } |
| 4967 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 4968 | public int stopUser(int userid, IStopUserCallback callback) throws RemoteException { |
| 4969 | Parcel data = Parcel.obtain(); |
| 4970 | Parcel reply = Parcel.obtain(); |
| 4971 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4972 | data.writeInt(userid); |
| 4973 | data.writeStrongInterface(callback); |
| 4974 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 4975 | reply.readException(); |
| 4976 | int result = reply.readInt(); |
| 4977 | reply.recycle(); |
| 4978 | data.recycle(); |
| 4979 | return result; |
| 4980 | } |
| 4981 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 4982 | public UserInfo getCurrentUser() throws RemoteException { |
| 4983 | Parcel data = Parcel.obtain(); |
| 4984 | Parcel reply = Parcel.obtain(); |
| 4985 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 4986 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 4987 | reply.readException(); |
| 4988 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 4989 | reply.recycle(); |
| 4990 | data.recycle(); |
| 4991 | return userInfo; |
| 4992 | } |
| 4993 | |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 4994 | public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4995 | Parcel data = Parcel.obtain(); |
| 4996 | Parcel reply = Parcel.obtain(); |
| 4997 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4998 | data.writeInt(userid); |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 4999 | data.writeInt(orStopping ? 1 : 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5000 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5001 | reply.readException(); |
| 5002 | boolean result = reply.readInt() != 0; |
| 5003 | reply.recycle(); |
| 5004 | data.recycle(); |
| 5005 | return result; |
| 5006 | } |
| 5007 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5008 | public int[] getRunningUserIds() throws RemoteException { |
| 5009 | Parcel data = Parcel.obtain(); |
| 5010 | Parcel reply = Parcel.obtain(); |
| 5011 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5012 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5013 | reply.readException(); |
| 5014 | int[] result = reply.createIntArray(); |
| 5015 | reply.recycle(); |
| 5016 | data.recycle(); |
| 5017 | return result; |
| 5018 | } |
| 5019 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5020 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5021 | Parcel data = Parcel.obtain(); |
| 5022 | Parcel reply = Parcel.obtain(); |
| 5023 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5024 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5025 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5026 | reply.readException(); |
| 5027 | boolean result = reply.readInt() != 0; |
| 5028 | reply.recycle(); |
| 5029 | data.recycle(); |
| 5030 | return result; |
| 5031 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5032 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5033 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5034 | Parcel data = Parcel.obtain(); |
| 5035 | Parcel reply = Parcel.obtain(); |
| 5036 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5037 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5038 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5039 | reply.readException(); |
| 5040 | data.recycle(); |
| 5041 | reply.recycle(); |
| 5042 | } |
| 5043 | |
| 5044 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5045 | Parcel data = Parcel.obtain(); |
| 5046 | Parcel reply = Parcel.obtain(); |
| 5047 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5048 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5049 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5050 | reply.readException(); |
| 5051 | data.recycle(); |
| 5052 | reply.recycle(); |
| 5053 | } |
| 5054 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5055 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5056 | Parcel data = Parcel.obtain(); |
| 5057 | Parcel reply = Parcel.obtain(); |
| 5058 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5059 | data.writeStrongBinder(sender.asBinder()); |
| 5060 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5061 | reply.readException(); |
| 5062 | boolean res = reply.readInt() != 0; |
| 5063 | data.recycle(); |
| 5064 | reply.recycle(); |
| 5065 | return res; |
| 5066 | } |
| 5067 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5068 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5069 | Parcel data = Parcel.obtain(); |
| 5070 | Parcel reply = Parcel.obtain(); |
| 5071 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5072 | data.writeStrongBinder(sender.asBinder()); |
| 5073 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5074 | reply.readException(); |
| 5075 | boolean res = reply.readInt() != 0; |
| 5076 | data.recycle(); |
| 5077 | reply.recycle(); |
| 5078 | return res; |
| 5079 | } |
| 5080 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5081 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5082 | Parcel data = Parcel.obtain(); |
| 5083 | Parcel reply = Parcel.obtain(); |
| 5084 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5085 | data.writeStrongBinder(sender.asBinder()); |
| 5086 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5087 | reply.readException(); |
| 5088 | Intent res = reply.readInt() != 0 |
| 5089 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5090 | data.recycle(); |
| 5091 | reply.recycle(); |
| 5092 | return res; |
| 5093 | } |
| 5094 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5095 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5096 | throws RemoteException { |
| 5097 | Parcel data = Parcel.obtain(); |
| 5098 | Parcel reply = Parcel.obtain(); |
| 5099 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5100 | data.writeStrongBinder(sender.asBinder()); |
| 5101 | data.writeString(prefix); |
| 5102 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5103 | reply.readException(); |
| 5104 | String res = reply.readString(); |
| 5105 | data.recycle(); |
| 5106 | reply.recycle(); |
| 5107 | return res; |
| 5108 | } |
| 5109 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5110 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5111 | { |
| 5112 | Parcel data = Parcel.obtain(); |
| 5113 | Parcel reply = Parcel.obtain(); |
| 5114 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5115 | values.writeToParcel(data, 0); |
| 5116 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5117 | reply.readException(); |
| 5118 | data.recycle(); |
| 5119 | reply.recycle(); |
| 5120 | } |
| 5121 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 5122 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 5123 | Parcel data = Parcel.obtain(); |
| 5124 | Parcel reply = Parcel.obtain(); |
| 5125 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5126 | data.writeIntArray(pids); |
| 5127 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 5128 | reply.readException(); |
| 5129 | long[] res = reply.createLongArray(); |
| 5130 | data.recycle(); |
| 5131 | reply.recycle(); |
| 5132 | return res; |
| 5133 | } |
| 5134 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5135 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5136 | Parcel data = Parcel.obtain(); |
| 5137 | Parcel reply = Parcel.obtain(); |
| 5138 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5139 | TextUtils.writeToParcel(msg, data, 0); |
| 5140 | data.writeInt(always ? 1 : 0); |
| 5141 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5142 | reply.readException(); |
| 5143 | data.recycle(); |
| 5144 | reply.recycle(); |
| 5145 | } |
| 5146 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5147 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5148 | Parcel data = Parcel.obtain(); |
| 5149 | Parcel reply = Parcel.obtain(); |
| 5150 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5151 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5152 | reply.readException(); |
| 5153 | data.recycle(); |
| 5154 | reply.recycle(); |
| 5155 | } |
| 5156 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5157 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5158 | throws RemoteException { |
| 5159 | Parcel data = Parcel.obtain(); |
| 5160 | Parcel reply = Parcel.obtain(); |
| 5161 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5162 | data.writeStrongBinder(token); |
| 5163 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5164 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5165 | reply.readException(); |
| 5166 | boolean result = reply.readInt() != 0; |
| 5167 | data.recycle(); |
| 5168 | reply.recycle(); |
| 5169 | return result; |
| 5170 | } |
| 5171 | |
| 5172 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5173 | throws RemoteException { |
| 5174 | Parcel data = Parcel.obtain(); |
| 5175 | Parcel reply = Parcel.obtain(); |
| 5176 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5177 | data.writeStrongBinder(token); |
| 5178 | target.writeToParcel(data, 0); |
| 5179 | data.writeInt(resultCode); |
| 5180 | if (resultData != null) { |
| 5181 | data.writeInt(1); |
| 5182 | resultData.writeToParcel(data, 0); |
| 5183 | } else { |
| 5184 | data.writeInt(0); |
| 5185 | } |
| 5186 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5187 | reply.readException(); |
| 5188 | boolean result = reply.readInt() != 0; |
| 5189 | data.recycle(); |
| 5190 | reply.recycle(); |
| 5191 | return result; |
| 5192 | } |
| 5193 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5194 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5195 | Parcel data = Parcel.obtain(); |
| 5196 | Parcel reply = Parcel.obtain(); |
| 5197 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5198 | data.writeStrongBinder(activityToken); |
| 5199 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5200 | reply.readException(); |
| 5201 | int result = reply.readInt(); |
| 5202 | data.recycle(); |
| 5203 | reply.recycle(); |
| 5204 | return result; |
| 5205 | } |
| 5206 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5207 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 5208 | Parcel data = Parcel.obtain(); |
| 5209 | Parcel reply = Parcel.obtain(); |
| 5210 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5211 | data.writeStrongBinder(activityToken); |
| 5212 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 5213 | reply.readException(); |
| 5214 | String result = reply.readString(); |
| 5215 | data.recycle(); |
| 5216 | reply.recycle(); |
| 5217 | return result; |
| 5218 | } |
| 5219 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 5220 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5221 | Parcel data = Parcel.obtain(); |
| 5222 | Parcel reply = Parcel.obtain(); |
| 5223 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5224 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5225 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5226 | reply.readException(); |
| 5227 | data.recycle(); |
| 5228 | reply.recycle(); |
| 5229 | } |
| 5230 | |
| 5231 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5232 | Parcel data = Parcel.obtain(); |
| 5233 | Parcel reply = Parcel.obtain(); |
| 5234 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5235 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5236 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5237 | reply.readException(); |
| 5238 | data.recycle(); |
| 5239 | reply.recycle(); |
| 5240 | } |
| 5241 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5242 | public void requestBugReport() throws RemoteException { |
| 5243 | Parcel data = Parcel.obtain(); |
| 5244 | Parcel reply = Parcel.obtain(); |
| 5245 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5246 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 5247 | reply.readException(); |
| 5248 | data.recycle(); |
| 5249 | reply.recycle(); |
| 5250 | } |
| 5251 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5252 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 5253 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5254 | Parcel data = Parcel.obtain(); |
| 5255 | Parcel reply = Parcel.obtain(); |
| 5256 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5257 | data.writeInt(pid); |
| 5258 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5259 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5260 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 5261 | reply.readException(); |
| 5262 | long res = reply.readInt(); |
| 5263 | data.recycle(); |
| 5264 | reply.recycle(); |
| 5265 | return res; |
| 5266 | } |
| 5267 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5268 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5269 | Parcel data = Parcel.obtain(); |
| 5270 | Parcel reply = Parcel.obtain(); |
| 5271 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5272 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5273 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5274 | reply.readException(); |
| 5275 | Bundle res = reply.readBundle(); |
| 5276 | data.recycle(); |
| 5277 | reply.recycle(); |
| 5278 | return res; |
| 5279 | } |
| 5280 | |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5281 | public void requestAssistContextExtras(int requestType, IResultReceiver receiver) |
| 5282 | throws RemoteException { |
| 5283 | Parcel data = Parcel.obtain(); |
| 5284 | Parcel reply = Parcel.obtain(); |
| 5285 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5286 | data.writeInt(requestType); |
| 5287 | data.writeStrongBinder(receiver.asBinder()); |
| 5288 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 5289 | reply.readException(); |
| 5290 | data.recycle(); |
| 5291 | reply.recycle(); |
| 5292 | } |
| 5293 | |
Adam Skory | 7140a25 | 2013-09-11 12:04:58 +0100 | [diff] [blame] | 5294 | public void reportAssistContextExtras(IBinder token, Bundle extras) |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5295 | throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5296 | Parcel data = Parcel.obtain(); |
| 5297 | Parcel reply = Parcel.obtain(); |
| 5298 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5299 | data.writeStrongBinder(token); |
| 5300 | data.writeBundle(extras); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5301 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5302 | reply.readException(); |
| 5303 | data.recycle(); |
| 5304 | reply.recycle(); |
| 5305 | } |
| 5306 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 5307 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle) |
| 5308 | throws RemoteException { |
| 5309 | Parcel data = Parcel.obtain(); |
| 5310 | Parcel reply = Parcel.obtain(); |
| 5311 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5312 | intent.writeToParcel(data, 0); |
| 5313 | data.writeInt(requestType); |
| 5314 | data.writeString(hint); |
| 5315 | data.writeInt(userHandle); |
| 5316 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 5317 | reply.readException(); |
| 5318 | boolean res = reply.readInt() != 0; |
| 5319 | data.recycle(); |
| 5320 | reply.recycle(); |
| 5321 | return res; |
| 5322 | } |
| 5323 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5324 | public void killUid(int uid, String reason) throws RemoteException { |
| 5325 | Parcel data = Parcel.obtain(); |
| 5326 | Parcel reply = Parcel.obtain(); |
| 5327 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5328 | data.writeInt(uid); |
| 5329 | data.writeString(reason); |
| 5330 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 5331 | reply.readException(); |
| 5332 | data.recycle(); |
| 5333 | reply.recycle(); |
| 5334 | } |
| 5335 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 5336 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 5337 | Parcel data = Parcel.obtain(); |
| 5338 | Parcel reply = Parcel.obtain(); |
| 5339 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5340 | data.writeStrongBinder(who); |
| 5341 | data.writeInt(allowRestart ? 1 : 0); |
| 5342 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 5343 | reply.readException(); |
| 5344 | data.recycle(); |
| 5345 | reply.recycle(); |
| 5346 | } |
| 5347 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 5348 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 5349 | Parcel data = Parcel.obtain(); |
| 5350 | Parcel reply = Parcel.obtain(); |
| 5351 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5352 | data.writeStrongBinder(token); |
| 5353 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 5354 | reply.readException(); |
| 5355 | data.recycle(); |
| 5356 | reply.recycle(); |
| 5357 | } |
| 5358 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5359 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 5360 | Parcel data = Parcel.obtain(); |
| 5361 | Parcel reply = Parcel.obtain(); |
| 5362 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5363 | data.writeStrongBinder(token); |
| 5364 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 5365 | reply.readException(); |
| 5366 | data.recycle(); |
| 5367 | reply.recycle(); |
| 5368 | } |
| 5369 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 5370 | public void restart() throws RemoteException { |
| 5371 | Parcel data = Parcel.obtain(); |
| 5372 | Parcel reply = Parcel.obtain(); |
| 5373 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5374 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 5375 | reply.readException(); |
| 5376 | data.recycle(); |
| 5377 | reply.recycle(); |
| 5378 | } |
| 5379 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 5380 | public void performIdleMaintenance() throws RemoteException { |
| 5381 | Parcel data = Parcel.obtain(); |
| 5382 | Parcel reply = Parcel.obtain(); |
| 5383 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5384 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 5385 | reply.readException(); |
| 5386 | data.recycle(); |
| 5387 | reply.recycle(); |
| 5388 | } |
| 5389 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 5390 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5391 | IActivityContainerCallback callback) throws RemoteException { |
| 5392 | Parcel data = Parcel.obtain(); |
| 5393 | Parcel reply = Parcel.obtain(); |
| 5394 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5395 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 5396 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 5397 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5398 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 5399 | final int result = reply.readInt(); |
| 5400 | final IActivityContainer res; |
| 5401 | if (result == 1) { |
| 5402 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5403 | } else { |
| 5404 | res = null; |
| 5405 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5406 | data.recycle(); |
| 5407 | reply.recycle(); |
| 5408 | return res; |
| 5409 | } |
| 5410 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 5411 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 5412 | throws RemoteException { |
| 5413 | Parcel data = Parcel.obtain(); |
| 5414 | Parcel reply = Parcel.obtain(); |
| 5415 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5416 | data.writeStrongBinder(activityContainer.asBinder()); |
| 5417 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 5418 | reply.readException(); |
| 5419 | data.recycle(); |
| 5420 | reply.recycle(); |
| 5421 | } |
| 5422 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5423 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 5424 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 5425 | Parcel data = Parcel.obtain(); |
| 5426 | Parcel reply = Parcel.obtain(); |
| 5427 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5428 | data.writeInt(displayId); |
| 5429 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 5430 | reply.readException(); |
| 5431 | final int result = reply.readInt(); |
| 5432 | final IActivityContainer res; |
| 5433 | if (result == 1) { |
| 5434 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5435 | } else { |
| 5436 | res = null; |
| 5437 | } |
| 5438 | data.recycle(); |
| 5439 | reply.recycle(); |
| 5440 | return res; |
| 5441 | } |
| 5442 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5443 | @Override |
| 5444 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5445 | throws RemoteException { |
| 5446 | Parcel data = Parcel.obtain(); |
| 5447 | Parcel reply = Parcel.obtain(); |
| 5448 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5449 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5450 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5451 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5452 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5453 | data.recycle(); |
| 5454 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5455 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5456 | } |
| 5457 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5458 | @Override |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5459 | public IBinder getHomeActivityToken() throws RemoteException { |
| 5460 | Parcel data = Parcel.obtain(); |
| 5461 | Parcel reply = Parcel.obtain(); |
| 5462 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5463 | mRemote.transact(GET_HOME_ACTIVITY_TOKEN_TRANSACTION, data, reply, 0); |
| 5464 | reply.readException(); |
| 5465 | IBinder res = reply.readStrongBinder(); |
| 5466 | data.recycle(); |
| 5467 | reply.recycle(); |
| 5468 | return res; |
| 5469 | } |
| 5470 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5471 | @Override |
| 5472 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 5473 | Parcel data = Parcel.obtain(); |
| 5474 | Parcel reply = Parcel.obtain(); |
| 5475 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5476 | data.writeInt(taskId); |
| 5477 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 5478 | reply.readException(); |
| 5479 | data.recycle(); |
| 5480 | reply.recycle(); |
| 5481 | } |
| 5482 | |
| 5483 | @Override |
| 5484 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 5485 | Parcel data = Parcel.obtain(); |
| 5486 | Parcel reply = Parcel.obtain(); |
| 5487 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5488 | data.writeStrongBinder(token); |
| 5489 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 5490 | reply.readException(); |
| 5491 | data.recycle(); |
| 5492 | reply.recycle(); |
| 5493 | } |
| 5494 | |
| 5495 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5496 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 5497 | Parcel data = Parcel.obtain(); |
| 5498 | Parcel reply = Parcel.obtain(); |
| 5499 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5500 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5501 | reply.readException(); |
| 5502 | data.recycle(); |
| 5503 | reply.recycle(); |
| 5504 | } |
| 5505 | |
| 5506 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5507 | public void stopLockTaskMode() throws RemoteException { |
| 5508 | Parcel data = Parcel.obtain(); |
| 5509 | Parcel reply = Parcel.obtain(); |
| 5510 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5511 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 5512 | reply.readException(); |
| 5513 | data.recycle(); |
| 5514 | reply.recycle(); |
| 5515 | } |
| 5516 | |
| 5517 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5518 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 5519 | Parcel data = Parcel.obtain(); |
| 5520 | Parcel reply = Parcel.obtain(); |
| 5521 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5522 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5523 | reply.readException(); |
| 5524 | data.recycle(); |
| 5525 | reply.recycle(); |
| 5526 | } |
| 5527 | |
| 5528 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5529 | public boolean isInLockTaskMode() throws RemoteException { |
| 5530 | Parcel data = Parcel.obtain(); |
| 5531 | Parcel reply = Parcel.obtain(); |
| 5532 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5533 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 5534 | reply.readException(); |
| 5535 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 5536 | data.recycle(); |
| 5537 | reply.recycle(); |
| 5538 | return isInLockTaskMode; |
| 5539 | } |
| 5540 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 5541 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 5542 | public int getLockTaskModeState() throws RemoteException { |
| 5543 | Parcel data = Parcel.obtain(); |
| 5544 | Parcel reply = Parcel.obtain(); |
| 5545 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5546 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 5547 | reply.readException(); |
| 5548 | int lockTaskModeState = reply.readInt(); |
| 5549 | data.recycle(); |
| 5550 | reply.recycle(); |
| 5551 | return lockTaskModeState; |
| 5552 | } |
| 5553 | |
| 5554 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 5555 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 5556 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 5557 | Parcel data = Parcel.obtain(); |
| 5558 | Parcel reply = Parcel.obtain(); |
| 5559 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5560 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 5561 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5562 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 5563 | reply.readException(); |
| 5564 | data.recycle(); |
| 5565 | reply.recycle(); |
| 5566 | } |
| 5567 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5568 | @Override |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 5569 | public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException { |
| 5570 | Parcel data = Parcel.obtain(); |
| 5571 | Parcel reply = Parcel.obtain(); |
| 5572 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5573 | data.writeInt(taskId); |
| 5574 | data.writeInt(resizeable ? 1 : 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5575 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 5576 | reply.readException(); |
| 5577 | data.recycle(); |
| 5578 | reply.recycle(); |
| 5579 | } |
| 5580 | |
| 5581 | @Override |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 5582 | public void resizeTask(int taskId, Rect r) throws RemoteException |
| 5583 | { |
| 5584 | Parcel data = Parcel.obtain(); |
| 5585 | Parcel reply = Parcel.obtain(); |
| 5586 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5587 | data.writeInt(taskId); |
| 5588 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5589 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 5590 | reply.readException(); |
| 5591 | data.recycle(); |
| 5592 | reply.recycle(); |
| 5593 | } |
| 5594 | |
| 5595 | @Override |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 5596 | public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException { |
| 5597 | Parcel data = Parcel.obtain(); |
| 5598 | Parcel reply = Parcel.obtain(); |
| 5599 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5600 | data.writeString(filename); |
| 5601 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 5602 | reply.readException(); |
| 5603 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 5604 | data.recycle(); |
| 5605 | reply.recycle(); |
| 5606 | return icon; |
| 5607 | } |
| 5608 | |
| 5609 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 5610 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 5611 | throws RemoteException { |
| 5612 | Parcel data = Parcel.obtain(); |
| 5613 | Parcel reply = Parcel.obtain(); |
| 5614 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5615 | if (options == null) { |
| 5616 | data.writeInt(0); |
| 5617 | } else { |
| 5618 | data.writeInt(1); |
| 5619 | data.writeBundle(options.toBundle()); |
| 5620 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5621 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 5622 | reply.readException(); |
| 5623 | data.recycle(); |
| 5624 | reply.recycle(); |
| 5625 | } |
| 5626 | |
| 5627 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5628 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5629 | Parcel data = Parcel.obtain(); |
| 5630 | Parcel reply = Parcel.obtain(); |
| 5631 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5632 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5633 | data.writeInt(visible ? 1 : 0); |
| 5634 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5635 | reply.readException(); |
| 5636 | boolean success = reply.readInt() > 0; |
| 5637 | data.recycle(); |
| 5638 | reply.recycle(); |
| 5639 | return success; |
| 5640 | } |
| 5641 | |
| 5642 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5643 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5644 | Parcel data = Parcel.obtain(); |
| 5645 | Parcel reply = Parcel.obtain(); |
| 5646 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5647 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5648 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5649 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5650 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5651 | data.recycle(); |
| 5652 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5653 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5654 | } |
| 5655 | |
| 5656 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 5657 | public void backgroundResourcesReleased(IBinder token) 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); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5662 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 5663 | reply.readException(); |
| 5664 | data.recycle(); |
| 5665 | reply.recycle(); |
| 5666 | } |
| 5667 | |
| 5668 | @Override |
| 5669 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 5670 | Parcel data = Parcel.obtain(); |
| 5671 | Parcel reply = Parcel.obtain(); |
| 5672 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5673 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5674 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5675 | reply.readException(); |
| 5676 | data.recycle(); |
| 5677 | reply.recycle(); |
| 5678 | } |
| 5679 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 5680 | @Override |
| 5681 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 5682 | Parcel data = Parcel.obtain(); |
| 5683 | Parcel reply = Parcel.obtain(); |
| 5684 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5685 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5686 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 5687 | reply.readException(); |
| 5688 | data.recycle(); |
| 5689 | reply.recycle(); |
| 5690 | } |
| 5691 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 5692 | @Override |
| 5693 | public void bootAnimationComplete() throws RemoteException { |
| 5694 | Parcel data = Parcel.obtain(); |
| 5695 | Parcel reply = Parcel.obtain(); |
| 5696 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5697 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 5698 | reply.readException(); |
| 5699 | data.recycle(); |
| 5700 | reply.recycle(); |
| 5701 | } |
| 5702 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 5703 | @Override |
| 5704 | public void systemBackupRestored() throws RemoteException { |
| 5705 | Parcel data = Parcel.obtain(); |
| 5706 | Parcel reply = Parcel.obtain(); |
| 5707 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5708 | mRemote.transact(SYSTEM_BACKUP_RESTORED, data, reply, 0); |
| 5709 | reply.readException(); |
| 5710 | data.recycle(); |
| 5711 | reply.recycle(); |
| 5712 | } |
| 5713 | |
Jeff Sharkey | c2ae6fb | 2015-01-15 21:27:13 -0800 | [diff] [blame] | 5714 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 5715 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 5716 | Parcel data = Parcel.obtain(); |
| 5717 | Parcel reply = Parcel.obtain(); |
| 5718 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5719 | data.writeInt(uid); |
| 5720 | data.writeByteArray(firstPacket); |
| 5721 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 5722 | reply.readException(); |
| 5723 | data.recycle(); |
| 5724 | reply.recycle(); |
| 5725 | } |
| 5726 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 5727 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 5728 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 5729 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 5730 | Parcel data = Parcel.obtain(); |
| 5731 | Parcel reply = Parcel.obtain(); |
| 5732 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5733 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 5734 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 5735 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 5736 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 5737 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 5738 | reply.readException(); |
| 5739 | data.recycle(); |
| 5740 | reply.recycle(); |
| 5741 | } |
| 5742 | |
| 5743 | @Override |
| 5744 | public void dumpHeapFinished(String path) throws RemoteException { |
| 5745 | Parcel data = Parcel.obtain(); |
| 5746 | Parcel reply = Parcel.obtain(); |
| 5747 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5748 | data.writeString(path); |
| 5749 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 5750 | reply.readException(); |
| 5751 | data.recycle(); |
| 5752 | reply.recycle(); |
| 5753 | } |
| 5754 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 5755 | @Override |
| 5756 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 5757 | throws RemoteException { |
| 5758 | Parcel data = Parcel.obtain(); |
| 5759 | Parcel reply = Parcel.obtain(); |
| 5760 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5761 | data.writeStrongBinder(session.asBinder()); |
| 5762 | data.writeInt(keepAwake ? 1 : 0); |
| 5763 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 5764 | reply.readException(); |
| 5765 | data.recycle(); |
| 5766 | reply.recycle(); |
| 5767 | } |
| 5768 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 5769 | @Override |
| 5770 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 5771 | Parcel data = Parcel.obtain(); |
| 5772 | Parcel reply = Parcel.obtain(); |
| 5773 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5774 | data.writeInt(userId); |
| 5775 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5776 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 5777 | reply.readException(); |
| 5778 | data.recycle(); |
| 5779 | reply.recycle(); |
| 5780 | } |
| 5781 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5782 | @Override |
| 5783 | public int getPackageProcessState(String packageName) throws RemoteException { |
| 5784 | Parcel data = Parcel.obtain(); |
| 5785 | Parcel reply = Parcel.obtain(); |
| 5786 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5787 | data.writeString(packageName); |
| 5788 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 5789 | reply.readException(); |
| 5790 | int res = reply.readInt(); |
| 5791 | data.recycle(); |
| 5792 | reply.recycle(); |
| 5793 | return res; |
| 5794 | } |
| 5795 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5796 | private IBinder mRemote; |
| 5797 | } |