The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.app; |
| 18 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 19 | import android.app.ActivityManager.StackInfo; |
Dianne Hackborn | 69c6adc | 2015-06-02 10:52:59 -0700 | [diff] [blame] | 20 | import android.app.assist.AssistContent; |
| 21 | import android.app.assist.AssistStructure; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.content.ComponentName; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 23 | import android.content.IIntentReceiver; |
| 24 | import android.content.IIntentSender; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | import android.content.Intent; |
| 26 | import android.content.IntentFilter; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 27 | import android.content.IntentSender; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 28 | import android.content.UriPermission; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 29 | import android.content.pm.ApplicationInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | import android.content.pm.ConfigurationInfo; |
| 31 | import android.content.pm.IPackageDataObserver; |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 32 | import android.content.pm.ParceledListSlice; |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 33 | import android.content.pm.UserInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 34 | import android.content.res.Configuration; |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 35 | import android.graphics.Bitmap; |
| 36 | import android.graphics.Point; |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 37 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 38 | import android.net.Uri; |
| 39 | import android.os.Binder; |
| 40 | import android.os.Bundle; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 41 | import android.os.Debug; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | import android.os.IBinder; |
| 43 | import android.os.Parcel; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 44 | import android.os.ParcelFileDescriptor; |
| 45 | import android.os.Parcelable; |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 46 | import android.os.PersistableBundle; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 47 | import android.os.RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | import android.os.ServiceManager; |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 49 | import android.os.StrictMode; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 50 | import android.service.voice.IVoiceInteractionSession; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 51 | import android.text.TextUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | import android.util.Log; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 53 | import android.util.Singleton; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 54 | import com.android.internal.app.IVoiceInteractor; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 55 | import com.android.internal.os.IResultReceiver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | import java.util.ArrayList; |
| 58 | import java.util.List; |
| 59 | |
| 60 | /** {@hide} */ |
| 61 | public abstract class ActivityManagerNative extends Binder implements IActivityManager |
| 62 | { |
| 63 | /** |
| 64 | * Cast a Binder object into an activity manager interface, generating |
| 65 | * a proxy if needed. |
| 66 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 67 | static public IActivityManager asInterface(IBinder obj) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 68 | if (obj == null) { |
| 69 | return null; |
| 70 | } |
| 71 | IActivityManager in = |
| 72 | (IActivityManager)obj.queryLocalInterface(descriptor); |
| 73 | if (in != null) { |
| 74 | return in; |
| 75 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 76 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 77 | return new ActivityManagerProxy(obj); |
| 78 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 79 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 80 | /** |
| 81 | * Retrieve the system's default/global activity manager. |
| 82 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 83 | static public IActivityManager getDefault() { |
| 84 | return gDefault.get(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Convenience for checking whether the system is ready. For internal use only. |
| 89 | */ |
| 90 | static public boolean isSystemReady() { |
| 91 | if (!sSystemReady) { |
| 92 | sSystemReady = getDefault().testIsSystemReady(); |
| 93 | } |
| 94 | return sSystemReady; |
| 95 | } |
| 96 | static boolean sSystemReady = false; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 97 | |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 98 | static public void broadcastStickyIntent(Intent intent, String permission, int userId) { |
| 99 | broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId); |
| 100 | } |
| 101 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 102 | /** |
| 103 | * Convenience for sending a sticky broadcast. For internal use only. |
| 104 | * If you don't care about permission, use null. |
| 105 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 106 | static public void broadcastStickyIntent(Intent intent, String permission, int appOp, |
| 107 | int userId) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 108 | try { |
| 109 | getDefault().broadcastIntent( |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 110 | null, intent, null, null, Activity.RESULT_OK, null, null, |
| 111 | null /*permission*/, appOp, null, false, true, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 112 | } catch (RemoteException ex) { |
| 113 | } |
| 114 | } |
| 115 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 116 | static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg, |
| 117 | String tag) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 118 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 119 | getDefault().noteWakeupAlarm((ps != null) ? ps.getTarget() : null, |
| 120 | sourceUid, sourcePkg, tag); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 121 | } catch (RemoteException ex) { |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) { |
| 126 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 127 | getDefault().noteAlarmStart((ps != null) ? ps.getTarget() : null, sourceUid, tag); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 128 | } catch (RemoteException ex) { |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) { |
| 133 | try { |
Christopher Tate | 14a7bb0 | 2015-10-01 10:24:31 -0700 | [diff] [blame] | 134 | getDefault().noteAlarmFinish((ps != null) ? ps.getTarget() : null, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 135 | } catch (RemoteException ex) { |
| 136 | } |
| 137 | } |
| 138 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 139 | public ActivityManagerNative() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 140 | attachInterface(this, descriptor); |
| 141 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 142 | |
| 143 | @Override |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 144 | public boolean onTransact(int code, Parcel data, Parcel reply, int flags) |
| 145 | throws RemoteException { |
| 146 | switch (code) { |
| 147 | case START_ACTIVITY_TRANSACTION: |
| 148 | { |
| 149 | data.enforceInterface(IActivityManager.descriptor); |
| 150 | IBinder b = data.readStrongBinder(); |
| 151 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 152 | String callingPackage = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 153 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 154 | String resolvedType = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 155 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 156 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 157 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 158 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 159 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 160 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 161 | Bundle options = data.readInt() != 0 |
| 162 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 163 | int result = startActivity(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 164 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 165 | reply.writeNoException(); |
| 166 | reply.writeInt(result); |
| 167 | return true; |
| 168 | } |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 169 | |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 170 | case START_ACTIVITY_AS_USER_TRANSACTION: |
| 171 | { |
| 172 | data.enforceInterface(IActivityManager.descriptor); |
| 173 | IBinder b = data.readStrongBinder(); |
| 174 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 175 | String callingPackage = data.readString(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 176 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 177 | String resolvedType = data.readString(); |
| 178 | IBinder resultTo = data.readStrongBinder(); |
| 179 | String resultWho = data.readString(); |
| 180 | int requestCode = data.readInt(); |
| 181 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 182 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 183 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 184 | Bundle options = data.readInt() != 0 |
| 185 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 186 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 187 | int result = startActivityAsUser(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 188 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 189 | reply.writeNoException(); |
| 190 | reply.writeInt(result); |
| 191 | return true; |
| 192 | } |
| 193 | |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 194 | case START_ACTIVITY_AS_CALLER_TRANSACTION: |
| 195 | { |
| 196 | data.enforceInterface(IActivityManager.descriptor); |
| 197 | IBinder b = data.readStrongBinder(); |
| 198 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 199 | String callingPackage = data.readString(); |
| 200 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 201 | String resolvedType = data.readString(); |
| 202 | IBinder resultTo = data.readStrongBinder(); |
| 203 | String resultWho = data.readString(); |
| 204 | int requestCode = data.readInt(); |
| 205 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 206 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 207 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 208 | Bundle options = data.readInt() != 0 |
| 209 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 210 | boolean ignoreTargetSecurity = data.readInt() != 0; |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 211 | int userId = data.readInt(); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 212 | int result = startActivityAsCaller(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 213 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, |
| 214 | ignoreTargetSecurity, userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 215 | reply.writeNoException(); |
| 216 | reply.writeInt(result); |
| 217 | return true; |
| 218 | } |
| 219 | |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 220 | case START_ACTIVITY_AND_WAIT_TRANSACTION: |
| 221 | { |
| 222 | data.enforceInterface(IActivityManager.descriptor); |
| 223 | IBinder b = data.readStrongBinder(); |
| 224 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 225 | String callingPackage = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 226 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 227 | String resolvedType = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 228 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 229 | String resultWho = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 230 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 231 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 232 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 233 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 234 | Bundle options = data.readInt() != 0 |
| 235 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 236 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 237 | WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 238 | resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 239 | reply.writeNoException(); |
| 240 | result.writeToParcel(reply, 0); |
| 241 | return true; |
| 242 | } |
| 243 | |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 244 | case START_ACTIVITY_WITH_CONFIG_TRANSACTION: |
| 245 | { |
| 246 | data.enforceInterface(IActivityManager.descriptor); |
| 247 | IBinder b = data.readStrongBinder(); |
| 248 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 249 | String callingPackage = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 250 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 251 | String resolvedType = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 252 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 253 | String resultWho = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 254 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 255 | int startFlags = data.readInt(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 256 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 257 | Bundle options = data.readInt() != 0 |
| 258 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 259 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 260 | int result = startActivityWithConfig(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 261 | resultTo, resultWho, requestCode, startFlags, config, options, userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 262 | reply.writeNoException(); |
| 263 | reply.writeInt(result); |
| 264 | return true; |
| 265 | } |
| 266 | |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 267 | case START_ACTIVITY_INTENT_SENDER_TRANSACTION: |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 268 | { |
| 269 | data.enforceInterface(IActivityManager.descriptor); |
| 270 | IBinder b = data.readStrongBinder(); |
| 271 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 272 | IntentSender intent = IntentSender.CREATOR.createFromParcel(data); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 273 | Intent fillInIntent = null; |
| 274 | if (data.readInt() != 0) { |
| 275 | fillInIntent = Intent.CREATOR.createFromParcel(data); |
| 276 | } |
| 277 | String resolvedType = data.readString(); |
| 278 | IBinder resultTo = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 279 | String resultWho = data.readString(); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 280 | int requestCode = data.readInt(); |
| 281 | int flagsMask = data.readInt(); |
| 282 | int flagsValues = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 283 | Bundle options = data.readInt() != 0 |
| 284 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 285 | int result = startActivityIntentSender(app, intent, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 286 | fillInIntent, resolvedType, resultTo, resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 287 | requestCode, flagsMask, flagsValues, options); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 288 | reply.writeNoException(); |
| 289 | reply.writeInt(result); |
| 290 | return true; |
| 291 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 292 | |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 293 | case START_VOICE_ACTIVITY_TRANSACTION: |
| 294 | { |
| 295 | data.enforceInterface(IActivityManager.descriptor); |
| 296 | String callingPackage = data.readString(); |
| 297 | int callingPid = data.readInt(); |
| 298 | int callingUid = data.readInt(); |
| 299 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 300 | String resolvedType = data.readString(); |
| 301 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 302 | data.readStrongBinder()); |
| 303 | IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface( |
| 304 | data.readStrongBinder()); |
| 305 | int startFlags = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 306 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 307 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 308 | Bundle options = data.readInt() != 0 |
| 309 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 310 | int userId = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 311 | int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent, |
| 312 | resolvedType, session, interactor, startFlags, profilerInfo, options, userId); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 313 | reply.writeNoException(); |
| 314 | reply.writeInt(result); |
| 315 | return true; |
| 316 | } |
| 317 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 318 | case START_NEXT_MATCHING_ACTIVITY_TRANSACTION: |
| 319 | { |
| 320 | data.enforceInterface(IActivityManager.descriptor); |
| 321 | IBinder callingActivity = data.readStrongBinder(); |
| 322 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 323 | Bundle options = data.readInt() != 0 |
| 324 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 325 | boolean result = startNextMatchingActivity(callingActivity, intent, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 326 | reply.writeNoException(); |
| 327 | reply.writeInt(result ? 1 : 0); |
| 328 | return true; |
| 329 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 330 | |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 331 | case START_ACTIVITY_FROM_RECENTS_TRANSACTION: |
| 332 | { |
| 333 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 334 | final int taskId = data.readInt(); |
| 335 | final int launchStackId = data.readInt(); |
| 336 | final Bundle options = |
| 337 | data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data); |
| 338 | final int result = startActivityFromRecents(taskId, launchStackId, options); |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 339 | reply.writeNoException(); |
| 340 | reply.writeInt(result); |
| 341 | return true; |
| 342 | } |
| 343 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 344 | case FINISH_ACTIVITY_TRANSACTION: { |
| 345 | data.enforceInterface(IActivityManager.descriptor); |
| 346 | IBinder token = data.readStrongBinder(); |
| 347 | Intent resultData = null; |
| 348 | int resultCode = data.readInt(); |
| 349 | if (data.readInt() != 0) { |
| 350 | resultData = Intent.CREATOR.createFromParcel(data); |
| 351 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 352 | int finishTask = data.readInt(); |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 353 | boolean res = finishActivity(token, resultCode, resultData, finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 354 | reply.writeNoException(); |
| 355 | reply.writeInt(res ? 1 : 0); |
| 356 | return true; |
| 357 | } |
| 358 | |
| 359 | case FINISH_SUB_ACTIVITY_TRANSACTION: { |
| 360 | data.enforceInterface(IActivityManager.descriptor); |
| 361 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 362 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 363 | int requestCode = data.readInt(); |
| 364 | finishSubActivity(token, resultWho, requestCode); |
| 365 | reply.writeNoException(); |
| 366 | return true; |
| 367 | } |
| 368 | |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 369 | case FINISH_ACTIVITY_AFFINITY_TRANSACTION: { |
| 370 | data.enforceInterface(IActivityManager.descriptor); |
| 371 | IBinder token = data.readStrongBinder(); |
| 372 | boolean res = finishActivityAffinity(token); |
| 373 | reply.writeNoException(); |
| 374 | reply.writeInt(res ? 1 : 0); |
| 375 | return true; |
| 376 | } |
| 377 | |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 378 | case FINISH_VOICE_TASK_TRANSACTION: { |
| 379 | data.enforceInterface(IActivityManager.descriptor); |
| 380 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 381 | data.readStrongBinder()); |
| 382 | finishVoiceTask(session); |
| 383 | reply.writeNoException(); |
| 384 | return true; |
| 385 | } |
| 386 | |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 387 | case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: { |
| 388 | data.enforceInterface(IActivityManager.descriptor); |
| 389 | IBinder token = data.readStrongBinder(); |
| 390 | boolean res = releaseActivityInstance(token); |
| 391 | reply.writeNoException(); |
| 392 | reply.writeInt(res ? 1 : 0); |
| 393 | return true; |
| 394 | } |
| 395 | |
| 396 | case RELEASE_SOME_ACTIVITIES_TRANSACTION: { |
| 397 | data.enforceInterface(IActivityManager.descriptor); |
| 398 | IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder()); |
| 399 | releaseSomeActivities(app); |
| 400 | reply.writeNoException(); |
| 401 | return true; |
| 402 | } |
| 403 | |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 404 | case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: { |
| 405 | data.enforceInterface(IActivityManager.descriptor); |
| 406 | IBinder token = data.readStrongBinder(); |
| 407 | boolean res = willActivityBeVisible(token); |
| 408 | reply.writeNoException(); |
| 409 | reply.writeInt(res ? 1 : 0); |
| 410 | return true; |
| 411 | } |
| 412 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 413 | case REGISTER_RECEIVER_TRANSACTION: |
| 414 | { |
| 415 | data.enforceInterface(IActivityManager.descriptor); |
| 416 | IBinder b = data.readStrongBinder(); |
| 417 | IApplicationThread app = |
| 418 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 419 | String packageName = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 420 | b = data.readStrongBinder(); |
| 421 | IIntentReceiver rec |
| 422 | = b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 423 | IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data); |
| 424 | String perm = data.readString(); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 425 | int userId = data.readInt(); |
| 426 | Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 427 | reply.writeNoException(); |
| 428 | if (intent != null) { |
| 429 | reply.writeInt(1); |
| 430 | intent.writeToParcel(reply, 0); |
| 431 | } else { |
| 432 | reply.writeInt(0); |
| 433 | } |
| 434 | return true; |
| 435 | } |
| 436 | |
| 437 | case UNREGISTER_RECEIVER_TRANSACTION: |
| 438 | { |
| 439 | data.enforceInterface(IActivityManager.descriptor); |
| 440 | IBinder b = data.readStrongBinder(); |
| 441 | if (b == null) { |
| 442 | return true; |
| 443 | } |
| 444 | IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b); |
| 445 | unregisterReceiver(rec); |
| 446 | reply.writeNoException(); |
| 447 | return true; |
| 448 | } |
| 449 | |
| 450 | case BROADCAST_INTENT_TRANSACTION: |
| 451 | { |
| 452 | data.enforceInterface(IActivityManager.descriptor); |
| 453 | IBinder b = data.readStrongBinder(); |
| 454 | IApplicationThread app = |
| 455 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 456 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 457 | String resolvedType = data.readString(); |
| 458 | b = data.readStrongBinder(); |
| 459 | IIntentReceiver resultTo = |
| 460 | b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 461 | int resultCode = data.readInt(); |
| 462 | String resultData = data.readString(); |
| 463 | Bundle resultExtras = data.readBundle(); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 464 | String[] perms = data.readStringArray(); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 465 | int appOp = data.readInt(); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 466 | Bundle options = data.readBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 467 | boolean serialized = data.readInt() != 0; |
| 468 | boolean sticky = data.readInt() != 0; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 469 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 470 | int res = broadcastIntent(app, intent, resolvedType, resultTo, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 471 | resultCode, resultData, resultExtras, perms, appOp, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 472 | options, serialized, sticky, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 473 | reply.writeNoException(); |
| 474 | reply.writeInt(res); |
| 475 | return true; |
| 476 | } |
| 477 | |
| 478 | case UNBROADCAST_INTENT_TRANSACTION: |
| 479 | { |
| 480 | data.enforceInterface(IActivityManager.descriptor); |
| 481 | IBinder b = data.readStrongBinder(); |
| 482 | IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 483 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 484 | int userId = data.readInt(); |
| 485 | unbroadcastIntent(app, intent, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 486 | reply.writeNoException(); |
| 487 | return true; |
| 488 | } |
| 489 | |
| 490 | case FINISH_RECEIVER_TRANSACTION: { |
| 491 | data.enforceInterface(IActivityManager.descriptor); |
| 492 | IBinder who = data.readStrongBinder(); |
| 493 | int resultCode = data.readInt(); |
| 494 | String resultData = data.readString(); |
| 495 | Bundle resultExtras = data.readBundle(); |
| 496 | boolean resultAbort = data.readInt() != 0; |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 497 | int intentFlags = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 498 | if (who != null) { |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 499 | finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 500 | } |
| 501 | reply.writeNoException(); |
| 502 | return true; |
| 503 | } |
| 504 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 505 | case ATTACH_APPLICATION_TRANSACTION: { |
| 506 | data.enforceInterface(IActivityManager.descriptor); |
| 507 | IApplicationThread app = ApplicationThreadNative.asInterface( |
| 508 | data.readStrongBinder()); |
| 509 | if (app != null) { |
| 510 | attachApplication(app); |
| 511 | } |
| 512 | reply.writeNoException(); |
| 513 | return true; |
| 514 | } |
| 515 | |
| 516 | case ACTIVITY_IDLE_TRANSACTION: { |
| 517 | data.enforceInterface(IActivityManager.descriptor); |
| 518 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 519 | Configuration config = null; |
| 520 | if (data.readInt() != 0) { |
| 521 | config = Configuration.CREATOR.createFromParcel(data); |
| 522 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 523 | boolean stopProfiling = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 524 | if (token != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 525 | activityIdle(token, config, stopProfiling); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 526 | } |
| 527 | reply.writeNoException(); |
| 528 | return true; |
| 529 | } |
| 530 | |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 531 | case ACTIVITY_RESUMED_TRANSACTION: { |
| 532 | data.enforceInterface(IActivityManager.descriptor); |
| 533 | IBinder token = data.readStrongBinder(); |
| 534 | activityResumed(token); |
| 535 | reply.writeNoException(); |
| 536 | return true; |
| 537 | } |
| 538 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 539 | case ACTIVITY_PAUSED_TRANSACTION: { |
| 540 | data.enforceInterface(IActivityManager.descriptor); |
| 541 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 542 | activityPaused(token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 543 | reply.writeNoException(); |
| 544 | return true; |
| 545 | } |
| 546 | |
| 547 | case ACTIVITY_STOPPED_TRANSACTION: { |
| 548 | data.enforceInterface(IActivityManager.descriptor); |
| 549 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 550 | Bundle map = data.readBundle(); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 551 | PersistableBundle persistentState = data.readPersistableBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 552 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 553 | activityStopped(token, map, persistentState, description); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 554 | reply.writeNoException(); |
| 555 | return true; |
| 556 | } |
| 557 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 558 | case ACTIVITY_SLEPT_TRANSACTION: { |
| 559 | data.enforceInterface(IActivityManager.descriptor); |
| 560 | IBinder token = data.readStrongBinder(); |
| 561 | activitySlept(token); |
| 562 | reply.writeNoException(); |
| 563 | return true; |
| 564 | } |
| 565 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 566 | case ACTIVITY_DESTROYED_TRANSACTION: { |
| 567 | data.enforceInterface(IActivityManager.descriptor); |
| 568 | IBinder token = data.readStrongBinder(); |
| 569 | activityDestroyed(token); |
| 570 | reply.writeNoException(); |
| 571 | return true; |
| 572 | } |
| 573 | |
| 574 | case GET_CALLING_PACKAGE_TRANSACTION: { |
| 575 | data.enforceInterface(IActivityManager.descriptor); |
| 576 | IBinder token = data.readStrongBinder(); |
| 577 | String res = token != null ? getCallingPackage(token) : null; |
| 578 | reply.writeNoException(); |
| 579 | reply.writeString(res); |
| 580 | return true; |
| 581 | } |
| 582 | |
| 583 | case GET_CALLING_ACTIVITY_TRANSACTION: { |
| 584 | data.enforceInterface(IActivityManager.descriptor); |
| 585 | IBinder token = data.readStrongBinder(); |
| 586 | ComponentName cn = getCallingActivity(token); |
| 587 | reply.writeNoException(); |
| 588 | ComponentName.writeToParcel(cn, reply); |
| 589 | return true; |
| 590 | } |
| 591 | |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 592 | case GET_APP_TASKS_TRANSACTION: { |
| 593 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 594 | String callingPackage = data.readString(); |
| 595 | List<IAppTask> list = getAppTasks(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 596 | reply.writeNoException(); |
| 597 | int N = list != null ? list.size() : -1; |
| 598 | reply.writeInt(N); |
| 599 | int i; |
| 600 | for (i=0; i<N; i++) { |
| 601 | IAppTask task = list.get(i); |
| 602 | reply.writeStrongBinder(task.asBinder()); |
| 603 | } |
| 604 | return true; |
| 605 | } |
| 606 | |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 607 | case ADD_APP_TASK_TRANSACTION: { |
| 608 | data.enforceInterface(IActivityManager.descriptor); |
| 609 | IBinder activityToken = data.readStrongBinder(); |
| 610 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 611 | ActivityManager.TaskDescription descr |
| 612 | = ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 613 | Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data); |
| 614 | int res = addAppTask(activityToken, intent, descr, thumbnail); |
| 615 | reply.writeNoException(); |
| 616 | reply.writeInt(res); |
| 617 | return true; |
| 618 | } |
| 619 | |
| 620 | case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: { |
| 621 | data.enforceInterface(IActivityManager.descriptor); |
| 622 | Point size = getAppTaskThumbnailSize(); |
| 623 | reply.writeNoException(); |
| 624 | size.writeToParcel(reply, 0); |
| 625 | return true; |
| 626 | } |
| 627 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 628 | case GET_TASKS_TRANSACTION: { |
| 629 | data.enforceInterface(IActivityManager.descriptor); |
| 630 | int maxNum = data.readInt(); |
| 631 | int fl = data.readInt(); |
Dianne Hackborn | 0923328 | 2014-04-30 11:33:59 -0700 | [diff] [blame] | 632 | List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 633 | reply.writeNoException(); |
| 634 | int N = list != null ? list.size() : -1; |
| 635 | reply.writeInt(N); |
| 636 | int i; |
| 637 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 638 | ActivityManager.RunningTaskInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 639 | info.writeToParcel(reply, 0); |
| 640 | } |
| 641 | return true; |
| 642 | } |
| 643 | |
| 644 | case GET_RECENT_TASKS_TRANSACTION: { |
| 645 | data.enforceInterface(IActivityManager.descriptor); |
| 646 | int maxNum = data.readInt(); |
| 647 | int fl = data.readInt(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 648 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 649 | List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 650 | fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 651 | reply.writeNoException(); |
| 652 | reply.writeTypedList(list); |
| 653 | return true; |
| 654 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 655 | |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 656 | case GET_TASK_THUMBNAIL_TRANSACTION: { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 657 | data.enforceInterface(IActivityManager.descriptor); |
| 658 | int id = data.readInt(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 659 | ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 660 | reply.writeNoException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 661 | if (taskThumbnail != null) { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 662 | reply.writeInt(1); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 663 | taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 664 | } else { |
| 665 | reply.writeInt(0); |
| 666 | } |
| 667 | return true; |
| 668 | } |
| 669 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 670 | case GET_SERVICES_TRANSACTION: { |
| 671 | data.enforceInterface(IActivityManager.descriptor); |
| 672 | int maxNum = data.readInt(); |
| 673 | int fl = data.readInt(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 674 | List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 675 | reply.writeNoException(); |
| 676 | int N = list != null ? list.size() : -1; |
| 677 | reply.writeInt(N); |
| 678 | int i; |
| 679 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 680 | ActivityManager.RunningServiceInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 681 | info.writeToParcel(reply, 0); |
| 682 | } |
| 683 | return true; |
| 684 | } |
| 685 | |
| 686 | case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: { |
| 687 | data.enforceInterface(IActivityManager.descriptor); |
| 688 | List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState(); |
| 689 | reply.writeNoException(); |
| 690 | reply.writeTypedList(list); |
| 691 | return true; |
| 692 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 693 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 694 | case GET_RUNNING_APP_PROCESSES_TRANSACTION: { |
| 695 | data.enforceInterface(IActivityManager.descriptor); |
| 696 | List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses(); |
| 697 | reply.writeNoException(); |
| 698 | reply.writeTypedList(list); |
| 699 | return true; |
| 700 | } |
| 701 | |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 702 | case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: { |
| 703 | data.enforceInterface(IActivityManager.descriptor); |
| 704 | List<ApplicationInfo> list = getRunningExternalApplications(); |
| 705 | reply.writeNoException(); |
| 706 | reply.writeTypedList(list); |
| 707 | return true; |
| 708 | } |
| 709 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 710 | case MOVE_TASK_TO_FRONT_TRANSACTION: { |
| 711 | data.enforceInterface(IActivityManager.descriptor); |
| 712 | int task = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 713 | int fl = data.readInt(); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 714 | Bundle options = data.readInt() != 0 |
| 715 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 716 | moveTaskToFront(task, fl, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 717 | reply.writeNoException(); |
| 718 | return true; |
| 719 | } |
| 720 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 721 | case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: { |
| 722 | data.enforceInterface(IActivityManager.descriptor); |
| 723 | IBinder token = data.readStrongBinder(); |
| 724 | boolean nonRoot = data.readInt() != 0; |
| 725 | boolean res = moveActivityTaskToBack(token, nonRoot); |
| 726 | reply.writeNoException(); |
| 727 | reply.writeInt(res ? 1 : 0); |
| 728 | return true; |
| 729 | } |
| 730 | |
| 731 | case MOVE_TASK_BACKWARDS_TRANSACTION: { |
| 732 | data.enforceInterface(IActivityManager.descriptor); |
| 733 | int task = data.readInt(); |
| 734 | moveTaskBackwards(task); |
| 735 | reply.writeNoException(); |
| 736 | return true; |
| 737 | } |
| 738 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 739 | case MOVE_TASK_TO_STACK_TRANSACTION: { |
| 740 | data.enforceInterface(IActivityManager.descriptor); |
| 741 | int taskId = data.readInt(); |
| 742 | int stackId = data.readInt(); |
| 743 | boolean toTop = data.readInt() != 0; |
| 744 | moveTaskToStack(taskId, stackId, toTop); |
| 745 | reply.writeNoException(); |
| 746 | return true; |
| 747 | } |
| 748 | |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 749 | case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: { |
| 750 | data.enforceInterface(IActivityManager.descriptor); |
| 751 | int taskId = data.readInt(); |
| 752 | int createMode = data.readInt(); |
| 753 | boolean toTop = data.readInt() != 0; |
| 754 | moveTaskToDockedStack(taskId, createMode, toTop); |
| 755 | reply.writeNoException(); |
| 756 | return true; |
| 757 | } |
| 758 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 759 | case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: { |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 760 | data.enforceInterface(IActivityManager.descriptor); |
| 761 | final int stackId = data.readInt(); |
| 762 | final Rect r = Rect.CREATOR.createFromParcel(data); |
| 763 | final boolean res = moveTopActivityToPinnedStack(stackId, r); |
| 764 | reply.writeNoException(); |
| 765 | reply.writeInt(res ? 1 : 0); |
| 766 | return true; |
| 767 | } |
| 768 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 769 | case RESIZE_STACK_TRANSACTION: { |
| 770 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 771 | final int stackId = data.readInt(); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 772 | final boolean hasRect = data.readInt() != 0; |
| 773 | Rect r = null; |
| 774 | if (hasRect) { |
| 775 | r = Rect.CREATOR.createFromParcel(data); |
| 776 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 777 | final boolean allowResizeInDockedMode = data.readInt() == 1; |
| 778 | resizeStack(stackId, r, allowResizeInDockedMode); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 779 | reply.writeNoException(); |
| 780 | return true; |
| 781 | } |
| 782 | |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 783 | case POSITION_TASK_IN_STACK_TRANSACTION: { |
| 784 | data.enforceInterface(IActivityManager.descriptor); |
| 785 | int taskId = data.readInt(); |
| 786 | int stackId = data.readInt(); |
| 787 | int position = data.readInt(); |
| 788 | positionTaskInStack(taskId, stackId, position); |
| 789 | reply.writeNoException(); |
| 790 | return true; |
| 791 | } |
| 792 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 793 | case GET_ALL_STACK_INFOS_TRANSACTION: { |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 794 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 795 | List<StackInfo> list = getAllStackInfos(); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 796 | reply.writeNoException(); |
| 797 | reply.writeTypedList(list); |
| 798 | return true; |
| 799 | } |
| 800 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 801 | case GET_STACK_INFO_TRANSACTION: { |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 802 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 803 | int stackId = data.readInt(); |
| 804 | StackInfo info = getStackInfo(stackId); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 805 | reply.writeNoException(); |
| 806 | if (info != null) { |
| 807 | reply.writeInt(1); |
| 808 | info.writeToParcel(reply, 0); |
| 809 | } else { |
| 810 | reply.writeInt(0); |
| 811 | } |
| 812 | return true; |
| 813 | } |
| 814 | |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 815 | case IS_IN_HOME_STACK_TRANSACTION: { |
| 816 | data.enforceInterface(IActivityManager.descriptor); |
| 817 | int taskId = data.readInt(); |
| 818 | boolean isInHomeStack = isInHomeStack(taskId); |
| 819 | reply.writeNoException(); |
| 820 | reply.writeInt(isInHomeStack ? 1 : 0); |
| 821 | return true; |
| 822 | } |
| 823 | |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 824 | case SET_FOCUSED_STACK_TRANSACTION: { |
| 825 | data.enforceInterface(IActivityManager.descriptor); |
| 826 | int stackId = data.readInt(); |
| 827 | setFocusedStack(stackId); |
| 828 | reply.writeNoException(); |
| 829 | return true; |
| 830 | } |
| 831 | |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 832 | case GET_FOCUSED_STACK_ID_TRANSACTION: { |
| 833 | data.enforceInterface(IActivityManager.descriptor); |
| 834 | int focusedStackId = getFocusedStackId(); |
| 835 | reply.writeNoException(); |
| 836 | reply.writeInt(focusedStackId); |
| 837 | return true; |
| 838 | } |
| 839 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 840 | case SET_FOCUSED_TASK_TRANSACTION: { |
| 841 | data.enforceInterface(IActivityManager.descriptor); |
| 842 | int taskId = data.readInt(); |
Skuhne | f36bb0c | 2015-08-26 14:26:17 -0700 | [diff] [blame] | 843 | setFocusedTask(taskId); |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 844 | reply.writeNoException(); |
| 845 | return true; |
| 846 | } |
| 847 | |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 848 | case REGISTER_TASK_STACK_LISTENER_TRANSACTION: { |
| 849 | data.enforceInterface(IActivityManager.descriptor); |
| 850 | IBinder token = data.readStrongBinder(); |
| 851 | registerTaskStackListener(ITaskStackListener.Stub.asInterface(token)); |
| 852 | reply.writeNoException(); |
| 853 | return true; |
| 854 | } |
| 855 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 856 | case GET_TASK_FOR_ACTIVITY_TRANSACTION: { |
| 857 | data.enforceInterface(IActivityManager.descriptor); |
| 858 | IBinder token = data.readStrongBinder(); |
| 859 | boolean onlyRoot = data.readInt() != 0; |
| 860 | int res = token != null |
| 861 | ? getTaskForActivity(token, onlyRoot) : -1; |
| 862 | reply.writeNoException(); |
| 863 | reply.writeInt(res); |
| 864 | return true; |
| 865 | } |
| 866 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 867 | case GET_CONTENT_PROVIDER_TRANSACTION: { |
| 868 | data.enforceInterface(IActivityManager.descriptor); |
| 869 | IBinder b = data.readStrongBinder(); |
| 870 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 871 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 872 | int userId = data.readInt(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 873 | boolean stable = data.readInt() != 0; |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 874 | ContentProviderHolder cph = getContentProvider(app, name, userId, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 875 | reply.writeNoException(); |
| 876 | if (cph != null) { |
| 877 | reply.writeInt(1); |
| 878 | cph.writeToParcel(reply, 0); |
| 879 | } else { |
| 880 | reply.writeInt(0); |
| 881 | } |
| 882 | return true; |
| 883 | } |
| 884 | |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 885 | case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 886 | data.enforceInterface(IActivityManager.descriptor); |
| 887 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 888 | int userId = data.readInt(); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 889 | IBinder token = data.readStrongBinder(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 890 | ContentProviderHolder cph = getContentProviderExternal(name, userId, token); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 891 | reply.writeNoException(); |
| 892 | if (cph != null) { |
| 893 | reply.writeInt(1); |
| 894 | cph.writeToParcel(reply, 0); |
| 895 | } else { |
| 896 | reply.writeInt(0); |
| 897 | } |
| 898 | return true; |
| 899 | } |
| 900 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 901 | case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: { |
| 902 | data.enforceInterface(IActivityManager.descriptor); |
| 903 | IBinder b = data.readStrongBinder(); |
| 904 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 905 | ArrayList<ContentProviderHolder> providers = |
| 906 | data.createTypedArrayList(ContentProviderHolder.CREATOR); |
| 907 | publishContentProviders(app, providers); |
| 908 | reply.writeNoException(); |
| 909 | return true; |
| 910 | } |
| 911 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 912 | case REF_CONTENT_PROVIDER_TRANSACTION: { |
| 913 | data.enforceInterface(IActivityManager.descriptor); |
| 914 | IBinder b = data.readStrongBinder(); |
| 915 | int stable = data.readInt(); |
| 916 | int unstable = data.readInt(); |
| 917 | boolean res = refContentProvider(b, stable, unstable); |
| 918 | reply.writeNoException(); |
| 919 | reply.writeInt(res ? 1 : 0); |
| 920 | return true; |
| 921 | } |
| 922 | |
| 923 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: { |
| 924 | data.enforceInterface(IActivityManager.descriptor); |
| 925 | IBinder b = data.readStrongBinder(); |
| 926 | unstableProviderDied(b); |
| 927 | reply.writeNoException(); |
| 928 | return true; |
| 929 | } |
| 930 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 931 | case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: { |
| 932 | data.enforceInterface(IActivityManager.descriptor); |
| 933 | IBinder b = data.readStrongBinder(); |
| 934 | appNotRespondingViaProvider(b); |
| 935 | reply.writeNoException(); |
| 936 | return true; |
| 937 | } |
| 938 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 939 | case REMOVE_CONTENT_PROVIDER_TRANSACTION: { |
| 940 | data.enforceInterface(IActivityManager.descriptor); |
| 941 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 942 | boolean stable = data.readInt() != 0; |
| 943 | removeContentProvider(b, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 944 | reply.writeNoException(); |
| 945 | return true; |
| 946 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 947 | |
| 948 | case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 949 | data.enforceInterface(IActivityManager.descriptor); |
| 950 | String name = data.readString(); |
| 951 | IBinder token = data.readStrongBinder(); |
| 952 | removeContentProviderExternal(name, token); |
| 953 | reply.writeNoException(); |
| 954 | return true; |
| 955 | } |
| 956 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 957 | case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: { |
| 958 | data.enforceInterface(IActivityManager.descriptor); |
| 959 | ComponentName comp = ComponentName.CREATOR.createFromParcel(data); |
| 960 | PendingIntent pi = getRunningServiceControlPanel(comp); |
| 961 | reply.writeNoException(); |
| 962 | PendingIntent.writePendingIntentOrNullToParcel(pi, reply); |
| 963 | return true; |
| 964 | } |
| 965 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 966 | case START_SERVICE_TRANSACTION: { |
| 967 | data.enforceInterface(IActivityManager.descriptor); |
| 968 | IBinder b = data.readStrongBinder(); |
| 969 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 970 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 971 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 972 | String callingPackage = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 973 | int userId = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 974 | ComponentName cn = startService(app, service, resolvedType, callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 975 | reply.writeNoException(); |
| 976 | ComponentName.writeToParcel(cn, reply); |
| 977 | return true; |
| 978 | } |
| 979 | |
| 980 | case STOP_SERVICE_TRANSACTION: { |
| 981 | data.enforceInterface(IActivityManager.descriptor); |
| 982 | IBinder b = data.readStrongBinder(); |
| 983 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 984 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 985 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 986 | int userId = data.readInt(); |
| 987 | int res = stopService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 988 | reply.writeNoException(); |
| 989 | reply.writeInt(res); |
| 990 | return true; |
| 991 | } |
| 992 | |
| 993 | case STOP_SERVICE_TOKEN_TRANSACTION: { |
| 994 | data.enforceInterface(IActivityManager.descriptor); |
| 995 | ComponentName className = ComponentName.readFromParcel(data); |
| 996 | IBinder token = data.readStrongBinder(); |
| 997 | int startId = data.readInt(); |
| 998 | boolean res = stopServiceToken(className, token, startId); |
| 999 | reply.writeNoException(); |
| 1000 | reply.writeInt(res ? 1 : 0); |
| 1001 | return true; |
| 1002 | } |
| 1003 | |
| 1004 | case SET_SERVICE_FOREGROUND_TRANSACTION: { |
| 1005 | data.enforceInterface(IActivityManager.descriptor); |
| 1006 | ComponentName className = ComponentName.readFromParcel(data); |
| 1007 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 1008 | int id = data.readInt(); |
| 1009 | Notification notification = null; |
| 1010 | if (data.readInt() != 0) { |
| 1011 | notification = Notification.CREATOR.createFromParcel(data); |
| 1012 | } |
| 1013 | boolean removeNotification = data.readInt() != 0; |
| 1014 | setServiceForeground(className, token, id, notification, removeNotification); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1015 | reply.writeNoException(); |
| 1016 | return true; |
| 1017 | } |
| 1018 | |
| 1019 | case BIND_SERVICE_TRANSACTION: { |
| 1020 | data.enforceInterface(IActivityManager.descriptor); |
| 1021 | IBinder b = data.readStrongBinder(); |
| 1022 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1023 | IBinder token = data.readStrongBinder(); |
| 1024 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1025 | String resolvedType = data.readString(); |
| 1026 | b = data.readStrongBinder(); |
| 1027 | int fl = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1028 | String callingPackage = data.readString(); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 1029 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1030 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1031 | int res = bindService(app, token, service, resolvedType, conn, fl, |
| 1032 | callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1033 | reply.writeNoException(); |
| 1034 | reply.writeInt(res); |
| 1035 | return true; |
| 1036 | } |
| 1037 | |
| 1038 | case UNBIND_SERVICE_TRANSACTION: { |
| 1039 | data.enforceInterface(IActivityManager.descriptor); |
| 1040 | IBinder b = data.readStrongBinder(); |
| 1041 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
| 1042 | boolean res = unbindService(conn); |
| 1043 | reply.writeNoException(); |
| 1044 | reply.writeInt(res ? 1 : 0); |
| 1045 | return true; |
| 1046 | } |
| 1047 | |
| 1048 | case PUBLISH_SERVICE_TRANSACTION: { |
| 1049 | data.enforceInterface(IActivityManager.descriptor); |
| 1050 | IBinder token = data.readStrongBinder(); |
| 1051 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1052 | IBinder service = data.readStrongBinder(); |
| 1053 | publishService(token, intent, service); |
| 1054 | reply.writeNoException(); |
| 1055 | return true; |
| 1056 | } |
| 1057 | |
| 1058 | case UNBIND_FINISHED_TRANSACTION: { |
| 1059 | data.enforceInterface(IActivityManager.descriptor); |
| 1060 | IBinder token = data.readStrongBinder(); |
| 1061 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1062 | boolean doRebind = data.readInt() != 0; |
| 1063 | unbindFinished(token, intent, doRebind); |
| 1064 | reply.writeNoException(); |
| 1065 | return true; |
| 1066 | } |
| 1067 | |
| 1068 | case SERVICE_DONE_EXECUTING_TRANSACTION: { |
| 1069 | data.enforceInterface(IActivityManager.descriptor); |
| 1070 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 1071 | int type = data.readInt(); |
| 1072 | int startId = data.readInt(); |
| 1073 | int res = data.readInt(); |
| 1074 | serviceDoneExecuting(token, type, startId, res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1075 | reply.writeNoException(); |
| 1076 | return true; |
| 1077 | } |
| 1078 | |
| 1079 | case START_INSTRUMENTATION_TRANSACTION: { |
| 1080 | data.enforceInterface(IActivityManager.descriptor); |
| 1081 | ComponentName className = ComponentName.readFromParcel(data); |
| 1082 | String profileFile = data.readString(); |
| 1083 | int fl = data.readInt(); |
| 1084 | Bundle arguments = data.readBundle(); |
| 1085 | IBinder b = data.readStrongBinder(); |
| 1086 | IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 1087 | b = data.readStrongBinder(); |
| 1088 | IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1089 | int userId = data.readInt(); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 1090 | String abiOverride = data.readString(); |
| 1091 | boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId, |
| 1092 | abiOverride); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1093 | reply.writeNoException(); |
| 1094 | reply.writeInt(res ? 1 : 0); |
| 1095 | return true; |
| 1096 | } |
| 1097 | |
| 1098 | |
| 1099 | case FINISH_INSTRUMENTATION_TRANSACTION: { |
| 1100 | data.enforceInterface(IActivityManager.descriptor); |
| 1101 | IBinder b = data.readStrongBinder(); |
| 1102 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1103 | int resultCode = data.readInt(); |
| 1104 | Bundle results = data.readBundle(); |
| 1105 | finishInstrumentation(app, resultCode, results); |
| 1106 | reply.writeNoException(); |
| 1107 | return true; |
| 1108 | } |
| 1109 | |
| 1110 | case GET_CONFIGURATION_TRANSACTION: { |
| 1111 | data.enforceInterface(IActivityManager.descriptor); |
| 1112 | Configuration config = getConfiguration(); |
| 1113 | reply.writeNoException(); |
| 1114 | config.writeToParcel(reply, 0); |
| 1115 | return true; |
| 1116 | } |
| 1117 | |
| 1118 | case UPDATE_CONFIGURATION_TRANSACTION: { |
| 1119 | data.enforceInterface(IActivityManager.descriptor); |
| 1120 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 1121 | updateConfiguration(config); |
| 1122 | reply.writeNoException(); |
| 1123 | return true; |
| 1124 | } |
| 1125 | |
| 1126 | case SET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1127 | data.enforceInterface(IActivityManager.descriptor); |
| 1128 | IBinder token = data.readStrongBinder(); |
| 1129 | int requestedOrientation = data.readInt(); |
| 1130 | setRequestedOrientation(token, requestedOrientation); |
| 1131 | reply.writeNoException(); |
| 1132 | return true; |
| 1133 | } |
| 1134 | |
| 1135 | case GET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1136 | data.enforceInterface(IActivityManager.descriptor); |
| 1137 | IBinder token = data.readStrongBinder(); |
| 1138 | int req = getRequestedOrientation(token); |
| 1139 | reply.writeNoException(); |
| 1140 | reply.writeInt(req); |
| 1141 | return true; |
| 1142 | } |
| 1143 | |
| 1144 | case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: { |
| 1145 | data.enforceInterface(IActivityManager.descriptor); |
| 1146 | IBinder token = data.readStrongBinder(); |
| 1147 | ComponentName cn = getActivityClassForToken(token); |
| 1148 | reply.writeNoException(); |
| 1149 | ComponentName.writeToParcel(cn, reply); |
| 1150 | return true; |
| 1151 | } |
| 1152 | |
| 1153 | case GET_PACKAGE_FOR_TOKEN_TRANSACTION: { |
| 1154 | data.enforceInterface(IActivityManager.descriptor); |
| 1155 | IBinder token = data.readStrongBinder(); |
| 1156 | reply.writeNoException(); |
| 1157 | reply.writeString(getPackageForToken(token)); |
| 1158 | return true; |
| 1159 | } |
| 1160 | |
| 1161 | case GET_INTENT_SENDER_TRANSACTION: { |
| 1162 | data.enforceInterface(IActivityManager.descriptor); |
| 1163 | int type = data.readInt(); |
| 1164 | String packageName = data.readString(); |
| 1165 | IBinder token = data.readStrongBinder(); |
| 1166 | String resultWho = data.readString(); |
| 1167 | int requestCode = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1168 | Intent[] requestIntents; |
| 1169 | String[] requestResolvedTypes; |
| 1170 | if (data.readInt() != 0) { |
| 1171 | requestIntents = data.createTypedArray(Intent.CREATOR); |
| 1172 | requestResolvedTypes = data.createStringArray(); |
| 1173 | } else { |
| 1174 | requestIntents = null; |
| 1175 | requestResolvedTypes = null; |
| 1176 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1177 | int fl = data.readInt(); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 1178 | Bundle options = data.readInt() != 0 |
| 1179 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1180 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1181 | IIntentSender res = getIntentSender(type, packageName, token, |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1182 | resultWho, requestCode, requestIntents, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1183 | requestResolvedTypes, fl, options, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1184 | reply.writeNoException(); |
| 1185 | reply.writeStrongBinder(res != null ? res.asBinder() : null); |
| 1186 | return true; |
| 1187 | } |
| 1188 | |
| 1189 | case CANCEL_INTENT_SENDER_TRANSACTION: { |
| 1190 | data.enforceInterface(IActivityManager.descriptor); |
| 1191 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1192 | data.readStrongBinder()); |
| 1193 | cancelIntentSender(r); |
| 1194 | reply.writeNoException(); |
| 1195 | return true; |
| 1196 | } |
| 1197 | |
| 1198 | case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: { |
| 1199 | data.enforceInterface(IActivityManager.descriptor); |
| 1200 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1201 | data.readStrongBinder()); |
| 1202 | String res = getPackageForIntentSender(r); |
| 1203 | reply.writeNoException(); |
| 1204 | reply.writeString(res); |
| 1205 | return true; |
| 1206 | } |
| 1207 | |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 1208 | case GET_UID_FOR_INTENT_SENDER_TRANSACTION: { |
| 1209 | data.enforceInterface(IActivityManager.descriptor); |
| 1210 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1211 | data.readStrongBinder()); |
| 1212 | int res = getUidForIntentSender(r); |
| 1213 | reply.writeNoException(); |
| 1214 | reply.writeInt(res); |
| 1215 | return true; |
| 1216 | } |
| 1217 | |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1218 | case HANDLE_INCOMING_USER_TRANSACTION: { |
| 1219 | data.enforceInterface(IActivityManager.descriptor); |
| 1220 | int callingPid = data.readInt(); |
| 1221 | int callingUid = data.readInt(); |
| 1222 | int userId = data.readInt(); |
| 1223 | boolean allowAll = data.readInt() != 0 ; |
| 1224 | boolean requireFull = data.readInt() != 0; |
| 1225 | String name = data.readString(); |
| 1226 | String callerPackage = data.readString(); |
| 1227 | int res = handleIncomingUser(callingPid, callingUid, userId, allowAll, |
| 1228 | requireFull, name, callerPackage); |
| 1229 | reply.writeNoException(); |
| 1230 | reply.writeInt(res); |
| 1231 | return true; |
| 1232 | } |
| 1233 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1234 | case SET_PROCESS_LIMIT_TRANSACTION: { |
| 1235 | data.enforceInterface(IActivityManager.descriptor); |
| 1236 | int max = data.readInt(); |
| 1237 | setProcessLimit(max); |
| 1238 | reply.writeNoException(); |
| 1239 | return true; |
| 1240 | } |
| 1241 | |
| 1242 | case GET_PROCESS_LIMIT_TRANSACTION: { |
| 1243 | data.enforceInterface(IActivityManager.descriptor); |
| 1244 | int limit = getProcessLimit(); |
| 1245 | reply.writeNoException(); |
| 1246 | reply.writeInt(limit); |
| 1247 | return true; |
| 1248 | } |
| 1249 | |
| 1250 | case SET_PROCESS_FOREGROUND_TRANSACTION: { |
| 1251 | data.enforceInterface(IActivityManager.descriptor); |
| 1252 | IBinder token = data.readStrongBinder(); |
| 1253 | int pid = data.readInt(); |
| 1254 | boolean isForeground = data.readInt() != 0; |
| 1255 | setProcessForeground(token, pid, isForeground); |
| 1256 | reply.writeNoException(); |
| 1257 | return true; |
| 1258 | } |
| 1259 | |
| 1260 | case CHECK_PERMISSION_TRANSACTION: { |
| 1261 | data.enforceInterface(IActivityManager.descriptor); |
| 1262 | String perm = data.readString(); |
| 1263 | int pid = data.readInt(); |
| 1264 | int uid = data.readInt(); |
| 1265 | int res = checkPermission(perm, pid, uid); |
| 1266 | reply.writeNoException(); |
| 1267 | reply.writeInt(res); |
| 1268 | return true; |
| 1269 | } |
| 1270 | |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1271 | case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: { |
| 1272 | data.enforceInterface(IActivityManager.descriptor); |
| 1273 | String perm = data.readString(); |
| 1274 | int pid = data.readInt(); |
| 1275 | int uid = data.readInt(); |
| 1276 | IBinder token = data.readStrongBinder(); |
| 1277 | int res = checkPermissionWithToken(perm, pid, uid, token); |
| 1278 | reply.writeNoException(); |
| 1279 | reply.writeInt(res); |
| 1280 | return true; |
| 1281 | } |
| 1282 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1283 | case CHECK_URI_PERMISSION_TRANSACTION: { |
| 1284 | data.enforceInterface(IActivityManager.descriptor); |
| 1285 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1286 | int pid = data.readInt(); |
| 1287 | int uid = data.readInt(); |
| 1288 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1289 | int userId = data.readInt(); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1290 | IBinder callerToken = data.readStrongBinder(); |
| 1291 | int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1292 | reply.writeNoException(); |
| 1293 | reply.writeInt(res); |
| 1294 | return true; |
| 1295 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1296 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1297 | case CLEAR_APP_DATA_TRANSACTION: { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1298 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1299 | String packageName = data.readString(); |
| 1300 | IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface( |
| 1301 | data.readStrongBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 1302 | int userId = data.readInt(); |
| 1303 | boolean res = clearApplicationUserData(packageName, observer, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1304 | reply.writeNoException(); |
| 1305 | reply.writeInt(res ? 1 : 0); |
| 1306 | return true; |
| 1307 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1308 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1309 | case GRANT_URI_PERMISSION_TRANSACTION: { |
| 1310 | data.enforceInterface(IActivityManager.descriptor); |
| 1311 | IBinder b = data.readStrongBinder(); |
| 1312 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1313 | String targetPkg = data.readString(); |
| 1314 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1315 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1316 | int userId = data.readInt(); |
| 1317 | grantUriPermission(app, targetPkg, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1318 | reply.writeNoException(); |
| 1319 | return true; |
| 1320 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1321 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1322 | case REVOKE_URI_PERMISSION_TRANSACTION: { |
| 1323 | data.enforceInterface(IActivityManager.descriptor); |
| 1324 | IBinder b = data.readStrongBinder(); |
| 1325 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1326 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1327 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1328 | int userId = data.readInt(); |
| 1329 | revokeUriPermission(app, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1330 | reply.writeNoException(); |
| 1331 | return true; |
| 1332 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1333 | |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1334 | case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1335 | data.enforceInterface(IActivityManager.descriptor); |
| 1336 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1337 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1338 | int userId = data.readInt(); |
| 1339 | takePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1340 | reply.writeNoException(); |
| 1341 | return true; |
| 1342 | } |
| 1343 | |
| 1344 | case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1345 | data.enforceInterface(IActivityManager.descriptor); |
| 1346 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1347 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1348 | int userId = data.readInt(); |
| 1349 | releasePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1350 | reply.writeNoException(); |
| 1351 | return true; |
| 1352 | } |
| 1353 | |
| 1354 | case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: { |
| 1355 | data.enforceInterface(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 1356 | final String packageName = data.readString(); |
| 1357 | final boolean incoming = data.readInt() != 0; |
| 1358 | final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions( |
| 1359 | packageName, incoming); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1360 | reply.writeNoException(); |
| 1361 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1362 | return true; |
| 1363 | } |
| 1364 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1365 | case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: { |
| 1366 | data.enforceInterface(IActivityManager.descriptor); |
| 1367 | IBinder b = data.readStrongBinder(); |
| 1368 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1369 | boolean waiting = data.readInt() != 0; |
| 1370 | showWaitingForDebugger(app, waiting); |
| 1371 | reply.writeNoException(); |
| 1372 | return true; |
| 1373 | } |
| 1374 | |
| 1375 | case GET_MEMORY_INFO_TRANSACTION: { |
| 1376 | data.enforceInterface(IActivityManager.descriptor); |
| 1377 | ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); |
| 1378 | getMemoryInfo(mi); |
| 1379 | reply.writeNoException(); |
| 1380 | mi.writeToParcel(reply, 0); |
| 1381 | return true; |
| 1382 | } |
| 1383 | |
| 1384 | case UNHANDLED_BACK_TRANSACTION: { |
| 1385 | data.enforceInterface(IActivityManager.descriptor); |
| 1386 | unhandledBack(); |
| 1387 | reply.writeNoException(); |
| 1388 | return true; |
| 1389 | } |
| 1390 | |
| 1391 | case OPEN_CONTENT_URI_TRANSACTION: { |
| 1392 | data.enforceInterface(IActivityManager.descriptor); |
| 1393 | Uri uri = Uri.parse(data.readString()); |
| 1394 | ParcelFileDescriptor pfd = openContentUri(uri); |
| 1395 | reply.writeNoException(); |
| 1396 | if (pfd != null) { |
| 1397 | reply.writeInt(1); |
| 1398 | pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1399 | } else { |
| 1400 | reply.writeInt(0); |
| 1401 | } |
| 1402 | return true; |
| 1403 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1404 | |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1405 | case SET_LOCK_SCREEN_SHOWN_TRANSACTION: { |
| 1406 | data.enforceInterface(IActivityManager.descriptor); |
| 1407 | setLockScreenShown(data.readInt() != 0); |
| 1408 | reply.writeNoException(); |
| 1409 | return true; |
| 1410 | } |
| 1411 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1412 | case SET_DEBUG_APP_TRANSACTION: { |
| 1413 | data.enforceInterface(IActivityManager.descriptor); |
| 1414 | String pn = data.readString(); |
| 1415 | boolean wfd = data.readInt() != 0; |
| 1416 | boolean per = data.readInt() != 0; |
| 1417 | setDebugApp(pn, wfd, per); |
| 1418 | reply.writeNoException(); |
| 1419 | return true; |
| 1420 | } |
| 1421 | |
| 1422 | case SET_ALWAYS_FINISH_TRANSACTION: { |
| 1423 | data.enforceInterface(IActivityManager.descriptor); |
| 1424 | boolean enabled = data.readInt() != 0; |
| 1425 | setAlwaysFinish(enabled); |
| 1426 | reply.writeNoException(); |
| 1427 | return true; |
| 1428 | } |
| 1429 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1430 | case SET_ACTIVITY_CONTROLLER_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1431 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1432 | IActivityController watcher = IActivityController.Stub.asInterface( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1433 | data.readStrongBinder()); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1434 | setActivityController(watcher); |
Sungmin Choi | cdb86bb | 2012-12-20 14:08:59 +0900 | [diff] [blame] | 1435 | reply.writeNoException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1436 | return true; |
| 1437 | } |
| 1438 | |
| 1439 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1440 | data.enforceInterface(IActivityManager.descriptor); |
| 1441 | enterSafeMode(); |
| 1442 | reply.writeNoException(); |
| 1443 | return true; |
| 1444 | } |
| 1445 | |
| 1446 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1447 | data.enforceInterface(IActivityManager.descriptor); |
| 1448 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1449 | data.readStrongBinder()); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 1450 | int sourceUid = data.readInt(); |
| 1451 | String sourcePkg = data.readString(); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 1452 | String tag = data.readString(); |
| 1453 | noteWakeupAlarm(is, sourceUid, sourcePkg, tag); |
| 1454 | reply.writeNoException(); |
| 1455 | return true; |
| 1456 | } |
| 1457 | |
| 1458 | case NOTE_ALARM_START_TRANSACTION: { |
| 1459 | data.enforceInterface(IActivityManager.descriptor); |
| 1460 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1461 | data.readStrongBinder()); |
| 1462 | int sourceUid = data.readInt(); |
| 1463 | String tag = data.readString(); |
| 1464 | noteAlarmStart(is, sourceUid, tag); |
| 1465 | reply.writeNoException(); |
| 1466 | return true; |
| 1467 | } |
| 1468 | |
| 1469 | case NOTE_ALARM_FINISH_TRANSACTION: { |
| 1470 | data.enforceInterface(IActivityManager.descriptor); |
| 1471 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1472 | data.readStrongBinder()); |
| 1473 | int sourceUid = data.readInt(); |
| 1474 | String tag = data.readString(); |
| 1475 | noteAlarmFinish(is, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1476 | reply.writeNoException(); |
| 1477 | return true; |
| 1478 | } |
| 1479 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1480 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1481 | data.enforceInterface(IActivityManager.descriptor); |
| 1482 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1483 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1484 | boolean secure = data.readInt() != 0; |
| 1485 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1486 | reply.writeNoException(); |
| 1487 | reply.writeInt(res ? 1 : 0); |
| 1488 | return true; |
| 1489 | } |
| 1490 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1491 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1492 | data.enforceInterface(IActivityManager.descriptor); |
| 1493 | String reason = data.readString(); |
| 1494 | boolean res = killProcessesBelowForeground(reason); |
| 1495 | reply.writeNoException(); |
| 1496 | reply.writeInt(res ? 1 : 0); |
| 1497 | return true; |
| 1498 | } |
| 1499 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1500 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1501 | data.enforceInterface(IActivityManager.descriptor); |
| 1502 | IBinder app = data.readStrongBinder(); |
| 1503 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1504 | handleApplicationCrash(app, ci); |
| 1505 | reply.writeNoException(); |
| 1506 | return true; |
| 1507 | } |
| 1508 | |
| 1509 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1510 | data.enforceInterface(IActivityManager.descriptor); |
| 1511 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1512 | String tag = data.readString(); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1513 | boolean system = data.readInt() != 0; |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1514 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1515 | boolean res = handleApplicationWtf(app, tag, system, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1516 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1517 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1518 | return true; |
| 1519 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1520 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1521 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1522 | data.enforceInterface(IActivityManager.descriptor); |
| 1523 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1524 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1525 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1526 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1527 | reply.writeNoException(); |
| 1528 | return true; |
| 1529 | } |
| 1530 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1531 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1532 | data.enforceInterface(IActivityManager.descriptor); |
| 1533 | int sig = data.readInt(); |
| 1534 | signalPersistentProcesses(sig); |
| 1535 | reply.writeNoException(); |
| 1536 | return true; |
| 1537 | } |
| 1538 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1539 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1540 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1541 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1542 | int userId = data.readInt(); |
| 1543 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1544 | reply.writeNoException(); |
| 1545 | return true; |
| 1546 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1547 | |
| 1548 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1549 | data.enforceInterface(IActivityManager.descriptor); |
| 1550 | killAllBackgroundProcesses(); |
| 1551 | reply.writeNoException(); |
| 1552 | return true; |
| 1553 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1554 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1555 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1556 | data.enforceInterface(IActivityManager.descriptor); |
| 1557 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1558 | int userId = data.readInt(); |
| 1559 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1560 | reply.writeNoException(); |
| 1561 | return true; |
| 1562 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1563 | |
| 1564 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1565 | data.enforceInterface(IActivityManager.descriptor); |
| 1566 | ActivityManager.RunningAppProcessInfo info = |
| 1567 | new ActivityManager.RunningAppProcessInfo(); |
| 1568 | getMyMemoryState(info); |
| 1569 | reply.writeNoException(); |
| 1570 | info.writeToParcel(reply, 0); |
| 1571 | return true; |
| 1572 | } |
| 1573 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1574 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1575 | data.enforceInterface(IActivityManager.descriptor); |
| 1576 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1577 | reply.writeNoException(); |
| 1578 | config.writeToParcel(reply, 0); |
| 1579 | return true; |
| 1580 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1581 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1582 | case PROFILE_CONTROL_TRANSACTION: { |
| 1583 | data.enforceInterface(IActivityManager.descriptor); |
| 1584 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1585 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1586 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1587 | int profileType = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1588 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 1589 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
| 1590 | boolean res = profileControl(process, userId, start, profilerInfo, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1591 | reply.writeNoException(); |
| 1592 | reply.writeInt(res ? 1 : 0); |
| 1593 | return true; |
| 1594 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1595 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1596 | case SHUTDOWN_TRANSACTION: { |
| 1597 | data.enforceInterface(IActivityManager.descriptor); |
| 1598 | boolean res = shutdown(data.readInt()); |
| 1599 | reply.writeNoException(); |
| 1600 | reply.writeInt(res ? 1 : 0); |
| 1601 | return true; |
| 1602 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1603 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1604 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1605 | data.enforceInterface(IActivityManager.descriptor); |
| 1606 | stopAppSwitches(); |
| 1607 | reply.writeNoException(); |
| 1608 | return true; |
| 1609 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1610 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1611 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1612 | data.enforceInterface(IActivityManager.descriptor); |
| 1613 | resumeAppSwitches(); |
| 1614 | reply.writeNoException(); |
| 1615 | return true; |
| 1616 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1617 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1618 | case PEEK_SERVICE_TRANSACTION: { |
| 1619 | data.enforceInterface(IActivityManager.descriptor); |
| 1620 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1621 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1622 | String callingPackage = data.readString(); |
| 1623 | IBinder binder = peekService(service, resolvedType, callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1624 | reply.writeNoException(); |
| 1625 | reply.writeStrongBinder(binder); |
| 1626 | return true; |
| 1627 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1628 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1629 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1630 | data.enforceInterface(IActivityManager.descriptor); |
| 1631 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1632 | int backupRestoreMode = data.readInt(); |
| 1633 | boolean success = bindBackupAgent(info, backupRestoreMode); |
| 1634 | reply.writeNoException(); |
| 1635 | reply.writeInt(success ? 1 : 0); |
| 1636 | return true; |
| 1637 | } |
| 1638 | |
| 1639 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1640 | data.enforceInterface(IActivityManager.descriptor); |
| 1641 | String packageName = data.readString(); |
| 1642 | IBinder agent = data.readStrongBinder(); |
| 1643 | backupAgentCreated(packageName, agent); |
| 1644 | reply.writeNoException(); |
| 1645 | return true; |
| 1646 | } |
| 1647 | |
| 1648 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1649 | data.enforceInterface(IActivityManager.descriptor); |
| 1650 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1651 | unbindBackupAgent(info); |
| 1652 | reply.writeNoException(); |
| 1653 | return true; |
| 1654 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1655 | |
| 1656 | case ADD_PACKAGE_DEPENDENCY_TRANSACTION: { |
| 1657 | data.enforceInterface(IActivityManager.descriptor); |
| 1658 | String packageName = data.readString(); |
| 1659 | addPackageDependency(packageName); |
| 1660 | reply.writeNoException(); |
| 1661 | return true; |
| 1662 | } |
| 1663 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1664 | case KILL_APPLICATION_WITH_APPID_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1665 | data.enforceInterface(IActivityManager.descriptor); |
| 1666 | String pkg = data.readString(); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1667 | int appid = data.readInt(); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 1668 | String reason = data.readString(); |
| 1669 | killApplicationWithAppId(pkg, appid, reason); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1670 | reply.writeNoException(); |
| 1671 | return true; |
| 1672 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1673 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1674 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1675 | data.enforceInterface(IActivityManager.descriptor); |
| 1676 | String reason = data.readString(); |
| 1677 | closeSystemDialogs(reason); |
| 1678 | reply.writeNoException(); |
| 1679 | return true; |
| 1680 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1681 | |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1682 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1683 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1684 | int[] pids = data.createIntArray(); |
| 1685 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1686 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1687 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1688 | return true; |
| 1689 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1690 | |
| 1691 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1692 | data.enforceInterface(IActivityManager.descriptor); |
| 1693 | String processName = data.readString(); |
| 1694 | int uid = data.readInt(); |
| 1695 | killApplicationProcess(processName, uid); |
| 1696 | reply.writeNoException(); |
| 1697 | return true; |
| 1698 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1699 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1700 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1701 | data.enforceInterface(IActivityManager.descriptor); |
| 1702 | IBinder token = data.readStrongBinder(); |
| 1703 | String packageName = data.readString(); |
| 1704 | int enterAnim = data.readInt(); |
| 1705 | int exitAnim = data.readInt(); |
| 1706 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1707 | reply.writeNoException(); |
| 1708 | return true; |
| 1709 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1710 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1711 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1712 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1713 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1714 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1715 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1716 | return true; |
| 1717 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1718 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1719 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1720 | data.enforceInterface(IActivityManager.descriptor); |
| 1721 | final boolean monkey = (data.readInt() == 1); |
| 1722 | setUserIsMonkey(monkey); |
| 1723 | reply.writeNoException(); |
| 1724 | return true; |
| 1725 | } |
| 1726 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1727 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1728 | data.enforceInterface(IActivityManager.descriptor); |
| 1729 | finishHeavyWeightApp(); |
| 1730 | reply.writeNoException(); |
| 1731 | return true; |
| 1732 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1733 | |
| 1734 | case IS_IMMERSIVE_TRANSACTION: { |
| 1735 | data.enforceInterface(IActivityManager.descriptor); |
| 1736 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1737 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1738 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1739 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1740 | return true; |
| 1741 | } |
| 1742 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 1743 | case IS_TOP_OF_TASK_TRANSACTION: { |
| 1744 | data.enforceInterface(IActivityManager.descriptor); |
| 1745 | IBinder token = data.readStrongBinder(); |
| 1746 | final boolean isTopOfTask = isTopOfTask(token); |
| 1747 | reply.writeNoException(); |
| 1748 | reply.writeInt(isTopOfTask ? 1 : 0); |
| 1749 | return true; |
| 1750 | } |
| 1751 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1752 | case CONVERT_FROM_TRANSLUCENT_TRANSACTION: { |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1753 | data.enforceInterface(IActivityManager.descriptor); |
| 1754 | IBinder token = data.readStrongBinder(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1755 | boolean converted = convertFromTranslucent(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1756 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1757 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1758 | return true; |
| 1759 | } |
| 1760 | |
| 1761 | case CONVERT_TO_TRANSLUCENT_TRANSACTION: { |
| 1762 | data.enforceInterface(IActivityManager.descriptor); |
| 1763 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1764 | final Bundle bundle; |
| 1765 | if (data.readInt() == 0) { |
| 1766 | bundle = null; |
| 1767 | } else { |
| 1768 | bundle = data.readBundle(); |
| 1769 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 1770 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1771 | boolean converted = convertToTranslucent(token, options); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1772 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1773 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1774 | return true; |
| 1775 | } |
| 1776 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1777 | case GET_ACTIVITY_OPTIONS_TRANSACTION: { |
| 1778 | data.enforceInterface(IActivityManager.descriptor); |
| 1779 | IBinder token = data.readStrongBinder(); |
| 1780 | final ActivityOptions options = getActivityOptions(token); |
| 1781 | reply.writeNoException(); |
| 1782 | reply.writeBundle(options == null ? null : options.toBundle()); |
| 1783 | return true; |
| 1784 | } |
| 1785 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1786 | case SET_IMMERSIVE_TRANSACTION: { |
| 1787 | data.enforceInterface(IActivityManager.descriptor); |
| 1788 | IBinder token = data.readStrongBinder(); |
| 1789 | boolean imm = data.readInt() == 1; |
| 1790 | setImmersive(token, imm); |
| 1791 | reply.writeNoException(); |
| 1792 | return true; |
| 1793 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1794 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1795 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1796 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1797 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1798 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1799 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1800 | return true; |
| 1801 | } |
| 1802 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1803 | case CRASH_APPLICATION_TRANSACTION: { |
| 1804 | data.enforceInterface(IActivityManager.descriptor); |
| 1805 | int uid = data.readInt(); |
| 1806 | int initialPid = data.readInt(); |
| 1807 | String packageName = data.readString(); |
| 1808 | String message = data.readString(); |
| 1809 | crashApplication(uid, initialPid, packageName, message); |
| 1810 | reply.writeNoException(); |
| 1811 | return true; |
| 1812 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1813 | |
| 1814 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1815 | data.enforceInterface(IActivityManager.descriptor); |
| 1816 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1817 | int userId = data.readInt(); |
| 1818 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1819 | reply.writeNoException(); |
| 1820 | reply.writeString(type); |
| 1821 | return true; |
| 1822 | } |
| 1823 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1824 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1825 | data.enforceInterface(IActivityManager.descriptor); |
| 1826 | String name = data.readString(); |
| 1827 | IBinder perm = newUriPermissionOwner(name); |
| 1828 | reply.writeNoException(); |
| 1829 | reply.writeStrongBinder(perm); |
| 1830 | return true; |
| 1831 | } |
| 1832 | |
| 1833 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1834 | data.enforceInterface(IActivityManager.descriptor); |
| 1835 | IBinder owner = data.readStrongBinder(); |
| 1836 | int fromUid = data.readInt(); |
| 1837 | String targetPkg = data.readString(); |
| 1838 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1839 | int mode = data.readInt(); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 1840 | int sourceUserId = data.readInt(); |
| 1841 | int targetUserId = data.readInt(); |
| 1842 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId, |
| 1843 | targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1844 | reply.writeNoException(); |
| 1845 | return true; |
| 1846 | } |
| 1847 | |
| 1848 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1849 | data.enforceInterface(IActivityManager.descriptor); |
| 1850 | IBinder owner = data.readStrongBinder(); |
| 1851 | Uri uri = null; |
| 1852 | if (data.readInt() != 0) { |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1853 | uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1854 | } |
| 1855 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1856 | int userId = data.readInt(); |
| 1857 | revokeUriPermissionFromOwner(owner, uri, mode, userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1858 | reply.writeNoException(); |
| 1859 | return true; |
| 1860 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1861 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1862 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 1863 | data.enforceInterface(IActivityManager.descriptor); |
| 1864 | int callingUid = data.readInt(); |
| 1865 | String targetPkg = data.readString(); |
| 1866 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1867 | int modeFlags = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1868 | int userId = data.readInt(); |
| 1869 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1870 | reply.writeNoException(); |
| 1871 | reply.writeInt(res); |
| 1872 | return true; |
| 1873 | } |
| 1874 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1875 | case DUMP_HEAP_TRANSACTION: { |
| 1876 | data.enforceInterface(IActivityManager.descriptor); |
| 1877 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 1878 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1879 | boolean managed = data.readInt() != 0; |
| 1880 | String path = data.readString(); |
| 1881 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 1882 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1883 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1884 | reply.writeNoException(); |
| 1885 | reply.writeInt(res ? 1 : 0); |
| 1886 | return true; |
| 1887 | } |
| 1888 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1889 | case START_ACTIVITIES_TRANSACTION: |
| 1890 | { |
| 1891 | data.enforceInterface(IActivityManager.descriptor); |
| 1892 | IBinder b = data.readStrongBinder(); |
| 1893 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1894 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1895 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 1896 | String[] resolvedTypes = data.createStringArray(); |
| 1897 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 1898 | Bundle options = data.readInt() != 0 |
| 1899 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 1900 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1901 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 1902 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1903 | reply.writeNoException(); |
| 1904 | reply.writeInt(result); |
| 1905 | return true; |
| 1906 | } |
| 1907 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 1908 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1909 | { |
| 1910 | data.enforceInterface(IActivityManager.descriptor); |
| 1911 | int mode = getFrontActivityScreenCompatMode(); |
| 1912 | reply.writeNoException(); |
| 1913 | reply.writeInt(mode); |
| 1914 | return true; |
| 1915 | } |
| 1916 | |
| 1917 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1918 | { |
| 1919 | data.enforceInterface(IActivityManager.descriptor); |
| 1920 | int mode = data.readInt(); |
| 1921 | setFrontActivityScreenCompatMode(mode); |
| 1922 | reply.writeNoException(); |
| 1923 | reply.writeInt(mode); |
| 1924 | return true; |
| 1925 | } |
| 1926 | |
| 1927 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1928 | { |
| 1929 | data.enforceInterface(IActivityManager.descriptor); |
| 1930 | String pkg = data.readString(); |
| 1931 | int mode = getPackageScreenCompatMode(pkg); |
| 1932 | reply.writeNoException(); |
| 1933 | reply.writeInt(mode); |
| 1934 | return true; |
| 1935 | } |
| 1936 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1937 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1938 | { |
| 1939 | data.enforceInterface(IActivityManager.descriptor); |
| 1940 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 1941 | int mode = data.readInt(); |
| 1942 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1943 | reply.writeNoException(); |
| 1944 | return true; |
| 1945 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1946 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1947 | case SWITCH_USER_TRANSACTION: { |
| 1948 | data.enforceInterface(IActivityManager.descriptor); |
| 1949 | int userid = data.readInt(); |
| 1950 | boolean result = switchUser(userid); |
| 1951 | reply.writeNoException(); |
| 1952 | reply.writeInt(result ? 1 : 0); |
| 1953 | return true; |
| 1954 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 1955 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 1956 | case START_USER_IN_BACKGROUND_TRANSACTION: { |
| 1957 | data.enforceInterface(IActivityManager.descriptor); |
| 1958 | int userid = data.readInt(); |
| 1959 | boolean result = startUserInBackground(userid); |
| 1960 | reply.writeNoException(); |
| 1961 | reply.writeInt(result ? 1 : 0); |
| 1962 | return true; |
| 1963 | } |
| 1964 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame^] | 1965 | case UNLOCK_USER_TRANSACTION: { |
| 1966 | data.enforceInterface(IActivityManager.descriptor); |
| 1967 | int userId = data.readInt(); |
| 1968 | byte[] token = data.createByteArray(); |
| 1969 | boolean result = unlockUser(userId, token); |
| 1970 | reply.writeNoException(); |
| 1971 | reply.writeInt(result ? 1 : 0); |
| 1972 | return true; |
| 1973 | } |
| 1974 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 1975 | case STOP_USER_TRANSACTION: { |
| 1976 | data.enforceInterface(IActivityManager.descriptor); |
| 1977 | int userid = data.readInt(); |
| 1978 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 1979 | data.readStrongBinder()); |
| 1980 | int result = stopUser(userid, callback); |
| 1981 | reply.writeNoException(); |
| 1982 | reply.writeInt(result); |
| 1983 | return true; |
| 1984 | } |
| 1985 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 1986 | case GET_CURRENT_USER_TRANSACTION: { |
| 1987 | data.enforceInterface(IActivityManager.descriptor); |
| 1988 | UserInfo userInfo = getCurrentUser(); |
| 1989 | reply.writeNoException(); |
| 1990 | userInfo.writeToParcel(reply, 0); |
| 1991 | return true; |
| 1992 | } |
| 1993 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1994 | case IS_USER_RUNNING_TRANSACTION: { |
| 1995 | data.enforceInterface(IActivityManager.descriptor); |
| 1996 | int userid = data.readInt(); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 1997 | int _flags = data.readInt(); |
| 1998 | boolean result = isUserRunning(userid, _flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1999 | reply.writeNoException(); |
| 2000 | reply.writeInt(result ? 1 : 0); |
| 2001 | return true; |
| 2002 | } |
| 2003 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 2004 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 2005 | data.enforceInterface(IActivityManager.descriptor); |
| 2006 | int[] result = getRunningUserIds(); |
| 2007 | reply.writeNoException(); |
| 2008 | reply.writeIntArray(result); |
| 2009 | return true; |
| 2010 | } |
| 2011 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2012 | case REMOVE_TASK_TRANSACTION: |
| 2013 | { |
| 2014 | data.enforceInterface(IActivityManager.descriptor); |
| 2015 | int taskId = data.readInt(); |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 2016 | boolean result = removeTask(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2017 | reply.writeNoException(); |
| 2018 | reply.writeInt(result ? 1 : 0); |
| 2019 | return true; |
| 2020 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2021 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 2022 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2023 | data.enforceInterface(IActivityManager.descriptor); |
| 2024 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2025 | data.readStrongBinder()); |
| 2026 | registerProcessObserver(observer); |
| 2027 | return true; |
| 2028 | } |
| 2029 | |
| 2030 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2031 | data.enforceInterface(IActivityManager.descriptor); |
| 2032 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2033 | data.readStrongBinder()); |
| 2034 | unregisterProcessObserver(observer); |
| 2035 | return true; |
| 2036 | } |
| 2037 | |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2038 | case REGISTER_UID_OBSERVER_TRANSACTION: { |
| 2039 | data.enforceInterface(IActivityManager.descriptor); |
| 2040 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2041 | data.readStrongBinder()); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2042 | int which = data.readInt(); |
| 2043 | registerUidObserver(observer, which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2044 | return true; |
| 2045 | } |
| 2046 | |
| 2047 | case UNREGISTER_UID_OBSERVER_TRANSACTION: { |
| 2048 | data.enforceInterface(IActivityManager.descriptor); |
| 2049 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2050 | data.readStrongBinder()); |
| 2051 | unregisterUidObserver(observer); |
| 2052 | return true; |
| 2053 | } |
| 2054 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 2055 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2056 | { |
| 2057 | data.enforceInterface(IActivityManager.descriptor); |
| 2058 | String pkg = data.readString(); |
| 2059 | boolean ask = getPackageAskScreenCompat(pkg); |
| 2060 | reply.writeNoException(); |
| 2061 | reply.writeInt(ask ? 1 : 0); |
| 2062 | return true; |
| 2063 | } |
| 2064 | |
| 2065 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2066 | { |
| 2067 | data.enforceInterface(IActivityManager.descriptor); |
| 2068 | String pkg = data.readString(); |
| 2069 | boolean ask = data.readInt() != 0; |
| 2070 | setPackageAskScreenCompat(pkg, ask); |
| 2071 | reply.writeNoException(); |
| 2072 | return true; |
| 2073 | } |
| 2074 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2075 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 2076 | data.enforceInterface(IActivityManager.descriptor); |
| 2077 | IIntentSender r = IIntentSender.Stub.asInterface( |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2078 | data.readStrongBinder()); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2079 | boolean res = isIntentSenderTargetedToPackage(r); |
| 2080 | reply.writeNoException(); |
| 2081 | reply.writeInt(res ? 1 : 0); |
| 2082 | return true; |
| 2083 | } |
| 2084 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 2085 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 2086 | data.enforceInterface(IActivityManager.descriptor); |
| 2087 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2088 | data.readStrongBinder()); |
| 2089 | boolean res = isIntentSenderAnActivity(r); |
| 2090 | reply.writeNoException(); |
| 2091 | reply.writeInt(res ? 1 : 0); |
| 2092 | return true; |
| 2093 | } |
| 2094 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 2095 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 2096 | data.enforceInterface(IActivityManager.descriptor); |
| 2097 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2098 | data.readStrongBinder()); |
| 2099 | Intent intent = getIntentForIntentSender(r); |
| 2100 | reply.writeNoException(); |
| 2101 | if (intent != null) { |
| 2102 | reply.writeInt(1); |
| 2103 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2104 | } else { |
| 2105 | reply.writeInt(0); |
| 2106 | } |
| 2107 | return true; |
| 2108 | } |
| 2109 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 2110 | case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { |
| 2111 | data.enforceInterface(IActivityManager.descriptor); |
| 2112 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2113 | data.readStrongBinder()); |
| 2114 | String prefix = data.readString(); |
| 2115 | String tag = getTagForIntentSender(r, prefix); |
| 2116 | reply.writeNoException(); |
| 2117 | reply.writeString(tag); |
| 2118 | return true; |
| 2119 | } |
| 2120 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2121 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 2122 | data.enforceInterface(IActivityManager.descriptor); |
| 2123 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 2124 | updatePersistentConfiguration(config); |
| 2125 | reply.writeNoException(); |
| 2126 | return true; |
| 2127 | } |
| 2128 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 2129 | case GET_PROCESS_PSS_TRANSACTION: { |
| 2130 | data.enforceInterface(IActivityManager.descriptor); |
| 2131 | int[] pids = data.createIntArray(); |
| 2132 | long[] pss = getProcessPss(pids); |
| 2133 | reply.writeNoException(); |
| 2134 | reply.writeLongArray(pss); |
| 2135 | return true; |
| 2136 | } |
| 2137 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 2138 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 2139 | data.enforceInterface(IActivityManager.descriptor); |
| 2140 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 2141 | boolean always = data.readInt() != 0; |
| 2142 | showBootMessage(msg, always); |
| 2143 | reply.writeNoException(); |
| 2144 | return true; |
| 2145 | } |
| 2146 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2147 | case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2148 | data.enforceInterface(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2149 | keyguardWaitingForActivityDrawn(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2150 | reply.writeNoException(); |
| 2151 | return true; |
| 2152 | } |
| 2153 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2154 | case KEYGUARD_GOING_AWAY_TRANSACTION: { |
| 2155 | data.enforceInterface(IActivityManager.descriptor); |
| 2156 | keyguardGoingAway(data.readInt() != 0, data.readInt() != 0); |
| 2157 | reply.writeNoException(); |
| 2158 | return true; |
| 2159 | } |
| 2160 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2161 | case SHOULD_UP_RECREATE_TASK_TRANSACTION: { |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2162 | data.enforceInterface(IActivityManager.descriptor); |
| 2163 | IBinder token = data.readStrongBinder(); |
| 2164 | String destAffinity = data.readString(); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2165 | boolean res = shouldUpRecreateTask(token, destAffinity); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2166 | reply.writeNoException(); |
| 2167 | reply.writeInt(res ? 1 : 0); |
| 2168 | return true; |
| 2169 | } |
| 2170 | |
| 2171 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 2172 | data.enforceInterface(IActivityManager.descriptor); |
| 2173 | IBinder token = data.readStrongBinder(); |
| 2174 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 2175 | int resultCode = data.readInt(); |
| 2176 | Intent resultData = null; |
| 2177 | if (data.readInt() != 0) { |
| 2178 | resultData = Intent.CREATOR.createFromParcel(data); |
| 2179 | } |
| 2180 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 2181 | reply.writeNoException(); |
| 2182 | reply.writeInt(res ? 1 : 0); |
| 2183 | return true; |
| 2184 | } |
| 2185 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 2186 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 2187 | data.enforceInterface(IActivityManager.descriptor); |
| 2188 | IBinder token = data.readStrongBinder(); |
| 2189 | int res = getLaunchedFromUid(token); |
| 2190 | reply.writeNoException(); |
| 2191 | reply.writeInt(res); |
| 2192 | return true; |
| 2193 | } |
| 2194 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2195 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 2196 | data.enforceInterface(IActivityManager.descriptor); |
| 2197 | IBinder token = data.readStrongBinder(); |
| 2198 | String res = getLaunchedFromPackage(token); |
| 2199 | reply.writeNoException(); |
| 2200 | reply.writeString(res); |
| 2201 | return true; |
| 2202 | } |
| 2203 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2204 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2205 | data.enforceInterface(IActivityManager.descriptor); |
| 2206 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2207 | data.readStrongBinder()); |
| 2208 | registerUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2209 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2210 | return true; |
| 2211 | } |
| 2212 | |
| 2213 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2214 | data.enforceInterface(IActivityManager.descriptor); |
| 2215 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2216 | data.readStrongBinder()); |
| 2217 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2218 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2219 | return true; |
| 2220 | } |
| 2221 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2222 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 2223 | data.enforceInterface(IActivityManager.descriptor); |
| 2224 | requestBugReport(); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2225 | reply.writeNoException(); |
| 2226 | return true; |
| 2227 | } |
| 2228 | |
| 2229 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 2230 | data.enforceInterface(IActivityManager.descriptor); |
| 2231 | int pid = data.readInt(); |
| 2232 | boolean aboveSystem = data.readInt() != 0; |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 2233 | String reason = data.readString(); |
| 2234 | long res = inputDispatchingTimedOut(pid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2235 | reply.writeNoException(); |
| 2236 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2237 | return true; |
| 2238 | } |
| 2239 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2240 | case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2241 | data.enforceInterface(IActivityManager.descriptor); |
| 2242 | int requestType = data.readInt(); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2243 | Bundle res = getAssistContextExtras(requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2244 | reply.writeNoException(); |
| 2245 | reply.writeBundle(res); |
| 2246 | return true; |
| 2247 | } |
| 2248 | |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2249 | case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
| 2250 | data.enforceInterface(IActivityManager.descriptor); |
| 2251 | int requestType = data.readInt(); |
| 2252 | IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2253 | IBinder activityToken = data.readStrongBinder(); |
| 2254 | boolean res = requestAssistContextExtras(requestType, receiver, activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2255 | reply.writeNoException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2256 | reply.writeInt(res ? 1 : 0); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2257 | return true; |
| 2258 | } |
| 2259 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2260 | case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2261 | data.enforceInterface(IActivityManager.descriptor); |
| 2262 | IBinder token = data.readStrongBinder(); |
| 2263 | Bundle extras = data.readBundle(); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 2264 | AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data); |
| 2265 | AssistContent content = AssistContent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 2266 | Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null; |
| 2267 | reportAssistContextExtras(token, extras, structure, content, referrer); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2268 | reply.writeNoException(); |
| 2269 | return true; |
| 2270 | } |
| 2271 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2272 | case LAUNCH_ASSIST_INTENT_TRANSACTION: { |
| 2273 | data.enforceInterface(IActivityManager.descriptor); |
| 2274 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2275 | int requestType = data.readInt(); |
| 2276 | String hint = data.readString(); |
| 2277 | int userHandle = data.readInt(); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 2278 | Bundle args = data.readBundle(); |
| 2279 | boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2280 | reply.writeNoException(); |
| 2281 | reply.writeInt(res ? 1 : 0); |
| 2282 | return true; |
| 2283 | } |
| 2284 | |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2285 | case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: { |
| 2286 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2287 | boolean res = isAssistDataAllowedOnCurrentActivity(); |
| 2288 | reply.writeNoException(); |
| 2289 | reply.writeInt(res ? 1 : 0); |
| 2290 | return true; |
| 2291 | } |
| 2292 | |
| 2293 | case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: { |
| 2294 | data.enforceInterface(IActivityManager.descriptor); |
| 2295 | IBinder token = data.readStrongBinder(); |
| 2296 | Bundle args = data.readBundle(); |
| 2297 | boolean res = showAssistFromActivity(token, args); |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2298 | reply.writeNoException(); |
| 2299 | reply.writeInt(res ? 1 : 0); |
| 2300 | return true; |
| 2301 | } |
| 2302 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2303 | case KILL_UID_TRANSACTION: { |
| 2304 | data.enforceInterface(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2305 | int appId = data.readInt(); |
| 2306 | int userId = data.readInt(); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2307 | String reason = data.readString(); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2308 | killUid(appId, userId, reason); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2309 | reply.writeNoException(); |
| 2310 | return true; |
| 2311 | } |
| 2312 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2313 | case HANG_TRANSACTION: { |
| 2314 | data.enforceInterface(IActivityManager.descriptor); |
| 2315 | IBinder who = data.readStrongBinder(); |
| 2316 | boolean allowRestart = data.readInt() != 0; |
| 2317 | hang(who, allowRestart); |
| 2318 | reply.writeNoException(); |
| 2319 | return true; |
| 2320 | } |
| 2321 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2322 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2323 | data.enforceInterface(IActivityManager.descriptor); |
| 2324 | IBinder token = data.readStrongBinder(); |
| 2325 | reportActivityFullyDrawn(token); |
| 2326 | reply.writeNoException(); |
| 2327 | return true; |
| 2328 | } |
| 2329 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2330 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2331 | data.enforceInterface(IActivityManager.descriptor); |
| 2332 | IBinder token = data.readStrongBinder(); |
| 2333 | notifyActivityDrawn(token); |
| 2334 | reply.writeNoException(); |
| 2335 | return true; |
| 2336 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2337 | |
| 2338 | case RESTART_TRANSACTION: { |
| 2339 | data.enforceInterface(IActivityManager.descriptor); |
| 2340 | restart(); |
| 2341 | reply.writeNoException(); |
| 2342 | return true; |
| 2343 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2344 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2345 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2346 | data.enforceInterface(IActivityManager.descriptor); |
| 2347 | performIdleMaintenance(); |
| 2348 | reply.writeNoException(); |
| 2349 | return true; |
| 2350 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2351 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2352 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2353 | data.enforceInterface(IActivityManager.descriptor); |
| 2354 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2355 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2356 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2357 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2358 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2359 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2360 | if (activityContainer != null) { |
| 2361 | reply.writeInt(1); |
| 2362 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2363 | } else { |
| 2364 | reply.writeInt(0); |
| 2365 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2366 | return true; |
| 2367 | } |
| 2368 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2369 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2370 | data.enforceInterface(IActivityManager.descriptor); |
| 2371 | IActivityContainer activityContainer = |
| 2372 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2373 | deleteActivityContainer(activityContainer); |
| 2374 | reply.writeNoException(); |
| 2375 | return true; |
| 2376 | } |
| 2377 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2378 | case CREATE_STACK_ON_DISPLAY: { |
| 2379 | data.enforceInterface(IActivityManager.descriptor); |
| 2380 | int displayId = data.readInt(); |
| 2381 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2382 | reply.writeNoException(); |
| 2383 | if (activityContainer != null) { |
| 2384 | reply.writeInt(1); |
| 2385 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2386 | } else { |
| 2387 | reply.writeInt(0); |
| 2388 | } |
| 2389 | return true; |
| 2390 | } |
| 2391 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2392 | case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: { |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2393 | data.enforceInterface(IActivityManager.descriptor); |
| 2394 | IBinder activityToken = data.readStrongBinder(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2395 | int displayId = getActivityDisplayId(activityToken); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2396 | reply.writeNoException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2397 | reply.writeInt(displayId); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2398 | return true; |
| 2399 | } |
| 2400 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2401 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2402 | data.enforceInterface(IActivityManager.descriptor); |
| 2403 | final int taskId = data.readInt(); |
| 2404 | startLockTaskMode(taskId); |
| 2405 | reply.writeNoException(); |
| 2406 | return true; |
| 2407 | } |
| 2408 | |
| 2409 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2410 | data.enforceInterface(IActivityManager.descriptor); |
| 2411 | IBinder token = data.readStrongBinder(); |
| 2412 | startLockTaskMode(token); |
| 2413 | reply.writeNoException(); |
| 2414 | return true; |
| 2415 | } |
| 2416 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2417 | case START_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2418 | data.enforceInterface(IActivityManager.descriptor); |
| 2419 | startLockTaskModeOnCurrent(); |
| 2420 | reply.writeNoException(); |
| 2421 | return true; |
| 2422 | } |
| 2423 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2424 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2425 | data.enforceInterface(IActivityManager.descriptor); |
| 2426 | stopLockTaskMode(); |
| 2427 | reply.writeNoException(); |
| 2428 | return true; |
| 2429 | } |
| 2430 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2431 | case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2432 | data.enforceInterface(IActivityManager.descriptor); |
| 2433 | stopLockTaskModeOnCurrent(); |
| 2434 | reply.writeNoException(); |
| 2435 | return true; |
| 2436 | } |
| 2437 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2438 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2439 | data.enforceInterface(IActivityManager.descriptor); |
| 2440 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2441 | reply.writeNoException(); |
| 2442 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2443 | return true; |
| 2444 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2445 | |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 2446 | case GET_LOCK_TASK_MODE_STATE_TRANSACTION: { |
| 2447 | data.enforceInterface(IActivityManager.descriptor); |
| 2448 | final int lockTaskModeState = getLockTaskModeState(); |
| 2449 | reply.writeNoException(); |
| 2450 | reply.writeInt(lockTaskModeState); |
| 2451 | return true; |
| 2452 | } |
| 2453 | |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 2454 | case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: { |
| 2455 | data.enforceInterface(IActivityManager.descriptor); |
| 2456 | final IBinder token = data.readStrongBinder(); |
| 2457 | showLockTaskEscapeMessage(token); |
| 2458 | reply.writeNoException(); |
| 2459 | return true; |
| 2460 | } |
| 2461 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2462 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2463 | data.enforceInterface(IActivityManager.descriptor); |
| 2464 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2465 | ActivityManager.TaskDescription values = |
| 2466 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2467 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2468 | reply.writeNoException(); |
| 2469 | return true; |
| 2470 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2471 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2472 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2473 | data.enforceInterface(IActivityManager.descriptor); |
| 2474 | int taskId = data.readInt(); |
| 2475 | boolean resizeable = (data.readInt() == 1) ? true : false; |
| 2476 | setTaskResizeable(taskId, resizeable); |
| 2477 | reply.writeNoException(); |
| 2478 | return true; |
| 2479 | } |
| 2480 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2481 | case RESIZE_TASK_TRANSACTION: { |
| 2482 | data.enforceInterface(IActivityManager.descriptor); |
| 2483 | int taskId = data.readInt(); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2484 | int resizeMode = data.readInt(); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2485 | Rect r = Rect.CREATOR.createFromParcel(data); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2486 | resizeTask(taskId, r, resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2487 | reply.writeNoException(); |
| 2488 | return true; |
| 2489 | } |
| 2490 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 2491 | case GET_TASK_BOUNDS_TRANSACTION: { |
| 2492 | data.enforceInterface(IActivityManager.descriptor); |
| 2493 | int taskId = data.readInt(); |
| 2494 | Rect r = getTaskBounds(taskId); |
| 2495 | reply.writeNoException(); |
| 2496 | r.writeToParcel(reply, 0); |
| 2497 | return true; |
| 2498 | } |
| 2499 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2500 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2501 | data.enforceInterface(IActivityManager.descriptor); |
| 2502 | String filename = data.readString(); |
| 2503 | Bitmap icon = getTaskDescriptionIcon(filename); |
| 2504 | reply.writeNoException(); |
| 2505 | if (icon == null) { |
| 2506 | reply.writeInt(0); |
| 2507 | } else { |
| 2508 | reply.writeInt(1); |
| 2509 | icon.writeToParcel(reply, 0); |
| 2510 | } |
| 2511 | return true; |
| 2512 | } |
| 2513 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2514 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2515 | data.enforceInterface(IActivityManager.descriptor); |
| 2516 | final Bundle bundle; |
| 2517 | if (data.readInt() == 0) { |
| 2518 | bundle = null; |
| 2519 | } else { |
| 2520 | bundle = data.readBundle(); |
| 2521 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 2522 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2523 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2524 | reply.writeNoException(); |
| 2525 | return true; |
| 2526 | } |
| 2527 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2528 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2529 | data.enforceInterface(IActivityManager.descriptor); |
| 2530 | IBinder token = data.readStrongBinder(); |
| 2531 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2532 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2533 | reply.writeNoException(); |
| 2534 | reply.writeInt(success ? 1 : 0); |
| 2535 | return true; |
| 2536 | } |
| 2537 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2538 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2539 | data.enforceInterface(IActivityManager.descriptor); |
| 2540 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2541 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2542 | reply.writeNoException(); |
| 2543 | reply.writeInt(enabled ? 1 : 0); |
| 2544 | return true; |
| 2545 | } |
| 2546 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2547 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2548 | data.enforceInterface(IActivityManager.descriptor); |
| 2549 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2550 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2551 | reply.writeNoException(); |
| 2552 | return true; |
| 2553 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2554 | |
| 2555 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2556 | data.enforceInterface(IActivityManager.descriptor); |
| 2557 | IBinder token = data.readStrongBinder(); |
| 2558 | notifyLaunchTaskBehindComplete(token); |
| 2559 | reply.writeNoException(); |
| 2560 | return true; |
| 2561 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2562 | |
| 2563 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2564 | data.enforceInterface(IActivityManager.descriptor); |
| 2565 | IBinder token = data.readStrongBinder(); |
| 2566 | notifyEnterAnimationComplete(token); |
| 2567 | reply.writeNoException(); |
| 2568 | return true; |
| 2569 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2570 | |
| 2571 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2572 | data.enforceInterface(IActivityManager.descriptor); |
| 2573 | bootAnimationComplete(); |
| 2574 | reply.writeNoException(); |
| 2575 | return true; |
| 2576 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2577 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2578 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2579 | data.enforceInterface(IActivityManager.descriptor); |
| 2580 | final int uid = data.readInt(); |
| 2581 | final byte[] firstPacket = data.createByteArray(); |
| 2582 | notifyCleartextNetwork(uid, firstPacket); |
| 2583 | reply.writeNoException(); |
| 2584 | return true; |
| 2585 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2586 | |
| 2587 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2588 | data.enforceInterface(IActivityManager.descriptor); |
| 2589 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2590 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2591 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2592 | String reportPackage = data.readString(); |
| 2593 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2594 | reply.writeNoException(); |
| 2595 | return true; |
| 2596 | } |
| 2597 | |
| 2598 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2599 | data.enforceInterface(IActivityManager.descriptor); |
| 2600 | String path = data.readString(); |
| 2601 | dumpHeapFinished(path); |
| 2602 | reply.writeNoException(); |
| 2603 | return true; |
| 2604 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2605 | |
| 2606 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2607 | data.enforceInterface(IActivityManager.descriptor); |
| 2608 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2609 | data.readStrongBinder()); |
| 2610 | boolean keepAwake = data.readInt() != 0; |
| 2611 | setVoiceKeepAwake(session, keepAwake); |
| 2612 | reply.writeNoException(); |
| 2613 | return true; |
| 2614 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2615 | |
| 2616 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2617 | data.enforceInterface(IActivityManager.descriptor); |
| 2618 | int userId = data.readInt(); |
| 2619 | String[] packages = data.readStringArray(); |
| 2620 | updateLockTaskPackages(userId, packages); |
| 2621 | reply.writeNoException(); |
| 2622 | return true; |
| 2623 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2624 | |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 2625 | case UPDATE_DEVICE_OWNER_TRANSACTION: { |
| 2626 | data.enforceInterface(IActivityManager.descriptor); |
| 2627 | String packageName = data.readString(); |
| 2628 | updateDeviceOwner(packageName); |
| 2629 | reply.writeNoException(); |
| 2630 | return true; |
| 2631 | } |
| 2632 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2633 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2634 | data.enforceInterface(IActivityManager.descriptor); |
| 2635 | String pkg = data.readString(); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 2636 | String callingPackage = data.readString(); |
| 2637 | int res = getPackageProcessState(pkg, callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2638 | reply.writeNoException(); |
| 2639 | reply.writeInt(res); |
| 2640 | return true; |
| 2641 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2642 | |
| 2643 | case SET_PROCESS_MEMORY_TRIM_TRANSACTION: { |
| 2644 | data.enforceInterface(IActivityManager.descriptor); |
| 2645 | String process = data.readString(); |
| 2646 | int userId = data.readInt(); |
| 2647 | int level = data.readInt(); |
| 2648 | boolean res = setProcessMemoryTrimLevel(process, userId, level); |
| 2649 | reply.writeNoException(); |
| 2650 | reply.writeInt(res ? 1 : 0); |
| 2651 | return true; |
| 2652 | } |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2653 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 2654 | case IS_ROOT_VOICE_INTERACTION_TRANSACTION: { |
| 2655 | data.enforceInterface(IActivityManager.descriptor); |
| 2656 | IBinder token = data.readStrongBinder(); |
| 2657 | boolean res = isRootVoiceInteraction(token); |
| 2658 | reply.writeNoException(); |
| 2659 | reply.writeInt(res ? 1 : 0); |
| 2660 | return true; |
| 2661 | } |
Ian Pedowitz | a371084 | 2015-08-03 23:36:15 -0700 | [diff] [blame] | 2662 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2663 | case START_BINDER_TRACKING_TRANSACTION: { |
| 2664 | data.enforceInterface(IActivityManager.descriptor); |
| 2665 | boolean res = startBinderTracking(); |
| 2666 | reply.writeNoException(); |
| 2667 | reply.writeInt(res ? 1 : 0); |
| 2668 | return true; |
| 2669 | } |
| 2670 | |
| 2671 | case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: { |
| 2672 | data.enforceInterface(IActivityManager.descriptor); |
| 2673 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 2674 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
| 2675 | boolean res = stopBinderTrackingAndDump(fd); |
| 2676 | reply.writeNoException(); |
| 2677 | reply.writeInt(res ? 1 : 0); |
| 2678 | return true; |
| 2679 | } |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2680 | case GET_ACTIVITY_STACK_ID_TRANSACTION: { |
| 2681 | data.enforceInterface(IActivityManager.descriptor); |
| 2682 | IBinder token = data.readStrongBinder(); |
| 2683 | int stackId = getActivityStackId(token); |
| 2684 | reply.writeNoException(); |
| 2685 | reply.writeInt(stackId); |
| 2686 | return true; |
| 2687 | } |
| 2688 | case MOVE_ACTIVITY_TO_STACK_TRANSACTION: { |
| 2689 | data.enforceInterface(IActivityManager.descriptor); |
| 2690 | IBinder token = data.readStrongBinder(); |
| 2691 | int stackId = data.readInt(); |
| 2692 | moveActivityToStack(token, stackId); |
| 2693 | reply.writeNoException(); |
| 2694 | return true; |
| 2695 | } |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2696 | case REPORT_SIZE_CONFIGURATIONS: { |
| 2697 | data.enforceInterface(IActivityManager.descriptor); |
| 2698 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2699 | int[] horizontal = readIntArray(data); |
| 2700 | int[] vertical = readIntArray(data); |
| 2701 | int[] smallest = readIntArray(data); |
| 2702 | reportSizeConfigurations(token, horizontal, vertical, smallest); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2703 | return true; |
| 2704 | } |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 2705 | case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: { |
| 2706 | data.enforceInterface(IActivityManager.descriptor); |
| 2707 | final boolean suppress = data.readInt() == 1; |
| 2708 | suppressResizeConfigChanges(suppress); |
| 2709 | reply.writeNoException(); |
| 2710 | return true; |
| 2711 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2712 | case REMOVE_STACK_TRANSACTION: { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2713 | data.enforceInterface(IActivityManager.descriptor); |
| 2714 | final int stackId = data.readInt(); |
| 2715 | removeStack(stackId); |
| 2716 | reply.writeNoException(); |
| 2717 | return true; |
| 2718 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2719 | case GET_APP_START_MODE_TRANSACTION: { |
| 2720 | data.enforceInterface(IActivityManager.descriptor); |
| 2721 | final int uid = data.readInt(); |
| 2722 | final String pkg = data.readString(); |
| 2723 | int res = getAppStartMode(uid, pkg); |
| 2724 | reply.writeNoException(); |
| 2725 | reply.writeInt(res); |
| 2726 | return true; |
| 2727 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2728 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2729 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2730 | return super.onTransact(code, data, reply, flags); |
| 2731 | } |
| 2732 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2733 | private int[] readIntArray(Parcel data) { |
| 2734 | int[] smallest = null; |
| 2735 | int smallestSize = data.readInt(); |
| 2736 | if (smallestSize > 0) { |
| 2737 | smallest = new int[smallestSize]; |
| 2738 | data.readIntArray(smallest); |
| 2739 | } |
| 2740 | return smallest; |
| 2741 | } |
| 2742 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2743 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2744 | return this; |
| 2745 | } |
| 2746 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2747 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2748 | protected IActivityManager create() { |
| 2749 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2750 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2751 | Log.v("ActivityManager", "default service binder = " + b); |
| 2752 | } |
| 2753 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2754 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2755 | Log.v("ActivityManager", "default service = " + am); |
| 2756 | } |
| 2757 | return am; |
| 2758 | } |
| 2759 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2760 | } |
| 2761 | |
| 2762 | class ActivityManagerProxy implements IActivityManager |
| 2763 | { |
| 2764 | public ActivityManagerProxy(IBinder remote) |
| 2765 | { |
| 2766 | mRemote = remote; |
| 2767 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2768 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2769 | public IBinder asBinder() |
| 2770 | { |
| 2771 | return mRemote; |
| 2772 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2773 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2774 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2775 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2776 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2777 | Parcel data = Parcel.obtain(); |
| 2778 | Parcel reply = Parcel.obtain(); |
| 2779 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2780 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2781 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2782 | intent.writeToParcel(data, 0); |
| 2783 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2784 | data.writeStrongBinder(resultTo); |
| 2785 | data.writeString(resultWho); |
| 2786 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2787 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2788 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2789 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2790 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2791 | } else { |
| 2792 | data.writeInt(0); |
| 2793 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2794 | if (options != null) { |
| 2795 | data.writeInt(1); |
| 2796 | options.writeToParcel(data, 0); |
| 2797 | } else { |
| 2798 | data.writeInt(0); |
| 2799 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2800 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2801 | reply.readException(); |
| 2802 | int result = reply.readInt(); |
| 2803 | reply.recycle(); |
| 2804 | data.recycle(); |
| 2805 | return result; |
| 2806 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2807 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2808 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2809 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2810 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2811 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2812 | Parcel data = Parcel.obtain(); |
| 2813 | Parcel reply = Parcel.obtain(); |
| 2814 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2815 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2816 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2817 | intent.writeToParcel(data, 0); |
| 2818 | data.writeString(resolvedType); |
| 2819 | data.writeStrongBinder(resultTo); |
| 2820 | data.writeString(resultWho); |
| 2821 | data.writeInt(requestCode); |
| 2822 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2823 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2824 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2825 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2826 | } else { |
| 2827 | data.writeInt(0); |
| 2828 | } |
| 2829 | if (options != null) { |
| 2830 | data.writeInt(1); |
| 2831 | options.writeToParcel(data, 0); |
| 2832 | } else { |
| 2833 | data.writeInt(0); |
| 2834 | } |
| 2835 | data.writeInt(userId); |
| 2836 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 2837 | reply.readException(); |
| 2838 | int result = reply.readInt(); |
| 2839 | reply.recycle(); |
| 2840 | data.recycle(); |
| 2841 | return result; |
| 2842 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2843 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 2844 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 2845 | int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, |
| 2846 | int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2847 | Parcel data = Parcel.obtain(); |
| 2848 | Parcel reply = Parcel.obtain(); |
| 2849 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2850 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2851 | data.writeString(callingPackage); |
| 2852 | intent.writeToParcel(data, 0); |
| 2853 | data.writeString(resolvedType); |
| 2854 | data.writeStrongBinder(resultTo); |
| 2855 | data.writeString(resultWho); |
| 2856 | data.writeInt(requestCode); |
| 2857 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2858 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2859 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2860 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2861 | } else { |
| 2862 | data.writeInt(0); |
| 2863 | } |
| 2864 | if (options != null) { |
| 2865 | data.writeInt(1); |
| 2866 | options.writeToParcel(data, 0); |
| 2867 | } else { |
| 2868 | data.writeInt(0); |
| 2869 | } |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 2870 | data.writeInt(ignoreTargetSecurity ? 1 : 0); |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 2871 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 2872 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 2873 | reply.readException(); |
| 2874 | int result = reply.readInt(); |
| 2875 | reply.recycle(); |
| 2876 | data.recycle(); |
| 2877 | return result; |
| 2878 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2879 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 2880 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2881 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 2882 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2883 | Parcel data = Parcel.obtain(); |
| 2884 | Parcel reply = Parcel.obtain(); |
| 2885 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2886 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2887 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2888 | intent.writeToParcel(data, 0); |
| 2889 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2890 | data.writeStrongBinder(resultTo); |
| 2891 | data.writeString(resultWho); |
| 2892 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2893 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2894 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2895 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2896 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2897 | } else { |
| 2898 | data.writeInt(0); |
| 2899 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2900 | if (options != null) { |
| 2901 | data.writeInt(1); |
| 2902 | options.writeToParcel(data, 0); |
| 2903 | } else { |
| 2904 | data.writeInt(0); |
| 2905 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2906 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2907 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 2908 | reply.readException(); |
| 2909 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 2910 | reply.recycle(); |
| 2911 | data.recycle(); |
| 2912 | return result; |
| 2913 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2914 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 2915 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2916 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2917 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2918 | Parcel data = Parcel.obtain(); |
| 2919 | Parcel reply = Parcel.obtain(); |
| 2920 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2921 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2922 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2923 | intent.writeToParcel(data, 0); |
| 2924 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2925 | data.writeStrongBinder(resultTo); |
| 2926 | data.writeString(resultWho); |
| 2927 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2928 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2929 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2930 | if (options != null) { |
| 2931 | data.writeInt(1); |
| 2932 | options.writeToParcel(data, 0); |
| 2933 | } else { |
| 2934 | data.writeInt(0); |
| 2935 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2936 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2937 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2938 | reply.readException(); |
| 2939 | int result = reply.readInt(); |
| 2940 | reply.recycle(); |
| 2941 | data.recycle(); |
| 2942 | return result; |
| 2943 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2944 | public int startActivityIntentSender(IApplicationThread caller, |
| 2945 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2946 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2947 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2948 | Parcel data = Parcel.obtain(); |
| 2949 | Parcel reply = Parcel.obtain(); |
| 2950 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2951 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2952 | intent.writeToParcel(data, 0); |
| 2953 | if (fillInIntent != null) { |
| 2954 | data.writeInt(1); |
| 2955 | fillInIntent.writeToParcel(data, 0); |
| 2956 | } else { |
| 2957 | data.writeInt(0); |
| 2958 | } |
| 2959 | data.writeString(resolvedType); |
| 2960 | data.writeStrongBinder(resultTo); |
| 2961 | data.writeString(resultWho); |
| 2962 | data.writeInt(requestCode); |
| 2963 | data.writeInt(flagsMask); |
| 2964 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2965 | if (options != null) { |
| 2966 | data.writeInt(1); |
| 2967 | options.writeToParcel(data, 0); |
| 2968 | } else { |
| 2969 | data.writeInt(0); |
| 2970 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2971 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2972 | reply.readException(); |
| 2973 | int result = reply.readInt(); |
| 2974 | reply.recycle(); |
| 2975 | data.recycle(); |
| 2976 | return result; |
| 2977 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2978 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 2979 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2980 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 2981 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2982 | Parcel data = Parcel.obtain(); |
| 2983 | Parcel reply = Parcel.obtain(); |
| 2984 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2985 | data.writeString(callingPackage); |
| 2986 | data.writeInt(callingPid); |
| 2987 | data.writeInt(callingUid); |
| 2988 | intent.writeToParcel(data, 0); |
| 2989 | data.writeString(resolvedType); |
| 2990 | data.writeStrongBinder(session.asBinder()); |
| 2991 | data.writeStrongBinder(interactor.asBinder()); |
| 2992 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2993 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2994 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2995 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2996 | } else { |
| 2997 | data.writeInt(0); |
| 2998 | } |
| 2999 | if (options != null) { |
| 3000 | data.writeInt(1); |
| 3001 | options.writeToParcel(data, 0); |
| 3002 | } else { |
| 3003 | data.writeInt(0); |
| 3004 | } |
| 3005 | data.writeInt(userId); |
| 3006 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3007 | reply.readException(); |
| 3008 | int result = reply.readInt(); |
| 3009 | reply.recycle(); |
| 3010 | data.recycle(); |
| 3011 | return result; |
| 3012 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3013 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3014 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3015 | Parcel data = Parcel.obtain(); |
| 3016 | Parcel reply = Parcel.obtain(); |
| 3017 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3018 | data.writeStrongBinder(callingActivity); |
| 3019 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3020 | if (options != null) { |
| 3021 | data.writeInt(1); |
| 3022 | options.writeToParcel(data, 0); |
| 3023 | } else { |
| 3024 | data.writeInt(0); |
| 3025 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3026 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3027 | reply.readException(); |
| 3028 | int result = reply.readInt(); |
| 3029 | reply.recycle(); |
| 3030 | data.recycle(); |
| 3031 | return result != 0; |
| 3032 | } |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3033 | public int startActivityFromRecents(int taskId, int launchStackId, Bundle options) |
| 3034 | throws RemoteException { |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3035 | Parcel data = Parcel.obtain(); |
| 3036 | Parcel reply = Parcel.obtain(); |
| 3037 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3038 | data.writeInt(taskId); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3039 | data.writeInt(launchStackId); |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3040 | if (options == null) { |
| 3041 | data.writeInt(0); |
| 3042 | } else { |
| 3043 | data.writeInt(1); |
| 3044 | options.writeToParcel(data, 0); |
| 3045 | } |
| 3046 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 3047 | reply.readException(); |
| 3048 | int result = reply.readInt(); |
| 3049 | reply.recycle(); |
| 3050 | data.recycle(); |
| 3051 | return result; |
| 3052 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3053 | public boolean finishActivity(IBinder token, int resultCode, Intent resultData, int finishTask) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3054 | throws RemoteException { |
| 3055 | Parcel data = Parcel.obtain(); |
| 3056 | Parcel reply = Parcel.obtain(); |
| 3057 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3058 | data.writeStrongBinder(token); |
| 3059 | data.writeInt(resultCode); |
| 3060 | if (resultData != null) { |
| 3061 | data.writeInt(1); |
| 3062 | resultData.writeToParcel(data, 0); |
| 3063 | } else { |
| 3064 | data.writeInt(0); |
| 3065 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3066 | data.writeInt(finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3067 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3068 | reply.readException(); |
| 3069 | boolean res = reply.readInt() != 0; |
| 3070 | data.recycle(); |
| 3071 | reply.recycle(); |
| 3072 | return res; |
| 3073 | } |
| 3074 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 3075 | { |
| 3076 | Parcel data = Parcel.obtain(); |
| 3077 | Parcel reply = Parcel.obtain(); |
| 3078 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3079 | data.writeStrongBinder(token); |
| 3080 | data.writeString(resultWho); |
| 3081 | data.writeInt(requestCode); |
| 3082 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3083 | reply.readException(); |
| 3084 | data.recycle(); |
| 3085 | reply.recycle(); |
| 3086 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 3087 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 3088 | Parcel data = Parcel.obtain(); |
| 3089 | Parcel reply = Parcel.obtain(); |
| 3090 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3091 | data.writeStrongBinder(token); |
| 3092 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 3093 | reply.readException(); |
| 3094 | boolean res = reply.readInt() != 0; |
| 3095 | data.recycle(); |
| 3096 | reply.recycle(); |
| 3097 | return res; |
| 3098 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 3099 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 3100 | Parcel data = Parcel.obtain(); |
| 3101 | Parcel reply = Parcel.obtain(); |
| 3102 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3103 | data.writeStrongBinder(session.asBinder()); |
| 3104 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 3105 | reply.readException(); |
| 3106 | data.recycle(); |
| 3107 | reply.recycle(); |
| 3108 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 3109 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 3110 | Parcel data = Parcel.obtain(); |
| 3111 | Parcel reply = Parcel.obtain(); |
| 3112 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3113 | data.writeStrongBinder(token); |
| 3114 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 3115 | reply.readException(); |
| 3116 | boolean res = reply.readInt() != 0; |
| 3117 | data.recycle(); |
| 3118 | reply.recycle(); |
| 3119 | return res; |
| 3120 | } |
| 3121 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 3122 | Parcel data = Parcel.obtain(); |
| 3123 | Parcel reply = Parcel.obtain(); |
| 3124 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3125 | data.writeStrongBinder(app.asBinder()); |
| 3126 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 3127 | reply.readException(); |
| 3128 | data.recycle(); |
| 3129 | reply.recycle(); |
| 3130 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 3131 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 3132 | Parcel data = Parcel.obtain(); |
| 3133 | Parcel reply = Parcel.obtain(); |
| 3134 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3135 | data.writeStrongBinder(token); |
| 3136 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 3137 | reply.readException(); |
| 3138 | boolean res = reply.readInt() != 0; |
| 3139 | data.recycle(); |
| 3140 | reply.recycle(); |
| 3141 | return res; |
| 3142 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3143 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3144 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3145 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3146 | { |
| 3147 | Parcel data = Parcel.obtain(); |
| 3148 | Parcel reply = Parcel.obtain(); |
| 3149 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3150 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3151 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3152 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 3153 | filter.writeToParcel(data, 0); |
| 3154 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3155 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3156 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3157 | reply.readException(); |
| 3158 | Intent intent = null; |
| 3159 | int haveIntent = reply.readInt(); |
| 3160 | if (haveIntent != 0) { |
| 3161 | intent = Intent.CREATOR.createFromParcel(reply); |
| 3162 | } |
| 3163 | reply.recycle(); |
| 3164 | data.recycle(); |
| 3165 | return intent; |
| 3166 | } |
| 3167 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 3168 | { |
| 3169 | Parcel data = Parcel.obtain(); |
| 3170 | Parcel reply = Parcel.obtain(); |
| 3171 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3172 | data.writeStrongBinder(receiver.asBinder()); |
| 3173 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3174 | reply.readException(); |
| 3175 | data.recycle(); |
| 3176 | reply.recycle(); |
| 3177 | } |
| 3178 | public int broadcastIntent(IApplicationThread caller, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3179 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3180 | int resultCode, String resultData, Bundle map, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3181 | String[] requiredPermissions, int appOp, Bundle options, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3182 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3183 | { |
| 3184 | Parcel data = Parcel.obtain(); |
| 3185 | Parcel reply = Parcel.obtain(); |
| 3186 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3187 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3188 | intent.writeToParcel(data, 0); |
| 3189 | data.writeString(resolvedType); |
| 3190 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 3191 | data.writeInt(resultCode); |
| 3192 | data.writeString(resultData); |
| 3193 | data.writeBundle(map); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3194 | data.writeStringArray(requiredPermissions); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 3195 | data.writeInt(appOp); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3196 | data.writeBundle(options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3197 | data.writeInt(serialized ? 1 : 0); |
| 3198 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3199 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3200 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3201 | reply.readException(); |
| 3202 | int res = reply.readInt(); |
| 3203 | reply.recycle(); |
| 3204 | data.recycle(); |
| 3205 | return res; |
| 3206 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3207 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 3208 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3209 | { |
| 3210 | Parcel data = Parcel.obtain(); |
| 3211 | Parcel reply = Parcel.obtain(); |
| 3212 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3213 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3214 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3215 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3216 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3217 | reply.readException(); |
| 3218 | data.recycle(); |
| 3219 | reply.recycle(); |
| 3220 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3221 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 3222 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3223 | { |
| 3224 | Parcel data = Parcel.obtain(); |
| 3225 | Parcel reply = Parcel.obtain(); |
| 3226 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3227 | data.writeStrongBinder(who); |
| 3228 | data.writeInt(resultCode); |
| 3229 | data.writeString(resultData); |
| 3230 | data.writeBundle(map); |
| 3231 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3232 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3233 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3234 | reply.readException(); |
| 3235 | data.recycle(); |
| 3236 | reply.recycle(); |
| 3237 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3238 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3239 | { |
| 3240 | Parcel data = Parcel.obtain(); |
| 3241 | Parcel reply = Parcel.obtain(); |
| 3242 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3243 | data.writeStrongBinder(app.asBinder()); |
| 3244 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3245 | reply.readException(); |
| 3246 | data.recycle(); |
| 3247 | reply.recycle(); |
| 3248 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3249 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3250 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3251 | { |
| 3252 | Parcel data = Parcel.obtain(); |
| 3253 | Parcel reply = Parcel.obtain(); |
| 3254 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3255 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3256 | if (config != null) { |
| 3257 | data.writeInt(1); |
| 3258 | config.writeToParcel(data, 0); |
| 3259 | } else { |
| 3260 | data.writeInt(0); |
| 3261 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3262 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3263 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3264 | reply.readException(); |
| 3265 | data.recycle(); |
| 3266 | reply.recycle(); |
| 3267 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3268 | public void activityResumed(IBinder token) throws RemoteException |
| 3269 | { |
| 3270 | Parcel data = Parcel.obtain(); |
| 3271 | Parcel reply = Parcel.obtain(); |
| 3272 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3273 | data.writeStrongBinder(token); |
| 3274 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3275 | reply.readException(); |
| 3276 | data.recycle(); |
| 3277 | reply.recycle(); |
| 3278 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3279 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3280 | { |
| 3281 | Parcel data = Parcel.obtain(); |
| 3282 | Parcel reply = Parcel.obtain(); |
| 3283 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3284 | data.writeStrongBinder(token); |
| 3285 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3286 | reply.readException(); |
| 3287 | data.recycle(); |
| 3288 | reply.recycle(); |
| 3289 | } |
| 3290 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3291 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3292 | { |
| 3293 | Parcel data = Parcel.obtain(); |
| 3294 | Parcel reply = Parcel.obtain(); |
| 3295 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3296 | data.writeStrongBinder(token); |
| 3297 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3298 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3299 | TextUtils.writeToParcel(description, data, 0); |
| 3300 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3301 | reply.readException(); |
| 3302 | data.recycle(); |
| 3303 | reply.recycle(); |
| 3304 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3305 | public void activitySlept(IBinder token) throws RemoteException |
| 3306 | { |
| 3307 | Parcel data = Parcel.obtain(); |
| 3308 | Parcel reply = Parcel.obtain(); |
| 3309 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3310 | data.writeStrongBinder(token); |
| 3311 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3312 | reply.readException(); |
| 3313 | data.recycle(); |
| 3314 | reply.recycle(); |
| 3315 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3316 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3317 | { |
| 3318 | Parcel data = Parcel.obtain(); |
| 3319 | Parcel reply = Parcel.obtain(); |
| 3320 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3321 | data.writeStrongBinder(token); |
| 3322 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3323 | reply.readException(); |
| 3324 | data.recycle(); |
| 3325 | reply.recycle(); |
| 3326 | } |
| 3327 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3328 | { |
| 3329 | Parcel data = Parcel.obtain(); |
| 3330 | Parcel reply = Parcel.obtain(); |
| 3331 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3332 | data.writeStrongBinder(token); |
| 3333 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3334 | reply.readException(); |
| 3335 | String res = reply.readString(); |
| 3336 | data.recycle(); |
| 3337 | reply.recycle(); |
| 3338 | return res; |
| 3339 | } |
| 3340 | public ComponentName getCallingActivity(IBinder token) |
| 3341 | throws RemoteException { |
| 3342 | Parcel data = Parcel.obtain(); |
| 3343 | Parcel reply = Parcel.obtain(); |
| 3344 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3345 | data.writeStrongBinder(token); |
| 3346 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3347 | reply.readException(); |
| 3348 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3349 | data.recycle(); |
| 3350 | reply.recycle(); |
| 3351 | return res; |
| 3352 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3353 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3354 | Parcel data = Parcel.obtain(); |
| 3355 | Parcel reply = Parcel.obtain(); |
| 3356 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3357 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3358 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3359 | reply.readException(); |
| 3360 | ArrayList<IAppTask> list = null; |
| 3361 | int N = reply.readInt(); |
| 3362 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3363 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3364 | while (N > 0) { |
| 3365 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3366 | list.add(task); |
| 3367 | N--; |
| 3368 | } |
| 3369 | } |
| 3370 | data.recycle(); |
| 3371 | reply.recycle(); |
| 3372 | return list; |
| 3373 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3374 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3375 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3376 | Parcel data = Parcel.obtain(); |
| 3377 | Parcel reply = Parcel.obtain(); |
| 3378 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3379 | data.writeStrongBinder(activityToken); |
| 3380 | intent.writeToParcel(data, 0); |
| 3381 | description.writeToParcel(data, 0); |
| 3382 | thumbnail.writeToParcel(data, 0); |
| 3383 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3384 | reply.readException(); |
| 3385 | int res = reply.readInt(); |
| 3386 | data.recycle(); |
| 3387 | reply.recycle(); |
| 3388 | return res; |
| 3389 | } |
| 3390 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3391 | Parcel data = Parcel.obtain(); |
| 3392 | Parcel reply = Parcel.obtain(); |
| 3393 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3394 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3395 | reply.readException(); |
| 3396 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3397 | data.recycle(); |
| 3398 | reply.recycle(); |
| 3399 | return size; |
| 3400 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3401 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3402 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3403 | Parcel data = Parcel.obtain(); |
| 3404 | Parcel reply = Parcel.obtain(); |
| 3405 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3406 | data.writeInt(maxNum); |
| 3407 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3408 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3409 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3410 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3411 | int N = reply.readInt(); |
| 3412 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3413 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3414 | while (N > 0) { |
| 3415 | ActivityManager.RunningTaskInfo info = |
| 3416 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3417 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3418 | list.add(info); |
| 3419 | N--; |
| 3420 | } |
| 3421 | } |
| 3422 | data.recycle(); |
| 3423 | reply.recycle(); |
| 3424 | return list; |
| 3425 | } |
| 3426 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3427 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3428 | Parcel data = Parcel.obtain(); |
| 3429 | Parcel reply = Parcel.obtain(); |
| 3430 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3431 | data.writeInt(maxNum); |
| 3432 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3433 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3434 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3435 | reply.readException(); |
| 3436 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3437 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3438 | data.recycle(); |
| 3439 | reply.recycle(); |
| 3440 | return list; |
| 3441 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3442 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3443 | Parcel data = Parcel.obtain(); |
| 3444 | Parcel reply = Parcel.obtain(); |
| 3445 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3446 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3447 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3448 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3449 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3450 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3451 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3452 | } |
| 3453 | data.recycle(); |
| 3454 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3455 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3456 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3457 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3458 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3459 | Parcel data = Parcel.obtain(); |
| 3460 | Parcel reply = Parcel.obtain(); |
| 3461 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3462 | data.writeInt(maxNum); |
| 3463 | data.writeInt(flags); |
| 3464 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3465 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3466 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3467 | int N = reply.readInt(); |
| 3468 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3469 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3470 | while (N > 0) { |
| 3471 | ActivityManager.RunningServiceInfo info = |
| 3472 | ActivityManager.RunningServiceInfo.CREATOR |
| 3473 | .createFromParcel(reply); |
| 3474 | list.add(info); |
| 3475 | N--; |
| 3476 | } |
| 3477 | } |
| 3478 | data.recycle(); |
| 3479 | reply.recycle(); |
| 3480 | return list; |
| 3481 | } |
| 3482 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3483 | throws RemoteException { |
| 3484 | Parcel data = Parcel.obtain(); |
| 3485 | Parcel reply = Parcel.obtain(); |
| 3486 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3487 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3488 | reply.readException(); |
| 3489 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3490 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3491 | data.recycle(); |
| 3492 | reply.recycle(); |
| 3493 | return list; |
| 3494 | } |
| 3495 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3496 | throws RemoteException { |
| 3497 | Parcel data = Parcel.obtain(); |
| 3498 | Parcel reply = Parcel.obtain(); |
| 3499 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3500 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3501 | reply.readException(); |
| 3502 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3503 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3504 | data.recycle(); |
| 3505 | reply.recycle(); |
| 3506 | return list; |
| 3507 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3508 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3509 | throws RemoteException { |
| 3510 | Parcel data = Parcel.obtain(); |
| 3511 | Parcel reply = Parcel.obtain(); |
| 3512 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3513 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3514 | reply.readException(); |
| 3515 | ArrayList<ApplicationInfo> list |
| 3516 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3517 | data.recycle(); |
| 3518 | reply.recycle(); |
| 3519 | return list; |
| 3520 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3521 | 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] | 3522 | { |
| 3523 | Parcel data = Parcel.obtain(); |
| 3524 | Parcel reply = Parcel.obtain(); |
| 3525 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3526 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3527 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3528 | if (options != null) { |
| 3529 | data.writeInt(1); |
| 3530 | options.writeToParcel(data, 0); |
| 3531 | } else { |
| 3532 | data.writeInt(0); |
| 3533 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3534 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3535 | reply.readException(); |
| 3536 | data.recycle(); |
| 3537 | reply.recycle(); |
| 3538 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3539 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3540 | throws RemoteException { |
| 3541 | Parcel data = Parcel.obtain(); |
| 3542 | Parcel reply = Parcel.obtain(); |
| 3543 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3544 | data.writeStrongBinder(token); |
| 3545 | data.writeInt(nonRoot ? 1 : 0); |
| 3546 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3547 | reply.readException(); |
| 3548 | boolean res = reply.readInt() != 0; |
| 3549 | data.recycle(); |
| 3550 | reply.recycle(); |
| 3551 | return res; |
| 3552 | } |
| 3553 | public void moveTaskBackwards(int task) throws RemoteException |
| 3554 | { |
| 3555 | Parcel data = Parcel.obtain(); |
| 3556 | Parcel reply = Parcel.obtain(); |
| 3557 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3558 | data.writeInt(task); |
| 3559 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3560 | reply.readException(); |
| 3561 | data.recycle(); |
| 3562 | reply.recycle(); |
| 3563 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3564 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3565 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3566 | { |
| 3567 | Parcel data = Parcel.obtain(); |
| 3568 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3569 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3570 | data.writeInt(taskId); |
| 3571 | data.writeInt(stackId); |
| 3572 | data.writeInt(toTop ? 1 : 0); |
| 3573 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3574 | reply.readException(); |
| 3575 | data.recycle(); |
| 3576 | reply.recycle(); |
| 3577 | } |
| 3578 | @Override |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3579 | public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop) |
| 3580 | throws RemoteException |
| 3581 | { |
| 3582 | Parcel data = Parcel.obtain(); |
| 3583 | Parcel reply = Parcel.obtain(); |
| 3584 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3585 | data.writeInt(taskId); |
| 3586 | data.writeInt(createMode); |
| 3587 | data.writeInt(toTop ? 1 : 0); |
| 3588 | mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3589 | reply.readException(); |
| 3590 | data.recycle(); |
| 3591 | reply.recycle(); |
| 3592 | } |
| 3593 | @Override |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3594 | public boolean moveTopActivityToPinnedStack(int stackId, Rect r) |
| 3595 | throws RemoteException |
| 3596 | { |
| 3597 | Parcel data = Parcel.obtain(); |
| 3598 | Parcel reply = Parcel.obtain(); |
| 3599 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3600 | data.writeInt(stackId); |
| 3601 | r.writeToParcel(data, 0); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 3602 | mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3603 | reply.readException(); |
| 3604 | final boolean res = reply.readInt() != 0; |
| 3605 | data.recycle(); |
| 3606 | reply.recycle(); |
| 3607 | return res; |
| 3608 | } |
| 3609 | @Override |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3610 | public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode) |
| 3611 | throws RemoteException |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3612 | { |
| 3613 | Parcel data = Parcel.obtain(); |
| 3614 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3615 | data.writeInterfaceToken(IActivityManager.descriptor); |
Wale Ogunwale | b34a7ad | 2015-08-14 11:05:30 -0700 | [diff] [blame] | 3616 | data.writeInt(stackId); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 3617 | if (r != null) { |
| 3618 | data.writeInt(1); |
| 3619 | r.writeToParcel(data, 0); |
| 3620 | } else { |
| 3621 | data.writeInt(0); |
| 3622 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3623 | data.writeInt(allowResizeInDockedMode ? 1 : 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3624 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3625 | reply.readException(); |
| 3626 | data.recycle(); |
| 3627 | reply.recycle(); |
| 3628 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3629 | @Override |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 3630 | public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException |
| 3631 | { |
| 3632 | Parcel data = Parcel.obtain(); |
| 3633 | Parcel reply = Parcel.obtain(); |
| 3634 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3635 | data.writeInt(taskId); |
| 3636 | data.writeInt(stackId); |
| 3637 | data.writeInt(position); |
| 3638 | mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0); |
| 3639 | reply.readException(); |
| 3640 | data.recycle(); |
| 3641 | reply.recycle(); |
| 3642 | } |
| 3643 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3644 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3645 | { |
| 3646 | Parcel data = Parcel.obtain(); |
| 3647 | Parcel reply = Parcel.obtain(); |
| 3648 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3649 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3650 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3651 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3652 | data.recycle(); |
| 3653 | reply.recycle(); |
| 3654 | return list; |
| 3655 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3656 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3657 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3658 | { |
| 3659 | Parcel data = Parcel.obtain(); |
| 3660 | Parcel reply = Parcel.obtain(); |
| 3661 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3662 | data.writeInt(stackId); |
| 3663 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3664 | reply.readException(); |
| 3665 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3666 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3667 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3668 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 3669 | } |
| 3670 | data.recycle(); |
| 3671 | reply.recycle(); |
| 3672 | return info; |
| 3673 | } |
| 3674 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 3675 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 3676 | Parcel data = Parcel.obtain(); |
| 3677 | Parcel reply = Parcel.obtain(); |
| 3678 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3679 | data.writeInt(taskId); |
| 3680 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 3681 | reply.readException(); |
| 3682 | boolean isInHomeStack = reply.readInt() > 0; |
| 3683 | data.recycle(); |
| 3684 | reply.recycle(); |
| 3685 | return isInHomeStack; |
| 3686 | } |
| 3687 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3688 | public void setFocusedStack(int stackId) throws RemoteException |
| 3689 | { |
| 3690 | Parcel data = Parcel.obtain(); |
| 3691 | Parcel reply = Parcel.obtain(); |
| 3692 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3693 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3694 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 3695 | reply.readException(); |
| 3696 | data.recycle(); |
| 3697 | reply.recycle(); |
| 3698 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3699 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 3700 | public int getFocusedStackId() throws RemoteException { |
| 3701 | Parcel data = Parcel.obtain(); |
| 3702 | Parcel reply = Parcel.obtain(); |
| 3703 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3704 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 3705 | reply.readException(); |
| 3706 | int focusedStackId = reply.readInt(); |
| 3707 | data.recycle(); |
| 3708 | reply.recycle(); |
| 3709 | return focusedStackId; |
| 3710 | } |
| 3711 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 3712 | public void setFocusedTask(int taskId) throws RemoteException |
| 3713 | { |
| 3714 | Parcel data = Parcel.obtain(); |
| 3715 | Parcel reply = Parcel.obtain(); |
| 3716 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3717 | data.writeInt(taskId); |
| 3718 | mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0); |
| 3719 | reply.readException(); |
| 3720 | data.recycle(); |
| 3721 | reply.recycle(); |
| 3722 | } |
| 3723 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3724 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 3725 | { |
| 3726 | Parcel data = Parcel.obtain(); |
| 3727 | Parcel reply = Parcel.obtain(); |
| 3728 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3729 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3730 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 3731 | reply.readException(); |
| 3732 | data.recycle(); |
| 3733 | reply.recycle(); |
| 3734 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3735 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 3736 | { |
| 3737 | Parcel data = Parcel.obtain(); |
| 3738 | Parcel reply = Parcel.obtain(); |
| 3739 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3740 | data.writeStrongBinder(token); |
| 3741 | data.writeInt(onlyRoot ? 1 : 0); |
| 3742 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3743 | reply.readException(); |
| 3744 | int res = reply.readInt(); |
| 3745 | data.recycle(); |
| 3746 | reply.recycle(); |
| 3747 | return res; |
| 3748 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3749 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3750 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3751 | Parcel data = Parcel.obtain(); |
| 3752 | Parcel reply = Parcel.obtain(); |
| 3753 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3754 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3755 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3756 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3757 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3758 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3759 | reply.readException(); |
| 3760 | int res = reply.readInt(); |
| 3761 | ContentProviderHolder cph = null; |
| 3762 | if (res != 0) { |
| 3763 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 3764 | } |
| 3765 | data.recycle(); |
| 3766 | reply.recycle(); |
| 3767 | return cph; |
| 3768 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3769 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 3770 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3771 | Parcel data = Parcel.obtain(); |
| 3772 | Parcel reply = Parcel.obtain(); |
| 3773 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3774 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 3775 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3776 | data.writeStrongBinder(token); |
| 3777 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3778 | reply.readException(); |
| 3779 | int res = reply.readInt(); |
| 3780 | ContentProviderHolder cph = null; |
| 3781 | if (res != 0) { |
| 3782 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 3783 | } |
| 3784 | data.recycle(); |
| 3785 | reply.recycle(); |
| 3786 | return cph; |
| 3787 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3788 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3789 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3790 | { |
| 3791 | Parcel data = Parcel.obtain(); |
| 3792 | Parcel reply = Parcel.obtain(); |
| 3793 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3794 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3795 | data.writeTypedList(providers); |
| 3796 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 3797 | reply.readException(); |
| 3798 | data.recycle(); |
| 3799 | reply.recycle(); |
| 3800 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3801 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 3802 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3803 | Parcel data = Parcel.obtain(); |
| 3804 | Parcel reply = Parcel.obtain(); |
| 3805 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3806 | data.writeStrongBinder(connection); |
| 3807 | data.writeInt(stable); |
| 3808 | data.writeInt(unstable); |
| 3809 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3810 | reply.readException(); |
| 3811 | boolean res = reply.readInt() != 0; |
| 3812 | data.recycle(); |
| 3813 | reply.recycle(); |
| 3814 | return res; |
| 3815 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3816 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3817 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 3818 | Parcel data = Parcel.obtain(); |
| 3819 | Parcel reply = Parcel.obtain(); |
| 3820 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3821 | data.writeStrongBinder(connection); |
| 3822 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 3823 | reply.readException(); |
| 3824 | data.recycle(); |
| 3825 | reply.recycle(); |
| 3826 | } |
| 3827 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 3828 | @Override |
| 3829 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 3830 | Parcel data = Parcel.obtain(); |
| 3831 | Parcel reply = Parcel.obtain(); |
| 3832 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3833 | data.writeStrongBinder(connection); |
| 3834 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 3835 | reply.readException(); |
| 3836 | data.recycle(); |
| 3837 | reply.recycle(); |
| 3838 | } |
| 3839 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 3840 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 3841 | Parcel data = Parcel.obtain(); |
| 3842 | Parcel reply = Parcel.obtain(); |
| 3843 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3844 | data.writeStrongBinder(connection); |
| 3845 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3846 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 3847 | reply.readException(); |
| 3848 | data.recycle(); |
| 3849 | reply.recycle(); |
| 3850 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 3851 | |
| 3852 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 3853 | Parcel data = Parcel.obtain(); |
| 3854 | Parcel reply = Parcel.obtain(); |
| 3855 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3856 | data.writeString(name); |
| 3857 | data.writeStrongBinder(token); |
| 3858 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 3859 | reply.readException(); |
| 3860 | data.recycle(); |
| 3861 | reply.recycle(); |
| 3862 | } |
| 3863 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 3864 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 3865 | throws RemoteException |
| 3866 | { |
| 3867 | Parcel data = Parcel.obtain(); |
| 3868 | Parcel reply = Parcel.obtain(); |
| 3869 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3870 | service.writeToParcel(data, 0); |
| 3871 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 3872 | reply.readException(); |
| 3873 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 3874 | data.recycle(); |
| 3875 | reply.recycle(); |
| 3876 | return res; |
| 3877 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 3878 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3879 | public ComponentName startService(IApplicationThread caller, Intent service, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3880 | String resolvedType, String callingPackage, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3881 | { |
| 3882 | Parcel data = Parcel.obtain(); |
| 3883 | Parcel reply = Parcel.obtain(); |
| 3884 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3885 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3886 | service.writeToParcel(data, 0); |
| 3887 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3888 | data.writeString(callingPackage); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3889 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3890 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 3891 | reply.readException(); |
| 3892 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3893 | data.recycle(); |
| 3894 | reply.recycle(); |
| 3895 | return res; |
| 3896 | } |
| 3897 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3898 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3899 | { |
| 3900 | Parcel data = Parcel.obtain(); |
| 3901 | Parcel reply = Parcel.obtain(); |
| 3902 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3903 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3904 | service.writeToParcel(data, 0); |
| 3905 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3906 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3907 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 3908 | reply.readException(); |
| 3909 | int res = reply.readInt(); |
| 3910 | reply.recycle(); |
| 3911 | data.recycle(); |
| 3912 | return res; |
| 3913 | } |
| 3914 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 3915 | int startId) throws RemoteException { |
| 3916 | Parcel data = Parcel.obtain(); |
| 3917 | Parcel reply = Parcel.obtain(); |
| 3918 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3919 | ComponentName.writeToParcel(className, data); |
| 3920 | data.writeStrongBinder(token); |
| 3921 | data.writeInt(startId); |
| 3922 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 3923 | reply.readException(); |
| 3924 | boolean res = reply.readInt() != 0; |
| 3925 | data.recycle(); |
| 3926 | reply.recycle(); |
| 3927 | return res; |
| 3928 | } |
| 3929 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3930 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3931 | Parcel data = Parcel.obtain(); |
| 3932 | Parcel reply = Parcel.obtain(); |
| 3933 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3934 | ComponentName.writeToParcel(className, data); |
| 3935 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 3936 | data.writeInt(id); |
| 3937 | if (notification != null) { |
| 3938 | data.writeInt(1); |
| 3939 | notification.writeToParcel(data, 0); |
| 3940 | } else { |
| 3941 | data.writeInt(0); |
| 3942 | } |
| 3943 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3944 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3945 | reply.readException(); |
| 3946 | data.recycle(); |
| 3947 | reply.recycle(); |
| 3948 | } |
| 3949 | public int bindService(IApplicationThread caller, IBinder token, |
| 3950 | Intent service, String resolvedType, IServiceConnection connection, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3951 | int flags, String callingPackage, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3952 | Parcel data = Parcel.obtain(); |
| 3953 | Parcel reply = Parcel.obtain(); |
| 3954 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3955 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3956 | data.writeStrongBinder(token); |
| 3957 | service.writeToParcel(data, 0); |
| 3958 | data.writeString(resolvedType); |
| 3959 | data.writeStrongBinder(connection.asBinder()); |
| 3960 | data.writeInt(flags); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 3961 | data.writeString(callingPackage); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 3962 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3963 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 3964 | reply.readException(); |
| 3965 | int res = reply.readInt(); |
| 3966 | data.recycle(); |
| 3967 | reply.recycle(); |
| 3968 | return res; |
| 3969 | } |
| 3970 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 3971 | { |
| 3972 | Parcel data = Parcel.obtain(); |
| 3973 | Parcel reply = Parcel.obtain(); |
| 3974 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3975 | data.writeStrongBinder(connection.asBinder()); |
| 3976 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 3977 | reply.readException(); |
| 3978 | boolean res = reply.readInt() != 0; |
| 3979 | data.recycle(); |
| 3980 | reply.recycle(); |
| 3981 | return res; |
| 3982 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 3983 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3984 | public void publishService(IBinder token, |
| 3985 | Intent intent, IBinder service) throws RemoteException { |
| 3986 | Parcel data = Parcel.obtain(); |
| 3987 | Parcel reply = Parcel.obtain(); |
| 3988 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3989 | data.writeStrongBinder(token); |
| 3990 | intent.writeToParcel(data, 0); |
| 3991 | data.writeStrongBinder(service); |
| 3992 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 3993 | reply.readException(); |
| 3994 | data.recycle(); |
| 3995 | reply.recycle(); |
| 3996 | } |
| 3997 | |
| 3998 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 3999 | throws RemoteException { |
| 4000 | Parcel data = Parcel.obtain(); |
| 4001 | Parcel reply = Parcel.obtain(); |
| 4002 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4003 | data.writeStrongBinder(token); |
| 4004 | intent.writeToParcel(data, 0); |
| 4005 | data.writeInt(doRebind ? 1 : 0); |
| 4006 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 4007 | reply.readException(); |
| 4008 | data.recycle(); |
| 4009 | reply.recycle(); |
| 4010 | } |
| 4011 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4012 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 4013 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4014 | Parcel data = Parcel.obtain(); |
| 4015 | Parcel reply = Parcel.obtain(); |
| 4016 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4017 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4018 | data.writeInt(type); |
| 4019 | data.writeInt(startId); |
| 4020 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4021 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 4022 | reply.readException(); |
| 4023 | data.recycle(); |
| 4024 | reply.recycle(); |
| 4025 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4026 | |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4027 | public IBinder peekService(Intent service, String resolvedType, String callingPackage) |
| 4028 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4029 | Parcel data = Parcel.obtain(); |
| 4030 | Parcel reply = Parcel.obtain(); |
| 4031 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4032 | service.writeToParcel(data, 0); |
| 4033 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4034 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4035 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 4036 | reply.readException(); |
| 4037 | IBinder binder = reply.readStrongBinder(); |
| 4038 | reply.recycle(); |
| 4039 | data.recycle(); |
| 4040 | return binder; |
| 4041 | } |
| 4042 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4043 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 4044 | throws RemoteException { |
| 4045 | Parcel data = Parcel.obtain(); |
| 4046 | Parcel reply = Parcel.obtain(); |
| 4047 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4048 | app.writeToParcel(data, 0); |
| 4049 | data.writeInt(backupRestoreMode); |
| 4050 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4051 | reply.readException(); |
| 4052 | boolean success = reply.readInt() != 0; |
| 4053 | reply.recycle(); |
| 4054 | data.recycle(); |
| 4055 | return success; |
| 4056 | } |
| 4057 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 4058 | public void clearPendingBackup() throws RemoteException { |
| 4059 | Parcel data = Parcel.obtain(); |
| 4060 | Parcel reply = Parcel.obtain(); |
| 4061 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4062 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 4063 | reply.recycle(); |
| 4064 | data.recycle(); |
| 4065 | } |
| 4066 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4067 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 4068 | Parcel data = Parcel.obtain(); |
| 4069 | Parcel reply = Parcel.obtain(); |
| 4070 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4071 | data.writeString(packageName); |
| 4072 | data.writeStrongBinder(agent); |
| 4073 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 4074 | reply.recycle(); |
| 4075 | data.recycle(); |
| 4076 | } |
| 4077 | |
| 4078 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 4079 | Parcel data = Parcel.obtain(); |
| 4080 | Parcel reply = Parcel.obtain(); |
| 4081 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4082 | app.writeToParcel(data, 0); |
| 4083 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4084 | reply.readException(); |
| 4085 | reply.recycle(); |
| 4086 | data.recycle(); |
| 4087 | } |
| 4088 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4089 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4090 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4091 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 4092 | 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 | ComponentName.writeToParcel(className, data); |
| 4097 | data.writeString(profileFile); |
| 4098 | data.writeInt(flags); |
| 4099 | data.writeBundle(arguments); |
| 4100 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4101 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4102 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4103 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4104 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4105 | reply.readException(); |
| 4106 | boolean res = reply.readInt() != 0; |
| 4107 | reply.recycle(); |
| 4108 | data.recycle(); |
| 4109 | return res; |
| 4110 | } |
| 4111 | |
| 4112 | public void finishInstrumentation(IApplicationThread target, |
| 4113 | int resultCode, Bundle results) throws RemoteException { |
| 4114 | Parcel data = Parcel.obtain(); |
| 4115 | Parcel reply = Parcel.obtain(); |
| 4116 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4117 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 4118 | data.writeInt(resultCode); |
| 4119 | data.writeBundle(results); |
| 4120 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4121 | reply.readException(); |
| 4122 | data.recycle(); |
| 4123 | reply.recycle(); |
| 4124 | } |
| 4125 | public Configuration getConfiguration() throws RemoteException |
| 4126 | { |
| 4127 | Parcel data = Parcel.obtain(); |
| 4128 | Parcel reply = Parcel.obtain(); |
| 4129 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4130 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4131 | reply.readException(); |
| 4132 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 4133 | reply.recycle(); |
| 4134 | data.recycle(); |
| 4135 | return res; |
| 4136 | } |
| 4137 | public void updateConfiguration(Configuration values) throws RemoteException |
| 4138 | { |
| 4139 | Parcel data = Parcel.obtain(); |
| 4140 | Parcel reply = Parcel.obtain(); |
| 4141 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4142 | values.writeToParcel(data, 0); |
| 4143 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4144 | reply.readException(); |
| 4145 | data.recycle(); |
| 4146 | reply.recycle(); |
| 4147 | } |
| 4148 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 4149 | throws RemoteException { |
| 4150 | Parcel data = Parcel.obtain(); |
| 4151 | Parcel reply = Parcel.obtain(); |
| 4152 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4153 | data.writeStrongBinder(token); |
| 4154 | data.writeInt(requestedOrientation); |
| 4155 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4156 | reply.readException(); |
| 4157 | data.recycle(); |
| 4158 | reply.recycle(); |
| 4159 | } |
| 4160 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 4161 | Parcel data = Parcel.obtain(); |
| 4162 | Parcel reply = Parcel.obtain(); |
| 4163 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4164 | data.writeStrongBinder(token); |
| 4165 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4166 | reply.readException(); |
| 4167 | int res = reply.readInt(); |
| 4168 | data.recycle(); |
| 4169 | reply.recycle(); |
| 4170 | return res; |
| 4171 | } |
| 4172 | public ComponentName getActivityClassForToken(IBinder token) |
| 4173 | throws RemoteException { |
| 4174 | Parcel data = Parcel.obtain(); |
| 4175 | Parcel reply = Parcel.obtain(); |
| 4176 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4177 | data.writeStrongBinder(token); |
| 4178 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4179 | reply.readException(); |
| 4180 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4181 | data.recycle(); |
| 4182 | reply.recycle(); |
| 4183 | return res; |
| 4184 | } |
| 4185 | public String getPackageForToken(IBinder token) throws RemoteException |
| 4186 | { |
| 4187 | Parcel data = Parcel.obtain(); |
| 4188 | Parcel reply = Parcel.obtain(); |
| 4189 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4190 | data.writeStrongBinder(token); |
| 4191 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4192 | reply.readException(); |
| 4193 | String res = reply.readString(); |
| 4194 | data.recycle(); |
| 4195 | reply.recycle(); |
| 4196 | return res; |
| 4197 | } |
| 4198 | public IIntentSender getIntentSender(int type, |
| 4199 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4200 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4201 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4202 | Parcel data = Parcel.obtain(); |
| 4203 | Parcel reply = Parcel.obtain(); |
| 4204 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4205 | data.writeInt(type); |
| 4206 | data.writeString(packageName); |
| 4207 | data.writeStrongBinder(token); |
| 4208 | data.writeString(resultWho); |
| 4209 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4210 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4211 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4212 | data.writeTypedArray(intents, 0); |
| 4213 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4214 | } else { |
| 4215 | data.writeInt(0); |
| 4216 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4217 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4218 | if (options != null) { |
| 4219 | data.writeInt(1); |
| 4220 | options.writeToParcel(data, 0); |
| 4221 | } else { |
| 4222 | data.writeInt(0); |
| 4223 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4224 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4225 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4226 | reply.readException(); |
| 4227 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4228 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4229 | data.recycle(); |
| 4230 | reply.recycle(); |
| 4231 | return res; |
| 4232 | } |
| 4233 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 4234 | Parcel data = Parcel.obtain(); |
| 4235 | Parcel reply = Parcel.obtain(); |
| 4236 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4237 | data.writeStrongBinder(sender.asBinder()); |
| 4238 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4239 | reply.readException(); |
| 4240 | data.recycle(); |
| 4241 | reply.recycle(); |
| 4242 | } |
| 4243 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 4244 | Parcel data = Parcel.obtain(); |
| 4245 | Parcel reply = Parcel.obtain(); |
| 4246 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4247 | data.writeStrongBinder(sender.asBinder()); |
| 4248 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4249 | reply.readException(); |
| 4250 | String res = reply.readString(); |
| 4251 | data.recycle(); |
| 4252 | reply.recycle(); |
| 4253 | return res; |
| 4254 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 4255 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 4256 | Parcel data = Parcel.obtain(); |
| 4257 | Parcel reply = Parcel.obtain(); |
| 4258 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4259 | data.writeStrongBinder(sender.asBinder()); |
| 4260 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4261 | reply.readException(); |
| 4262 | int res = reply.readInt(); |
| 4263 | data.recycle(); |
| 4264 | reply.recycle(); |
| 4265 | return res; |
| 4266 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4267 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 4268 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 4269 | Parcel data = Parcel.obtain(); |
| 4270 | Parcel reply = Parcel.obtain(); |
| 4271 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4272 | data.writeInt(callingPid); |
| 4273 | data.writeInt(callingUid); |
| 4274 | data.writeInt(userId); |
| 4275 | data.writeInt(allowAll ? 1 : 0); |
| 4276 | data.writeInt(requireFull ? 1 : 0); |
| 4277 | data.writeString(name); |
| 4278 | data.writeString(callerPackage); |
| 4279 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 4280 | reply.readException(); |
| 4281 | int res = reply.readInt(); |
| 4282 | data.recycle(); |
| 4283 | reply.recycle(); |
| 4284 | return res; |
| 4285 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4286 | public void setProcessLimit(int max) throws RemoteException |
| 4287 | { |
| 4288 | Parcel data = Parcel.obtain(); |
| 4289 | Parcel reply = Parcel.obtain(); |
| 4290 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4291 | data.writeInt(max); |
| 4292 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4293 | reply.readException(); |
| 4294 | data.recycle(); |
| 4295 | reply.recycle(); |
| 4296 | } |
| 4297 | public int getProcessLimit() throws RemoteException |
| 4298 | { |
| 4299 | Parcel data = Parcel.obtain(); |
| 4300 | Parcel reply = Parcel.obtain(); |
| 4301 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4302 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4303 | reply.readException(); |
| 4304 | int res = reply.readInt(); |
| 4305 | data.recycle(); |
| 4306 | reply.recycle(); |
| 4307 | return res; |
| 4308 | } |
| 4309 | public void setProcessForeground(IBinder token, int pid, |
| 4310 | boolean isForeground) throws RemoteException { |
| 4311 | Parcel data = Parcel.obtain(); |
| 4312 | Parcel reply = Parcel.obtain(); |
| 4313 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4314 | data.writeStrongBinder(token); |
| 4315 | data.writeInt(pid); |
| 4316 | data.writeInt(isForeground ? 1 : 0); |
| 4317 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4318 | reply.readException(); |
| 4319 | data.recycle(); |
| 4320 | reply.recycle(); |
| 4321 | } |
| 4322 | public int checkPermission(String permission, int pid, int uid) |
| 4323 | throws RemoteException { |
| 4324 | Parcel data = Parcel.obtain(); |
| 4325 | Parcel reply = Parcel.obtain(); |
| 4326 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4327 | data.writeString(permission); |
| 4328 | data.writeInt(pid); |
| 4329 | data.writeInt(uid); |
| 4330 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4331 | reply.readException(); |
| 4332 | int res = reply.readInt(); |
| 4333 | data.recycle(); |
| 4334 | reply.recycle(); |
| 4335 | return res; |
| 4336 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4337 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4338 | throws RemoteException { |
| 4339 | Parcel data = Parcel.obtain(); |
| 4340 | Parcel reply = Parcel.obtain(); |
| 4341 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4342 | data.writeString(permission); |
| 4343 | data.writeInt(pid); |
| 4344 | data.writeInt(uid); |
| 4345 | data.writeStrongBinder(callerToken); |
| 4346 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4347 | reply.readException(); |
| 4348 | int res = reply.readInt(); |
| 4349 | data.recycle(); |
| 4350 | reply.recycle(); |
| 4351 | return res; |
| 4352 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4353 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4354 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4355 | Parcel data = Parcel.obtain(); |
| 4356 | Parcel reply = Parcel.obtain(); |
| 4357 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4358 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4359 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4360 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4361 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4362 | reply.readException(); |
| 4363 | boolean res = reply.readInt() != 0; |
| 4364 | data.recycle(); |
| 4365 | reply.recycle(); |
| 4366 | return res; |
| 4367 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4368 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4369 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4370 | Parcel data = Parcel.obtain(); |
| 4371 | Parcel reply = Parcel.obtain(); |
| 4372 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4373 | uri.writeToParcel(data, 0); |
| 4374 | data.writeInt(pid); |
| 4375 | data.writeInt(uid); |
| 4376 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4377 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4378 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4379 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4380 | reply.readException(); |
| 4381 | int res = reply.readInt(); |
| 4382 | data.recycle(); |
| 4383 | reply.recycle(); |
| 4384 | return res; |
| 4385 | } |
| 4386 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4387 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4388 | Parcel data = Parcel.obtain(); |
| 4389 | Parcel reply = Parcel.obtain(); |
| 4390 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4391 | data.writeStrongBinder(caller.asBinder()); |
| 4392 | data.writeString(targetPkg); |
| 4393 | uri.writeToParcel(data, 0); |
| 4394 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4395 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4396 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4397 | reply.readException(); |
| 4398 | data.recycle(); |
| 4399 | reply.recycle(); |
| 4400 | } |
| 4401 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4402 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4403 | Parcel data = Parcel.obtain(); |
| 4404 | Parcel reply = Parcel.obtain(); |
| 4405 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4406 | data.writeStrongBinder(caller.asBinder()); |
| 4407 | uri.writeToParcel(data, 0); |
| 4408 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4409 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4410 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4411 | reply.readException(); |
| 4412 | data.recycle(); |
| 4413 | reply.recycle(); |
| 4414 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4415 | |
| 4416 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4417 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4418 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4419 | Parcel data = Parcel.obtain(); |
| 4420 | Parcel reply = Parcel.obtain(); |
| 4421 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4422 | uri.writeToParcel(data, 0); |
| 4423 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4424 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4425 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4426 | reply.readException(); |
| 4427 | data.recycle(); |
| 4428 | reply.recycle(); |
| 4429 | } |
| 4430 | |
| 4431 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4432 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4433 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4434 | Parcel data = Parcel.obtain(); |
| 4435 | Parcel reply = Parcel.obtain(); |
| 4436 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4437 | uri.writeToParcel(data, 0); |
| 4438 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4439 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4440 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4441 | reply.readException(); |
| 4442 | data.recycle(); |
| 4443 | reply.recycle(); |
| 4444 | } |
| 4445 | |
| 4446 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4447 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4448 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4449 | Parcel data = Parcel.obtain(); |
| 4450 | Parcel reply = Parcel.obtain(); |
| 4451 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4452 | data.writeString(packageName); |
| 4453 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4454 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4455 | reply.readException(); |
| 4456 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4457 | reply); |
| 4458 | data.recycle(); |
| 4459 | reply.recycle(); |
| 4460 | return perms; |
| 4461 | } |
| 4462 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4463 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4464 | throws RemoteException { |
| 4465 | Parcel data = Parcel.obtain(); |
| 4466 | Parcel reply = Parcel.obtain(); |
| 4467 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4468 | data.writeStrongBinder(who.asBinder()); |
| 4469 | data.writeInt(waiting ? 1 : 0); |
| 4470 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4471 | reply.readException(); |
| 4472 | data.recycle(); |
| 4473 | reply.recycle(); |
| 4474 | } |
| 4475 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4476 | Parcel data = Parcel.obtain(); |
| 4477 | Parcel reply = Parcel.obtain(); |
| 4478 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4479 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4480 | reply.readException(); |
| 4481 | outInfo.readFromParcel(reply); |
| 4482 | data.recycle(); |
| 4483 | reply.recycle(); |
| 4484 | } |
| 4485 | public void unhandledBack() throws RemoteException |
| 4486 | { |
| 4487 | Parcel data = Parcel.obtain(); |
| 4488 | Parcel reply = Parcel.obtain(); |
| 4489 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4490 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4491 | reply.readException(); |
| 4492 | data.recycle(); |
| 4493 | reply.recycle(); |
| 4494 | } |
| 4495 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4496 | { |
| 4497 | Parcel data = Parcel.obtain(); |
| 4498 | Parcel reply = Parcel.obtain(); |
| 4499 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4500 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4501 | reply.readException(); |
| 4502 | ParcelFileDescriptor pfd = null; |
| 4503 | if (reply.readInt() != 0) { |
| 4504 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4505 | } |
| 4506 | data.recycle(); |
| 4507 | reply.recycle(); |
| 4508 | return pfd; |
| 4509 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4510 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4511 | { |
| 4512 | Parcel data = Parcel.obtain(); |
| 4513 | Parcel reply = Parcel.obtain(); |
| 4514 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4515 | data.writeInt(shown ? 1 : 0); |
| 4516 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4517 | reply.readException(); |
| 4518 | data.recycle(); |
| 4519 | reply.recycle(); |
| 4520 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4521 | public void setDebugApp( |
| 4522 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4523 | throws RemoteException |
| 4524 | { |
| 4525 | Parcel data = Parcel.obtain(); |
| 4526 | Parcel reply = Parcel.obtain(); |
| 4527 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4528 | data.writeString(packageName); |
| 4529 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4530 | data.writeInt(persistent ? 1 : 0); |
| 4531 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4532 | reply.readException(); |
| 4533 | data.recycle(); |
| 4534 | reply.recycle(); |
| 4535 | } |
| 4536 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4537 | { |
| 4538 | Parcel data = Parcel.obtain(); |
| 4539 | Parcel reply = Parcel.obtain(); |
| 4540 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4541 | data.writeInt(enabled ? 1 : 0); |
| 4542 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4543 | reply.readException(); |
| 4544 | data.recycle(); |
| 4545 | reply.recycle(); |
| 4546 | } |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4547 | public void setActivityController(IActivityController watcher) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4548 | { |
| 4549 | Parcel data = Parcel.obtain(); |
| 4550 | Parcel reply = Parcel.obtain(); |
| 4551 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4552 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4553 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4554 | reply.readException(); |
| 4555 | data.recycle(); |
| 4556 | reply.recycle(); |
| 4557 | } |
| 4558 | public void enterSafeMode() throws RemoteException { |
| 4559 | Parcel data = Parcel.obtain(); |
| 4560 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4561 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4562 | data.recycle(); |
| 4563 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4564 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4565 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4566 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4567 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4568 | data.writeStrongBinder(sender.asBinder()); |
| 4569 | data.writeInt(sourceUid); |
| 4570 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4571 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4572 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4573 | data.recycle(); |
| 4574 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4575 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 4576 | throws RemoteException { |
| 4577 | Parcel data = Parcel.obtain(); |
| 4578 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4579 | data.writeStrongBinder(sender.asBinder()); |
| 4580 | data.writeInt(sourceUid); |
| 4581 | data.writeString(tag); |
| 4582 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 4583 | data.recycle(); |
| 4584 | } |
| 4585 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 4586 | throws RemoteException { |
| 4587 | Parcel data = Parcel.obtain(); |
| 4588 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4589 | data.writeStrongBinder(sender.asBinder()); |
| 4590 | data.writeInt(sourceUid); |
| 4591 | data.writeString(tag); |
| 4592 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 4593 | data.recycle(); |
| 4594 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4595 | 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] | 4596 | Parcel data = Parcel.obtain(); |
| 4597 | Parcel reply = Parcel.obtain(); |
| 4598 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4599 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4600 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 4601 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 4602 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 4603 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4604 | boolean res = reply.readInt() != 0; |
| 4605 | data.recycle(); |
| 4606 | reply.recycle(); |
| 4607 | return res; |
| 4608 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 4609 | @Override |
| 4610 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 4611 | Parcel data = Parcel.obtain(); |
| 4612 | Parcel reply = Parcel.obtain(); |
| 4613 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4614 | data.writeString(reason); |
| 4615 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4616 | boolean res = reply.readInt() != 0; |
| 4617 | data.recycle(); |
| 4618 | reply.recycle(); |
| 4619 | return res; |
| 4620 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4621 | public boolean testIsSystemReady() |
| 4622 | { |
| 4623 | /* this base class version is never called */ |
| 4624 | return true; |
| 4625 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4626 | public void handleApplicationCrash(IBinder app, |
| 4627 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 4628 | { |
| 4629 | Parcel data = Parcel.obtain(); |
| 4630 | Parcel reply = Parcel.obtain(); |
| 4631 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4632 | data.writeStrongBinder(app); |
| 4633 | crashInfo.writeToParcel(data, 0); |
| 4634 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 4635 | reply.readException(); |
| 4636 | reply.recycle(); |
| 4637 | data.recycle(); |
| 4638 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4639 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4640 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4641 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4642 | { |
| 4643 | Parcel data = Parcel.obtain(); |
| 4644 | Parcel reply = Parcel.obtain(); |
| 4645 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4646 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4647 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 4648 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4649 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4650 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4651 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4652 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4653 | reply.recycle(); |
| 4654 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 4655 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4656 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 4657 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4658 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4659 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4660 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4661 | { |
| 4662 | Parcel data = Parcel.obtain(); |
| 4663 | Parcel reply = Parcel.obtain(); |
| 4664 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4665 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 4666 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 4667 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 4668 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 4669 | reply.readException(); |
| 4670 | reply.recycle(); |
| 4671 | data.recycle(); |
| 4672 | } |
| 4673 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4674 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 4675 | Parcel data = Parcel.obtain(); |
| 4676 | Parcel reply = Parcel.obtain(); |
| 4677 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4678 | data.writeInt(sig); |
| 4679 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 4680 | reply.readException(); |
| 4681 | data.recycle(); |
| 4682 | reply.recycle(); |
| 4683 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4684 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4685 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4686 | Parcel data = Parcel.obtain(); |
| 4687 | Parcel reply = Parcel.obtain(); |
| 4688 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4689 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4690 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4691 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4692 | reply.readException(); |
| 4693 | data.recycle(); |
| 4694 | reply.recycle(); |
| 4695 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 4696 | |
| 4697 | public void killAllBackgroundProcesses() throws RemoteException { |
| 4698 | Parcel data = Parcel.obtain(); |
| 4699 | Parcel reply = Parcel.obtain(); |
| 4700 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4701 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 4702 | reply.readException(); |
| 4703 | data.recycle(); |
| 4704 | reply.recycle(); |
| 4705 | } |
| 4706 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4707 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4708 | Parcel data = Parcel.obtain(); |
| 4709 | Parcel reply = Parcel.obtain(); |
| 4710 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4711 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4712 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 4713 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4714 | reply.readException(); |
| 4715 | data.recycle(); |
| 4716 | reply.recycle(); |
| 4717 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4718 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 4719 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 4720 | throws RemoteException |
| 4721 | { |
| 4722 | Parcel data = Parcel.obtain(); |
| 4723 | Parcel reply = Parcel.obtain(); |
| 4724 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4725 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 4726 | reply.readException(); |
| 4727 | outInfo.readFromParcel(reply); |
| 4728 | reply.recycle(); |
| 4729 | data.recycle(); |
| 4730 | } |
| 4731 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4732 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 4733 | { |
| 4734 | Parcel data = Parcel.obtain(); |
| 4735 | Parcel reply = Parcel.obtain(); |
| 4736 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4737 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4738 | reply.readException(); |
| 4739 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 4740 | reply.recycle(); |
| 4741 | data.recycle(); |
| 4742 | return res; |
| 4743 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4744 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4745 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4746 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4747 | { |
| 4748 | Parcel data = Parcel.obtain(); |
| 4749 | Parcel reply = Parcel.obtain(); |
| 4750 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4751 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 4752 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4753 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 4754 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4755 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 4756 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4757 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 4758 | } else { |
| 4759 | data.writeInt(0); |
| 4760 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 4761 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 4762 | reply.readException(); |
| 4763 | boolean res = reply.readInt() != 0; |
| 4764 | reply.recycle(); |
| 4765 | data.recycle(); |
| 4766 | return res; |
| 4767 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 4768 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 4769 | public boolean shutdown(int timeout) throws RemoteException |
| 4770 | { |
| 4771 | Parcel data = Parcel.obtain(); |
| 4772 | Parcel reply = Parcel.obtain(); |
| 4773 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4774 | data.writeInt(timeout); |
| 4775 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 4776 | reply.readException(); |
| 4777 | boolean res = reply.readInt() != 0; |
| 4778 | reply.recycle(); |
| 4779 | data.recycle(); |
| 4780 | return res; |
| 4781 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4782 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 4783 | public void stopAppSwitches() throws RemoteException { |
| 4784 | Parcel data = Parcel.obtain(); |
| 4785 | Parcel reply = Parcel.obtain(); |
| 4786 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4787 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 4788 | reply.readException(); |
| 4789 | reply.recycle(); |
| 4790 | data.recycle(); |
| 4791 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4792 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 4793 | public void resumeAppSwitches() throws RemoteException { |
| 4794 | Parcel data = Parcel.obtain(); |
| 4795 | Parcel reply = Parcel.obtain(); |
| 4796 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4797 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 4798 | reply.readException(); |
| 4799 | reply.recycle(); |
| 4800 | data.recycle(); |
| 4801 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 4802 | |
| 4803 | public void addPackageDependency(String packageName) throws RemoteException { |
| 4804 | Parcel data = Parcel.obtain(); |
| 4805 | Parcel reply = Parcel.obtain(); |
| 4806 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4807 | data.writeString(packageName); |
| 4808 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 4809 | reply.readException(); |
| 4810 | data.recycle(); |
| 4811 | reply.recycle(); |
| 4812 | } |
| 4813 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 4814 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 4815 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 4816 | Parcel data = Parcel.obtain(); |
| 4817 | Parcel reply = Parcel.obtain(); |
| 4818 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4819 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4820 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 4821 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4822 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 4823 | reply.readException(); |
| 4824 | data.recycle(); |
| 4825 | reply.recycle(); |
| 4826 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4827 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 4828 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 4829 | Parcel data = Parcel.obtain(); |
| 4830 | Parcel reply = Parcel.obtain(); |
| 4831 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4832 | data.writeString(reason); |
| 4833 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 4834 | reply.readException(); |
| 4835 | data.recycle(); |
| 4836 | reply.recycle(); |
| 4837 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4838 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4839 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4840 | throws RemoteException { |
| 4841 | Parcel data = Parcel.obtain(); |
| 4842 | Parcel reply = Parcel.obtain(); |
| 4843 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4844 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4845 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4846 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4847 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4848 | data.recycle(); |
| 4849 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 4850 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 4851 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 4852 | |
| 4853 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 4854 | Parcel data = Parcel.obtain(); |
| 4855 | Parcel reply = Parcel.obtain(); |
| 4856 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4857 | data.writeString(processName); |
| 4858 | data.writeInt(uid); |
| 4859 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 4860 | reply.readException(); |
| 4861 | data.recycle(); |
| 4862 | reply.recycle(); |
| 4863 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4864 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 4865 | public void overridePendingTransition(IBinder token, String packageName, |
| 4866 | int enterAnim, int exitAnim) throws RemoteException { |
| 4867 | Parcel data = Parcel.obtain(); |
| 4868 | Parcel reply = Parcel.obtain(); |
| 4869 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4870 | data.writeStrongBinder(token); |
| 4871 | data.writeString(packageName); |
| 4872 | data.writeInt(enterAnim); |
| 4873 | data.writeInt(exitAnim); |
| 4874 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 4875 | reply.readException(); |
| 4876 | data.recycle(); |
| 4877 | reply.recycle(); |
| 4878 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4879 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 4880 | public boolean isUserAMonkey() throws RemoteException { |
| 4881 | Parcel data = Parcel.obtain(); |
| 4882 | Parcel reply = Parcel.obtain(); |
| 4883 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4884 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 4885 | reply.readException(); |
| 4886 | boolean res = reply.readInt() != 0; |
| 4887 | data.recycle(); |
| 4888 | reply.recycle(); |
| 4889 | return res; |
| 4890 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 4891 | |
| 4892 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 4893 | Parcel data = Parcel.obtain(); |
| 4894 | Parcel reply = Parcel.obtain(); |
| 4895 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4896 | data.writeInt(monkey ? 1 : 0); |
| 4897 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 4898 | reply.readException(); |
| 4899 | data.recycle(); |
| 4900 | reply.recycle(); |
| 4901 | } |
| 4902 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 4903 | public void finishHeavyWeightApp() throws RemoteException { |
| 4904 | Parcel data = Parcel.obtain(); |
| 4905 | Parcel reply = Parcel.obtain(); |
| 4906 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4907 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 4908 | reply.readException(); |
| 4909 | data.recycle(); |
| 4910 | reply.recycle(); |
| 4911 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4912 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4913 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4914 | throws RemoteException { |
| 4915 | Parcel data = Parcel.obtain(); |
| 4916 | Parcel reply = Parcel.obtain(); |
| 4917 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4918 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4919 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 4920 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4921 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4922 | data.recycle(); |
| 4923 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4924 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4925 | } |
| 4926 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4927 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4928 | throws RemoteException { |
| 4929 | Parcel data = Parcel.obtain(); |
| 4930 | Parcel reply = Parcel.obtain(); |
| 4931 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4932 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4933 | if (options == null) { |
| 4934 | data.writeInt(0); |
| 4935 | } else { |
| 4936 | data.writeInt(1); |
| 4937 | data.writeBundle(options.toBundle()); |
| 4938 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 4939 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4940 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4941 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4942 | data.recycle(); |
| 4943 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 4944 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 4945 | } |
| 4946 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4947 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 4948 | Parcel data = Parcel.obtain(); |
| 4949 | Parcel reply = Parcel.obtain(); |
| 4950 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4951 | data.writeStrongBinder(token); |
| 4952 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 4953 | reply.readException(); |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 4954 | ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle()); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 4955 | data.recycle(); |
| 4956 | reply.recycle(); |
| 4957 | return options; |
| 4958 | } |
| 4959 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4960 | public void setImmersive(IBinder token, boolean immersive) |
| 4961 | throws RemoteException { |
| 4962 | Parcel data = Parcel.obtain(); |
| 4963 | Parcel reply = Parcel.obtain(); |
| 4964 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4965 | data.writeStrongBinder(token); |
| 4966 | data.writeInt(immersive ? 1 : 0); |
| 4967 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 4968 | reply.readException(); |
| 4969 | data.recycle(); |
| 4970 | reply.recycle(); |
| 4971 | } |
| 4972 | |
| 4973 | public boolean isImmersive(IBinder token) |
| 4974 | throws RemoteException { |
| 4975 | Parcel data = Parcel.obtain(); |
| 4976 | Parcel reply = Parcel.obtain(); |
| 4977 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4978 | data.writeStrongBinder(token); |
| 4979 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4980 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 4981 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 4982 | data.recycle(); |
| 4983 | reply.recycle(); |
| 4984 | return res; |
| 4985 | } |
| 4986 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 4987 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 4988 | Parcel data = Parcel.obtain(); |
| 4989 | Parcel reply = Parcel.obtain(); |
| 4990 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4991 | data.writeStrongBinder(token); |
| 4992 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 4993 | reply.readException(); |
| 4994 | boolean res = reply.readInt() == 1; |
| 4995 | data.recycle(); |
| 4996 | reply.recycle(); |
| 4997 | return res; |
| 4998 | } |
| 4999 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5000 | public boolean isTopActivityImmersive() |
| 5001 | throws RemoteException { |
| 5002 | Parcel data = Parcel.obtain(); |
| 5003 | Parcel reply = Parcel.obtain(); |
| 5004 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5005 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5006 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5007 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5008 | data.recycle(); |
| 5009 | reply.recycle(); |
| 5010 | return res; |
| 5011 | } |
| 5012 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 5013 | public void crashApplication(int uid, int initialPid, String packageName, |
| 5014 | String message) throws RemoteException { |
| 5015 | Parcel data = Parcel.obtain(); |
| 5016 | Parcel reply = Parcel.obtain(); |
| 5017 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5018 | data.writeInt(uid); |
| 5019 | data.writeInt(initialPid); |
| 5020 | data.writeString(packageName); |
| 5021 | data.writeString(message); |
| 5022 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 5023 | reply.readException(); |
| 5024 | data.recycle(); |
| 5025 | reply.recycle(); |
| 5026 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5027 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5028 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5029 | Parcel data = Parcel.obtain(); |
| 5030 | Parcel reply = Parcel.obtain(); |
| 5031 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5032 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5033 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5034 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 5035 | reply.readException(); |
| 5036 | String res = reply.readString(); |
| 5037 | data.recycle(); |
| 5038 | reply.recycle(); |
| 5039 | return res; |
| 5040 | } |
| 5041 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5042 | public IBinder newUriPermissionOwner(String name) |
| 5043 | throws RemoteException { |
| 5044 | Parcel data = Parcel.obtain(); |
| 5045 | Parcel reply = Parcel.obtain(); |
| 5046 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5047 | data.writeString(name); |
| 5048 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 5049 | reply.readException(); |
| 5050 | IBinder res = reply.readStrongBinder(); |
| 5051 | data.recycle(); |
| 5052 | reply.recycle(); |
| 5053 | return res; |
| 5054 | } |
| 5055 | |
| 5056 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5057 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5058 | Parcel data = Parcel.obtain(); |
| 5059 | Parcel reply = Parcel.obtain(); |
| 5060 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5061 | data.writeStrongBinder(owner); |
| 5062 | data.writeInt(fromUid); |
| 5063 | data.writeString(targetPkg); |
| 5064 | uri.writeToParcel(data, 0); |
| 5065 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5066 | data.writeInt(sourceUserId); |
| 5067 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5068 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5069 | reply.readException(); |
| 5070 | data.recycle(); |
| 5071 | reply.recycle(); |
| 5072 | } |
| 5073 | |
| 5074 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5075 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5076 | Parcel data = Parcel.obtain(); |
| 5077 | Parcel reply = Parcel.obtain(); |
| 5078 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5079 | data.writeStrongBinder(owner); |
| 5080 | if (uri != null) { |
| 5081 | data.writeInt(1); |
| 5082 | uri.writeToParcel(data, 0); |
| 5083 | } else { |
| 5084 | data.writeInt(0); |
| 5085 | } |
| 5086 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5087 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5088 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5089 | reply.readException(); |
| 5090 | data.recycle(); |
| 5091 | reply.recycle(); |
| 5092 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 5093 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5094 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5095 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5096 | Parcel data = Parcel.obtain(); |
| 5097 | Parcel reply = Parcel.obtain(); |
| 5098 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5099 | data.writeInt(callingUid); |
| 5100 | data.writeString(targetPkg); |
| 5101 | uri.writeToParcel(data, 0); |
| 5102 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5103 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5104 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5105 | reply.readException(); |
| 5106 | int res = reply.readInt(); |
| 5107 | data.recycle(); |
| 5108 | reply.recycle(); |
| 5109 | return res; |
| 5110 | } |
| 5111 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5112 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5113 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 5114 | Parcel data = Parcel.obtain(); |
| 5115 | Parcel reply = Parcel.obtain(); |
| 5116 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5117 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5118 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5119 | data.writeInt(managed ? 1 : 0); |
| 5120 | data.writeString(path); |
| 5121 | if (fd != null) { |
| 5122 | data.writeInt(1); |
| 5123 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5124 | } else { |
| 5125 | data.writeInt(0); |
| 5126 | } |
| 5127 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 5128 | reply.readException(); |
| 5129 | boolean res = reply.readInt() != 0; |
| 5130 | reply.recycle(); |
| 5131 | data.recycle(); |
| 5132 | return res; |
| 5133 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5134 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5135 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5136 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5137 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5138 | Parcel data = Parcel.obtain(); |
| 5139 | Parcel reply = Parcel.obtain(); |
| 5140 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5141 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5142 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5143 | data.writeTypedArray(intents, 0); |
| 5144 | data.writeStringArray(resolvedTypes); |
| 5145 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5146 | if (options != null) { |
| 5147 | data.writeInt(1); |
| 5148 | options.writeToParcel(data, 0); |
| 5149 | } else { |
| 5150 | data.writeInt(0); |
| 5151 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5152 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5153 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 5154 | reply.readException(); |
| 5155 | int result = reply.readInt(); |
| 5156 | reply.recycle(); |
| 5157 | data.recycle(); |
| 5158 | return result; |
| 5159 | } |
| 5160 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5161 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 5162 | Parcel data = Parcel.obtain(); |
| 5163 | Parcel reply = Parcel.obtain(); |
| 5164 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5165 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5166 | reply.readException(); |
| 5167 | int mode = reply.readInt(); |
| 5168 | reply.recycle(); |
| 5169 | data.recycle(); |
| 5170 | return mode; |
| 5171 | } |
| 5172 | |
| 5173 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 5174 | Parcel data = Parcel.obtain(); |
| 5175 | Parcel reply = Parcel.obtain(); |
| 5176 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5177 | data.writeInt(mode); |
| 5178 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5179 | reply.readException(); |
| 5180 | reply.recycle(); |
| 5181 | data.recycle(); |
| 5182 | } |
| 5183 | |
| 5184 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 5185 | Parcel data = Parcel.obtain(); |
| 5186 | Parcel reply = Parcel.obtain(); |
| 5187 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5188 | data.writeString(packageName); |
| 5189 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5190 | reply.readException(); |
| 5191 | int mode = reply.readInt(); |
| 5192 | reply.recycle(); |
| 5193 | data.recycle(); |
| 5194 | return mode; |
| 5195 | } |
| 5196 | |
| 5197 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5198 | throws RemoteException { |
| 5199 | Parcel data = Parcel.obtain(); |
| 5200 | Parcel reply = Parcel.obtain(); |
| 5201 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5202 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5203 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5204 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5205 | reply.readException(); |
| 5206 | reply.recycle(); |
| 5207 | data.recycle(); |
| 5208 | } |
| 5209 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5210 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 5211 | Parcel data = Parcel.obtain(); |
| 5212 | Parcel reply = Parcel.obtain(); |
| 5213 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5214 | data.writeString(packageName); |
| 5215 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5216 | reply.readException(); |
| 5217 | boolean ask = reply.readInt() != 0; |
| 5218 | reply.recycle(); |
| 5219 | data.recycle(); |
| 5220 | return ask; |
| 5221 | } |
| 5222 | |
| 5223 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 5224 | throws RemoteException { |
| 5225 | Parcel data = Parcel.obtain(); |
| 5226 | Parcel reply = Parcel.obtain(); |
| 5227 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5228 | data.writeString(packageName); |
| 5229 | data.writeInt(ask ? 1 : 0); |
| 5230 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5231 | reply.readException(); |
| 5232 | reply.recycle(); |
| 5233 | data.recycle(); |
| 5234 | } |
| 5235 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5236 | public boolean switchUser(int userid) throws RemoteException { |
| 5237 | Parcel data = Parcel.obtain(); |
| 5238 | Parcel reply = Parcel.obtain(); |
| 5239 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5240 | data.writeInt(userid); |
| 5241 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 5242 | reply.readException(); |
| 5243 | boolean result = reply.readInt() != 0; |
| 5244 | reply.recycle(); |
| 5245 | data.recycle(); |
| 5246 | return result; |
| 5247 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5248 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 5249 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 5250 | Parcel data = Parcel.obtain(); |
| 5251 | Parcel reply = Parcel.obtain(); |
| 5252 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5253 | data.writeInt(userid); |
| 5254 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 5255 | reply.readException(); |
| 5256 | boolean result = reply.readInt() != 0; |
| 5257 | reply.recycle(); |
| 5258 | data.recycle(); |
| 5259 | return result; |
| 5260 | } |
| 5261 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame^] | 5262 | public boolean unlockUser(int userId, byte[] token) throws RemoteException { |
| 5263 | Parcel data = Parcel.obtain(); |
| 5264 | Parcel reply = Parcel.obtain(); |
| 5265 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5266 | data.writeInt(userId); |
| 5267 | data.writeByteArray(token); |
| 5268 | mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0); |
| 5269 | reply.readException(); |
| 5270 | boolean result = reply.readInt() != 0; |
| 5271 | reply.recycle(); |
| 5272 | data.recycle(); |
| 5273 | return result; |
| 5274 | } |
| 5275 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5276 | public int stopUser(int userid, IStopUserCallback callback) throws RemoteException { |
| 5277 | Parcel data = Parcel.obtain(); |
| 5278 | Parcel reply = Parcel.obtain(); |
| 5279 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5280 | data.writeInt(userid); |
| 5281 | data.writeStrongInterface(callback); |
| 5282 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 5283 | reply.readException(); |
| 5284 | int result = reply.readInt(); |
| 5285 | reply.recycle(); |
| 5286 | data.recycle(); |
| 5287 | return result; |
| 5288 | } |
| 5289 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5290 | public UserInfo getCurrentUser() throws RemoteException { |
| 5291 | Parcel data = Parcel.obtain(); |
| 5292 | Parcel reply = Parcel.obtain(); |
| 5293 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5294 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5295 | reply.readException(); |
| 5296 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 5297 | reply.recycle(); |
| 5298 | data.recycle(); |
| 5299 | return userInfo; |
| 5300 | } |
| 5301 | |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5302 | public boolean isUserRunning(int userid, int flags) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5303 | Parcel data = Parcel.obtain(); |
| 5304 | Parcel reply = Parcel.obtain(); |
| 5305 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5306 | data.writeInt(userid); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5307 | data.writeInt(flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5308 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5309 | reply.readException(); |
| 5310 | boolean result = reply.readInt() != 0; |
| 5311 | reply.recycle(); |
| 5312 | data.recycle(); |
| 5313 | return result; |
| 5314 | } |
| 5315 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5316 | public int[] getRunningUserIds() throws RemoteException { |
| 5317 | Parcel data = Parcel.obtain(); |
| 5318 | Parcel reply = Parcel.obtain(); |
| 5319 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5320 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5321 | reply.readException(); |
| 5322 | int[] result = reply.createIntArray(); |
| 5323 | reply.recycle(); |
| 5324 | data.recycle(); |
| 5325 | return result; |
| 5326 | } |
| 5327 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5328 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5329 | Parcel data = Parcel.obtain(); |
| 5330 | Parcel reply = Parcel.obtain(); |
| 5331 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5332 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5333 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5334 | reply.readException(); |
| 5335 | boolean result = reply.readInt() != 0; |
| 5336 | reply.recycle(); |
| 5337 | data.recycle(); |
| 5338 | return result; |
| 5339 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5340 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5341 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5342 | Parcel data = Parcel.obtain(); |
| 5343 | Parcel reply = Parcel.obtain(); |
| 5344 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5345 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5346 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5347 | reply.readException(); |
| 5348 | data.recycle(); |
| 5349 | reply.recycle(); |
| 5350 | } |
| 5351 | |
| 5352 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5353 | Parcel data = Parcel.obtain(); |
| 5354 | Parcel reply = Parcel.obtain(); |
| 5355 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5356 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5357 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5358 | reply.readException(); |
| 5359 | data.recycle(); |
| 5360 | reply.recycle(); |
| 5361 | } |
| 5362 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5363 | public void registerUidObserver(IUidObserver observer, int which) throws RemoteException { |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5364 | Parcel data = Parcel.obtain(); |
| 5365 | Parcel reply = Parcel.obtain(); |
| 5366 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5367 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5368 | data.writeInt(which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5369 | mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5370 | reply.readException(); |
| 5371 | data.recycle(); |
| 5372 | reply.recycle(); |
| 5373 | } |
| 5374 | |
| 5375 | public void unregisterUidObserver(IUidObserver observer) throws RemoteException { |
| 5376 | Parcel data = Parcel.obtain(); |
| 5377 | Parcel reply = Parcel.obtain(); |
| 5378 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5379 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5380 | mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5381 | reply.readException(); |
| 5382 | data.recycle(); |
| 5383 | reply.recycle(); |
| 5384 | } |
| 5385 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5386 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5387 | Parcel data = Parcel.obtain(); |
| 5388 | Parcel reply = Parcel.obtain(); |
| 5389 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5390 | data.writeStrongBinder(sender.asBinder()); |
| 5391 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5392 | reply.readException(); |
| 5393 | boolean res = reply.readInt() != 0; |
| 5394 | data.recycle(); |
| 5395 | reply.recycle(); |
| 5396 | return res; |
| 5397 | } |
| 5398 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5399 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5400 | Parcel data = Parcel.obtain(); |
| 5401 | Parcel reply = Parcel.obtain(); |
| 5402 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5403 | data.writeStrongBinder(sender.asBinder()); |
| 5404 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5405 | reply.readException(); |
| 5406 | boolean res = reply.readInt() != 0; |
| 5407 | data.recycle(); |
| 5408 | reply.recycle(); |
| 5409 | return res; |
| 5410 | } |
| 5411 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5412 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5413 | Parcel data = Parcel.obtain(); |
| 5414 | Parcel reply = Parcel.obtain(); |
| 5415 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5416 | data.writeStrongBinder(sender.asBinder()); |
| 5417 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5418 | reply.readException(); |
| 5419 | Intent res = reply.readInt() != 0 |
| 5420 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5421 | data.recycle(); |
| 5422 | reply.recycle(); |
| 5423 | return res; |
| 5424 | } |
| 5425 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5426 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5427 | throws RemoteException { |
| 5428 | Parcel data = Parcel.obtain(); |
| 5429 | Parcel reply = Parcel.obtain(); |
| 5430 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5431 | data.writeStrongBinder(sender.asBinder()); |
| 5432 | data.writeString(prefix); |
| 5433 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5434 | reply.readException(); |
| 5435 | String res = reply.readString(); |
| 5436 | data.recycle(); |
| 5437 | reply.recycle(); |
| 5438 | return res; |
| 5439 | } |
| 5440 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5441 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5442 | { |
| 5443 | Parcel data = Parcel.obtain(); |
| 5444 | Parcel reply = Parcel.obtain(); |
| 5445 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5446 | values.writeToParcel(data, 0); |
| 5447 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5448 | reply.readException(); |
| 5449 | data.recycle(); |
| 5450 | reply.recycle(); |
| 5451 | } |
| 5452 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 5453 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 5454 | Parcel data = Parcel.obtain(); |
| 5455 | Parcel reply = Parcel.obtain(); |
| 5456 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5457 | data.writeIntArray(pids); |
| 5458 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 5459 | reply.readException(); |
| 5460 | long[] res = reply.createLongArray(); |
| 5461 | data.recycle(); |
| 5462 | reply.recycle(); |
| 5463 | return res; |
| 5464 | } |
| 5465 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5466 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5467 | Parcel data = Parcel.obtain(); |
| 5468 | Parcel reply = Parcel.obtain(); |
| 5469 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5470 | TextUtils.writeToParcel(msg, data, 0); |
| 5471 | data.writeInt(always ? 1 : 0); |
| 5472 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5473 | reply.readException(); |
| 5474 | data.recycle(); |
| 5475 | reply.recycle(); |
| 5476 | } |
| 5477 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5478 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5479 | Parcel data = Parcel.obtain(); |
| 5480 | Parcel reply = Parcel.obtain(); |
| 5481 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5482 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5483 | reply.readException(); |
| 5484 | data.recycle(); |
| 5485 | reply.recycle(); |
| 5486 | } |
| 5487 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5488 | public void keyguardGoingAway(boolean disableWindowAnimations, |
| 5489 | boolean keyguardGoingToNotificationShade) throws RemoteException { |
| 5490 | Parcel data = Parcel.obtain(); |
| 5491 | Parcel reply = Parcel.obtain(); |
| 5492 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5493 | data.writeInt(disableWindowAnimations ? 1 : 0); |
| 5494 | data.writeInt(keyguardGoingToNotificationShade ? 1 : 0); |
| 5495 | mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0); |
| 5496 | reply.readException(); |
| 5497 | data.recycle(); |
| 5498 | reply.recycle(); |
| 5499 | } |
| 5500 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5501 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5502 | throws RemoteException { |
| 5503 | Parcel data = Parcel.obtain(); |
| 5504 | Parcel reply = Parcel.obtain(); |
| 5505 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5506 | data.writeStrongBinder(token); |
| 5507 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5508 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5509 | reply.readException(); |
| 5510 | boolean result = reply.readInt() != 0; |
| 5511 | data.recycle(); |
| 5512 | reply.recycle(); |
| 5513 | return result; |
| 5514 | } |
| 5515 | |
| 5516 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5517 | throws RemoteException { |
| 5518 | Parcel data = Parcel.obtain(); |
| 5519 | Parcel reply = Parcel.obtain(); |
| 5520 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5521 | data.writeStrongBinder(token); |
| 5522 | target.writeToParcel(data, 0); |
| 5523 | data.writeInt(resultCode); |
| 5524 | if (resultData != null) { |
| 5525 | data.writeInt(1); |
| 5526 | resultData.writeToParcel(data, 0); |
| 5527 | } else { |
| 5528 | data.writeInt(0); |
| 5529 | } |
| 5530 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5531 | reply.readException(); |
| 5532 | boolean result = reply.readInt() != 0; |
| 5533 | data.recycle(); |
| 5534 | reply.recycle(); |
| 5535 | return result; |
| 5536 | } |
| 5537 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5538 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5539 | Parcel data = Parcel.obtain(); |
| 5540 | Parcel reply = Parcel.obtain(); |
| 5541 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5542 | data.writeStrongBinder(activityToken); |
| 5543 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5544 | reply.readException(); |
| 5545 | int result = reply.readInt(); |
| 5546 | data.recycle(); |
| 5547 | reply.recycle(); |
| 5548 | return result; |
| 5549 | } |
| 5550 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5551 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 5552 | Parcel data = Parcel.obtain(); |
| 5553 | Parcel reply = Parcel.obtain(); |
| 5554 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5555 | data.writeStrongBinder(activityToken); |
| 5556 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 5557 | reply.readException(); |
| 5558 | String result = reply.readString(); |
| 5559 | data.recycle(); |
| 5560 | reply.recycle(); |
| 5561 | return result; |
| 5562 | } |
| 5563 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 5564 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5565 | Parcel data = Parcel.obtain(); |
| 5566 | Parcel reply = Parcel.obtain(); |
| 5567 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5568 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5569 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5570 | reply.readException(); |
| 5571 | data.recycle(); |
| 5572 | reply.recycle(); |
| 5573 | } |
| 5574 | |
| 5575 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 5576 | Parcel data = Parcel.obtain(); |
| 5577 | Parcel reply = Parcel.obtain(); |
| 5578 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5579 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5580 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 5581 | reply.readException(); |
| 5582 | data.recycle(); |
| 5583 | reply.recycle(); |
| 5584 | } |
| 5585 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 5586 | public void requestBugReport() throws RemoteException { |
| 5587 | Parcel data = Parcel.obtain(); |
| 5588 | Parcel reply = Parcel.obtain(); |
| 5589 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5590 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 5591 | reply.readException(); |
| 5592 | data.recycle(); |
| 5593 | reply.recycle(); |
| 5594 | } |
| 5595 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5596 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 5597 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5598 | Parcel data = Parcel.obtain(); |
| 5599 | Parcel reply = Parcel.obtain(); |
| 5600 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5601 | data.writeInt(pid); |
| 5602 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 5603 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 5604 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 5605 | reply.readException(); |
| 5606 | long res = reply.readInt(); |
| 5607 | data.recycle(); |
| 5608 | reply.recycle(); |
| 5609 | return res; |
| 5610 | } |
| 5611 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5612 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5613 | Parcel data = Parcel.obtain(); |
| 5614 | Parcel reply = Parcel.obtain(); |
| 5615 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5616 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5617 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5618 | reply.readException(); |
| 5619 | Bundle res = reply.readBundle(); |
| 5620 | data.recycle(); |
| 5621 | reply.recycle(); |
| 5622 | return res; |
| 5623 | } |
| 5624 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5625 | public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, |
| 5626 | IBinder activityToken) throws RemoteException { |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5627 | Parcel data = Parcel.obtain(); |
| 5628 | Parcel reply = Parcel.obtain(); |
| 5629 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5630 | data.writeInt(requestType); |
| 5631 | data.writeStrongBinder(receiver.asBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5632 | data.writeStrongBinder(activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5633 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 5634 | reply.readException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5635 | boolean res = reply.readInt() != 0; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5636 | data.recycle(); |
| 5637 | reply.recycle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5638 | return res; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 5639 | } |
| 5640 | |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 5641 | public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 5642 | AssistContent content, Uri referrer) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5643 | Parcel data = Parcel.obtain(); |
| 5644 | Parcel reply = Parcel.obtain(); |
| 5645 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5646 | data.writeStrongBinder(token); |
| 5647 | data.writeBundle(extras); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 5648 | structure.writeToParcel(data, 0); |
| 5649 | content.writeToParcel(data, 0); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 5650 | if (referrer != null) { |
| 5651 | data.writeInt(1); |
| 5652 | referrer.writeToParcel(data, 0); |
| 5653 | } else { |
| 5654 | data.writeInt(0); |
| 5655 | } |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 5656 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 5657 | reply.readException(); |
| 5658 | data.recycle(); |
| 5659 | reply.recycle(); |
| 5660 | } |
| 5661 | |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 5662 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, |
| 5663 | Bundle args) throws RemoteException { |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 5664 | Parcel data = Parcel.obtain(); |
| 5665 | Parcel reply = Parcel.obtain(); |
| 5666 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5667 | intent.writeToParcel(data, 0); |
| 5668 | data.writeInt(requestType); |
| 5669 | data.writeString(hint); |
| 5670 | data.writeInt(userHandle); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 5671 | data.writeBundle(args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 5672 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 5673 | reply.readException(); |
| 5674 | boolean res = reply.readInt() != 0; |
| 5675 | data.recycle(); |
| 5676 | reply.recycle(); |
| 5677 | return res; |
| 5678 | } |
| 5679 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5680 | public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException { |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 5681 | Parcel data = Parcel.obtain(); |
| 5682 | Parcel reply = Parcel.obtain(); |
| 5683 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5684 | mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5685 | reply.readException(); |
| 5686 | boolean res = reply.readInt() != 0; |
| 5687 | data.recycle(); |
| 5688 | reply.recycle(); |
| 5689 | return res; |
| 5690 | } |
| 5691 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 5692 | public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException { |
| 5693 | Parcel data = Parcel.obtain(); |
| 5694 | Parcel reply = Parcel.obtain(); |
| 5695 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5696 | data.writeStrongBinder(token); |
| 5697 | data.writeBundle(args); |
| 5698 | mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5699 | reply.readException(); |
| 5700 | boolean res = reply.readInt() != 0; |
| 5701 | data.recycle(); |
| 5702 | reply.recycle(); |
| 5703 | return res; |
| 5704 | } |
| 5705 | |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 5706 | public void killUid(int appId, int userId, String reason) throws RemoteException { |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5707 | Parcel data = Parcel.obtain(); |
| 5708 | Parcel reply = Parcel.obtain(); |
| 5709 | data.writeInterfaceToken(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 5710 | data.writeInt(appId); |
| 5711 | data.writeInt(userId); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5712 | data.writeString(reason); |
| 5713 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 5714 | reply.readException(); |
| 5715 | data.recycle(); |
| 5716 | reply.recycle(); |
| 5717 | } |
| 5718 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 5719 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 5720 | Parcel data = Parcel.obtain(); |
| 5721 | Parcel reply = Parcel.obtain(); |
| 5722 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5723 | data.writeStrongBinder(who); |
| 5724 | data.writeInt(allowRestart ? 1 : 0); |
| 5725 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 5726 | reply.readException(); |
| 5727 | data.recycle(); |
| 5728 | reply.recycle(); |
| 5729 | } |
| 5730 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 5731 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 5732 | Parcel data = Parcel.obtain(); |
| 5733 | Parcel reply = Parcel.obtain(); |
| 5734 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5735 | data.writeStrongBinder(token); |
| 5736 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 5737 | reply.readException(); |
| 5738 | data.recycle(); |
| 5739 | reply.recycle(); |
| 5740 | } |
| 5741 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5742 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 5743 | Parcel data = Parcel.obtain(); |
| 5744 | Parcel reply = Parcel.obtain(); |
| 5745 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5746 | data.writeStrongBinder(token); |
| 5747 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 5748 | reply.readException(); |
| 5749 | data.recycle(); |
| 5750 | reply.recycle(); |
| 5751 | } |
| 5752 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 5753 | public void restart() throws RemoteException { |
| 5754 | Parcel data = Parcel.obtain(); |
| 5755 | Parcel reply = Parcel.obtain(); |
| 5756 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5757 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 5758 | reply.readException(); |
| 5759 | data.recycle(); |
| 5760 | reply.recycle(); |
| 5761 | } |
| 5762 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 5763 | public void performIdleMaintenance() throws RemoteException { |
| 5764 | Parcel data = Parcel.obtain(); |
| 5765 | Parcel reply = Parcel.obtain(); |
| 5766 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5767 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 5768 | reply.readException(); |
| 5769 | data.recycle(); |
| 5770 | reply.recycle(); |
| 5771 | } |
| 5772 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 5773 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5774 | IActivityContainerCallback callback) throws RemoteException { |
| 5775 | Parcel data = Parcel.obtain(); |
| 5776 | Parcel reply = Parcel.obtain(); |
| 5777 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5778 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 5779 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 5780 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5781 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 5782 | final int result = reply.readInt(); |
| 5783 | final IActivityContainer res; |
| 5784 | if (result == 1) { |
| 5785 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5786 | } else { |
| 5787 | res = null; |
| 5788 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 5789 | data.recycle(); |
| 5790 | reply.recycle(); |
| 5791 | return res; |
| 5792 | } |
| 5793 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 5794 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 5795 | throws RemoteException { |
| 5796 | Parcel data = Parcel.obtain(); |
| 5797 | Parcel reply = Parcel.obtain(); |
| 5798 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5799 | data.writeStrongBinder(activityContainer.asBinder()); |
| 5800 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 5801 | reply.readException(); |
| 5802 | data.recycle(); |
| 5803 | reply.recycle(); |
| 5804 | } |
| 5805 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 5806 | public boolean startBinderTracking() throws RemoteException { |
| 5807 | Parcel data = Parcel.obtain(); |
| 5808 | Parcel reply = Parcel.obtain(); |
| 5809 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5810 | mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0); |
| 5811 | reply.readException(); |
| 5812 | boolean res = reply.readInt() != 0; |
| 5813 | reply.recycle(); |
| 5814 | data.recycle(); |
| 5815 | return res; |
| 5816 | } |
| 5817 | |
| 5818 | public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException { |
| 5819 | Parcel data = Parcel.obtain(); |
| 5820 | Parcel reply = Parcel.obtain(); |
| 5821 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5822 | if (fd != null) { |
| 5823 | data.writeInt(1); |
| 5824 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5825 | } else { |
| 5826 | data.writeInt(0); |
| 5827 | } |
| 5828 | mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0); |
| 5829 | reply.readException(); |
| 5830 | boolean res = reply.readInt() != 0; |
| 5831 | reply.recycle(); |
| 5832 | data.recycle(); |
| 5833 | return res; |
| 5834 | } |
| 5835 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5836 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 5837 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 5838 | Parcel data = Parcel.obtain(); |
| 5839 | Parcel reply = Parcel.obtain(); |
| 5840 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5841 | data.writeInt(displayId); |
| 5842 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 5843 | reply.readException(); |
| 5844 | final int result = reply.readInt(); |
| 5845 | final IActivityContainer res; |
| 5846 | if (result == 1) { |
| 5847 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 5848 | } else { |
| 5849 | res = null; |
| 5850 | } |
| 5851 | data.recycle(); |
| 5852 | reply.recycle(); |
| 5853 | return res; |
| 5854 | } |
| 5855 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5856 | @Override |
| 5857 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5858 | throws RemoteException { |
| 5859 | Parcel data = Parcel.obtain(); |
| 5860 | Parcel reply = Parcel.obtain(); |
| 5861 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5862 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5863 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5864 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5865 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5866 | data.recycle(); |
| 5867 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5868 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 5869 | } |
| 5870 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 5871 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5872 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 5873 | Parcel data = Parcel.obtain(); |
| 5874 | Parcel reply = Parcel.obtain(); |
| 5875 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5876 | data.writeInt(taskId); |
| 5877 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 5878 | reply.readException(); |
| 5879 | data.recycle(); |
| 5880 | reply.recycle(); |
| 5881 | } |
| 5882 | |
| 5883 | @Override |
| 5884 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 5885 | Parcel data = Parcel.obtain(); |
| 5886 | Parcel reply = Parcel.obtain(); |
| 5887 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5888 | data.writeStrongBinder(token); |
| 5889 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 5890 | reply.readException(); |
| 5891 | data.recycle(); |
| 5892 | reply.recycle(); |
| 5893 | } |
| 5894 | |
| 5895 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5896 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 5897 | Parcel data = Parcel.obtain(); |
| 5898 | Parcel reply = Parcel.obtain(); |
| 5899 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5900 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5901 | reply.readException(); |
| 5902 | data.recycle(); |
| 5903 | reply.recycle(); |
| 5904 | } |
| 5905 | |
| 5906 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5907 | public void stopLockTaskMode() throws RemoteException { |
| 5908 | Parcel data = Parcel.obtain(); |
| 5909 | Parcel reply = Parcel.obtain(); |
| 5910 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5911 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 5912 | reply.readException(); |
| 5913 | data.recycle(); |
| 5914 | reply.recycle(); |
| 5915 | } |
| 5916 | |
| 5917 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5918 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 5919 | Parcel data = Parcel.obtain(); |
| 5920 | Parcel reply = Parcel.obtain(); |
| 5921 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5922 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 5923 | reply.readException(); |
| 5924 | data.recycle(); |
| 5925 | reply.recycle(); |
| 5926 | } |
| 5927 | |
| 5928 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 5929 | public boolean isInLockTaskMode() throws RemoteException { |
| 5930 | Parcel data = Parcel.obtain(); |
| 5931 | Parcel reply = Parcel.obtain(); |
| 5932 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5933 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 5934 | reply.readException(); |
| 5935 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 5936 | data.recycle(); |
| 5937 | reply.recycle(); |
| 5938 | return isInLockTaskMode; |
| 5939 | } |
| 5940 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 5941 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 5942 | public int getLockTaskModeState() throws RemoteException { |
| 5943 | Parcel data = Parcel.obtain(); |
| 5944 | Parcel reply = Parcel.obtain(); |
| 5945 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5946 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 5947 | reply.readException(); |
| 5948 | int lockTaskModeState = reply.readInt(); |
| 5949 | data.recycle(); |
| 5950 | reply.recycle(); |
| 5951 | return lockTaskModeState; |
| 5952 | } |
| 5953 | |
| 5954 | @Override |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 5955 | public void showLockTaskEscapeMessage(IBinder token) throws RemoteException { |
| 5956 | Parcel data = Parcel.obtain(); |
| 5957 | Parcel reply = Parcel.obtain(); |
| 5958 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5959 | data.writeStrongBinder(token); |
| 5960 | mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply, |
| 5961 | IBinder.FLAG_ONEWAY); |
| 5962 | reply.readException(); |
| 5963 | data.recycle(); |
| 5964 | reply.recycle(); |
| 5965 | } |
| 5966 | |
| 5967 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 5968 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 5969 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 5970 | Parcel data = Parcel.obtain(); |
| 5971 | Parcel reply = Parcel.obtain(); |
| 5972 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5973 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 5974 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5975 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 5976 | reply.readException(); |
| 5977 | data.recycle(); |
| 5978 | reply.recycle(); |
| 5979 | } |
| 5980 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 5981 | @Override |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 5982 | public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException { |
| 5983 | Parcel data = Parcel.obtain(); |
| 5984 | Parcel reply = Parcel.obtain(); |
| 5985 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5986 | data.writeInt(taskId); |
| 5987 | data.writeInt(resizeable ? 1 : 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 5988 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 5989 | reply.readException(); |
| 5990 | data.recycle(); |
| 5991 | reply.recycle(); |
| 5992 | } |
| 5993 | |
| 5994 | @Override |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 5995 | public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 5996 | { |
| 5997 | Parcel data = Parcel.obtain(); |
| 5998 | Parcel reply = Parcel.obtain(); |
| 5999 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6000 | data.writeInt(taskId); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6001 | data.writeInt(resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6002 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6003 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6004 | reply.readException(); |
| 6005 | data.recycle(); |
| 6006 | reply.recycle(); |
| 6007 | } |
| 6008 | |
| 6009 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 6010 | public Rect getTaskBounds(int taskId) throws RemoteException |
| 6011 | { |
| 6012 | Parcel data = Parcel.obtain(); |
| 6013 | Parcel reply = Parcel.obtain(); |
| 6014 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6015 | data.writeInt(taskId); |
| 6016 | mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0); |
| 6017 | reply.readException(); |
| 6018 | Rect rect = Rect.CREATOR.createFromParcel(reply); |
| 6019 | data.recycle(); |
| 6020 | reply.recycle(); |
| 6021 | return rect; |
| 6022 | } |
| 6023 | |
| 6024 | @Override |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6025 | public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException { |
| 6026 | Parcel data = Parcel.obtain(); |
| 6027 | Parcel reply = Parcel.obtain(); |
| 6028 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6029 | data.writeString(filename); |
| 6030 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 6031 | reply.readException(); |
| 6032 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 6033 | data.recycle(); |
| 6034 | reply.recycle(); |
| 6035 | return icon; |
| 6036 | } |
| 6037 | |
| 6038 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6039 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 6040 | throws RemoteException { |
| 6041 | Parcel data = Parcel.obtain(); |
| 6042 | Parcel reply = Parcel.obtain(); |
| 6043 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6044 | if (options == null) { |
| 6045 | data.writeInt(0); |
| 6046 | } else { |
| 6047 | data.writeInt(1); |
| 6048 | data.writeBundle(options.toBundle()); |
| 6049 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6050 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6051 | reply.readException(); |
| 6052 | data.recycle(); |
| 6053 | reply.recycle(); |
| 6054 | } |
| 6055 | |
| 6056 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6057 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6058 | Parcel data = Parcel.obtain(); |
| 6059 | Parcel reply = Parcel.obtain(); |
| 6060 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6061 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6062 | data.writeInt(visible ? 1 : 0); |
| 6063 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6064 | reply.readException(); |
| 6065 | boolean success = reply.readInt() > 0; |
| 6066 | data.recycle(); |
| 6067 | reply.recycle(); |
| 6068 | return success; |
| 6069 | } |
| 6070 | |
| 6071 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6072 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6073 | Parcel data = Parcel.obtain(); |
| 6074 | Parcel reply = Parcel.obtain(); |
| 6075 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6076 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6077 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6078 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6079 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6080 | data.recycle(); |
| 6081 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6082 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6083 | } |
| 6084 | |
| 6085 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6086 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6087 | Parcel data = Parcel.obtain(); |
| 6088 | Parcel reply = Parcel.obtain(); |
| 6089 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6090 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6091 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 6092 | reply.readException(); |
| 6093 | data.recycle(); |
| 6094 | reply.recycle(); |
| 6095 | } |
| 6096 | |
| 6097 | @Override |
| 6098 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 6099 | Parcel data = Parcel.obtain(); |
| 6100 | Parcel reply = Parcel.obtain(); |
| 6101 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6102 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6103 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6104 | reply.readException(); |
| 6105 | data.recycle(); |
| 6106 | reply.recycle(); |
| 6107 | } |
| 6108 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6109 | @Override |
| 6110 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 6111 | Parcel data = Parcel.obtain(); |
| 6112 | Parcel reply = Parcel.obtain(); |
| 6113 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6114 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6115 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6116 | reply.readException(); |
| 6117 | data.recycle(); |
| 6118 | reply.recycle(); |
| 6119 | } |
| 6120 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 6121 | @Override |
| 6122 | public void bootAnimationComplete() throws RemoteException { |
| 6123 | Parcel data = Parcel.obtain(); |
| 6124 | Parcel reply = Parcel.obtain(); |
| 6125 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6126 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 6127 | reply.readException(); |
| 6128 | data.recycle(); |
| 6129 | reply.recycle(); |
| 6130 | } |
| 6131 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 6132 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 6133 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 6134 | Parcel data = Parcel.obtain(); |
| 6135 | Parcel reply = Parcel.obtain(); |
| 6136 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6137 | data.writeInt(uid); |
| 6138 | data.writeByteArray(firstPacket); |
| 6139 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 6140 | reply.readException(); |
| 6141 | data.recycle(); |
| 6142 | reply.recycle(); |
| 6143 | } |
| 6144 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6145 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6146 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 6147 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6148 | Parcel data = Parcel.obtain(); |
| 6149 | Parcel reply = Parcel.obtain(); |
| 6150 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6151 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6152 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6153 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6154 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6155 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 6156 | reply.readException(); |
| 6157 | data.recycle(); |
| 6158 | reply.recycle(); |
| 6159 | } |
| 6160 | |
| 6161 | @Override |
| 6162 | public void dumpHeapFinished(String path) throws RemoteException { |
| 6163 | Parcel data = Parcel.obtain(); |
| 6164 | Parcel reply = Parcel.obtain(); |
| 6165 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6166 | data.writeString(path); |
| 6167 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 6168 | reply.readException(); |
| 6169 | data.recycle(); |
| 6170 | reply.recycle(); |
| 6171 | } |
| 6172 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 6173 | @Override |
| 6174 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 6175 | throws RemoteException { |
| 6176 | Parcel data = Parcel.obtain(); |
| 6177 | Parcel reply = Parcel.obtain(); |
| 6178 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6179 | data.writeStrongBinder(session.asBinder()); |
| 6180 | data.writeInt(keepAwake ? 1 : 0); |
| 6181 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 6182 | reply.readException(); |
| 6183 | data.recycle(); |
| 6184 | reply.recycle(); |
| 6185 | } |
| 6186 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6187 | @Override |
| 6188 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 6189 | Parcel data = Parcel.obtain(); |
| 6190 | Parcel reply = Parcel.obtain(); |
| 6191 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6192 | data.writeInt(userId); |
| 6193 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6194 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6195 | reply.readException(); |
| 6196 | data.recycle(); |
| 6197 | reply.recycle(); |
| 6198 | } |
| 6199 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6200 | @Override |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 6201 | public void updateDeviceOwner(String packageName) throws RemoteException { |
| 6202 | Parcel data = Parcel.obtain(); |
| 6203 | Parcel reply = Parcel.obtain(); |
| 6204 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6205 | data.writeString(packageName); |
| 6206 | mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0); |
| 6207 | reply.readException(); |
| 6208 | data.recycle(); |
| 6209 | reply.recycle(); |
| 6210 | } |
| 6211 | |
| 6212 | @Override |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6213 | public int getPackageProcessState(String packageName, String callingPackage) |
| 6214 | throws RemoteException { |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6215 | Parcel data = Parcel.obtain(); |
| 6216 | Parcel reply = Parcel.obtain(); |
| 6217 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6218 | data.writeString(packageName); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6219 | data.writeString(callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6220 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 6221 | reply.readException(); |
| 6222 | int res = reply.readInt(); |
| 6223 | data.recycle(); |
| 6224 | reply.recycle(); |
| 6225 | return res; |
| 6226 | } |
| 6227 | |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 6228 | @Override |
| 6229 | public boolean setProcessMemoryTrimLevel(String process, int userId, int level) |
| 6230 | throws RemoteException { |
| 6231 | Parcel data = Parcel.obtain(); |
| 6232 | Parcel reply = Parcel.obtain(); |
| 6233 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6234 | data.writeString(process); |
| 6235 | data.writeInt(userId); |
| 6236 | data.writeInt(level); |
| 6237 | mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0); |
| 6238 | reply.readException(); |
| 6239 | int res = reply.readInt(); |
| 6240 | data.recycle(); |
| 6241 | reply.recycle(); |
| 6242 | return res != 0; |
| 6243 | } |
| 6244 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 6245 | @Override |
| 6246 | public boolean isRootVoiceInteraction(IBinder token) throws RemoteException { |
| 6247 | Parcel data = Parcel.obtain(); |
| 6248 | Parcel reply = Parcel.obtain(); |
| 6249 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6250 | data.writeStrongBinder(token); |
| 6251 | mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 6252 | reply.readException(); |
| 6253 | int res = reply.readInt(); |
| 6254 | data.recycle(); |
| 6255 | reply.recycle(); |
| 6256 | return res != 0; |
| 6257 | } |
| 6258 | |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6259 | @Override |
| 6260 | public void moveActivityToStack(IBinder token, int stackId) throws RemoteException { |
| 6261 | Parcel data = Parcel.obtain(); |
| 6262 | Parcel reply = Parcel.obtain(); |
| 6263 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6264 | data.writeStrongBinder(token); |
| 6265 | data.writeInt(stackId); |
| 6266 | mRemote.transact(MOVE_ACTIVITY_TO_STACK_TRANSACTION, data, reply, 0); |
| 6267 | reply.readException(); |
| 6268 | data.recycle(); |
| 6269 | reply.recycle(); |
| 6270 | } |
| 6271 | |
| 6272 | @Override |
| 6273 | public int getActivityStackId(IBinder token) throws RemoteException { |
| 6274 | Parcel data = Parcel.obtain(); |
| 6275 | Parcel reply = Parcel.obtain(); |
| 6276 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6277 | data.writeStrongBinder(token); |
| 6278 | mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0); |
| 6279 | reply.readException(); |
| 6280 | int stackId = reply.readInt(); |
| 6281 | data.recycle(); |
| 6282 | reply.recycle(); |
| 6283 | return stackId; |
| 6284 | } |
| 6285 | |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6286 | @Override |
| 6287 | public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration, |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6288 | int[] verticalSizeConfigurations, int[] smallestSizeConfigurations) |
| 6289 | throws RemoteException { |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6290 | Parcel data = Parcel.obtain(); |
| 6291 | Parcel reply = Parcel.obtain(); |
| 6292 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6293 | data.writeStrongBinder(token); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6294 | writeIntArray(horizontalSizeConfiguration, data); |
| 6295 | writeIntArray(verticalSizeConfigurations, data); |
| 6296 | writeIntArray(smallestSizeConfigurations, data); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6297 | mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0); |
| 6298 | reply.readException(); |
| 6299 | data.recycle(); |
| 6300 | reply.recycle(); |
| 6301 | } |
| 6302 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6303 | private static void writeIntArray(int[] array, Parcel data) { |
| 6304 | if (array == null) { |
| 6305 | data.writeInt(0); |
| 6306 | } else { |
| 6307 | data.writeInt(array.length); |
| 6308 | data.writeIntArray(array); |
| 6309 | } |
| 6310 | } |
| 6311 | |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 6312 | @Override |
| 6313 | public void suppressResizeConfigChanges(boolean suppress) throws RemoteException { |
| 6314 | Parcel data = Parcel.obtain(); |
| 6315 | Parcel reply = Parcel.obtain(); |
| 6316 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6317 | data.writeInt(suppress ? 1 : 0); |
| 6318 | mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0); |
| 6319 | reply.readException(); |
| 6320 | data.recycle(); |
| 6321 | reply.recycle(); |
| 6322 | } |
| 6323 | |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6324 | @Override |
| 6325 | public void removeStack(int stackId) throws RemoteException { |
| 6326 | Parcel data = Parcel.obtain(); |
| 6327 | Parcel reply = Parcel.obtain(); |
| 6328 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6329 | data.writeInt(stackId); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6330 | mRemote.transact(REMOVE_STACK_TRANSACTION, data, reply, 0); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6331 | reply.readException(); |
| 6332 | data.recycle(); |
| 6333 | reply.recycle(); |
| 6334 | } |
| 6335 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6336 | @Override |
| 6337 | public int getAppStartMode(int uid, String packageName) throws RemoteException { |
| 6338 | Parcel data = Parcel.obtain(); |
| 6339 | Parcel reply = Parcel.obtain(); |
| 6340 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6341 | data.writeInt(uid); |
| 6342 | data.writeString(packageName); |
| 6343 | mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0); |
| 6344 | reply.readException(); |
| 6345 | int res = reply.readInt(); |
| 6346 | data.recycle(); |
| 6347 | reply.recycle(); |
| 6348 | return res; |
| 6349 | } |
| 6350 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6351 | private IBinder mRemote; |
| 6352 | } |