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