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 | |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 318 | case START_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 319 | { |
| 320 | data.enforceInterface(IActivityManager.descriptor); |
| 321 | IBinder token = data.readStrongBinder(); |
| 322 | Bundle options = data.readBundle(); |
| 323 | startLocalVoiceInteraction(token, options); |
| 324 | reply.writeNoException(); |
| 325 | return true; |
| 326 | } |
| 327 | |
| 328 | case STOP_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 329 | { |
| 330 | data.enforceInterface(IActivityManager.descriptor); |
| 331 | IBinder token = data.readStrongBinder(); |
| 332 | stopLocalVoiceInteraction(token); |
| 333 | reply.writeNoException(); |
| 334 | return true; |
| 335 | } |
| 336 | |
| 337 | case SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION: |
| 338 | { |
| 339 | data.enforceInterface(IActivityManager.descriptor); |
| 340 | boolean result = supportsLocalVoiceInteraction(); |
| 341 | reply.writeNoException(); |
| 342 | reply.writeInt(result? 1 : 0); |
| 343 | return true; |
| 344 | } |
| 345 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 346 | case START_NEXT_MATCHING_ACTIVITY_TRANSACTION: |
| 347 | { |
| 348 | data.enforceInterface(IActivityManager.descriptor); |
| 349 | IBinder callingActivity = data.readStrongBinder(); |
| 350 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 351 | Bundle options = data.readInt() != 0 |
| 352 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 353 | boolean result = startNextMatchingActivity(callingActivity, intent, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 354 | reply.writeNoException(); |
| 355 | reply.writeInt(result ? 1 : 0); |
| 356 | return true; |
| 357 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 358 | |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 359 | case START_ACTIVITY_FROM_RECENTS_TRANSACTION: |
| 360 | { |
| 361 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 362 | final int taskId = data.readInt(); |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 363 | final Bundle options = |
| 364 | data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data); |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 365 | final int result = startActivityFromRecents(taskId, options); |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 366 | reply.writeNoException(); |
| 367 | reply.writeInt(result); |
| 368 | return true; |
| 369 | } |
| 370 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 371 | case FINISH_ACTIVITY_TRANSACTION: { |
| 372 | data.enforceInterface(IActivityManager.descriptor); |
| 373 | IBinder token = data.readStrongBinder(); |
| 374 | Intent resultData = null; |
| 375 | int resultCode = data.readInt(); |
| 376 | if (data.readInt() != 0) { |
| 377 | resultData = Intent.CREATOR.createFromParcel(data); |
| 378 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 379 | int finishTask = data.readInt(); |
Winson Chung | 3b3f464 | 2014-04-22 10:08:18 -0700 | [diff] [blame] | 380 | boolean res = finishActivity(token, resultCode, resultData, finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 381 | reply.writeNoException(); |
| 382 | reply.writeInt(res ? 1 : 0); |
| 383 | return true; |
| 384 | } |
| 385 | |
| 386 | case FINISH_SUB_ACTIVITY_TRANSACTION: { |
| 387 | data.enforceInterface(IActivityManager.descriptor); |
| 388 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 389 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 390 | int requestCode = data.readInt(); |
| 391 | finishSubActivity(token, resultWho, requestCode); |
| 392 | reply.writeNoException(); |
| 393 | return true; |
| 394 | } |
| 395 | |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 396 | case FINISH_ACTIVITY_AFFINITY_TRANSACTION: { |
| 397 | data.enforceInterface(IActivityManager.descriptor); |
| 398 | IBinder token = data.readStrongBinder(); |
| 399 | boolean res = finishActivityAffinity(token); |
| 400 | reply.writeNoException(); |
| 401 | reply.writeInt(res ? 1 : 0); |
| 402 | return true; |
| 403 | } |
| 404 | |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 405 | case FINISH_VOICE_TASK_TRANSACTION: { |
| 406 | data.enforceInterface(IActivityManager.descriptor); |
| 407 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 408 | data.readStrongBinder()); |
| 409 | finishVoiceTask(session); |
| 410 | reply.writeNoException(); |
| 411 | return true; |
| 412 | } |
| 413 | |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 414 | case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: { |
| 415 | data.enforceInterface(IActivityManager.descriptor); |
| 416 | IBinder token = data.readStrongBinder(); |
| 417 | boolean res = releaseActivityInstance(token); |
| 418 | reply.writeNoException(); |
| 419 | reply.writeInt(res ? 1 : 0); |
| 420 | return true; |
| 421 | } |
| 422 | |
| 423 | case RELEASE_SOME_ACTIVITIES_TRANSACTION: { |
| 424 | data.enforceInterface(IActivityManager.descriptor); |
| 425 | IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder()); |
| 426 | releaseSomeActivities(app); |
| 427 | reply.writeNoException(); |
| 428 | return true; |
| 429 | } |
| 430 | |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 431 | case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: { |
| 432 | data.enforceInterface(IActivityManager.descriptor); |
| 433 | IBinder token = data.readStrongBinder(); |
| 434 | boolean res = willActivityBeVisible(token); |
| 435 | reply.writeNoException(); |
| 436 | reply.writeInt(res ? 1 : 0); |
| 437 | return true; |
| 438 | } |
| 439 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 440 | case REGISTER_RECEIVER_TRANSACTION: |
| 441 | { |
| 442 | data.enforceInterface(IActivityManager.descriptor); |
| 443 | IBinder b = data.readStrongBinder(); |
| 444 | IApplicationThread app = |
| 445 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 446 | String packageName = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 447 | b = data.readStrongBinder(); |
| 448 | IIntentReceiver rec |
| 449 | = b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 450 | IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data); |
| 451 | String perm = data.readString(); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 452 | int userId = data.readInt(); |
| 453 | Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 454 | reply.writeNoException(); |
| 455 | if (intent != null) { |
| 456 | reply.writeInt(1); |
| 457 | intent.writeToParcel(reply, 0); |
| 458 | } else { |
| 459 | reply.writeInt(0); |
| 460 | } |
| 461 | return true; |
| 462 | } |
| 463 | |
| 464 | case UNREGISTER_RECEIVER_TRANSACTION: |
| 465 | { |
| 466 | data.enforceInterface(IActivityManager.descriptor); |
| 467 | IBinder b = data.readStrongBinder(); |
| 468 | if (b == null) { |
| 469 | return true; |
| 470 | } |
| 471 | IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b); |
| 472 | unregisterReceiver(rec); |
| 473 | reply.writeNoException(); |
| 474 | return true; |
| 475 | } |
| 476 | |
| 477 | case BROADCAST_INTENT_TRANSACTION: |
| 478 | { |
| 479 | data.enforceInterface(IActivityManager.descriptor); |
| 480 | IBinder b = data.readStrongBinder(); |
| 481 | IApplicationThread app = |
| 482 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 483 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 484 | String resolvedType = data.readString(); |
| 485 | b = data.readStrongBinder(); |
| 486 | IIntentReceiver resultTo = |
| 487 | b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 488 | int resultCode = data.readInt(); |
| 489 | String resultData = data.readString(); |
| 490 | Bundle resultExtras = data.readBundle(); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 491 | String[] perms = data.readStringArray(); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 492 | int appOp = data.readInt(); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 493 | Bundle options = data.readBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 494 | boolean serialized = data.readInt() != 0; |
| 495 | boolean sticky = data.readInt() != 0; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 496 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 497 | int res = broadcastIntent(app, intent, resolvedType, resultTo, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 498 | resultCode, resultData, resultExtras, perms, appOp, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 499 | options, serialized, sticky, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 500 | reply.writeNoException(); |
| 501 | reply.writeInt(res); |
| 502 | return true; |
| 503 | } |
| 504 | |
| 505 | case UNBROADCAST_INTENT_TRANSACTION: |
| 506 | { |
| 507 | data.enforceInterface(IActivityManager.descriptor); |
| 508 | IBinder b = data.readStrongBinder(); |
| 509 | IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 510 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 511 | int userId = data.readInt(); |
| 512 | unbroadcastIntent(app, intent, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 513 | reply.writeNoException(); |
| 514 | return true; |
| 515 | } |
| 516 | |
| 517 | case FINISH_RECEIVER_TRANSACTION: { |
| 518 | data.enforceInterface(IActivityManager.descriptor); |
| 519 | IBinder who = data.readStrongBinder(); |
| 520 | int resultCode = data.readInt(); |
| 521 | String resultData = data.readString(); |
| 522 | Bundle resultExtras = data.readBundle(); |
| 523 | boolean resultAbort = data.readInt() != 0; |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 524 | int intentFlags = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 525 | if (who != null) { |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 526 | finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 527 | } |
| 528 | reply.writeNoException(); |
| 529 | return true; |
| 530 | } |
| 531 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 532 | case ATTACH_APPLICATION_TRANSACTION: { |
| 533 | data.enforceInterface(IActivityManager.descriptor); |
| 534 | IApplicationThread app = ApplicationThreadNative.asInterface( |
| 535 | data.readStrongBinder()); |
| 536 | if (app != null) { |
| 537 | attachApplication(app); |
| 538 | } |
| 539 | reply.writeNoException(); |
| 540 | return true; |
| 541 | } |
| 542 | |
| 543 | case ACTIVITY_IDLE_TRANSACTION: { |
| 544 | data.enforceInterface(IActivityManager.descriptor); |
| 545 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 546 | Configuration config = null; |
| 547 | if (data.readInt() != 0) { |
| 548 | config = Configuration.CREATOR.createFromParcel(data); |
| 549 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 550 | boolean stopProfiling = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 551 | if (token != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 552 | activityIdle(token, config, stopProfiling); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 553 | } |
| 554 | reply.writeNoException(); |
| 555 | return true; |
| 556 | } |
| 557 | |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 558 | case ACTIVITY_RESUMED_TRANSACTION: { |
| 559 | data.enforceInterface(IActivityManager.descriptor); |
| 560 | IBinder token = data.readStrongBinder(); |
| 561 | activityResumed(token); |
| 562 | reply.writeNoException(); |
| 563 | return true; |
| 564 | } |
| 565 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 566 | case ACTIVITY_PAUSED_TRANSACTION: { |
| 567 | data.enforceInterface(IActivityManager.descriptor); |
| 568 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 569 | activityPaused(token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 570 | reply.writeNoException(); |
| 571 | return true; |
| 572 | } |
| 573 | |
| 574 | case ACTIVITY_STOPPED_TRANSACTION: { |
| 575 | data.enforceInterface(IActivityManager.descriptor); |
| 576 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 577 | Bundle map = data.readBundle(); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 578 | PersistableBundle persistentState = data.readPersistableBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 579 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 580 | activityStopped(token, map, persistentState, description); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 581 | reply.writeNoException(); |
| 582 | return true; |
| 583 | } |
| 584 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 585 | case ACTIVITY_SLEPT_TRANSACTION: { |
| 586 | data.enforceInterface(IActivityManager.descriptor); |
| 587 | IBinder token = data.readStrongBinder(); |
| 588 | activitySlept(token); |
| 589 | reply.writeNoException(); |
| 590 | return true; |
| 591 | } |
| 592 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 593 | case ACTIVITY_DESTROYED_TRANSACTION: { |
| 594 | data.enforceInterface(IActivityManager.descriptor); |
| 595 | IBinder token = data.readStrongBinder(); |
| 596 | activityDestroyed(token); |
| 597 | reply.writeNoException(); |
| 598 | return true; |
| 599 | } |
| 600 | |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 601 | case ACTIVITY_RELAUNCHED_TRANSACTION: { |
| 602 | data.enforceInterface(IActivityManager.descriptor); |
| 603 | IBinder token = data.readStrongBinder(); |
| 604 | activityRelaunched(token); |
| 605 | reply.writeNoException(); |
| 606 | return true; |
| 607 | } |
| 608 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 609 | case GET_CALLING_PACKAGE_TRANSACTION: { |
| 610 | data.enforceInterface(IActivityManager.descriptor); |
| 611 | IBinder token = data.readStrongBinder(); |
| 612 | String res = token != null ? getCallingPackage(token) : null; |
| 613 | reply.writeNoException(); |
| 614 | reply.writeString(res); |
| 615 | return true; |
| 616 | } |
| 617 | |
| 618 | case GET_CALLING_ACTIVITY_TRANSACTION: { |
| 619 | data.enforceInterface(IActivityManager.descriptor); |
| 620 | IBinder token = data.readStrongBinder(); |
| 621 | ComponentName cn = getCallingActivity(token); |
| 622 | reply.writeNoException(); |
| 623 | ComponentName.writeToParcel(cn, reply); |
| 624 | return true; |
| 625 | } |
| 626 | |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 627 | case GET_APP_TASKS_TRANSACTION: { |
| 628 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 629 | String callingPackage = data.readString(); |
| 630 | List<IAppTask> list = getAppTasks(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 631 | reply.writeNoException(); |
| 632 | int N = list != null ? list.size() : -1; |
| 633 | reply.writeInt(N); |
| 634 | int i; |
| 635 | for (i=0; i<N; i++) { |
| 636 | IAppTask task = list.get(i); |
| 637 | reply.writeStrongBinder(task.asBinder()); |
| 638 | } |
| 639 | return true; |
| 640 | } |
| 641 | |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 642 | case ADD_APP_TASK_TRANSACTION: { |
| 643 | data.enforceInterface(IActivityManager.descriptor); |
| 644 | IBinder activityToken = data.readStrongBinder(); |
| 645 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 646 | ActivityManager.TaskDescription descr |
| 647 | = ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 648 | Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data); |
| 649 | int res = addAppTask(activityToken, intent, descr, thumbnail); |
| 650 | reply.writeNoException(); |
| 651 | reply.writeInt(res); |
| 652 | return true; |
| 653 | } |
| 654 | |
| 655 | case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: { |
| 656 | data.enforceInterface(IActivityManager.descriptor); |
| 657 | Point size = getAppTaskThumbnailSize(); |
| 658 | reply.writeNoException(); |
| 659 | size.writeToParcel(reply, 0); |
| 660 | return true; |
| 661 | } |
| 662 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 663 | case GET_TASKS_TRANSACTION: { |
| 664 | data.enforceInterface(IActivityManager.descriptor); |
| 665 | int maxNum = data.readInt(); |
| 666 | int fl = data.readInt(); |
Dianne Hackborn | 0923328 | 2014-04-30 11:33:59 -0700 | [diff] [blame] | 667 | List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 668 | reply.writeNoException(); |
| 669 | int N = list != null ? list.size() : -1; |
| 670 | reply.writeInt(N); |
| 671 | int i; |
| 672 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 673 | ActivityManager.RunningTaskInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 674 | info.writeToParcel(reply, 0); |
| 675 | } |
| 676 | return true; |
| 677 | } |
| 678 | |
| 679 | case GET_RECENT_TASKS_TRANSACTION: { |
| 680 | data.enforceInterface(IActivityManager.descriptor); |
| 681 | int maxNum = data.readInt(); |
| 682 | int fl = data.readInt(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 683 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 684 | List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 685 | fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 686 | reply.writeNoException(); |
| 687 | reply.writeTypedList(list); |
| 688 | return true; |
| 689 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 690 | |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 691 | case GET_TASK_THUMBNAIL_TRANSACTION: { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 692 | data.enforceInterface(IActivityManager.descriptor); |
| 693 | int id = data.readInt(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 694 | ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 695 | reply.writeNoException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 696 | if (taskThumbnail != null) { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 697 | reply.writeInt(1); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 698 | taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 699 | } else { |
| 700 | reply.writeInt(0); |
| 701 | } |
| 702 | return true; |
| 703 | } |
| 704 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 705 | case GET_SERVICES_TRANSACTION: { |
| 706 | data.enforceInterface(IActivityManager.descriptor); |
| 707 | int maxNum = data.readInt(); |
| 708 | int fl = data.readInt(); |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 709 | List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 710 | reply.writeNoException(); |
| 711 | int N = list != null ? list.size() : -1; |
| 712 | reply.writeInt(N); |
| 713 | int i; |
| 714 | for (i=0; i<N; i++) { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 715 | ActivityManager.RunningServiceInfo info = list.get(i); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 716 | info.writeToParcel(reply, 0); |
| 717 | } |
| 718 | return true; |
| 719 | } |
| 720 | |
| 721 | case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: { |
| 722 | data.enforceInterface(IActivityManager.descriptor); |
| 723 | List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState(); |
| 724 | reply.writeNoException(); |
| 725 | reply.writeTypedList(list); |
| 726 | return true; |
| 727 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 728 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 729 | case GET_RUNNING_APP_PROCESSES_TRANSACTION: { |
| 730 | data.enforceInterface(IActivityManager.descriptor); |
| 731 | List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses(); |
| 732 | reply.writeNoException(); |
| 733 | reply.writeTypedList(list); |
| 734 | return true; |
| 735 | } |
| 736 | |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 737 | case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: { |
| 738 | data.enforceInterface(IActivityManager.descriptor); |
| 739 | List<ApplicationInfo> list = getRunningExternalApplications(); |
| 740 | reply.writeNoException(); |
| 741 | reply.writeTypedList(list); |
| 742 | return true; |
| 743 | } |
| 744 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 745 | case MOVE_TASK_TO_FRONT_TRANSACTION: { |
| 746 | data.enforceInterface(IActivityManager.descriptor); |
| 747 | int task = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 748 | int fl = data.readInt(); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 749 | Bundle options = data.readInt() != 0 |
| 750 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 751 | moveTaskToFront(task, fl, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 752 | reply.writeNoException(); |
| 753 | return true; |
| 754 | } |
| 755 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 756 | case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: { |
| 757 | data.enforceInterface(IActivityManager.descriptor); |
| 758 | IBinder token = data.readStrongBinder(); |
| 759 | boolean nonRoot = data.readInt() != 0; |
| 760 | boolean res = moveActivityTaskToBack(token, nonRoot); |
| 761 | reply.writeNoException(); |
| 762 | reply.writeInt(res ? 1 : 0); |
| 763 | return true; |
| 764 | } |
| 765 | |
| 766 | case MOVE_TASK_BACKWARDS_TRANSACTION: { |
| 767 | data.enforceInterface(IActivityManager.descriptor); |
| 768 | int task = data.readInt(); |
| 769 | moveTaskBackwards(task); |
| 770 | reply.writeNoException(); |
| 771 | return true; |
| 772 | } |
| 773 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 774 | case MOVE_TASK_TO_STACK_TRANSACTION: { |
| 775 | data.enforceInterface(IActivityManager.descriptor); |
| 776 | int taskId = data.readInt(); |
| 777 | int stackId = data.readInt(); |
| 778 | boolean toTop = data.readInt() != 0; |
| 779 | moveTaskToStack(taskId, stackId, toTop); |
| 780 | reply.writeNoException(); |
| 781 | return true; |
| 782 | } |
| 783 | |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 784 | case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: { |
| 785 | data.enforceInterface(IActivityManager.descriptor); |
| 786 | int taskId = data.readInt(); |
| 787 | int createMode = data.readInt(); |
| 788 | boolean toTop = data.readInt() != 0; |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 789 | boolean animate = data.readInt() != 0; |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 790 | Rect bounds = null; |
| 791 | boolean hasBounds = data.readInt() != 0; |
| 792 | if (hasBounds) { |
| 793 | bounds = Rect.CREATOR.createFromParcel(data); |
| 794 | } |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 795 | boolean res = moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 796 | reply.writeNoException(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 797 | reply.writeInt(res ? 1 : 0); |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 798 | return true; |
| 799 | } |
| 800 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 801 | case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: { |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 802 | data.enforceInterface(IActivityManager.descriptor); |
| 803 | final int stackId = data.readInt(); |
| 804 | final Rect r = Rect.CREATOR.createFromParcel(data); |
| 805 | final boolean res = moveTopActivityToPinnedStack(stackId, r); |
| 806 | reply.writeNoException(); |
| 807 | reply.writeInt(res ? 1 : 0); |
| 808 | return true; |
| 809 | } |
| 810 | |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 811 | case RESIZE_STACK_TRANSACTION: { |
| 812 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 813 | final int stackId = data.readInt(); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 814 | final boolean hasRect = data.readInt() != 0; |
| 815 | Rect r = null; |
| 816 | if (hasRect) { |
| 817 | r = Rect.CREATOR.createFromParcel(data); |
| 818 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 819 | final boolean allowResizeInDockedMode = data.readInt() == 1; |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 820 | final boolean preserveWindows = data.readInt() == 1; |
| 821 | final boolean animate = data.readInt() == 1; |
| 822 | resizeStack(stackId, r, allowResizeInDockedMode, preserveWindows, animate); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 823 | reply.writeNoException(); |
| 824 | return true; |
| 825 | } |
Robert Carr | 0d00c2e | 2016-02-29 17:45:02 -0800 | [diff] [blame] | 826 | case RESIZE_PINNED_STACK_TRANSACTION: { |
| 827 | data.enforceInterface(IActivityManager.descriptor); |
| 828 | final boolean hasBounds = data.readInt() != 0; |
| 829 | Rect bounds = null; |
| 830 | if (hasBounds) { |
| 831 | bounds = Rect.CREATOR.createFromParcel(data); |
| 832 | } |
| 833 | final boolean hasTempPinnedTaskBounds = data.readInt() != 0; |
| 834 | Rect tempPinnedTaskBounds = null; |
| 835 | if (hasTempPinnedTaskBounds) { |
| 836 | tempPinnedTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 837 | } |
| 838 | resizePinnedStack(bounds, tempPinnedTaskBounds); |
| 839 | return true; |
| 840 | } |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 841 | case SWAP_DOCKED_AND_FULLSCREEN_STACK: { |
| 842 | data.enforceInterface(IActivityManager.descriptor); |
| 843 | swapDockedAndFullscreenStack(); |
| 844 | reply.writeNoException(); |
| 845 | return true; |
| 846 | } |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 847 | case RESIZE_DOCKED_STACK_TRANSACTION: { |
| 848 | data.enforceInterface(IActivityManager.descriptor); |
| 849 | final boolean hasBounds = data.readInt() != 0; |
| 850 | Rect bounds = null; |
| 851 | if (hasBounds) { |
| 852 | bounds = Rect.CREATOR.createFromParcel(data); |
| 853 | } |
| 854 | final boolean hasTempDockedTaskBounds = data.readInt() != 0; |
| 855 | Rect tempDockedTaskBounds = null; |
| 856 | if (hasTempDockedTaskBounds) { |
| 857 | tempDockedTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 858 | } |
| 859 | final boolean hasTempDockedTaskInsetBounds = data.readInt() != 0; |
| 860 | Rect tempDockedTaskInsetBounds = null; |
| 861 | if (hasTempDockedTaskInsetBounds) { |
| 862 | tempDockedTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 863 | } |
| 864 | final boolean hasTempOtherTaskBounds = data.readInt() != 0; |
| 865 | Rect tempOtherTaskBounds = null; |
| 866 | if (hasTempOtherTaskBounds) { |
| 867 | tempOtherTaskBounds = Rect.CREATOR.createFromParcel(data); |
| 868 | } |
| 869 | final boolean hasTempOtherTaskInsetBounds = data.readInt() != 0; |
| 870 | Rect tempOtherTaskInsetBounds = null; |
| 871 | if (hasTempOtherTaskInsetBounds) { |
| 872 | tempOtherTaskInsetBounds = Rect.CREATOR.createFromParcel(data); |
| 873 | } |
| 874 | resizeDockedStack(bounds, tempDockedTaskBounds, tempDockedTaskInsetBounds, |
| 875 | tempOtherTaskBounds, tempOtherTaskInsetBounds); |
| 876 | reply.writeNoException(); |
| 877 | return true; |
| 878 | } |
| 879 | |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 880 | case POSITION_TASK_IN_STACK_TRANSACTION: { |
| 881 | data.enforceInterface(IActivityManager.descriptor); |
| 882 | int taskId = data.readInt(); |
| 883 | int stackId = data.readInt(); |
| 884 | int position = data.readInt(); |
| 885 | positionTaskInStack(taskId, stackId, position); |
| 886 | reply.writeNoException(); |
| 887 | return true; |
| 888 | } |
| 889 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 890 | case GET_ALL_STACK_INFOS_TRANSACTION: { |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 891 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 892 | List<StackInfo> list = getAllStackInfos(); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 893 | reply.writeNoException(); |
| 894 | reply.writeTypedList(list); |
| 895 | return true; |
| 896 | } |
| 897 | |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 898 | case GET_STACK_INFO_TRANSACTION: { |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 899 | data.enforceInterface(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 900 | int stackId = data.readInt(); |
| 901 | StackInfo info = getStackInfo(stackId); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 902 | reply.writeNoException(); |
| 903 | if (info != null) { |
| 904 | reply.writeInt(1); |
| 905 | info.writeToParcel(reply, 0); |
| 906 | } else { |
| 907 | reply.writeInt(0); |
| 908 | } |
| 909 | return true; |
| 910 | } |
| 911 | |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 912 | case IS_IN_HOME_STACK_TRANSACTION: { |
| 913 | data.enforceInterface(IActivityManager.descriptor); |
| 914 | int taskId = data.readInt(); |
| 915 | boolean isInHomeStack = isInHomeStack(taskId); |
| 916 | reply.writeNoException(); |
| 917 | reply.writeInt(isInHomeStack ? 1 : 0); |
| 918 | return true; |
| 919 | } |
| 920 | |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 921 | case SET_FOCUSED_STACK_TRANSACTION: { |
| 922 | data.enforceInterface(IActivityManager.descriptor); |
| 923 | int stackId = data.readInt(); |
| 924 | setFocusedStack(stackId); |
| 925 | reply.writeNoException(); |
| 926 | return true; |
| 927 | } |
| 928 | |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 929 | case GET_FOCUSED_STACK_ID_TRANSACTION: { |
| 930 | data.enforceInterface(IActivityManager.descriptor); |
| 931 | int focusedStackId = getFocusedStackId(); |
| 932 | reply.writeNoException(); |
| 933 | reply.writeInt(focusedStackId); |
| 934 | return true; |
| 935 | } |
| 936 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 937 | case SET_FOCUSED_TASK_TRANSACTION: { |
| 938 | data.enforceInterface(IActivityManager.descriptor); |
| 939 | int taskId = data.readInt(); |
Skuhne | f36bb0c | 2015-08-26 14:26:17 -0700 | [diff] [blame] | 940 | setFocusedTask(taskId); |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 941 | reply.writeNoException(); |
| 942 | return true; |
| 943 | } |
| 944 | |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 945 | case REGISTER_TASK_STACK_LISTENER_TRANSACTION: { |
| 946 | data.enforceInterface(IActivityManager.descriptor); |
| 947 | IBinder token = data.readStrongBinder(); |
| 948 | registerTaskStackListener(ITaskStackListener.Stub.asInterface(token)); |
| 949 | reply.writeNoException(); |
| 950 | return true; |
| 951 | } |
| 952 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 953 | case GET_TASK_FOR_ACTIVITY_TRANSACTION: { |
| 954 | data.enforceInterface(IActivityManager.descriptor); |
| 955 | IBinder token = data.readStrongBinder(); |
| 956 | boolean onlyRoot = data.readInt() != 0; |
| 957 | int res = token != null |
| 958 | ? getTaskForActivity(token, onlyRoot) : -1; |
| 959 | reply.writeNoException(); |
| 960 | reply.writeInt(res); |
| 961 | return true; |
| 962 | } |
| 963 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 964 | case GET_CONTENT_PROVIDER_TRANSACTION: { |
| 965 | data.enforceInterface(IActivityManager.descriptor); |
| 966 | IBinder b = data.readStrongBinder(); |
| 967 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 968 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 969 | int userId = data.readInt(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 970 | boolean stable = data.readInt() != 0; |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 971 | ContentProviderHolder cph = getContentProvider(app, name, userId, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 972 | reply.writeNoException(); |
| 973 | if (cph != null) { |
| 974 | reply.writeInt(1); |
| 975 | cph.writeToParcel(reply, 0); |
| 976 | } else { |
| 977 | reply.writeInt(0); |
| 978 | } |
| 979 | return true; |
| 980 | } |
| 981 | |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 982 | case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 983 | data.enforceInterface(IActivityManager.descriptor); |
| 984 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 985 | int userId = data.readInt(); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 986 | IBinder token = data.readStrongBinder(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 987 | ContentProviderHolder cph = getContentProviderExternal(name, userId, token); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 988 | reply.writeNoException(); |
| 989 | if (cph != null) { |
| 990 | reply.writeInt(1); |
| 991 | cph.writeToParcel(reply, 0); |
| 992 | } else { |
| 993 | reply.writeInt(0); |
| 994 | } |
| 995 | return true; |
| 996 | } |
| 997 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 998 | case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: { |
| 999 | data.enforceInterface(IActivityManager.descriptor); |
| 1000 | IBinder b = data.readStrongBinder(); |
| 1001 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1002 | ArrayList<ContentProviderHolder> providers = |
| 1003 | data.createTypedArrayList(ContentProviderHolder.CREATOR); |
| 1004 | publishContentProviders(app, providers); |
| 1005 | reply.writeNoException(); |
| 1006 | return true; |
| 1007 | } |
| 1008 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1009 | case REF_CONTENT_PROVIDER_TRANSACTION: { |
| 1010 | data.enforceInterface(IActivityManager.descriptor); |
| 1011 | IBinder b = data.readStrongBinder(); |
| 1012 | int stable = data.readInt(); |
| 1013 | int unstable = data.readInt(); |
| 1014 | boolean res = refContentProvider(b, stable, unstable); |
| 1015 | reply.writeNoException(); |
| 1016 | reply.writeInt(res ? 1 : 0); |
| 1017 | return true; |
| 1018 | } |
| 1019 | |
| 1020 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: { |
| 1021 | data.enforceInterface(IActivityManager.descriptor); |
| 1022 | IBinder b = data.readStrongBinder(); |
| 1023 | unstableProviderDied(b); |
| 1024 | reply.writeNoException(); |
| 1025 | return true; |
| 1026 | } |
| 1027 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 1028 | case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: { |
| 1029 | data.enforceInterface(IActivityManager.descriptor); |
| 1030 | IBinder b = data.readStrongBinder(); |
| 1031 | appNotRespondingViaProvider(b); |
| 1032 | reply.writeNoException(); |
| 1033 | return true; |
| 1034 | } |
| 1035 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1036 | case REMOVE_CONTENT_PROVIDER_TRANSACTION: { |
| 1037 | data.enforceInterface(IActivityManager.descriptor); |
| 1038 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1039 | boolean stable = data.readInt() != 0; |
| 1040 | removeContentProvider(b, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1041 | reply.writeNoException(); |
| 1042 | return true; |
| 1043 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 1044 | |
| 1045 | case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 1046 | data.enforceInterface(IActivityManager.descriptor); |
| 1047 | String name = data.readString(); |
| 1048 | IBinder token = data.readStrongBinder(); |
| 1049 | removeContentProviderExternal(name, token); |
| 1050 | reply.writeNoException(); |
| 1051 | return true; |
| 1052 | } |
| 1053 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 1054 | case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: { |
| 1055 | data.enforceInterface(IActivityManager.descriptor); |
| 1056 | ComponentName comp = ComponentName.CREATOR.createFromParcel(data); |
| 1057 | PendingIntent pi = getRunningServiceControlPanel(comp); |
| 1058 | reply.writeNoException(); |
| 1059 | PendingIntent.writePendingIntentOrNullToParcel(pi, reply); |
| 1060 | return true; |
| 1061 | } |
| 1062 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1063 | case START_SERVICE_TRANSACTION: { |
| 1064 | data.enforceInterface(IActivityManager.descriptor); |
| 1065 | IBinder b = data.readStrongBinder(); |
| 1066 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1067 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1068 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1069 | String callingPackage = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1070 | int userId = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1071 | ComponentName cn = startService(app, service, resolvedType, callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1072 | reply.writeNoException(); |
| 1073 | ComponentName.writeToParcel(cn, reply); |
| 1074 | return true; |
| 1075 | } |
| 1076 | |
| 1077 | case STOP_SERVICE_TRANSACTION: { |
| 1078 | data.enforceInterface(IActivityManager.descriptor); |
| 1079 | IBinder b = data.readStrongBinder(); |
| 1080 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1081 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1082 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1083 | int userId = data.readInt(); |
| 1084 | int res = stopService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1085 | reply.writeNoException(); |
| 1086 | reply.writeInt(res); |
| 1087 | return true; |
| 1088 | } |
| 1089 | |
| 1090 | case STOP_SERVICE_TOKEN_TRANSACTION: { |
| 1091 | data.enforceInterface(IActivityManager.descriptor); |
| 1092 | ComponentName className = ComponentName.readFromParcel(data); |
| 1093 | IBinder token = data.readStrongBinder(); |
| 1094 | int startId = data.readInt(); |
| 1095 | boolean res = stopServiceToken(className, token, startId); |
| 1096 | reply.writeNoException(); |
| 1097 | reply.writeInt(res ? 1 : 0); |
| 1098 | return true; |
| 1099 | } |
| 1100 | |
| 1101 | case SET_SERVICE_FOREGROUND_TRANSACTION: { |
| 1102 | data.enforceInterface(IActivityManager.descriptor); |
| 1103 | ComponentName className = ComponentName.readFromParcel(data); |
| 1104 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 1105 | int id = data.readInt(); |
| 1106 | Notification notification = null; |
| 1107 | if (data.readInt() != 0) { |
| 1108 | notification = Notification.CREATOR.createFromParcel(data); |
| 1109 | } |
| 1110 | boolean removeNotification = data.readInt() != 0; |
| 1111 | setServiceForeground(className, token, id, notification, removeNotification); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1112 | reply.writeNoException(); |
| 1113 | return true; |
| 1114 | } |
| 1115 | |
| 1116 | case BIND_SERVICE_TRANSACTION: { |
| 1117 | data.enforceInterface(IActivityManager.descriptor); |
| 1118 | IBinder b = data.readStrongBinder(); |
| 1119 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1120 | IBinder token = data.readStrongBinder(); |
| 1121 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1122 | String resolvedType = data.readString(); |
| 1123 | b = data.readStrongBinder(); |
| 1124 | int fl = data.readInt(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1125 | String callingPackage = data.readString(); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 1126 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1127 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1128 | int res = bindService(app, token, service, resolvedType, conn, fl, |
| 1129 | callingPackage, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1130 | reply.writeNoException(); |
| 1131 | reply.writeInt(res); |
| 1132 | return true; |
| 1133 | } |
| 1134 | |
| 1135 | case UNBIND_SERVICE_TRANSACTION: { |
| 1136 | data.enforceInterface(IActivityManager.descriptor); |
| 1137 | IBinder b = data.readStrongBinder(); |
| 1138 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
| 1139 | boolean res = unbindService(conn); |
| 1140 | reply.writeNoException(); |
| 1141 | reply.writeInt(res ? 1 : 0); |
| 1142 | return true; |
| 1143 | } |
| 1144 | |
| 1145 | case PUBLISH_SERVICE_TRANSACTION: { |
| 1146 | data.enforceInterface(IActivityManager.descriptor); |
| 1147 | IBinder token = data.readStrongBinder(); |
| 1148 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1149 | IBinder service = data.readStrongBinder(); |
| 1150 | publishService(token, intent, service); |
| 1151 | reply.writeNoException(); |
| 1152 | return true; |
| 1153 | } |
| 1154 | |
| 1155 | case UNBIND_FINISHED_TRANSACTION: { |
| 1156 | data.enforceInterface(IActivityManager.descriptor); |
| 1157 | IBinder token = data.readStrongBinder(); |
| 1158 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 1159 | boolean doRebind = data.readInt() != 0; |
| 1160 | unbindFinished(token, intent, doRebind); |
| 1161 | reply.writeNoException(); |
| 1162 | return true; |
| 1163 | } |
| 1164 | |
| 1165 | case SERVICE_DONE_EXECUTING_TRANSACTION: { |
| 1166 | data.enforceInterface(IActivityManager.descriptor); |
| 1167 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 1168 | int type = data.readInt(); |
| 1169 | int startId = data.readInt(); |
| 1170 | int res = data.readInt(); |
| 1171 | serviceDoneExecuting(token, type, startId, res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1172 | reply.writeNoException(); |
| 1173 | return true; |
| 1174 | } |
| 1175 | |
| 1176 | case START_INSTRUMENTATION_TRANSACTION: { |
| 1177 | data.enforceInterface(IActivityManager.descriptor); |
| 1178 | ComponentName className = ComponentName.readFromParcel(data); |
| 1179 | String profileFile = data.readString(); |
| 1180 | int fl = data.readInt(); |
| 1181 | Bundle arguments = data.readBundle(); |
| 1182 | IBinder b = data.readStrongBinder(); |
| 1183 | IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 1184 | b = data.readStrongBinder(); |
| 1185 | IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1186 | int userId = data.readInt(); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 1187 | String abiOverride = data.readString(); |
| 1188 | boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId, |
| 1189 | abiOverride); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1190 | reply.writeNoException(); |
| 1191 | reply.writeInt(res ? 1 : 0); |
| 1192 | return true; |
| 1193 | } |
| 1194 | |
| 1195 | |
| 1196 | case FINISH_INSTRUMENTATION_TRANSACTION: { |
| 1197 | data.enforceInterface(IActivityManager.descriptor); |
| 1198 | IBinder b = data.readStrongBinder(); |
| 1199 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1200 | int resultCode = data.readInt(); |
| 1201 | Bundle results = data.readBundle(); |
| 1202 | finishInstrumentation(app, resultCode, results); |
| 1203 | reply.writeNoException(); |
| 1204 | return true; |
| 1205 | } |
| 1206 | |
| 1207 | case GET_CONFIGURATION_TRANSACTION: { |
| 1208 | data.enforceInterface(IActivityManager.descriptor); |
| 1209 | Configuration config = getConfiguration(); |
| 1210 | reply.writeNoException(); |
| 1211 | config.writeToParcel(reply, 0); |
| 1212 | return true; |
| 1213 | } |
| 1214 | |
| 1215 | case UPDATE_CONFIGURATION_TRANSACTION: { |
| 1216 | data.enforceInterface(IActivityManager.descriptor); |
| 1217 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 1218 | updateConfiguration(config); |
| 1219 | reply.writeNoException(); |
| 1220 | return true; |
| 1221 | } |
| 1222 | |
| 1223 | case SET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1224 | data.enforceInterface(IActivityManager.descriptor); |
| 1225 | IBinder token = data.readStrongBinder(); |
| 1226 | int requestedOrientation = data.readInt(); |
| 1227 | setRequestedOrientation(token, requestedOrientation); |
| 1228 | reply.writeNoException(); |
| 1229 | return true; |
| 1230 | } |
| 1231 | |
| 1232 | case GET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 1233 | data.enforceInterface(IActivityManager.descriptor); |
| 1234 | IBinder token = data.readStrongBinder(); |
| 1235 | int req = getRequestedOrientation(token); |
| 1236 | reply.writeNoException(); |
| 1237 | reply.writeInt(req); |
| 1238 | return true; |
| 1239 | } |
| 1240 | |
| 1241 | case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: { |
| 1242 | data.enforceInterface(IActivityManager.descriptor); |
| 1243 | IBinder token = data.readStrongBinder(); |
| 1244 | ComponentName cn = getActivityClassForToken(token); |
| 1245 | reply.writeNoException(); |
| 1246 | ComponentName.writeToParcel(cn, reply); |
| 1247 | return true; |
| 1248 | } |
| 1249 | |
| 1250 | case GET_PACKAGE_FOR_TOKEN_TRANSACTION: { |
| 1251 | data.enforceInterface(IActivityManager.descriptor); |
| 1252 | IBinder token = data.readStrongBinder(); |
| 1253 | reply.writeNoException(); |
| 1254 | reply.writeString(getPackageForToken(token)); |
| 1255 | return true; |
| 1256 | } |
| 1257 | |
| 1258 | case GET_INTENT_SENDER_TRANSACTION: { |
| 1259 | data.enforceInterface(IActivityManager.descriptor); |
| 1260 | int type = data.readInt(); |
| 1261 | String packageName = data.readString(); |
| 1262 | IBinder token = data.readStrongBinder(); |
| 1263 | String resultWho = data.readString(); |
| 1264 | int requestCode = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1265 | Intent[] requestIntents; |
| 1266 | String[] requestResolvedTypes; |
| 1267 | if (data.readInt() != 0) { |
| 1268 | requestIntents = data.createTypedArray(Intent.CREATOR); |
| 1269 | requestResolvedTypes = data.createStringArray(); |
| 1270 | } else { |
| 1271 | requestIntents = null; |
| 1272 | requestResolvedTypes = null; |
| 1273 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1274 | int fl = data.readInt(); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 1275 | Bundle options = data.readInt() != 0 |
| 1276 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1277 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1278 | IIntentSender res = getIntentSender(type, packageName, token, |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1279 | resultWho, requestCode, requestIntents, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1280 | requestResolvedTypes, fl, options, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1281 | reply.writeNoException(); |
| 1282 | reply.writeStrongBinder(res != null ? res.asBinder() : null); |
| 1283 | return true; |
| 1284 | } |
| 1285 | |
| 1286 | case CANCEL_INTENT_SENDER_TRANSACTION: { |
| 1287 | data.enforceInterface(IActivityManager.descriptor); |
| 1288 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1289 | data.readStrongBinder()); |
| 1290 | cancelIntentSender(r); |
| 1291 | reply.writeNoException(); |
| 1292 | return true; |
| 1293 | } |
| 1294 | |
| 1295 | case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: { |
| 1296 | data.enforceInterface(IActivityManager.descriptor); |
| 1297 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1298 | data.readStrongBinder()); |
| 1299 | String res = getPackageForIntentSender(r); |
| 1300 | reply.writeNoException(); |
| 1301 | reply.writeString(res); |
| 1302 | return true; |
| 1303 | } |
| 1304 | |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 1305 | case GET_UID_FOR_INTENT_SENDER_TRANSACTION: { |
| 1306 | data.enforceInterface(IActivityManager.descriptor); |
| 1307 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1308 | data.readStrongBinder()); |
| 1309 | int res = getUidForIntentSender(r); |
| 1310 | reply.writeNoException(); |
| 1311 | reply.writeInt(res); |
| 1312 | return true; |
| 1313 | } |
| 1314 | |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 1315 | case HANDLE_INCOMING_USER_TRANSACTION: { |
| 1316 | data.enforceInterface(IActivityManager.descriptor); |
| 1317 | int callingPid = data.readInt(); |
| 1318 | int callingUid = data.readInt(); |
| 1319 | int userId = data.readInt(); |
| 1320 | boolean allowAll = data.readInt() != 0 ; |
| 1321 | boolean requireFull = data.readInt() != 0; |
| 1322 | String name = data.readString(); |
| 1323 | String callerPackage = data.readString(); |
| 1324 | int res = handleIncomingUser(callingPid, callingUid, userId, allowAll, |
| 1325 | requireFull, name, callerPackage); |
| 1326 | reply.writeNoException(); |
| 1327 | reply.writeInt(res); |
| 1328 | return true; |
| 1329 | } |
| 1330 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1331 | case SET_PROCESS_LIMIT_TRANSACTION: { |
| 1332 | data.enforceInterface(IActivityManager.descriptor); |
| 1333 | int max = data.readInt(); |
| 1334 | setProcessLimit(max); |
| 1335 | reply.writeNoException(); |
| 1336 | return true; |
| 1337 | } |
| 1338 | |
| 1339 | case GET_PROCESS_LIMIT_TRANSACTION: { |
| 1340 | data.enforceInterface(IActivityManager.descriptor); |
| 1341 | int limit = getProcessLimit(); |
| 1342 | reply.writeNoException(); |
| 1343 | reply.writeInt(limit); |
| 1344 | return true; |
| 1345 | } |
| 1346 | |
| 1347 | case SET_PROCESS_FOREGROUND_TRANSACTION: { |
| 1348 | data.enforceInterface(IActivityManager.descriptor); |
| 1349 | IBinder token = data.readStrongBinder(); |
| 1350 | int pid = data.readInt(); |
| 1351 | boolean isForeground = data.readInt() != 0; |
| 1352 | setProcessForeground(token, pid, isForeground); |
| 1353 | reply.writeNoException(); |
| 1354 | return true; |
| 1355 | } |
| 1356 | |
| 1357 | case CHECK_PERMISSION_TRANSACTION: { |
| 1358 | data.enforceInterface(IActivityManager.descriptor); |
| 1359 | String perm = data.readString(); |
| 1360 | int pid = data.readInt(); |
| 1361 | int uid = data.readInt(); |
| 1362 | int res = checkPermission(perm, pid, uid); |
| 1363 | reply.writeNoException(); |
| 1364 | reply.writeInt(res); |
| 1365 | return true; |
| 1366 | } |
| 1367 | |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1368 | case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: { |
| 1369 | data.enforceInterface(IActivityManager.descriptor); |
| 1370 | String perm = data.readString(); |
| 1371 | int pid = data.readInt(); |
| 1372 | int uid = data.readInt(); |
| 1373 | IBinder token = data.readStrongBinder(); |
| 1374 | int res = checkPermissionWithToken(perm, pid, uid, token); |
| 1375 | reply.writeNoException(); |
| 1376 | reply.writeInt(res); |
| 1377 | return true; |
| 1378 | } |
| 1379 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1380 | case CHECK_URI_PERMISSION_TRANSACTION: { |
| 1381 | data.enforceInterface(IActivityManager.descriptor); |
| 1382 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1383 | int pid = data.readInt(); |
| 1384 | int uid = data.readInt(); |
| 1385 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1386 | int userId = data.readInt(); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 1387 | IBinder callerToken = data.readStrongBinder(); |
| 1388 | int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1389 | reply.writeNoException(); |
| 1390 | reply.writeInt(res); |
| 1391 | return true; |
| 1392 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1393 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1394 | case CLEAR_APP_DATA_TRANSACTION: { |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1395 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1396 | String packageName = data.readString(); |
| 1397 | IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface( |
| 1398 | data.readStrongBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 1399 | int userId = data.readInt(); |
| 1400 | boolean res = clearApplicationUserData(packageName, observer, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1401 | reply.writeNoException(); |
| 1402 | reply.writeInt(res ? 1 : 0); |
| 1403 | return true; |
| 1404 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1405 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1406 | case GRANT_URI_PERMISSION_TRANSACTION: { |
| 1407 | data.enforceInterface(IActivityManager.descriptor); |
| 1408 | IBinder b = data.readStrongBinder(); |
| 1409 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1410 | String targetPkg = data.readString(); |
| 1411 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1412 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1413 | int userId = data.readInt(); |
| 1414 | grantUriPermission(app, targetPkg, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1415 | reply.writeNoException(); |
| 1416 | return true; |
| 1417 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1418 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1419 | case REVOKE_URI_PERMISSION_TRANSACTION: { |
| 1420 | data.enforceInterface(IActivityManager.descriptor); |
| 1421 | IBinder b = data.readStrongBinder(); |
| 1422 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1423 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1424 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1425 | int userId = data.readInt(); |
| 1426 | revokeUriPermission(app, uri, mode, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1427 | reply.writeNoException(); |
| 1428 | return true; |
| 1429 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1430 | |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1431 | case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1432 | data.enforceInterface(IActivityManager.descriptor); |
| 1433 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1434 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1435 | int userId = data.readInt(); |
| 1436 | takePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1437 | reply.writeNoException(); |
| 1438 | return true; |
| 1439 | } |
| 1440 | |
| 1441 | case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: { |
| 1442 | data.enforceInterface(IActivityManager.descriptor); |
| 1443 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1444 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 1445 | int userId = data.readInt(); |
| 1446 | releasePersistableUriPermission(uri, mode, userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1447 | reply.writeNoException(); |
| 1448 | return true; |
| 1449 | } |
| 1450 | |
| 1451 | case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: { |
| 1452 | data.enforceInterface(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 1453 | final String packageName = data.readString(); |
| 1454 | final boolean incoming = data.readInt() != 0; |
| 1455 | final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions( |
| 1456 | packageName, incoming); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 1457 | reply.writeNoException(); |
| 1458 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1459 | return true; |
| 1460 | } |
| 1461 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 1462 | case GET_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1463 | data.enforceInterface(IActivityManager.descriptor); |
| 1464 | final String packageName = data.readString(); |
| 1465 | final int userId = data.readInt(); |
| 1466 | final ParceledListSlice<UriPermission> perms = getGrantedUriPermissions(packageName, |
| 1467 | userId); |
| 1468 | reply.writeNoException(); |
| 1469 | perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1470 | return true; |
| 1471 | } |
| 1472 | |
| 1473 | case CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION: { |
| 1474 | data.enforceInterface(IActivityManager.descriptor); |
| 1475 | final String packageName = data.readString(); |
| 1476 | final int userId = data.readInt(); |
| 1477 | clearGrantedUriPermissions(packageName, userId); |
| 1478 | reply.writeNoException(); |
| 1479 | return true; |
| 1480 | } |
| 1481 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1482 | case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: { |
| 1483 | data.enforceInterface(IActivityManager.descriptor); |
| 1484 | IBinder b = data.readStrongBinder(); |
| 1485 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1486 | boolean waiting = data.readInt() != 0; |
| 1487 | showWaitingForDebugger(app, waiting); |
| 1488 | reply.writeNoException(); |
| 1489 | return true; |
| 1490 | } |
| 1491 | |
| 1492 | case GET_MEMORY_INFO_TRANSACTION: { |
| 1493 | data.enforceInterface(IActivityManager.descriptor); |
| 1494 | ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); |
| 1495 | getMemoryInfo(mi); |
| 1496 | reply.writeNoException(); |
| 1497 | mi.writeToParcel(reply, 0); |
| 1498 | return true; |
| 1499 | } |
| 1500 | |
| 1501 | case UNHANDLED_BACK_TRANSACTION: { |
| 1502 | data.enforceInterface(IActivityManager.descriptor); |
| 1503 | unhandledBack(); |
| 1504 | reply.writeNoException(); |
| 1505 | return true; |
| 1506 | } |
| 1507 | |
| 1508 | case OPEN_CONTENT_URI_TRANSACTION: { |
| 1509 | data.enforceInterface(IActivityManager.descriptor); |
| 1510 | Uri uri = Uri.parse(data.readString()); |
| 1511 | ParcelFileDescriptor pfd = openContentUri(uri); |
| 1512 | reply.writeNoException(); |
| 1513 | if (pfd != null) { |
| 1514 | reply.writeInt(1); |
| 1515 | pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1516 | } else { |
| 1517 | reply.writeInt(0); |
| 1518 | } |
| 1519 | return true; |
| 1520 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1521 | |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1522 | case SET_LOCK_SCREEN_SHOWN_TRANSACTION: { |
| 1523 | data.enforceInterface(IActivityManager.descriptor); |
| 1524 | setLockScreenShown(data.readInt() != 0); |
| 1525 | reply.writeNoException(); |
| 1526 | return true; |
| 1527 | } |
| 1528 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1529 | case SET_DEBUG_APP_TRANSACTION: { |
| 1530 | data.enforceInterface(IActivityManager.descriptor); |
| 1531 | String pn = data.readString(); |
| 1532 | boolean wfd = data.readInt() != 0; |
| 1533 | boolean per = data.readInt() != 0; |
| 1534 | setDebugApp(pn, wfd, per); |
| 1535 | reply.writeNoException(); |
| 1536 | return true; |
| 1537 | } |
| 1538 | |
| 1539 | case SET_ALWAYS_FINISH_TRANSACTION: { |
| 1540 | data.enforceInterface(IActivityManager.descriptor); |
| 1541 | boolean enabled = data.readInt() != 0; |
| 1542 | setAlwaysFinish(enabled); |
| 1543 | reply.writeNoException(); |
| 1544 | return true; |
| 1545 | } |
| 1546 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1547 | case SET_ACTIVITY_CONTROLLER_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1548 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1549 | IActivityController watcher = IActivityController.Stub.asInterface( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1550 | data.readStrongBinder()); |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 1551 | boolean imAMonkey = data.readInt() != 0; |
| 1552 | setActivityController(watcher, imAMonkey); |
Sungmin Choi | cdb86bb | 2012-12-20 14:08:59 +0900 | [diff] [blame] | 1553 | reply.writeNoException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1554 | return true; |
| 1555 | } |
| 1556 | |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 1557 | case SET_LENIENT_BACKGROUND_CHECK_TRANSACTION: { |
| 1558 | data.enforceInterface(IActivityManager.descriptor); |
| 1559 | boolean enabled = data.readInt() != 0; |
| 1560 | setLenientBackgroundCheck(enabled); |
| 1561 | reply.writeNoException(); |
| 1562 | return true; |
| 1563 | } |
| 1564 | |
Dianne Hackborn | 970510b | 2016-02-24 16:56:42 -0800 | [diff] [blame] | 1565 | case GET_MEMORY_TRIM_LEVEL_TRANSACTION: { |
| 1566 | data.enforceInterface(IActivityManager.descriptor); |
| 1567 | int level = getMemoryTrimLevel(); |
| 1568 | reply.writeNoException(); |
| 1569 | reply.writeInt(level); |
| 1570 | return true; |
| 1571 | } |
| 1572 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1573 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1574 | data.enforceInterface(IActivityManager.descriptor); |
| 1575 | enterSafeMode(); |
| 1576 | reply.writeNoException(); |
| 1577 | return true; |
| 1578 | } |
| 1579 | |
| 1580 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1581 | data.enforceInterface(IActivityManager.descriptor); |
| 1582 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1583 | data.readStrongBinder()); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 1584 | int sourceUid = data.readInt(); |
| 1585 | String sourcePkg = data.readString(); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 1586 | String tag = data.readString(); |
| 1587 | noteWakeupAlarm(is, sourceUid, sourcePkg, tag); |
| 1588 | reply.writeNoException(); |
| 1589 | return true; |
| 1590 | } |
| 1591 | |
| 1592 | case NOTE_ALARM_START_TRANSACTION: { |
| 1593 | data.enforceInterface(IActivityManager.descriptor); |
| 1594 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1595 | data.readStrongBinder()); |
| 1596 | int sourceUid = data.readInt(); |
| 1597 | String tag = data.readString(); |
| 1598 | noteAlarmStart(is, sourceUid, tag); |
| 1599 | reply.writeNoException(); |
| 1600 | return true; |
| 1601 | } |
| 1602 | |
| 1603 | case NOTE_ALARM_FINISH_TRANSACTION: { |
| 1604 | data.enforceInterface(IActivityManager.descriptor); |
| 1605 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1606 | data.readStrongBinder()); |
| 1607 | int sourceUid = data.readInt(); |
| 1608 | String tag = data.readString(); |
| 1609 | noteAlarmFinish(is, sourceUid, tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1610 | reply.writeNoException(); |
| 1611 | return true; |
| 1612 | } |
| 1613 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1614 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1615 | data.enforceInterface(IActivityManager.descriptor); |
| 1616 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1617 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1618 | boolean secure = data.readInt() != 0; |
| 1619 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1620 | reply.writeNoException(); |
| 1621 | reply.writeInt(res ? 1 : 0); |
| 1622 | return true; |
| 1623 | } |
| 1624 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1625 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1626 | data.enforceInterface(IActivityManager.descriptor); |
| 1627 | String reason = data.readString(); |
| 1628 | boolean res = killProcessesBelowForeground(reason); |
| 1629 | reply.writeNoException(); |
| 1630 | reply.writeInt(res ? 1 : 0); |
| 1631 | return true; |
| 1632 | } |
| 1633 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1634 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1635 | data.enforceInterface(IActivityManager.descriptor); |
| 1636 | IBinder app = data.readStrongBinder(); |
| 1637 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1638 | handleApplicationCrash(app, ci); |
| 1639 | reply.writeNoException(); |
| 1640 | return true; |
| 1641 | } |
| 1642 | |
| 1643 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1644 | data.enforceInterface(IActivityManager.descriptor); |
| 1645 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1646 | String tag = data.readString(); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1647 | boolean system = data.readInt() != 0; |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1648 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 1649 | boolean res = handleApplicationWtf(app, tag, system, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1650 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1651 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1652 | return true; |
| 1653 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1654 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1655 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1656 | data.enforceInterface(IActivityManager.descriptor); |
| 1657 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1658 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1659 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1660 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1661 | reply.writeNoException(); |
| 1662 | return true; |
| 1663 | } |
| 1664 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1665 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1666 | data.enforceInterface(IActivityManager.descriptor); |
| 1667 | int sig = data.readInt(); |
| 1668 | signalPersistentProcesses(sig); |
| 1669 | reply.writeNoException(); |
| 1670 | return true; |
| 1671 | } |
| 1672 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1673 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1674 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1675 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1676 | int userId = data.readInt(); |
| 1677 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1678 | reply.writeNoException(); |
| 1679 | return true; |
| 1680 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1681 | |
| 1682 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1683 | data.enforceInterface(IActivityManager.descriptor); |
| 1684 | killAllBackgroundProcesses(); |
| 1685 | reply.writeNoException(); |
| 1686 | return true; |
| 1687 | } |
Craig Mautner | 4cd0c13f | 2013-04-16 15:55:52 -0700 | [diff] [blame] | 1688 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 1689 | case KILL_PACKAGE_DEPENDENTS_TRANSACTION: { |
| 1690 | data.enforceInterface(IActivityManager.descriptor); |
| 1691 | String packageName = data.readString(); |
| 1692 | int userId = data.readInt(); |
| 1693 | killPackageDependents(packageName, userId); |
| 1694 | reply.writeNoException(); |
| 1695 | return true; |
| 1696 | } |
| 1697 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1698 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1699 | data.enforceInterface(IActivityManager.descriptor); |
| 1700 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1701 | int userId = data.readInt(); |
| 1702 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1703 | reply.writeNoException(); |
| 1704 | return true; |
| 1705 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1706 | |
| 1707 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1708 | data.enforceInterface(IActivityManager.descriptor); |
| 1709 | ActivityManager.RunningAppProcessInfo info = |
| 1710 | new ActivityManager.RunningAppProcessInfo(); |
| 1711 | getMyMemoryState(info); |
| 1712 | reply.writeNoException(); |
| 1713 | info.writeToParcel(reply, 0); |
| 1714 | return true; |
| 1715 | } |
| 1716 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1717 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1718 | data.enforceInterface(IActivityManager.descriptor); |
| 1719 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1720 | reply.writeNoException(); |
| 1721 | config.writeToParcel(reply, 0); |
| 1722 | return true; |
| 1723 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1724 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1725 | case PROFILE_CONTROL_TRANSACTION: { |
| 1726 | data.enforceInterface(IActivityManager.descriptor); |
| 1727 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1728 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1729 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1730 | int profileType = data.readInt(); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1731 | ProfilerInfo profilerInfo = data.readInt() != 0 |
| 1732 | ? ProfilerInfo.CREATOR.createFromParcel(data) : null; |
| 1733 | boolean res = profileControl(process, userId, start, profilerInfo, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1734 | reply.writeNoException(); |
| 1735 | reply.writeInt(res ? 1 : 0); |
| 1736 | return true; |
| 1737 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 1738 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1739 | case SHUTDOWN_TRANSACTION: { |
| 1740 | data.enforceInterface(IActivityManager.descriptor); |
| 1741 | boolean res = shutdown(data.readInt()); |
| 1742 | reply.writeNoException(); |
| 1743 | reply.writeInt(res ? 1 : 0); |
| 1744 | return true; |
| 1745 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1746 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1747 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1748 | data.enforceInterface(IActivityManager.descriptor); |
| 1749 | stopAppSwitches(); |
| 1750 | reply.writeNoException(); |
| 1751 | return true; |
| 1752 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1753 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1754 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1755 | data.enforceInterface(IActivityManager.descriptor); |
| 1756 | resumeAppSwitches(); |
| 1757 | reply.writeNoException(); |
| 1758 | return true; |
| 1759 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1760 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1761 | case PEEK_SERVICE_TRANSACTION: { |
| 1762 | data.enforceInterface(IActivityManager.descriptor); |
| 1763 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1764 | String resolvedType = data.readString(); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 1765 | String callingPackage = data.readString(); |
| 1766 | IBinder binder = peekService(service, resolvedType, callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1767 | reply.writeNoException(); |
| 1768 | reply.writeStrongBinder(binder); |
| 1769 | return true; |
| 1770 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1771 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1772 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1773 | data.enforceInterface(IActivityManager.descriptor); |
| 1774 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1775 | int backupRestoreMode = data.readInt(); |
| 1776 | boolean success = bindBackupAgent(info, backupRestoreMode); |
| 1777 | reply.writeNoException(); |
| 1778 | reply.writeInt(success ? 1 : 0); |
| 1779 | return true; |
| 1780 | } |
| 1781 | |
| 1782 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1783 | data.enforceInterface(IActivityManager.descriptor); |
| 1784 | String packageName = data.readString(); |
| 1785 | IBinder agent = data.readStrongBinder(); |
| 1786 | backupAgentCreated(packageName, agent); |
| 1787 | reply.writeNoException(); |
| 1788 | return true; |
| 1789 | } |
| 1790 | |
| 1791 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1792 | data.enforceInterface(IActivityManager.descriptor); |
| 1793 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1794 | unbindBackupAgent(info); |
| 1795 | reply.writeNoException(); |
| 1796 | return true; |
| 1797 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1798 | |
| 1799 | case ADD_PACKAGE_DEPENDENCY_TRANSACTION: { |
| 1800 | data.enforceInterface(IActivityManager.descriptor); |
| 1801 | String packageName = data.readString(); |
| 1802 | addPackageDependency(packageName); |
| 1803 | reply.writeNoException(); |
| 1804 | return true; |
| 1805 | } |
| 1806 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1807 | case KILL_APPLICATION_WITH_APPID_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1808 | data.enforceInterface(IActivityManager.descriptor); |
| 1809 | String pkg = data.readString(); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1810 | int appid = data.readInt(); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 1811 | String reason = data.readString(); |
| 1812 | killApplicationWithAppId(pkg, appid, reason); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1813 | reply.writeNoException(); |
| 1814 | return true; |
| 1815 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 1816 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1817 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1818 | data.enforceInterface(IActivityManager.descriptor); |
| 1819 | String reason = data.readString(); |
| 1820 | closeSystemDialogs(reason); |
| 1821 | reply.writeNoException(); |
| 1822 | return true; |
| 1823 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1824 | |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1825 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1826 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1827 | int[] pids = data.createIntArray(); |
| 1828 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1829 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1830 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1831 | return true; |
| 1832 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1833 | |
| 1834 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1835 | data.enforceInterface(IActivityManager.descriptor); |
| 1836 | String processName = data.readString(); |
| 1837 | int uid = data.readInt(); |
| 1838 | killApplicationProcess(processName, uid); |
| 1839 | reply.writeNoException(); |
| 1840 | return true; |
| 1841 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1842 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1843 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1844 | data.enforceInterface(IActivityManager.descriptor); |
| 1845 | IBinder token = data.readStrongBinder(); |
| 1846 | String packageName = data.readString(); |
| 1847 | int enterAnim = data.readInt(); |
| 1848 | int exitAnim = data.readInt(); |
| 1849 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1850 | reply.writeNoException(); |
| 1851 | return true; |
| 1852 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1853 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1854 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1855 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1856 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1857 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1858 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1859 | return true; |
| 1860 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1861 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1862 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1863 | data.enforceInterface(IActivityManager.descriptor); |
| 1864 | final boolean monkey = (data.readInt() == 1); |
| 1865 | setUserIsMonkey(monkey); |
| 1866 | reply.writeNoException(); |
| 1867 | return true; |
| 1868 | } |
| 1869 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1870 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1871 | data.enforceInterface(IActivityManager.descriptor); |
| 1872 | finishHeavyWeightApp(); |
| 1873 | reply.writeNoException(); |
| 1874 | return true; |
| 1875 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1876 | |
| 1877 | case IS_IMMERSIVE_TRANSACTION: { |
| 1878 | data.enforceInterface(IActivityManager.descriptor); |
| 1879 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1880 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1881 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1882 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1883 | return true; |
| 1884 | } |
| 1885 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 1886 | case IS_TOP_OF_TASK_TRANSACTION: { |
| 1887 | data.enforceInterface(IActivityManager.descriptor); |
| 1888 | IBinder token = data.readStrongBinder(); |
| 1889 | final boolean isTopOfTask = isTopOfTask(token); |
| 1890 | reply.writeNoException(); |
| 1891 | reply.writeInt(isTopOfTask ? 1 : 0); |
| 1892 | return true; |
| 1893 | } |
| 1894 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1895 | case CONVERT_FROM_TRANSLUCENT_TRANSACTION: { |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1896 | data.enforceInterface(IActivityManager.descriptor); |
| 1897 | IBinder token = data.readStrongBinder(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1898 | boolean converted = convertFromTranslucent(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1899 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1900 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1901 | return true; |
| 1902 | } |
| 1903 | |
| 1904 | case CONVERT_TO_TRANSLUCENT_TRANSACTION: { |
| 1905 | data.enforceInterface(IActivityManager.descriptor); |
| 1906 | IBinder token = data.readStrongBinder(); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1907 | final Bundle bundle; |
| 1908 | if (data.readInt() == 0) { |
| 1909 | bundle = null; |
| 1910 | } else { |
| 1911 | bundle = data.readBundle(); |
| 1912 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 1913 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1914 | boolean converted = convertToTranslucent(token, options); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1915 | reply.writeNoException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 1916 | reply.writeInt(converted ? 1 : 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 1917 | return true; |
| 1918 | } |
| 1919 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 1920 | case GET_ACTIVITY_OPTIONS_TRANSACTION: { |
| 1921 | data.enforceInterface(IActivityManager.descriptor); |
| 1922 | IBinder token = data.readStrongBinder(); |
| 1923 | final ActivityOptions options = getActivityOptions(token); |
| 1924 | reply.writeNoException(); |
| 1925 | reply.writeBundle(options == null ? null : options.toBundle()); |
| 1926 | return true; |
| 1927 | } |
| 1928 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1929 | case SET_IMMERSIVE_TRANSACTION: { |
| 1930 | data.enforceInterface(IActivityManager.descriptor); |
| 1931 | IBinder token = data.readStrongBinder(); |
| 1932 | boolean imm = data.readInt() == 1; |
| 1933 | setImmersive(token, imm); |
| 1934 | reply.writeNoException(); |
| 1935 | return true; |
| 1936 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 1937 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1938 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1939 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1940 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1941 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1942 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1943 | return true; |
| 1944 | } |
| 1945 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1946 | case CRASH_APPLICATION_TRANSACTION: { |
| 1947 | data.enforceInterface(IActivityManager.descriptor); |
| 1948 | int uid = data.readInt(); |
| 1949 | int initialPid = data.readInt(); |
| 1950 | String packageName = data.readString(); |
| 1951 | String message = data.readString(); |
| 1952 | crashApplication(uid, initialPid, packageName, message); |
| 1953 | reply.writeNoException(); |
| 1954 | return true; |
| 1955 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1956 | |
| 1957 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1958 | data.enforceInterface(IActivityManager.descriptor); |
| 1959 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1960 | int userId = data.readInt(); |
| 1961 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1962 | reply.writeNoException(); |
| 1963 | reply.writeString(type); |
| 1964 | return true; |
| 1965 | } |
| 1966 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1967 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1968 | data.enforceInterface(IActivityManager.descriptor); |
| 1969 | String name = data.readString(); |
| 1970 | IBinder perm = newUriPermissionOwner(name); |
| 1971 | reply.writeNoException(); |
| 1972 | reply.writeStrongBinder(perm); |
| 1973 | return true; |
| 1974 | } |
| 1975 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 1976 | case GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION: { |
| 1977 | data.enforceInterface(IActivityManager.descriptor); |
| 1978 | IBinder activityToken = data.readStrongBinder(); |
| 1979 | IBinder perm = getUriPermissionOwnerForActivity(activityToken); |
| 1980 | reply.writeNoException(); |
| 1981 | reply.writeStrongBinder(perm); |
| 1982 | return true; |
| 1983 | } |
| 1984 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1985 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1986 | data.enforceInterface(IActivityManager.descriptor); |
| 1987 | IBinder owner = data.readStrongBinder(); |
| 1988 | int fromUid = data.readInt(); |
| 1989 | String targetPkg = data.readString(); |
| 1990 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1991 | int mode = data.readInt(); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 1992 | int sourceUserId = data.readInt(); |
| 1993 | int targetUserId = data.readInt(); |
| 1994 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId, |
| 1995 | targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1996 | reply.writeNoException(); |
| 1997 | return true; |
| 1998 | } |
| 1999 | |
| 2000 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 2001 | data.enforceInterface(IActivityManager.descriptor); |
| 2002 | IBinder owner = data.readStrongBinder(); |
| 2003 | Uri uri = null; |
| 2004 | if (data.readInt() != 0) { |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2005 | uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2006 | } |
| 2007 | int mode = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2008 | int userId = data.readInt(); |
| 2009 | revokeUriPermissionFromOwner(owner, uri, mode, userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 2010 | reply.writeNoException(); |
| 2011 | return true; |
| 2012 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 2013 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 2014 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 2015 | data.enforceInterface(IActivityManager.descriptor); |
| 2016 | int callingUid = data.readInt(); |
| 2017 | String targetPkg = data.readString(); |
| 2018 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 2019 | int modeFlags = data.readInt(); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 2020 | int userId = data.readInt(); |
| 2021 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 2022 | reply.writeNoException(); |
| 2023 | reply.writeInt(res); |
| 2024 | return true; |
| 2025 | } |
| 2026 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2027 | case DUMP_HEAP_TRANSACTION: { |
| 2028 | data.enforceInterface(IActivityManager.descriptor); |
| 2029 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 2030 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2031 | boolean managed = data.readInt() != 0; |
| 2032 | String path = data.readString(); |
| 2033 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 2034 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 2035 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 2036 | reply.writeNoException(); |
| 2037 | reply.writeInt(res ? 1 : 0); |
| 2038 | return true; |
| 2039 | } |
| 2040 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2041 | case START_ACTIVITIES_TRANSACTION: |
| 2042 | { |
| 2043 | data.enforceInterface(IActivityManager.descriptor); |
| 2044 | IBinder b = data.readStrongBinder(); |
| 2045 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2046 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2047 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 2048 | String[] resolvedTypes = data.createStringArray(); |
| 2049 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2050 | Bundle options = data.readInt() != 0 |
| 2051 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2052 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2053 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 2054 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2055 | reply.writeNoException(); |
| 2056 | reply.writeInt(result); |
| 2057 | return true; |
| 2058 | } |
| 2059 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2060 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2061 | { |
| 2062 | data.enforceInterface(IActivityManager.descriptor); |
| 2063 | int mode = getFrontActivityScreenCompatMode(); |
| 2064 | reply.writeNoException(); |
| 2065 | reply.writeInt(mode); |
| 2066 | return true; |
| 2067 | } |
| 2068 | |
| 2069 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2070 | { |
| 2071 | data.enforceInterface(IActivityManager.descriptor); |
| 2072 | int mode = data.readInt(); |
| 2073 | setFrontActivityScreenCompatMode(mode); |
| 2074 | reply.writeNoException(); |
| 2075 | reply.writeInt(mode); |
| 2076 | return true; |
| 2077 | } |
| 2078 | |
| 2079 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2080 | { |
| 2081 | data.enforceInterface(IActivityManager.descriptor); |
| 2082 | String pkg = data.readString(); |
| 2083 | int mode = getPackageScreenCompatMode(pkg); |
| 2084 | reply.writeNoException(); |
| 2085 | reply.writeInt(mode); |
| 2086 | return true; |
| 2087 | } |
| 2088 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2089 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 2090 | { |
| 2091 | data.enforceInterface(IActivityManager.descriptor); |
| 2092 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 2093 | int mode = data.readInt(); |
| 2094 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 2095 | reply.writeNoException(); |
| 2096 | return true; |
| 2097 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2098 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2099 | case SWITCH_USER_TRANSACTION: { |
| 2100 | data.enforceInterface(IActivityManager.descriptor); |
| 2101 | int userid = data.readInt(); |
| 2102 | boolean result = switchUser(userid); |
| 2103 | reply.writeNoException(); |
| 2104 | reply.writeInt(result ? 1 : 0); |
| 2105 | return true; |
| 2106 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2107 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 2108 | case START_USER_IN_BACKGROUND_TRANSACTION: { |
| 2109 | data.enforceInterface(IActivityManager.descriptor); |
| 2110 | int userid = data.readInt(); |
| 2111 | boolean result = startUserInBackground(userid); |
| 2112 | reply.writeNoException(); |
| 2113 | reply.writeInt(result ? 1 : 0); |
| 2114 | return true; |
| 2115 | } |
| 2116 | |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2117 | case UNLOCK_USER_TRANSACTION: { |
| 2118 | data.enforceInterface(IActivityManager.descriptor); |
| 2119 | int userId = data.readInt(); |
| 2120 | byte[] token = data.createByteArray(); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 2121 | byte[] secret = data.createByteArray(); |
| 2122 | boolean result = unlockUser(userId, token, secret); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 2123 | reply.writeNoException(); |
| 2124 | reply.writeInt(result ? 1 : 0); |
| 2125 | return true; |
| 2126 | } |
| 2127 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2128 | case STOP_USER_TRANSACTION: { |
| 2129 | data.enforceInterface(IActivityManager.descriptor); |
| 2130 | int userid = data.readInt(); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2131 | boolean force = data.readInt() != 0; |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2132 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 2133 | data.readStrongBinder()); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 2134 | int result = stopUser(userid, force, callback); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 2135 | reply.writeNoException(); |
| 2136 | reply.writeInt(result); |
| 2137 | return true; |
| 2138 | } |
| 2139 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 2140 | case GET_CURRENT_USER_TRANSACTION: { |
| 2141 | data.enforceInterface(IActivityManager.descriptor); |
| 2142 | UserInfo userInfo = getCurrentUser(); |
| 2143 | reply.writeNoException(); |
| 2144 | userInfo.writeToParcel(reply, 0); |
| 2145 | return true; |
| 2146 | } |
| 2147 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2148 | case IS_USER_RUNNING_TRANSACTION: { |
| 2149 | data.enforceInterface(IActivityManager.descriptor); |
| 2150 | int userid = data.readInt(); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 2151 | int _flags = data.readInt(); |
| 2152 | boolean result = isUserRunning(userid, _flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2153 | reply.writeNoException(); |
| 2154 | reply.writeInt(result ? 1 : 0); |
| 2155 | return true; |
| 2156 | } |
| 2157 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 2158 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 2159 | data.enforceInterface(IActivityManager.descriptor); |
| 2160 | int[] result = getRunningUserIds(); |
| 2161 | reply.writeNoException(); |
| 2162 | reply.writeIntArray(result); |
| 2163 | return true; |
| 2164 | } |
| 2165 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2166 | case REMOVE_TASK_TRANSACTION: |
| 2167 | { |
| 2168 | data.enforceInterface(IActivityManager.descriptor); |
| 2169 | int taskId = data.readInt(); |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 2170 | boolean result = removeTask(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 2171 | reply.writeNoException(); |
| 2172 | reply.writeInt(result ? 1 : 0); |
| 2173 | return true; |
| 2174 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2175 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 2176 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2177 | data.enforceInterface(IActivityManager.descriptor); |
| 2178 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2179 | data.readStrongBinder()); |
| 2180 | registerProcessObserver(observer); |
| 2181 | return true; |
| 2182 | } |
| 2183 | |
| 2184 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 2185 | data.enforceInterface(IActivityManager.descriptor); |
| 2186 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 2187 | data.readStrongBinder()); |
| 2188 | unregisterProcessObserver(observer); |
| 2189 | return true; |
| 2190 | } |
| 2191 | |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2192 | case REGISTER_UID_OBSERVER_TRANSACTION: { |
| 2193 | data.enforceInterface(IActivityManager.descriptor); |
| 2194 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2195 | data.readStrongBinder()); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2196 | int which = data.readInt(); |
| 2197 | registerUidObserver(observer, which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 2198 | return true; |
| 2199 | } |
| 2200 | |
| 2201 | case UNREGISTER_UID_OBSERVER_TRANSACTION: { |
| 2202 | data.enforceInterface(IActivityManager.descriptor); |
| 2203 | IUidObserver observer = IUidObserver.Stub.asInterface( |
| 2204 | data.readStrongBinder()); |
| 2205 | unregisterUidObserver(observer); |
| 2206 | return true; |
| 2207 | } |
| 2208 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 2209 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2210 | { |
| 2211 | data.enforceInterface(IActivityManager.descriptor); |
| 2212 | String pkg = data.readString(); |
| 2213 | boolean ask = getPackageAskScreenCompat(pkg); |
| 2214 | reply.writeNoException(); |
| 2215 | reply.writeInt(ask ? 1 : 0); |
| 2216 | return true; |
| 2217 | } |
| 2218 | |
| 2219 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 2220 | { |
| 2221 | data.enforceInterface(IActivityManager.descriptor); |
| 2222 | String pkg = data.readString(); |
| 2223 | boolean ask = data.readInt() != 0; |
| 2224 | setPackageAskScreenCompat(pkg, ask); |
| 2225 | reply.writeNoException(); |
| 2226 | return true; |
| 2227 | } |
| 2228 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2229 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 2230 | data.enforceInterface(IActivityManager.descriptor); |
| 2231 | IIntentSender r = IIntentSender.Stub.asInterface( |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2232 | data.readStrongBinder()); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2233 | boolean res = isIntentSenderTargetedToPackage(r); |
| 2234 | reply.writeNoException(); |
| 2235 | reply.writeInt(res ? 1 : 0); |
| 2236 | return true; |
| 2237 | } |
| 2238 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 2239 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 2240 | data.enforceInterface(IActivityManager.descriptor); |
| 2241 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2242 | data.readStrongBinder()); |
| 2243 | boolean res = isIntentSenderAnActivity(r); |
| 2244 | reply.writeNoException(); |
| 2245 | reply.writeInt(res ? 1 : 0); |
| 2246 | return true; |
| 2247 | } |
| 2248 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 2249 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 2250 | data.enforceInterface(IActivityManager.descriptor); |
| 2251 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2252 | data.readStrongBinder()); |
| 2253 | Intent intent = getIntentForIntentSender(r); |
| 2254 | reply.writeNoException(); |
| 2255 | if (intent != null) { |
| 2256 | reply.writeInt(1); |
| 2257 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2258 | } else { |
| 2259 | reply.writeInt(0); |
| 2260 | } |
| 2261 | return true; |
| 2262 | } |
| 2263 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 2264 | case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: { |
| 2265 | data.enforceInterface(IActivityManager.descriptor); |
| 2266 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 2267 | data.readStrongBinder()); |
| 2268 | String prefix = data.readString(); |
| 2269 | String tag = getTagForIntentSender(r, prefix); |
| 2270 | reply.writeNoException(); |
| 2271 | reply.writeString(tag); |
| 2272 | return true; |
| 2273 | } |
| 2274 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 2275 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 2276 | data.enforceInterface(IActivityManager.descriptor); |
| 2277 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 2278 | updatePersistentConfiguration(config); |
| 2279 | reply.writeNoException(); |
| 2280 | return true; |
| 2281 | } |
| 2282 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 2283 | case GET_PROCESS_PSS_TRANSACTION: { |
| 2284 | data.enforceInterface(IActivityManager.descriptor); |
| 2285 | int[] pids = data.createIntArray(); |
| 2286 | long[] pss = getProcessPss(pids); |
| 2287 | reply.writeNoException(); |
| 2288 | reply.writeLongArray(pss); |
| 2289 | return true; |
| 2290 | } |
| 2291 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 2292 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 2293 | data.enforceInterface(IActivityManager.descriptor); |
| 2294 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 2295 | boolean always = data.readInt() != 0; |
| 2296 | showBootMessage(msg, always); |
| 2297 | reply.writeNoException(); |
| 2298 | return true; |
| 2299 | } |
| 2300 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2301 | case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2302 | data.enforceInterface(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 2303 | keyguardWaitingForActivityDrawn(); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 2304 | reply.writeNoException(); |
| 2305 | return true; |
| 2306 | } |
| 2307 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 2308 | case KEYGUARD_GOING_AWAY_TRANSACTION: { |
| 2309 | data.enforceInterface(IActivityManager.descriptor); |
| 2310 | keyguardGoingAway(data.readInt() != 0, data.readInt() != 0); |
| 2311 | reply.writeNoException(); |
| 2312 | return true; |
| 2313 | } |
| 2314 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2315 | case SHOULD_UP_RECREATE_TASK_TRANSACTION: { |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2316 | data.enforceInterface(IActivityManager.descriptor); |
| 2317 | IBinder token = data.readStrongBinder(); |
| 2318 | String destAffinity = data.readString(); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 2319 | boolean res = shouldUpRecreateTask(token, destAffinity); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 2320 | reply.writeNoException(); |
| 2321 | reply.writeInt(res ? 1 : 0); |
| 2322 | return true; |
| 2323 | } |
| 2324 | |
| 2325 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 2326 | data.enforceInterface(IActivityManager.descriptor); |
| 2327 | IBinder token = data.readStrongBinder(); |
| 2328 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 2329 | int resultCode = data.readInt(); |
| 2330 | Intent resultData = null; |
| 2331 | if (data.readInt() != 0) { |
| 2332 | resultData = Intent.CREATOR.createFromParcel(data); |
| 2333 | } |
| 2334 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 2335 | reply.writeNoException(); |
| 2336 | reply.writeInt(res ? 1 : 0); |
| 2337 | return true; |
| 2338 | } |
| 2339 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 2340 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 2341 | data.enforceInterface(IActivityManager.descriptor); |
| 2342 | IBinder token = data.readStrongBinder(); |
| 2343 | int res = getLaunchedFromUid(token); |
| 2344 | reply.writeNoException(); |
| 2345 | reply.writeInt(res); |
| 2346 | return true; |
| 2347 | } |
| 2348 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2349 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 2350 | data.enforceInterface(IActivityManager.descriptor); |
| 2351 | IBinder token = data.readStrongBinder(); |
| 2352 | String res = getLaunchedFromPackage(token); |
| 2353 | reply.writeNoException(); |
| 2354 | reply.writeString(res); |
| 2355 | return true; |
| 2356 | } |
| 2357 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2358 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2359 | data.enforceInterface(IActivityManager.descriptor); |
| 2360 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2361 | data.readStrongBinder()); |
| 2362 | registerUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2363 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2364 | return true; |
| 2365 | } |
| 2366 | |
| 2367 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 2368 | data.enforceInterface(IActivityManager.descriptor); |
| 2369 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 2370 | data.readStrongBinder()); |
| 2371 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2372 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 2373 | return true; |
| 2374 | } |
| 2375 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2376 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 2377 | data.enforceInterface(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 2378 | int bugreportType = data.readInt(); |
| 2379 | requestBugReport(bugreportType); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2380 | reply.writeNoException(); |
| 2381 | return true; |
| 2382 | } |
| 2383 | |
| 2384 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 2385 | data.enforceInterface(IActivityManager.descriptor); |
| 2386 | int pid = data.readInt(); |
| 2387 | boolean aboveSystem = data.readInt() != 0; |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 2388 | String reason = data.readString(); |
| 2389 | long res = inputDispatchingTimedOut(pid, aboveSystem, reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 2390 | reply.writeNoException(); |
| 2391 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 2392 | return true; |
| 2393 | } |
| 2394 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2395 | case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2396 | data.enforceInterface(IActivityManager.descriptor); |
| 2397 | int requestType = data.readInt(); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2398 | Bundle res = getAssistContextExtras(requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2399 | reply.writeNoException(); |
| 2400 | reply.writeBundle(res); |
| 2401 | return true; |
| 2402 | } |
| 2403 | |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2404 | case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
| 2405 | data.enforceInterface(IActivityManager.descriptor); |
| 2406 | int requestType = data.readInt(); |
| 2407 | IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2408 | IBinder activityToken = data.readStrongBinder(); |
| 2409 | boolean res = requestAssistContextExtras(requestType, receiver, activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2410 | reply.writeNoException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2411 | reply.writeInt(res ? 1 : 0); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 2412 | return true; |
| 2413 | } |
| 2414 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 2415 | case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2416 | data.enforceInterface(IActivityManager.descriptor); |
| 2417 | IBinder token = data.readStrongBinder(); |
| 2418 | Bundle extras = data.readBundle(); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 2419 | AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data); |
| 2420 | AssistContent content = AssistContent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 2421 | Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null; |
| 2422 | reportAssistContextExtras(token, extras, structure, content, referrer); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 2423 | reply.writeNoException(); |
| 2424 | return true; |
| 2425 | } |
| 2426 | |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2427 | case LAUNCH_ASSIST_INTENT_TRANSACTION: { |
| 2428 | data.enforceInterface(IActivityManager.descriptor); |
| 2429 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 2430 | int requestType = data.readInt(); |
| 2431 | String hint = data.readString(); |
| 2432 | int userHandle = data.readInt(); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 2433 | Bundle args = data.readBundle(); |
| 2434 | boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 2435 | reply.writeNoException(); |
| 2436 | reply.writeInt(res ? 1 : 0); |
| 2437 | return true; |
| 2438 | } |
| 2439 | |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2440 | case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: { |
| 2441 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 2442 | boolean res = isAssistDataAllowedOnCurrentActivity(); |
| 2443 | reply.writeNoException(); |
| 2444 | reply.writeInt(res ? 1 : 0); |
| 2445 | return true; |
| 2446 | } |
| 2447 | |
| 2448 | case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: { |
| 2449 | data.enforceInterface(IActivityManager.descriptor); |
| 2450 | IBinder token = data.readStrongBinder(); |
| 2451 | Bundle args = data.readBundle(); |
| 2452 | boolean res = showAssistFromActivity(token, args); |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 2453 | reply.writeNoException(); |
| 2454 | reply.writeInt(res ? 1 : 0); |
| 2455 | return true; |
| 2456 | } |
| 2457 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2458 | case KILL_UID_TRANSACTION: { |
| 2459 | data.enforceInterface(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2460 | int appId = data.readInt(); |
| 2461 | int userId = data.readInt(); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2462 | String reason = data.readString(); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 2463 | killUid(appId, userId, reason); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 2464 | reply.writeNoException(); |
| 2465 | return true; |
| 2466 | } |
| 2467 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 2468 | case HANG_TRANSACTION: { |
| 2469 | data.enforceInterface(IActivityManager.descriptor); |
| 2470 | IBinder who = data.readStrongBinder(); |
| 2471 | boolean allowRestart = data.readInt() != 0; |
| 2472 | hang(who, allowRestart); |
| 2473 | reply.writeNoException(); |
| 2474 | return true; |
| 2475 | } |
| 2476 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 2477 | case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: { |
| 2478 | data.enforceInterface(IActivityManager.descriptor); |
| 2479 | IBinder token = data.readStrongBinder(); |
| 2480 | reportActivityFullyDrawn(token); |
| 2481 | reply.writeNoException(); |
| 2482 | return true; |
| 2483 | } |
| 2484 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 2485 | case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: { |
| 2486 | data.enforceInterface(IActivityManager.descriptor); |
| 2487 | IBinder token = data.readStrongBinder(); |
| 2488 | notifyActivityDrawn(token); |
| 2489 | reply.writeNoException(); |
| 2490 | return true; |
| 2491 | } |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 2492 | |
| 2493 | case RESTART_TRANSACTION: { |
| 2494 | data.enforceInterface(IActivityManager.descriptor); |
| 2495 | restart(); |
| 2496 | reply.writeNoException(); |
| 2497 | return true; |
| 2498 | } |
Jeff Sharkey | 08da7a1 | 2013-08-11 20:53:18 -0700 | [diff] [blame] | 2499 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 2500 | case PERFORM_IDLE_MAINTENANCE_TRANSACTION: { |
| 2501 | data.enforceInterface(IActivityManager.descriptor); |
| 2502 | performIdleMaintenance(); |
| 2503 | reply.writeNoException(); |
| 2504 | return true; |
| 2505 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2506 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2507 | case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: { |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2508 | data.enforceInterface(IActivityManager.descriptor); |
| 2509 | IBinder parentActivityToken = data.readStrongBinder(); |
| 2510 | IActivityContainerCallback callback = |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 2511 | IActivityContainerCallback.Stub.asInterface(data.readStrongBinder()); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2512 | IActivityContainer activityContainer = |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 2513 | createVirtualActivityContainer(parentActivityToken, callback); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2514 | reply.writeNoException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 2515 | if (activityContainer != null) { |
| 2516 | reply.writeInt(1); |
| 2517 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2518 | } else { |
| 2519 | reply.writeInt(0); |
| 2520 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 2521 | return true; |
| 2522 | } |
| 2523 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 2524 | case DELETE_ACTIVITY_CONTAINER_TRANSACTION: { |
| 2525 | data.enforceInterface(IActivityManager.descriptor); |
| 2526 | IActivityContainer activityContainer = |
| 2527 | IActivityContainer.Stub.asInterface(data.readStrongBinder()); |
| 2528 | deleteActivityContainer(activityContainer); |
| 2529 | reply.writeNoException(); |
| 2530 | return true; |
| 2531 | } |
| 2532 | |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 2533 | case CREATE_STACK_ON_DISPLAY: { |
| 2534 | data.enforceInterface(IActivityManager.descriptor); |
| 2535 | int displayId = data.readInt(); |
| 2536 | IActivityContainer activityContainer = createStackOnDisplay(displayId); |
| 2537 | reply.writeNoException(); |
| 2538 | if (activityContainer != null) { |
| 2539 | reply.writeInt(1); |
| 2540 | reply.writeStrongBinder(activityContainer.asBinder()); |
| 2541 | } else { |
| 2542 | reply.writeInt(0); |
| 2543 | } |
| 2544 | return true; |
| 2545 | } |
| 2546 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2547 | case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: { |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2548 | data.enforceInterface(IActivityManager.descriptor); |
| 2549 | IBinder activityToken = data.readStrongBinder(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2550 | int displayId = getActivityDisplayId(activityToken); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2551 | reply.writeNoException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 2552 | reply.writeInt(displayId); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 2553 | return true; |
| 2554 | } |
| 2555 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2556 | case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: { |
| 2557 | data.enforceInterface(IActivityManager.descriptor); |
| 2558 | final int taskId = data.readInt(); |
| 2559 | startLockTaskMode(taskId); |
| 2560 | reply.writeNoException(); |
| 2561 | return true; |
| 2562 | } |
| 2563 | |
| 2564 | case START_LOCK_TASK_BY_TOKEN_TRANSACTION: { |
| 2565 | data.enforceInterface(IActivityManager.descriptor); |
| 2566 | IBinder token = data.readStrongBinder(); |
| 2567 | startLockTaskMode(token); |
| 2568 | reply.writeNoException(); |
| 2569 | return true; |
| 2570 | } |
| 2571 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2572 | case START_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2573 | data.enforceInterface(IActivityManager.descriptor); |
| 2574 | startLockTaskModeOnCurrent(); |
| 2575 | reply.writeNoException(); |
| 2576 | return true; |
| 2577 | } |
| 2578 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2579 | case STOP_LOCK_TASK_MODE_TRANSACTION: { |
| 2580 | data.enforceInterface(IActivityManager.descriptor); |
| 2581 | stopLockTaskMode(); |
| 2582 | reply.writeNoException(); |
| 2583 | return true; |
| 2584 | } |
| 2585 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 2586 | case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: { |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 2587 | data.enforceInterface(IActivityManager.descriptor); |
| 2588 | stopLockTaskModeOnCurrent(); |
| 2589 | reply.writeNoException(); |
| 2590 | return true; |
| 2591 | } |
| 2592 | |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 2593 | case IS_IN_LOCK_TASK_MODE_TRANSACTION: { |
| 2594 | data.enforceInterface(IActivityManager.descriptor); |
| 2595 | final boolean isInLockTaskMode = isInLockTaskMode(); |
| 2596 | reply.writeNoException(); |
| 2597 | reply.writeInt(isInLockTaskMode ? 1 : 0); |
| 2598 | return true; |
| 2599 | } |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2600 | |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 2601 | case GET_LOCK_TASK_MODE_STATE_TRANSACTION: { |
| 2602 | data.enforceInterface(IActivityManager.descriptor); |
| 2603 | final int lockTaskModeState = getLockTaskModeState(); |
| 2604 | reply.writeNoException(); |
| 2605 | reply.writeInt(lockTaskModeState); |
| 2606 | return true; |
| 2607 | } |
| 2608 | |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 2609 | case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: { |
| 2610 | data.enforceInterface(IActivityManager.descriptor); |
| 2611 | final IBinder token = data.readStrongBinder(); |
| 2612 | showLockTaskEscapeMessage(token); |
| 2613 | reply.writeNoException(); |
| 2614 | return true; |
| 2615 | } |
| 2616 | |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2617 | case SET_TASK_DESCRIPTION_TRANSACTION: { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2618 | data.enforceInterface(IActivityManager.descriptor); |
| 2619 | IBinder token = data.readStrongBinder(); |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 2620 | ActivityManager.TaskDescription values = |
| 2621 | ActivityManager.TaskDescription.CREATOR.createFromParcel(data); |
| 2622 | setTaskDescription(token, values); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 2623 | reply.writeNoException(); |
| 2624 | return true; |
| 2625 | } |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2626 | |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2627 | case SET_TASK_RESIZEABLE_TRANSACTION: { |
| 2628 | data.enforceInterface(IActivityManager.descriptor); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 2629 | final int taskId = data.readInt(); |
| 2630 | final int resizeableMode = data.readInt(); |
| 2631 | setTaskResizeable(taskId, resizeableMode); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 2632 | reply.writeNoException(); |
| 2633 | return true; |
| 2634 | } |
| 2635 | |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2636 | case RESIZE_TASK_TRANSACTION: { |
| 2637 | data.enforceInterface(IActivityManager.descriptor); |
| 2638 | int taskId = data.readInt(); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2639 | int resizeMode = data.readInt(); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2640 | Rect r = Rect.CREATOR.createFromParcel(data); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 2641 | resizeTask(taskId, r, resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 2642 | reply.writeNoException(); |
| 2643 | return true; |
| 2644 | } |
| 2645 | |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 2646 | case GET_TASK_BOUNDS_TRANSACTION: { |
| 2647 | data.enforceInterface(IActivityManager.descriptor); |
| 2648 | int taskId = data.readInt(); |
| 2649 | Rect r = getTaskBounds(taskId); |
| 2650 | reply.writeNoException(); |
| 2651 | r.writeToParcel(reply, 0); |
| 2652 | return true; |
| 2653 | } |
| 2654 | |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2655 | case GET_TASK_DESCRIPTION_ICON_TRANSACTION: { |
| 2656 | data.enforceInterface(IActivityManager.descriptor); |
| 2657 | String filename = data.readString(); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 2658 | int userId = data.readInt(); |
| 2659 | Bitmap icon = getTaskDescriptionIcon(filename, userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 2660 | reply.writeNoException(); |
| 2661 | if (icon == null) { |
| 2662 | reply.writeInt(0); |
| 2663 | } else { |
| 2664 | reply.writeInt(1); |
| 2665 | icon.writeToParcel(reply, 0); |
| 2666 | } |
| 2667 | return true; |
| 2668 | } |
| 2669 | |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2670 | case START_IN_PLACE_ANIMATION_TRANSACTION: { |
| 2671 | data.enforceInterface(IActivityManager.descriptor); |
| 2672 | final Bundle bundle; |
| 2673 | if (data.readInt() == 0) { |
| 2674 | bundle = null; |
| 2675 | } else { |
| 2676 | bundle = data.readBundle(); |
| 2677 | } |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 2678 | final ActivityOptions options = ActivityOptions.fromBundle(bundle); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 2679 | startInPlaceAnimationOnFrontMostApplication(options); |
| 2680 | reply.writeNoException(); |
| 2681 | return true; |
| 2682 | } |
| 2683 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2684 | case REQUEST_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2685 | data.enforceInterface(IActivityManager.descriptor); |
| 2686 | IBinder token = data.readStrongBinder(); |
| 2687 | boolean enable = data.readInt() > 0; |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2688 | boolean success = requestVisibleBehind(token, enable); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2689 | reply.writeNoException(); |
| 2690 | reply.writeInt(success ? 1 : 0); |
| 2691 | return true; |
| 2692 | } |
| 2693 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2694 | case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2695 | data.enforceInterface(IActivityManager.descriptor); |
| 2696 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2697 | final boolean enabled = isBackgroundVisibleBehind(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2698 | reply.writeNoException(); |
| 2699 | reply.writeInt(enabled ? 1 : 0); |
| 2700 | return true; |
| 2701 | } |
| 2702 | |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2703 | case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2704 | data.enforceInterface(IActivityManager.descriptor); |
| 2705 | IBinder token = data.readStrongBinder(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 2706 | backgroundResourcesReleased(token); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 2707 | reply.writeNoException(); |
| 2708 | return true; |
| 2709 | } |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 2710 | |
| 2711 | case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: { |
| 2712 | data.enforceInterface(IActivityManager.descriptor); |
| 2713 | IBinder token = data.readStrongBinder(); |
| 2714 | notifyLaunchTaskBehindComplete(token); |
| 2715 | reply.writeNoException(); |
| 2716 | return true; |
| 2717 | } |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 2718 | |
| 2719 | case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: { |
| 2720 | data.enforceInterface(IActivityManager.descriptor); |
| 2721 | IBinder token = data.readStrongBinder(); |
| 2722 | notifyEnterAnimationComplete(token); |
| 2723 | reply.writeNoException(); |
| 2724 | return true; |
| 2725 | } |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 2726 | |
| 2727 | case BOOT_ANIMATION_COMPLETE_TRANSACTION: { |
| 2728 | data.enforceInterface(IActivityManager.descriptor); |
| 2729 | bootAnimationComplete(); |
| 2730 | reply.writeNoException(); |
| 2731 | return true; |
| 2732 | } |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 2733 | |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 2734 | case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: { |
| 2735 | data.enforceInterface(IActivityManager.descriptor); |
| 2736 | final int uid = data.readInt(); |
| 2737 | final byte[] firstPacket = data.createByteArray(); |
| 2738 | notifyCleartextNetwork(uid, firstPacket); |
| 2739 | reply.writeNoException(); |
| 2740 | return true; |
| 2741 | } |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2742 | |
| 2743 | case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: { |
| 2744 | data.enforceInterface(IActivityManager.descriptor); |
| 2745 | String procName = data.readString(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2746 | int uid = data.readInt(); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2747 | long maxMemSize = data.readLong(); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 2748 | String reportPackage = data.readString(); |
| 2749 | setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 2750 | reply.writeNoException(); |
| 2751 | return true; |
| 2752 | } |
| 2753 | |
| 2754 | case DUMP_HEAP_FINISHED_TRANSACTION: { |
| 2755 | data.enforceInterface(IActivityManager.descriptor); |
| 2756 | String path = data.readString(); |
| 2757 | dumpHeapFinished(path); |
| 2758 | reply.writeNoException(); |
| 2759 | return true; |
| 2760 | } |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 2761 | |
| 2762 | case SET_VOICE_KEEP_AWAKE_TRANSACTION: { |
| 2763 | data.enforceInterface(IActivityManager.descriptor); |
| 2764 | IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface( |
| 2765 | data.readStrongBinder()); |
| 2766 | boolean keepAwake = data.readInt() != 0; |
| 2767 | setVoiceKeepAwake(session, keepAwake); |
| 2768 | reply.writeNoException(); |
| 2769 | return true; |
| 2770 | } |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 2771 | |
| 2772 | case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: { |
| 2773 | data.enforceInterface(IActivityManager.descriptor); |
| 2774 | int userId = data.readInt(); |
| 2775 | String[] packages = data.readStringArray(); |
| 2776 | updateLockTaskPackages(userId, packages); |
| 2777 | reply.writeNoException(); |
| 2778 | return true; |
| 2779 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2780 | |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 2781 | case UPDATE_DEVICE_OWNER_TRANSACTION: { |
| 2782 | data.enforceInterface(IActivityManager.descriptor); |
| 2783 | String packageName = data.readString(); |
| 2784 | updateDeviceOwner(packageName); |
| 2785 | reply.writeNoException(); |
| 2786 | return true; |
| 2787 | } |
| 2788 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2789 | case GET_PACKAGE_PROCESS_STATE_TRANSACTION: { |
| 2790 | data.enforceInterface(IActivityManager.descriptor); |
| 2791 | String pkg = data.readString(); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 2792 | String callingPackage = data.readString(); |
| 2793 | int res = getPackageProcessState(pkg, callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 2794 | reply.writeNoException(); |
| 2795 | reply.writeInt(res); |
| 2796 | return true; |
| 2797 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 2798 | |
| 2799 | case SET_PROCESS_MEMORY_TRIM_TRANSACTION: { |
| 2800 | data.enforceInterface(IActivityManager.descriptor); |
| 2801 | String process = data.readString(); |
| 2802 | int userId = data.readInt(); |
| 2803 | int level = data.readInt(); |
| 2804 | boolean res = setProcessMemoryTrimLevel(process, userId, level); |
| 2805 | reply.writeNoException(); |
| 2806 | reply.writeInt(res ? 1 : 0); |
| 2807 | return true; |
| 2808 | } |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2809 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 2810 | case IS_ROOT_VOICE_INTERACTION_TRANSACTION: { |
| 2811 | data.enforceInterface(IActivityManager.descriptor); |
| 2812 | IBinder token = data.readStrongBinder(); |
| 2813 | boolean res = isRootVoiceInteraction(token); |
| 2814 | reply.writeNoException(); |
| 2815 | reply.writeInt(res ? 1 : 0); |
| 2816 | return true; |
| 2817 | } |
Ian Pedowitz | a371084 | 2015-08-03 23:36:15 -0700 | [diff] [blame] | 2818 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 2819 | case START_BINDER_TRACKING_TRANSACTION: { |
| 2820 | data.enforceInterface(IActivityManager.descriptor); |
| 2821 | boolean res = startBinderTracking(); |
| 2822 | reply.writeNoException(); |
| 2823 | reply.writeInt(res ? 1 : 0); |
| 2824 | return true; |
| 2825 | } |
| 2826 | |
| 2827 | case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: { |
| 2828 | data.enforceInterface(IActivityManager.descriptor); |
| 2829 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 2830 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
| 2831 | boolean res = stopBinderTrackingAndDump(fd); |
| 2832 | reply.writeNoException(); |
| 2833 | reply.writeInt(res ? 1 : 0); |
| 2834 | return true; |
| 2835 | } |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2836 | case GET_ACTIVITY_STACK_ID_TRANSACTION: { |
| 2837 | data.enforceInterface(IActivityManager.descriptor); |
| 2838 | IBinder token = data.readStrongBinder(); |
| 2839 | int stackId = getActivityStackId(token); |
| 2840 | reply.writeNoException(); |
| 2841 | reply.writeInt(stackId); |
| 2842 | return true; |
| 2843 | } |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2844 | case EXIT_FREEFORM_MODE_TRANSACTION: { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2845 | data.enforceInterface(IActivityManager.descriptor); |
| 2846 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 2847 | exitFreeformMode(token); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 2848 | reply.writeNoException(); |
| 2849 | return true; |
| 2850 | } |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2851 | case REPORT_SIZE_CONFIGURATIONS: { |
| 2852 | data.enforceInterface(IActivityManager.descriptor); |
| 2853 | IBinder token = data.readStrongBinder(); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2854 | int[] horizontal = readIntArray(data); |
| 2855 | int[] vertical = readIntArray(data); |
| 2856 | int[] smallest = readIntArray(data); |
| 2857 | reportSizeConfigurations(token, horizontal, vertical, smallest); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 2858 | return true; |
| 2859 | } |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 2860 | case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: { |
| 2861 | data.enforceInterface(IActivityManager.descriptor); |
| 2862 | final boolean suppress = data.readInt() == 1; |
| 2863 | suppressResizeConfigChanges(suppress); |
| 2864 | reply.writeNoException(); |
| 2865 | return true; |
| 2866 | } |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 2867 | case MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION: { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2868 | data.enforceInterface(IActivityManager.descriptor); |
| 2869 | final int stackId = data.readInt(); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 2870 | final boolean onTop = data.readInt() == 1; |
| 2871 | moveTasksToFullscreenStack(stackId, onTop); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 2872 | reply.writeNoException(); |
| 2873 | return true; |
| 2874 | } |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 2875 | case GET_APP_START_MODE_TRANSACTION: { |
| 2876 | data.enforceInterface(IActivityManager.descriptor); |
| 2877 | final int uid = data.readInt(); |
| 2878 | final String pkg = data.readString(); |
| 2879 | int res = getAppStartMode(uid, pkg); |
| 2880 | reply.writeNoException(); |
| 2881 | reply.writeInt(res); |
| 2882 | return true; |
| 2883 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2884 | case IN_MULTI_WINDOW_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2885 | data.enforceInterface(IActivityManager.descriptor); |
| 2886 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2887 | final boolean inMultiWindow = inMultiWindow(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2888 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2889 | reply.writeInt(inMultiWindow ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2890 | return true; |
| 2891 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2892 | case IN_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2893 | data.enforceInterface(IActivityManager.descriptor); |
| 2894 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2895 | final boolean inPip = inPictureInPicture(token); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2896 | reply.writeNoException(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2897 | reply.writeInt(inPip ? 1 : 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 2898 | return true; |
| 2899 | } |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2900 | case ENTER_PICTURE_IN_PICTURE_TRANSACTION: { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2901 | data.enforceInterface(IActivityManager.descriptor); |
| 2902 | final IBinder token = data.readStrongBinder(); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 2903 | enterPictureInPicture(token); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 2904 | reply.writeNoException(); |
| 2905 | return true; |
| 2906 | } |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2907 | case SET_VR_MODE_TRANSACTION: { |
| 2908 | data.enforceInterface(IActivityManager.descriptor); |
| 2909 | final IBinder token = data.readStrongBinder(); |
| 2910 | final boolean enable = data.readInt() == 1; |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 2911 | final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data); |
| 2912 | int res = setVrMode(token, enable, packageName); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2913 | reply.writeNoException(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 2914 | reply.writeInt(res); |
| 2915 | return true; |
| 2916 | } |
| 2917 | case IS_VR_PACKAGE_ENABLED_TRANSACTION: { |
| 2918 | data.enforceInterface(IActivityManager.descriptor); |
| 2919 | final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data); |
| 2920 | boolean res = isVrModePackageEnabled(packageName); |
| 2921 | reply.writeNoException(); |
| 2922 | reply.writeInt(res ? 1 : 0); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2923 | return true; |
| 2924 | } |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 2925 | case IS_APP_FOREGROUND_TRANSACTION: { |
| 2926 | data.enforceInterface(IActivityManager.descriptor); |
| 2927 | final int userHandle = data.readInt(); |
| 2928 | final boolean isForeground = isAppForeground(userHandle); |
| 2929 | reply.writeNoException(); |
| 2930 | reply.writeInt(isForeground ? 1 : 0); |
| 2931 | return true; |
| 2932 | } |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 2933 | case NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION: { |
| 2934 | data.enforceInterface(IActivityManager.descriptor); |
| 2935 | reply.writeNoException(); |
| 2936 | return true; |
| 2937 | } |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 2938 | case REMOVE_STACK: { |
| 2939 | data.enforceInterface(IActivityManager.descriptor); |
| 2940 | final int stackId = data.readInt(); |
| 2941 | removeStack(stackId); |
| 2942 | reply.writeNoException(); |
| 2943 | return true; |
| 2944 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2945 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2946 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2947 | return super.onTransact(code, data, reply, flags); |
| 2948 | } |
| 2949 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 2950 | private int[] readIntArray(Parcel data) { |
| 2951 | int[] smallest = null; |
| 2952 | int smallestSize = data.readInt(); |
| 2953 | if (smallestSize > 0) { |
| 2954 | smallest = new int[smallestSize]; |
| 2955 | data.readIntArray(smallest); |
| 2956 | } |
| 2957 | return smallest; |
| 2958 | } |
| 2959 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2960 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2961 | return this; |
| 2962 | } |
| 2963 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2964 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 2965 | protected IActivityManager create() { |
| 2966 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2967 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2968 | Log.v("ActivityManager", "default service binder = " + b); |
| 2969 | } |
| 2970 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 2971 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 2972 | Log.v("ActivityManager", "default service = " + am); |
| 2973 | } |
| 2974 | return am; |
| 2975 | } |
| 2976 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2977 | } |
| 2978 | |
| 2979 | class ActivityManagerProxy implements IActivityManager |
| 2980 | { |
| 2981 | public ActivityManagerProxy(IBinder remote) |
| 2982 | { |
| 2983 | mRemote = remote; |
| 2984 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2985 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2986 | public IBinder asBinder() |
| 2987 | { |
| 2988 | return mRemote; |
| 2989 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 2990 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2991 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2992 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 2993 | int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2994 | Parcel data = Parcel.obtain(); |
| 2995 | Parcel reply = Parcel.obtain(); |
| 2996 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2997 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2998 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2999 | intent.writeToParcel(data, 0); |
| 3000 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3001 | data.writeStrongBinder(resultTo); |
| 3002 | data.writeString(resultWho); |
| 3003 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3004 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3005 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3006 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3007 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3008 | } else { |
| 3009 | data.writeInt(0); |
| 3010 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3011 | if (options != null) { |
| 3012 | data.writeInt(1); |
| 3013 | options.writeToParcel(data, 0); |
| 3014 | } else { |
| 3015 | data.writeInt(0); |
| 3016 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3017 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3018 | reply.readException(); |
| 3019 | int result = reply.readInt(); |
| 3020 | reply.recycle(); |
| 3021 | data.recycle(); |
| 3022 | return result; |
| 3023 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3024 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3025 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3026 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3027 | int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3028 | int userId) throws RemoteException { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3029 | Parcel data = Parcel.obtain(); |
| 3030 | Parcel reply = Parcel.obtain(); |
| 3031 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3032 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3033 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3034 | intent.writeToParcel(data, 0); |
| 3035 | data.writeString(resolvedType); |
| 3036 | data.writeStrongBinder(resultTo); |
| 3037 | data.writeString(resultWho); |
| 3038 | data.writeInt(requestCode); |
| 3039 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3040 | if (profilerInfo != null) { |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3041 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3042 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3043 | } else { |
| 3044 | data.writeInt(0); |
| 3045 | } |
| 3046 | if (options != null) { |
| 3047 | data.writeInt(1); |
| 3048 | options.writeToParcel(data, 0); |
| 3049 | } else { |
| 3050 | data.writeInt(0); |
| 3051 | } |
| 3052 | data.writeInt(userId); |
| 3053 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 3054 | reply.readException(); |
| 3055 | int result = reply.readInt(); |
| 3056 | reply.recycle(); |
| 3057 | data.recycle(); |
| 3058 | return result; |
| 3059 | } |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3060 | public int startActivityAsCaller(IApplicationThread caller, String callingPackage, |
| 3061 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3062 | int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, |
| 3063 | int userId) throws RemoteException { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3064 | Parcel data = Parcel.obtain(); |
| 3065 | Parcel reply = Parcel.obtain(); |
| 3066 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3067 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3068 | data.writeString(callingPackage); |
| 3069 | intent.writeToParcel(data, 0); |
| 3070 | data.writeString(resolvedType); |
| 3071 | data.writeStrongBinder(resultTo); |
| 3072 | data.writeString(resultWho); |
| 3073 | data.writeInt(requestCode); |
| 3074 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3075 | if (profilerInfo != null) { |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3076 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3077 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3078 | } else { |
| 3079 | data.writeInt(0); |
| 3080 | } |
| 3081 | if (options != null) { |
| 3082 | data.writeInt(1); |
| 3083 | options.writeToParcel(data, 0); |
| 3084 | } else { |
| 3085 | data.writeInt(0); |
| 3086 | } |
Dianne Hackborn | a7cfbe0 | 2015-07-16 10:52:52 -0700 | [diff] [blame] | 3087 | data.writeInt(ignoreTargetSecurity ? 1 : 0); |
Jeff Sharkey | 9797880 | 2014-10-14 10:48:18 -0700 | [diff] [blame] | 3088 | data.writeInt(userId); |
Dianne Hackborn | 028ceeb | 2014-08-17 17:45:48 -0700 | [diff] [blame] | 3089 | mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); |
| 3090 | reply.readException(); |
| 3091 | int result = reply.readInt(); |
| 3092 | reply.recycle(); |
| 3093 | data.recycle(); |
| 3094 | return result; |
| 3095 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3096 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 3097 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3098 | int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, |
| 3099 | int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3100 | Parcel data = Parcel.obtain(); |
| 3101 | Parcel reply = Parcel.obtain(); |
| 3102 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3103 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3104 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3105 | intent.writeToParcel(data, 0); |
| 3106 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3107 | data.writeStrongBinder(resultTo); |
| 3108 | data.writeString(resultWho); |
| 3109 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3110 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3111 | if (profilerInfo != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -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 | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3114 | } else { |
| 3115 | data.writeInt(0); |
| 3116 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3117 | if (options != null) { |
| 3118 | data.writeInt(1); |
| 3119 | options.writeToParcel(data, 0); |
| 3120 | } else { |
| 3121 | data.writeInt(0); |
| 3122 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3123 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 3124 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 3125 | reply.readException(); |
| 3126 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 3127 | reply.recycle(); |
| 3128 | data.recycle(); |
| 3129 | return result; |
| 3130 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3131 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 3132 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3133 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3134 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3135 | Parcel data = Parcel.obtain(); |
| 3136 | Parcel reply = Parcel.obtain(); |
| 3137 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3138 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3139 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3140 | intent.writeToParcel(data, 0); |
| 3141 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3142 | data.writeStrongBinder(resultTo); |
| 3143 | data.writeString(resultWho); |
| 3144 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3145 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3146 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3147 | if (options != null) { |
| 3148 | data.writeInt(1); |
| 3149 | options.writeToParcel(data, 0); |
| 3150 | } else { |
| 3151 | data.writeInt(0); |
| 3152 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3153 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 3154 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3155 | reply.readException(); |
| 3156 | int result = reply.readInt(); |
| 3157 | reply.recycle(); |
| 3158 | data.recycle(); |
| 3159 | return result; |
| 3160 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3161 | public int startActivityIntentSender(IApplicationThread caller, |
| 3162 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3163 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3164 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3165 | Parcel data = Parcel.obtain(); |
| 3166 | Parcel reply = Parcel.obtain(); |
| 3167 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3168 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3169 | intent.writeToParcel(data, 0); |
| 3170 | if (fillInIntent != null) { |
| 3171 | data.writeInt(1); |
| 3172 | fillInIntent.writeToParcel(data, 0); |
| 3173 | } else { |
| 3174 | data.writeInt(0); |
| 3175 | } |
| 3176 | data.writeString(resolvedType); |
| 3177 | data.writeStrongBinder(resultTo); |
| 3178 | data.writeString(resultWho); |
| 3179 | data.writeInt(requestCode); |
| 3180 | data.writeInt(flagsMask); |
| 3181 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3182 | if (options != null) { |
| 3183 | data.writeInt(1); |
| 3184 | options.writeToParcel(data, 0); |
| 3185 | } else { |
| 3186 | data.writeInt(0); |
| 3187 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 3188 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 3189 | reply.readException(); |
| 3190 | int result = reply.readInt(); |
| 3191 | reply.recycle(); |
| 3192 | data.recycle(); |
| 3193 | return result; |
| 3194 | } |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3195 | public int startVoiceActivity(String callingPackage, int callingPid, int callingUid, |
| 3196 | Intent intent, String resolvedType, IVoiceInteractionSession session, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3197 | IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, |
| 3198 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3199 | Parcel data = Parcel.obtain(); |
| 3200 | Parcel reply = Parcel.obtain(); |
| 3201 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3202 | data.writeString(callingPackage); |
| 3203 | data.writeInt(callingPid); |
| 3204 | data.writeInt(callingUid); |
| 3205 | intent.writeToParcel(data, 0); |
| 3206 | data.writeString(resolvedType); |
| 3207 | data.writeStrongBinder(session.asBinder()); |
| 3208 | data.writeStrongBinder(interactor.asBinder()); |
| 3209 | data.writeInt(startFlags); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3210 | if (profilerInfo != null) { |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3211 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 3212 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 3213 | } else { |
| 3214 | data.writeInt(0); |
| 3215 | } |
| 3216 | if (options != null) { |
| 3217 | data.writeInt(1); |
| 3218 | options.writeToParcel(data, 0); |
| 3219 | } else { |
| 3220 | data.writeInt(0); |
| 3221 | } |
| 3222 | data.writeInt(userId); |
| 3223 | mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3224 | reply.readException(); |
| 3225 | int result = reply.readInt(); |
| 3226 | reply.recycle(); |
| 3227 | data.recycle(); |
| 3228 | return result; |
| 3229 | } |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 3230 | |
| 3231 | public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options) |
| 3232 | throws RemoteException { |
| 3233 | Parcel data = Parcel.obtain(); |
| 3234 | Parcel reply = Parcel.obtain(); |
| 3235 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3236 | data.writeStrongBinder(callingActivity); |
| 3237 | data.writeBundle(options); |
| 3238 | mRemote.transact(START_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3239 | reply.readException(); |
| 3240 | reply.recycle(); |
| 3241 | data.recycle(); |
| 3242 | } |
| 3243 | |
| 3244 | public void stopLocalVoiceInteraction(IBinder callingActivity) throws RemoteException { |
| 3245 | Parcel data = Parcel.obtain(); |
| 3246 | Parcel reply = Parcel.obtain(); |
| 3247 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3248 | data.writeStrongBinder(callingActivity); |
| 3249 | mRemote.transact(STOP_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3250 | reply.readException(); |
| 3251 | reply.recycle(); |
| 3252 | data.recycle(); |
| 3253 | } |
| 3254 | |
| 3255 | public boolean supportsLocalVoiceInteraction() throws RemoteException { |
| 3256 | Parcel data = Parcel.obtain(); |
| 3257 | Parcel reply = Parcel.obtain(); |
| 3258 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3259 | mRemote.transact(SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 3260 | reply.readException(); |
| 3261 | int result = reply.readInt(); |
| 3262 | reply.recycle(); |
| 3263 | data.recycle(); |
| 3264 | return result != 0; |
| 3265 | } |
| 3266 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3267 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3268 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3269 | Parcel data = Parcel.obtain(); |
| 3270 | Parcel reply = Parcel.obtain(); |
| 3271 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3272 | data.writeStrongBinder(callingActivity); |
| 3273 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3274 | if (options != null) { |
| 3275 | data.writeInt(1); |
| 3276 | options.writeToParcel(data, 0); |
| 3277 | } else { |
| 3278 | data.writeInt(0); |
| 3279 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3280 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3281 | reply.readException(); |
| 3282 | int result = reply.readInt(); |
| 3283 | reply.recycle(); |
| 3284 | data.recycle(); |
| 3285 | return result != 0; |
| 3286 | } |
Wale Ogunwale | 854809c | 2015-12-27 16:18:19 -0800 | [diff] [blame] | 3287 | public int startActivityFromRecents(int taskId, Bundle options) |
Wale Ogunwale | 7e8184b | 2015-10-05 14:37:03 -0700 | [diff] [blame] | 3288 | throws RemoteException { |
Craig Mautner | dc00cbe | 2014-07-20 17:48:47 -0700 | [diff] [blame] | 3289 | Parcel data = Parcel.obtain(); |
| 3290 | Parcel reply = Parcel.obtain(); |
| 3291 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3292 | data.writeInt(taskId); |
| 3293 | if (options == null) { |
| 3294 | data.writeInt(0); |
| 3295 | } else { |
| 3296 | data.writeInt(1); |
| 3297 | options.writeToParcel(data, 0); |
| 3298 | } |
| 3299 | mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0); |
| 3300 | reply.readException(); |
| 3301 | int result = reply.readInt(); |
| 3302 | reply.recycle(); |
| 3303 | data.recycle(); |
| 3304 | return result; |
| 3305 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3306 | 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] | 3307 | throws RemoteException { |
| 3308 | Parcel data = Parcel.obtain(); |
| 3309 | Parcel reply = Parcel.obtain(); |
| 3310 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3311 | data.writeStrongBinder(token); |
| 3312 | data.writeInt(resultCode); |
| 3313 | if (resultData != null) { |
| 3314 | data.writeInt(1); |
| 3315 | resultData.writeToParcel(data, 0); |
| 3316 | } else { |
| 3317 | data.writeInt(0); |
| 3318 | } |
Wale Ogunwale | ba7881c | 2015-08-01 19:28:29 -0700 | [diff] [blame] | 3319 | data.writeInt(finishTask); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3320 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3321 | reply.readException(); |
| 3322 | boolean res = reply.readInt() != 0; |
| 3323 | data.recycle(); |
| 3324 | reply.recycle(); |
| 3325 | return res; |
| 3326 | } |
| 3327 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 3328 | { |
| 3329 | Parcel data = Parcel.obtain(); |
| 3330 | Parcel reply = Parcel.obtain(); |
| 3331 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3332 | data.writeStrongBinder(token); |
| 3333 | data.writeString(resultWho); |
| 3334 | data.writeInt(requestCode); |
| 3335 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3336 | reply.readException(); |
| 3337 | data.recycle(); |
| 3338 | reply.recycle(); |
| 3339 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 3340 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 3341 | Parcel data = Parcel.obtain(); |
| 3342 | Parcel reply = Parcel.obtain(); |
| 3343 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3344 | data.writeStrongBinder(token); |
| 3345 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 3346 | reply.readException(); |
| 3347 | boolean res = reply.readInt() != 0; |
| 3348 | data.recycle(); |
| 3349 | reply.recycle(); |
| 3350 | return res; |
| 3351 | } |
Dianne Hackborn | 6ea0d0a | 2014-07-02 16:23:21 -0700 | [diff] [blame] | 3352 | public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException { |
| 3353 | Parcel data = Parcel.obtain(); |
| 3354 | Parcel reply = Parcel.obtain(); |
| 3355 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3356 | data.writeStrongBinder(session.asBinder()); |
| 3357 | mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0); |
| 3358 | reply.readException(); |
| 3359 | data.recycle(); |
| 3360 | reply.recycle(); |
| 3361 | } |
Dianne Hackborn | 89ad456 | 2014-08-24 16:45:38 -0700 | [diff] [blame] | 3362 | public boolean releaseActivityInstance(IBinder token) throws RemoteException { |
| 3363 | Parcel data = Parcel.obtain(); |
| 3364 | Parcel reply = Parcel.obtain(); |
| 3365 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3366 | data.writeStrongBinder(token); |
| 3367 | mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0); |
| 3368 | reply.readException(); |
| 3369 | boolean res = reply.readInt() != 0; |
| 3370 | data.recycle(); |
| 3371 | reply.recycle(); |
| 3372 | return res; |
| 3373 | } |
| 3374 | public void releaseSomeActivities(IApplicationThread app) throws RemoteException { |
| 3375 | Parcel data = Parcel.obtain(); |
| 3376 | Parcel reply = Parcel.obtain(); |
| 3377 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3378 | data.writeStrongBinder(app.asBinder()); |
| 3379 | mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 3380 | reply.readException(); |
| 3381 | data.recycle(); |
| 3382 | reply.recycle(); |
| 3383 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 3384 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 3385 | Parcel data = Parcel.obtain(); |
| 3386 | Parcel reply = Parcel.obtain(); |
| 3387 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3388 | data.writeStrongBinder(token); |
| 3389 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 3390 | reply.readException(); |
| 3391 | boolean res = reply.readInt() != 0; |
| 3392 | data.recycle(); |
| 3393 | reply.recycle(); |
| 3394 | return res; |
| 3395 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3396 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3397 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3398 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3399 | { |
| 3400 | Parcel data = Parcel.obtain(); |
| 3401 | Parcel reply = Parcel.obtain(); |
| 3402 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3403 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 3404 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3405 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 3406 | filter.writeToParcel(data, 0); |
| 3407 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 3408 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3409 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3410 | reply.readException(); |
| 3411 | Intent intent = null; |
| 3412 | int haveIntent = reply.readInt(); |
| 3413 | if (haveIntent != 0) { |
| 3414 | intent = Intent.CREATOR.createFromParcel(reply); |
| 3415 | } |
| 3416 | reply.recycle(); |
| 3417 | data.recycle(); |
| 3418 | return intent; |
| 3419 | } |
| 3420 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 3421 | { |
| 3422 | Parcel data = Parcel.obtain(); |
| 3423 | Parcel reply = Parcel.obtain(); |
| 3424 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3425 | data.writeStrongBinder(receiver.asBinder()); |
| 3426 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 3427 | reply.readException(); |
| 3428 | data.recycle(); |
| 3429 | reply.recycle(); |
| 3430 | } |
| 3431 | public int broadcastIntent(IApplicationThread caller, |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3432 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3433 | int resultCode, String resultData, Bundle map, |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3434 | String[] requiredPermissions, int appOp, Bundle options, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3435 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3436 | { |
| 3437 | Parcel data = Parcel.obtain(); |
| 3438 | Parcel reply = Parcel.obtain(); |
| 3439 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3440 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3441 | intent.writeToParcel(data, 0); |
| 3442 | data.writeString(resolvedType); |
| 3443 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 3444 | data.writeInt(resultCode); |
| 3445 | data.writeString(resultData); |
| 3446 | data.writeBundle(map); |
Fyodor Kupolov | d4fd8c7 | 2015-07-13 19:19:25 -0700 | [diff] [blame] | 3447 | data.writeStringArray(requiredPermissions); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 3448 | data.writeInt(appOp); |
Dianne Hackborn | a750a63 | 2015-06-16 17:18:23 -0700 | [diff] [blame] | 3449 | data.writeBundle(options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3450 | data.writeInt(serialized ? 1 : 0); |
| 3451 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3452 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3453 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3454 | reply.readException(); |
| 3455 | int res = reply.readInt(); |
| 3456 | reply.recycle(); |
| 3457 | data.recycle(); |
| 3458 | return res; |
| 3459 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3460 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 3461 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3462 | { |
| 3463 | Parcel data = Parcel.obtain(); |
| 3464 | Parcel reply = Parcel.obtain(); |
| 3465 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3466 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 3467 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3468 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3469 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 3470 | reply.readException(); |
| 3471 | data.recycle(); |
| 3472 | reply.recycle(); |
| 3473 | } |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3474 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, |
| 3475 | boolean abortBroadcast, int flags) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3476 | { |
| 3477 | Parcel data = Parcel.obtain(); |
| 3478 | Parcel reply = Parcel.obtain(); |
| 3479 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3480 | data.writeStrongBinder(who); |
| 3481 | data.writeInt(resultCode); |
| 3482 | data.writeString(resultData); |
| 3483 | data.writeBundle(map); |
| 3484 | data.writeInt(abortBroadcast ? 1 : 0); |
riddle_hsu | 1f5ac4d | 2015-01-03 15:38:21 +0800 | [diff] [blame] | 3485 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3486 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3487 | reply.readException(); |
| 3488 | data.recycle(); |
| 3489 | reply.recycle(); |
| 3490 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3491 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 3492 | { |
| 3493 | Parcel data = Parcel.obtain(); |
| 3494 | Parcel reply = Parcel.obtain(); |
| 3495 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3496 | data.writeStrongBinder(app.asBinder()); |
| 3497 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3498 | reply.readException(); |
| 3499 | data.recycle(); |
| 3500 | reply.recycle(); |
| 3501 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3502 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 3503 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3504 | { |
| 3505 | Parcel data = Parcel.obtain(); |
| 3506 | Parcel reply = Parcel.obtain(); |
| 3507 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3508 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 3509 | if (config != null) { |
| 3510 | data.writeInt(1); |
| 3511 | config.writeToParcel(data, 0); |
| 3512 | } else { |
| 3513 | data.writeInt(0); |
| 3514 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 3515 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3516 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3517 | reply.readException(); |
| 3518 | data.recycle(); |
| 3519 | reply.recycle(); |
| 3520 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 3521 | public void activityResumed(IBinder token) throws RemoteException |
| 3522 | { |
| 3523 | Parcel data = Parcel.obtain(); |
| 3524 | Parcel reply = Parcel.obtain(); |
| 3525 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3526 | data.writeStrongBinder(token); |
| 3527 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 3528 | reply.readException(); |
| 3529 | data.recycle(); |
| 3530 | reply.recycle(); |
| 3531 | } |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 3532 | public void activityPaused(IBinder token) throws RemoteException |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 3533 | { |
| 3534 | Parcel data = Parcel.obtain(); |
| 3535 | Parcel reply = Parcel.obtain(); |
| 3536 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3537 | data.writeStrongBinder(token); |
| 3538 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 3539 | reply.readException(); |
| 3540 | data.recycle(); |
| 3541 | reply.recycle(); |
| 3542 | } |
| 3543 | public void activityStopped(IBinder token, Bundle state, |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3544 | PersistableBundle persistentState, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3545 | { |
| 3546 | Parcel data = Parcel.obtain(); |
| 3547 | Parcel reply = Parcel.obtain(); |
| 3548 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3549 | data.writeStrongBinder(token); |
| 3550 | data.writeBundle(state); |
Craig Mautner | a002604 | 2014-04-23 11:45:37 -0700 | [diff] [blame] | 3551 | data.writePersistableBundle(persistentState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3552 | TextUtils.writeToParcel(description, data, 0); |
| 3553 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3554 | reply.readException(); |
| 3555 | data.recycle(); |
| 3556 | reply.recycle(); |
| 3557 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 3558 | public void activitySlept(IBinder token) throws RemoteException |
| 3559 | { |
| 3560 | Parcel data = Parcel.obtain(); |
| 3561 | Parcel reply = Parcel.obtain(); |
| 3562 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3563 | data.writeStrongBinder(token); |
| 3564 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3565 | reply.readException(); |
| 3566 | data.recycle(); |
| 3567 | reply.recycle(); |
| 3568 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3569 | public void activityDestroyed(IBinder token) throws RemoteException |
| 3570 | { |
| 3571 | Parcel data = Parcel.obtain(); |
| 3572 | Parcel reply = Parcel.obtain(); |
| 3573 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3574 | data.writeStrongBinder(token); |
| 3575 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 3576 | reply.readException(); |
| 3577 | data.recycle(); |
| 3578 | reply.recycle(); |
| 3579 | } |
Jorim Jaggi | fe89d12 | 2015-12-22 16:28:44 +0100 | [diff] [blame] | 3580 | public void activityRelaunched(IBinder token) throws RemoteException |
| 3581 | { |
| 3582 | Parcel data = Parcel.obtain(); |
| 3583 | Parcel reply = Parcel.obtain(); |
| 3584 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3585 | data.writeStrongBinder(token); |
| 3586 | mRemote.transact(ACTIVITY_RELAUNCHED_TRANSACTION, data, reply, 0); |
| 3587 | reply.readException(); |
| 3588 | data.recycle(); |
| 3589 | reply.recycle(); |
| 3590 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3591 | public String getCallingPackage(IBinder token) throws RemoteException |
| 3592 | { |
| 3593 | Parcel data = Parcel.obtain(); |
| 3594 | Parcel reply = Parcel.obtain(); |
| 3595 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3596 | data.writeStrongBinder(token); |
| 3597 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 3598 | reply.readException(); |
| 3599 | String res = reply.readString(); |
| 3600 | data.recycle(); |
| 3601 | reply.recycle(); |
| 3602 | return res; |
| 3603 | } |
| 3604 | public ComponentName getCallingActivity(IBinder token) |
| 3605 | throws RemoteException { |
| 3606 | Parcel data = Parcel.obtain(); |
| 3607 | Parcel reply = Parcel.obtain(); |
| 3608 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3609 | data.writeStrongBinder(token); |
| 3610 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 3611 | reply.readException(); |
| 3612 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3613 | data.recycle(); |
| 3614 | reply.recycle(); |
| 3615 | return res; |
| 3616 | } |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3617 | public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException { |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3618 | Parcel data = Parcel.obtain(); |
| 3619 | Parcel reply = Parcel.obtain(); |
| 3620 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 885fbe5 | 2014-08-23 15:23:58 -0700 | [diff] [blame] | 3621 | data.writeString(callingPackage); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3622 | mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0); |
| 3623 | reply.readException(); |
| 3624 | ArrayList<IAppTask> list = null; |
| 3625 | int N = reply.readInt(); |
| 3626 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3627 | list = new ArrayList<>(); |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3628 | while (N > 0) { |
| 3629 | IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder()); |
| 3630 | list.add(task); |
| 3631 | N--; |
| 3632 | } |
| 3633 | } |
| 3634 | data.recycle(); |
| 3635 | reply.recycle(); |
| 3636 | return list; |
| 3637 | } |
Dianne Hackborn | aec68bb | 2014-08-20 15:25:13 -0700 | [diff] [blame] | 3638 | public int addAppTask(IBinder activityToken, Intent intent, |
| 3639 | ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { |
| 3640 | Parcel data = Parcel.obtain(); |
| 3641 | Parcel reply = Parcel.obtain(); |
| 3642 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3643 | data.writeStrongBinder(activityToken); |
| 3644 | intent.writeToParcel(data, 0); |
| 3645 | description.writeToParcel(data, 0); |
| 3646 | thumbnail.writeToParcel(data, 0); |
| 3647 | mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0); |
| 3648 | reply.readException(); |
| 3649 | int res = reply.readInt(); |
| 3650 | data.recycle(); |
| 3651 | reply.recycle(); |
| 3652 | return res; |
| 3653 | } |
| 3654 | public Point getAppTaskThumbnailSize() throws RemoteException { |
| 3655 | Parcel data = Parcel.obtain(); |
| 3656 | Parcel reply = Parcel.obtain(); |
| 3657 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3658 | mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); |
| 3659 | reply.readException(); |
| 3660 | Point size = Point.CREATOR.createFromParcel(reply); |
| 3661 | data.recycle(); |
| 3662 | reply.recycle(); |
| 3663 | return size; |
| 3664 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3665 | public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags) |
| 3666 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3667 | Parcel data = Parcel.obtain(); |
| 3668 | Parcel reply = Parcel.obtain(); |
| 3669 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3670 | data.writeInt(maxNum); |
| 3671 | data.writeInt(flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3672 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 3673 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3674 | ArrayList<ActivityManager.RunningTaskInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3675 | int N = reply.readInt(); |
| 3676 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3677 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3678 | while (N > 0) { |
| 3679 | ActivityManager.RunningTaskInfo info = |
| 3680 | ActivityManager.RunningTaskInfo.CREATOR |
Winson Chung | 1147c40 | 2014-05-14 11:05:00 -0700 | [diff] [blame] | 3681 | .createFromParcel(reply); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3682 | list.add(info); |
| 3683 | N--; |
| 3684 | } |
| 3685 | } |
| 3686 | data.recycle(); |
| 3687 | reply.recycle(); |
| 3688 | return list; |
| 3689 | } |
| 3690 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3691 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3692 | Parcel data = Parcel.obtain(); |
| 3693 | Parcel reply = Parcel.obtain(); |
| 3694 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3695 | data.writeInt(maxNum); |
| 3696 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 3697 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3698 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 3699 | reply.readException(); |
| 3700 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 3701 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 3702 | data.recycle(); |
| 3703 | reply.recycle(); |
| 3704 | return list; |
| 3705 | } |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3706 | public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3707 | Parcel data = Parcel.obtain(); |
| 3708 | Parcel reply = Parcel.obtain(); |
| 3709 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3710 | data.writeInt(id); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3711 | mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3712 | reply.readException(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3713 | ActivityManager.TaskThumbnail taskThumbnail = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3714 | if (reply.readInt() != 0) { |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3715 | taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 3716 | } |
| 3717 | data.recycle(); |
| 3718 | reply.recycle(); |
Craig Mautner | c0ffce5 | 2014-07-01 12:38:52 -0700 | [diff] [blame] | 3719 | return taskThumbnail; |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 3720 | } |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3721 | public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) |
| 3722 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3723 | Parcel data = Parcel.obtain(); |
| 3724 | Parcel reply = Parcel.obtain(); |
| 3725 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3726 | data.writeInt(maxNum); |
| 3727 | data.writeInt(flags); |
| 3728 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 3729 | reply.readException(); |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3730 | ArrayList<ActivityManager.RunningServiceInfo> list = null; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3731 | int N = reply.readInt(); |
| 3732 | if (N >= 0) { |
Todd Kennedy | e635f66 | 2015-01-20 10:36:49 -0800 | [diff] [blame] | 3733 | list = new ArrayList<>(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3734 | while (N > 0) { |
| 3735 | ActivityManager.RunningServiceInfo info = |
| 3736 | ActivityManager.RunningServiceInfo.CREATOR |
| 3737 | .createFromParcel(reply); |
| 3738 | list.add(info); |
| 3739 | N--; |
| 3740 | } |
| 3741 | } |
| 3742 | data.recycle(); |
| 3743 | reply.recycle(); |
| 3744 | return list; |
| 3745 | } |
| 3746 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 3747 | throws RemoteException { |
| 3748 | Parcel data = Parcel.obtain(); |
| 3749 | Parcel reply = Parcel.obtain(); |
| 3750 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3751 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 3752 | reply.readException(); |
| 3753 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 3754 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 3755 | data.recycle(); |
| 3756 | reply.recycle(); |
| 3757 | return list; |
| 3758 | } |
| 3759 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 3760 | throws RemoteException { |
| 3761 | Parcel data = Parcel.obtain(); |
| 3762 | Parcel reply = Parcel.obtain(); |
| 3763 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3764 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 3765 | reply.readException(); |
| 3766 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 3767 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 3768 | data.recycle(); |
| 3769 | reply.recycle(); |
| 3770 | return list; |
| 3771 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 3772 | public List<ApplicationInfo> getRunningExternalApplications() |
| 3773 | throws RemoteException { |
| 3774 | Parcel data = Parcel.obtain(); |
| 3775 | Parcel reply = Parcel.obtain(); |
| 3776 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3777 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 3778 | reply.readException(); |
| 3779 | ArrayList<ApplicationInfo> list |
| 3780 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 3781 | data.recycle(); |
| 3782 | reply.recycle(); |
| 3783 | return list; |
| 3784 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3785 | 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] | 3786 | { |
| 3787 | Parcel data = Parcel.obtain(); |
| 3788 | Parcel reply = Parcel.obtain(); |
| 3789 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3790 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3791 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 3792 | if (options != null) { |
| 3793 | data.writeInt(1); |
| 3794 | options.writeToParcel(data, 0); |
| 3795 | } else { |
| 3796 | data.writeInt(0); |
| 3797 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3798 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 3799 | reply.readException(); |
| 3800 | data.recycle(); |
| 3801 | reply.recycle(); |
| 3802 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3803 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 3804 | throws RemoteException { |
| 3805 | Parcel data = Parcel.obtain(); |
| 3806 | Parcel reply = Parcel.obtain(); |
| 3807 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3808 | data.writeStrongBinder(token); |
| 3809 | data.writeInt(nonRoot ? 1 : 0); |
| 3810 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 3811 | reply.readException(); |
| 3812 | boolean res = reply.readInt() != 0; |
| 3813 | data.recycle(); |
| 3814 | reply.recycle(); |
| 3815 | return res; |
| 3816 | } |
| 3817 | public void moveTaskBackwards(int task) throws RemoteException |
| 3818 | { |
| 3819 | Parcel data = Parcel.obtain(); |
| 3820 | Parcel reply = Parcel.obtain(); |
| 3821 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3822 | data.writeInt(task); |
| 3823 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 3824 | reply.readException(); |
| 3825 | data.recycle(); |
| 3826 | reply.recycle(); |
| 3827 | } |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3828 | @Override |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3829 | public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException |
| 3830 | { |
| 3831 | Parcel data = Parcel.obtain(); |
| 3832 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3833 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3834 | data.writeInt(taskId); |
| 3835 | data.writeInt(stackId); |
| 3836 | data.writeInt(toTop ? 1 : 0); |
| 3837 | mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0); |
| 3838 | reply.readException(); |
| 3839 | data.recycle(); |
| 3840 | reply.recycle(); |
| 3841 | } |
| 3842 | @Override |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3843 | public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate, |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3844 | Rect initialBounds) throws RemoteException |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3845 | { |
| 3846 | Parcel data = Parcel.obtain(); |
| 3847 | Parcel reply = Parcel.obtain(); |
| 3848 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3849 | data.writeInt(taskId); |
| 3850 | data.writeInt(createMode); |
| 3851 | data.writeInt(toTop ? 1 : 0); |
Jorim Jaggi | 030979c | 2015-11-20 15:14:43 -0800 | [diff] [blame] | 3852 | data.writeInt(animate ? 1 : 0); |
Jorim Jaggi | 9ea2f7b | 2015-11-23 18:08:28 -0800 | [diff] [blame] | 3853 | if (initialBounds != null) { |
| 3854 | data.writeInt(1); |
| 3855 | initialBounds.writeToParcel(data, 0); |
| 3856 | } else { |
| 3857 | data.writeInt(0); |
| 3858 | } |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3859 | mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3860 | reply.readException(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3861 | boolean res = reply.readInt() > 0; |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3862 | data.recycle(); |
| 3863 | reply.recycle(); |
Chong Zhang | e4fbd32 | 2016-03-01 14:44:03 -0800 | [diff] [blame] | 3864 | return res; |
Wale Ogunwale | 59a73ca | 2015-09-14 12:54:50 -0700 | [diff] [blame] | 3865 | } |
| 3866 | @Override |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3867 | public boolean moveTopActivityToPinnedStack(int stackId, Rect r) |
| 3868 | throws RemoteException |
| 3869 | { |
| 3870 | Parcel data = Parcel.obtain(); |
| 3871 | Parcel reply = Parcel.obtain(); |
| 3872 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3873 | data.writeInt(stackId); |
| 3874 | r.writeToParcel(data, 0); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 3875 | mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 079a004 | 2015-10-24 11:44:07 -0700 | [diff] [blame] | 3876 | reply.readException(); |
| 3877 | final boolean res = reply.readInt() != 0; |
| 3878 | data.recycle(); |
| 3879 | reply.recycle(); |
| 3880 | return res; |
| 3881 | } |
| 3882 | @Override |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3883 | public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode, |
| 3884 | boolean preserveWindows, boolean animate) throws RemoteException { |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3885 | Parcel data = Parcel.obtain(); |
| 3886 | Parcel reply = Parcel.obtain(); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3887 | data.writeInterfaceToken(IActivityManager.descriptor); |
Wale Ogunwale | b34a7ad | 2015-08-14 11:05:30 -0700 | [diff] [blame] | 3888 | data.writeInt(stackId); |
Jorim Jaggi | 61f39a7 | 2015-10-29 16:54:18 +0100 | [diff] [blame] | 3889 | if (r != null) { |
| 3890 | data.writeInt(1); |
| 3891 | r.writeToParcel(data, 0); |
| 3892 | } else { |
| 3893 | data.writeInt(0); |
| 3894 | } |
Wale Ogunwale | ffc11bb | 2015-10-10 13:05:45 -0700 | [diff] [blame] | 3895 | data.writeInt(allowResizeInDockedMode ? 1 : 0); |
Filip Gruszczynski | 84fa335 | 2016-01-25 16:28:49 -0800 | [diff] [blame] | 3896 | data.writeInt(preserveWindows ? 1 : 0); |
| 3897 | data.writeInt(animate ? 1 : 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 3898 | mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | c00204b | 2013-03-05 15:02:14 -0800 | [diff] [blame] | 3899 | reply.readException(); |
| 3900 | data.recycle(); |
| 3901 | reply.recycle(); |
| 3902 | } |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 3903 | @Override |
Jorim Jaggi | d47e7e1 | 2016-03-01 09:57:38 +0100 | [diff] [blame] | 3904 | public void swapDockedAndFullscreenStack() throws RemoteException |
| 3905 | { |
| 3906 | Parcel data = Parcel.obtain(); |
| 3907 | Parcel reply = Parcel.obtain(); |
| 3908 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3909 | mRemote.transact(SWAP_DOCKED_AND_FULLSCREEN_STACK, data, reply, 0); |
| 3910 | reply.readException(); |
| 3911 | data.recycle(); |
| 3912 | reply.recycle(); |
| 3913 | } |
| 3914 | @Override |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 3915 | public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds, |
| 3916 | Rect tempDockedTaskInsetBounds, |
| 3917 | Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds) |
| 3918 | throws RemoteException |
| 3919 | { |
| 3920 | Parcel data = Parcel.obtain(); |
| 3921 | Parcel reply = Parcel.obtain(); |
| 3922 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3923 | if (dockedBounds != null) { |
| 3924 | data.writeInt(1); |
| 3925 | dockedBounds.writeToParcel(data, 0); |
| 3926 | } else { |
| 3927 | data.writeInt(0); |
| 3928 | } |
| 3929 | if (tempDockedTaskBounds != null) { |
| 3930 | data.writeInt(1); |
| 3931 | tempDockedTaskBounds.writeToParcel(data, 0); |
| 3932 | } else { |
| 3933 | data.writeInt(0); |
| 3934 | } |
| 3935 | if (tempDockedTaskInsetBounds != null) { |
| 3936 | data.writeInt(1); |
| 3937 | tempDockedTaskInsetBounds.writeToParcel(data, 0); |
| 3938 | } else { |
| 3939 | data.writeInt(0); |
| 3940 | } |
| 3941 | if (tempOtherTaskBounds != null) { |
| 3942 | data.writeInt(1); |
| 3943 | tempOtherTaskBounds.writeToParcel(data, 0); |
| 3944 | } else { |
| 3945 | data.writeInt(0); |
| 3946 | } |
| 3947 | if (tempOtherTaskInsetBounds != null) { |
| 3948 | data.writeInt(1); |
| 3949 | tempOtherTaskInsetBounds.writeToParcel(data, 0); |
| 3950 | } else { |
| 3951 | data.writeInt(0); |
| 3952 | } |
| 3953 | mRemote.transact(RESIZE_DOCKED_STACK_TRANSACTION, data, reply, 0); |
| 3954 | reply.readException(); |
| 3955 | data.recycle(); |
| 3956 | reply.recycle(); |
| 3957 | } |
Robert Carr | 0d00c2e | 2016-02-29 17:45:02 -0800 | [diff] [blame] | 3958 | |
| 3959 | @Override |
| 3960 | public void resizePinnedStack(Rect pinnedBounds, Rect tempPinnedTaskBounds) throws RemoteException |
| 3961 | { |
| 3962 | Parcel data = Parcel.obtain(); |
| 3963 | Parcel reply = Parcel.obtain(); |
| 3964 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3965 | if (pinnedBounds != null) { |
| 3966 | data.writeInt(1); |
| 3967 | pinnedBounds.writeToParcel(data, 0); |
| 3968 | } else { |
| 3969 | data.writeInt(0); |
| 3970 | } |
| 3971 | if (tempPinnedTaskBounds != null) { |
| 3972 | data.writeInt(1); |
| 3973 | tempPinnedTaskBounds.writeToParcel(data, 0); |
| 3974 | } else { |
| 3975 | data.writeInt(0); |
| 3976 | } |
| 3977 | mRemote.transact(RESIZE_PINNED_STACK_TRANSACTION, data, reply, 0); |
| 3978 | reply.readException(); |
| 3979 | data.recycle(); |
| 3980 | reply.recycle(); |
| 3981 | } |
| 3982 | |
Jorim Jaggi | dc249c4 | 2015-12-15 14:57:31 -0800 | [diff] [blame] | 3983 | @Override |
Wale Ogunwale | ddc1cb2 | 2015-07-25 19:23:04 -0700 | [diff] [blame] | 3984 | public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException |
| 3985 | { |
| 3986 | Parcel data = Parcel.obtain(); |
| 3987 | Parcel reply = Parcel.obtain(); |
| 3988 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3989 | data.writeInt(taskId); |
| 3990 | data.writeInt(stackId); |
| 3991 | data.writeInt(position); |
| 3992 | mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0); |
| 3993 | reply.readException(); |
| 3994 | data.recycle(); |
| 3995 | reply.recycle(); |
| 3996 | } |
| 3997 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 3998 | public List<StackInfo> getAllStackInfos() throws RemoteException |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 3999 | { |
| 4000 | Parcel data = Parcel.obtain(); |
| 4001 | Parcel reply = Parcel.obtain(); |
| 4002 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4003 | mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0); |
Craig Mautner | 5ff1210 | 2013-05-24 12:50:15 -0700 | [diff] [blame] | 4004 | reply.readException(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4005 | ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR); |
Craig Mautner | 967212c | 2013-04-13 21:10:58 -0700 | [diff] [blame] | 4006 | data.recycle(); |
| 4007 | reply.recycle(); |
| 4008 | return list; |
| 4009 | } |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4010 | @Override |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4011 | public StackInfo getStackInfo(int stackId) throws RemoteException |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4012 | { |
| 4013 | Parcel data = Parcel.obtain(); |
| 4014 | Parcel reply = Parcel.obtain(); |
| 4015 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4016 | data.writeInt(stackId); |
| 4017 | mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4018 | reply.readException(); |
| 4019 | int res = reply.readInt(); |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4020 | StackInfo info = null; |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4021 | if (res != 0) { |
Craig Mautner | bdc748af | 2013-12-02 14:08:25 -0800 | [diff] [blame] | 4022 | info = StackInfo.CREATOR.createFromParcel(reply); |
Craig Mautner | fd1ce8d | 2013-06-17 16:15:42 -0700 | [diff] [blame] | 4023 | } |
| 4024 | data.recycle(); |
| 4025 | reply.recycle(); |
| 4026 | return info; |
| 4027 | } |
| 4028 | @Override |
Winson Chung | 303e1ff | 2014-03-07 15:06:19 -0800 | [diff] [blame] | 4029 | public boolean isInHomeStack(int taskId) throws RemoteException { |
| 4030 | Parcel data = Parcel.obtain(); |
| 4031 | Parcel reply = Parcel.obtain(); |
| 4032 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4033 | data.writeInt(taskId); |
| 4034 | mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0); |
| 4035 | reply.readException(); |
| 4036 | boolean isInHomeStack = reply.readInt() > 0; |
| 4037 | data.recycle(); |
| 4038 | reply.recycle(); |
| 4039 | return isInHomeStack; |
| 4040 | } |
| 4041 | @Override |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4042 | public void setFocusedStack(int stackId) throws RemoteException |
| 4043 | { |
| 4044 | Parcel data = Parcel.obtain(); |
| 4045 | Parcel reply = Parcel.obtain(); |
| 4046 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4047 | data.writeInt(stackId); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4048 | mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0); |
Craig Mautner | cf910b0 | 2013-04-23 11:23:27 -0700 | [diff] [blame] | 4049 | reply.readException(); |
| 4050 | data.recycle(); |
| 4051 | reply.recycle(); |
| 4052 | } |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4053 | @Override |
Winson Chung | d16c565 | 2015-01-26 16:11:07 -0800 | [diff] [blame] | 4054 | public int getFocusedStackId() throws RemoteException { |
| 4055 | Parcel data = Parcel.obtain(); |
| 4056 | Parcel reply = Parcel.obtain(); |
| 4057 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4058 | mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0); |
| 4059 | reply.readException(); |
| 4060 | int focusedStackId = reply.readInt(); |
| 4061 | data.recycle(); |
| 4062 | reply.recycle(); |
| 4063 | return focusedStackId; |
| 4064 | } |
| 4065 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 4066 | public void setFocusedTask(int taskId) throws RemoteException |
| 4067 | { |
| 4068 | Parcel data = Parcel.obtain(); |
| 4069 | Parcel reply = Parcel.obtain(); |
| 4070 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4071 | data.writeInt(taskId); |
| 4072 | mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0); |
| 4073 | reply.readException(); |
| 4074 | data.recycle(); |
| 4075 | reply.recycle(); |
| 4076 | } |
| 4077 | @Override |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4078 | public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException |
| 4079 | { |
| 4080 | Parcel data = Parcel.obtain(); |
| 4081 | Parcel reply = Parcel.obtain(); |
| 4082 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4083 | data.writeStrongBinder(listener.asBinder()); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4084 | mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0); |
Winson Chung | 740c3ac | 2014-11-12 16:14:38 -0800 | [diff] [blame] | 4085 | reply.readException(); |
| 4086 | data.recycle(); |
| 4087 | reply.recycle(); |
| 4088 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4089 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 4090 | { |
| 4091 | Parcel data = Parcel.obtain(); |
| 4092 | Parcel reply = Parcel.obtain(); |
| 4093 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4094 | data.writeStrongBinder(token); |
| 4095 | data.writeInt(onlyRoot ? 1 : 0); |
| 4096 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4097 | reply.readException(); |
| 4098 | int res = reply.readInt(); |
| 4099 | data.recycle(); |
| 4100 | reply.recycle(); |
| 4101 | return res; |
| 4102 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4103 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4104 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4105 | Parcel data = Parcel.obtain(); |
| 4106 | Parcel reply = Parcel.obtain(); |
| 4107 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4108 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4109 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4110 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4111 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4112 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4113 | reply.readException(); |
| 4114 | int res = reply.readInt(); |
| 4115 | ContentProviderHolder cph = null; |
| 4116 | if (res != 0) { |
| 4117 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4118 | } |
| 4119 | data.recycle(); |
| 4120 | reply.recycle(); |
| 4121 | return cph; |
| 4122 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4123 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 4124 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4125 | Parcel data = Parcel.obtain(); |
| 4126 | Parcel reply = Parcel.obtain(); |
| 4127 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4128 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 4129 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4130 | data.writeStrongBinder(token); |
| 4131 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4132 | reply.readException(); |
| 4133 | int res = reply.readInt(); |
| 4134 | ContentProviderHolder cph = null; |
| 4135 | if (res != 0) { |
| 4136 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 4137 | } |
| 4138 | data.recycle(); |
| 4139 | reply.recycle(); |
| 4140 | return cph; |
| 4141 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4142 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4143 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4144 | { |
| 4145 | Parcel data = Parcel.obtain(); |
| 4146 | Parcel reply = Parcel.obtain(); |
| 4147 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4148 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4149 | data.writeTypedList(providers); |
| 4150 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 4151 | reply.readException(); |
| 4152 | data.recycle(); |
| 4153 | reply.recycle(); |
| 4154 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4155 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 4156 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4157 | Parcel data = Parcel.obtain(); |
| 4158 | Parcel reply = Parcel.obtain(); |
| 4159 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4160 | data.writeStrongBinder(connection); |
| 4161 | data.writeInt(stable); |
| 4162 | data.writeInt(unstable); |
| 4163 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4164 | reply.readException(); |
| 4165 | boolean res = reply.readInt() != 0; |
| 4166 | data.recycle(); |
| 4167 | reply.recycle(); |
| 4168 | return res; |
| 4169 | } |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4170 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4171 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 4172 | Parcel data = Parcel.obtain(); |
| 4173 | Parcel reply = Parcel.obtain(); |
| 4174 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4175 | data.writeStrongBinder(connection); |
| 4176 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 4177 | reply.readException(); |
| 4178 | data.recycle(); |
| 4179 | reply.recycle(); |
| 4180 | } |
| 4181 | |
Jeff Sharkey | 7aa7601 | 2013-09-30 14:26:27 -0700 | [diff] [blame] | 4182 | @Override |
| 4183 | public void appNotRespondingViaProvider(IBinder connection) throws RemoteException { |
| 4184 | Parcel data = Parcel.obtain(); |
| 4185 | Parcel reply = Parcel.obtain(); |
| 4186 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4187 | data.writeStrongBinder(connection); |
| 4188 | mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0); |
| 4189 | reply.readException(); |
| 4190 | data.recycle(); |
| 4191 | reply.recycle(); |
| 4192 | } |
| 4193 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 4194 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 4195 | Parcel data = Parcel.obtain(); |
| 4196 | Parcel reply = Parcel.obtain(); |
| 4197 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4198 | data.writeStrongBinder(connection); |
| 4199 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4200 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 4201 | reply.readException(); |
| 4202 | data.recycle(); |
| 4203 | reply.recycle(); |
| 4204 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 4205 | |
| 4206 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 4207 | Parcel data = Parcel.obtain(); |
| 4208 | Parcel reply = Parcel.obtain(); |
| 4209 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4210 | data.writeString(name); |
| 4211 | data.writeStrongBinder(token); |
| 4212 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 4213 | reply.readException(); |
| 4214 | data.recycle(); |
| 4215 | reply.recycle(); |
| 4216 | } |
| 4217 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 4218 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 4219 | throws RemoteException |
| 4220 | { |
| 4221 | Parcel data = Parcel.obtain(); |
| 4222 | Parcel reply = Parcel.obtain(); |
| 4223 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4224 | service.writeToParcel(data, 0); |
| 4225 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 4226 | reply.readException(); |
| 4227 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 4228 | data.recycle(); |
| 4229 | reply.recycle(); |
| 4230 | return res; |
| 4231 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4232 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4233 | public ComponentName startService(IApplicationThread caller, Intent service, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4234 | String resolvedType, String callingPackage, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4235 | { |
| 4236 | Parcel data = Parcel.obtain(); |
| 4237 | Parcel reply = Parcel.obtain(); |
| 4238 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4239 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4240 | service.writeToParcel(data, 0); |
| 4241 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4242 | data.writeString(callingPackage); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4243 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4244 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 4245 | reply.readException(); |
| 4246 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4247 | data.recycle(); |
| 4248 | reply.recycle(); |
| 4249 | return res; |
| 4250 | } |
| 4251 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4252 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4253 | { |
| 4254 | Parcel data = Parcel.obtain(); |
| 4255 | Parcel reply = Parcel.obtain(); |
| 4256 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4257 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4258 | service.writeToParcel(data, 0); |
| 4259 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4260 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4261 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 4262 | reply.readException(); |
| 4263 | int res = reply.readInt(); |
| 4264 | reply.recycle(); |
| 4265 | data.recycle(); |
| 4266 | return res; |
| 4267 | } |
| 4268 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 4269 | int startId) throws RemoteException { |
| 4270 | Parcel data = Parcel.obtain(); |
| 4271 | Parcel reply = Parcel.obtain(); |
| 4272 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4273 | ComponentName.writeToParcel(className, data); |
| 4274 | data.writeStrongBinder(token); |
| 4275 | data.writeInt(startId); |
| 4276 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 4277 | reply.readException(); |
| 4278 | boolean res = reply.readInt() != 0; |
| 4279 | data.recycle(); |
| 4280 | reply.recycle(); |
| 4281 | return res; |
| 4282 | } |
| 4283 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4284 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4285 | Parcel data = Parcel.obtain(); |
| 4286 | Parcel reply = Parcel.obtain(); |
| 4287 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4288 | ComponentName.writeToParcel(className, data); |
| 4289 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 4290 | data.writeInt(id); |
| 4291 | if (notification != null) { |
| 4292 | data.writeInt(1); |
| 4293 | notification.writeToParcel(data, 0); |
| 4294 | } else { |
| 4295 | data.writeInt(0); |
| 4296 | } |
| 4297 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4298 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4299 | reply.readException(); |
| 4300 | data.recycle(); |
| 4301 | reply.recycle(); |
| 4302 | } |
| 4303 | public int bindService(IApplicationThread caller, IBinder token, |
| 4304 | Intent service, String resolvedType, IServiceConnection connection, |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4305 | int flags, String callingPackage, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4306 | Parcel data = Parcel.obtain(); |
| 4307 | Parcel reply = Parcel.obtain(); |
| 4308 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4309 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 4310 | data.writeStrongBinder(token); |
| 4311 | service.writeToParcel(data, 0); |
| 4312 | data.writeString(resolvedType); |
| 4313 | data.writeStrongBinder(connection.asBinder()); |
| 4314 | data.writeInt(flags); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4315 | data.writeString(callingPackage); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 4316 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4317 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4318 | reply.readException(); |
| 4319 | int res = reply.readInt(); |
| 4320 | data.recycle(); |
| 4321 | reply.recycle(); |
| 4322 | return res; |
| 4323 | } |
| 4324 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 4325 | { |
| 4326 | Parcel data = Parcel.obtain(); |
| 4327 | Parcel reply = Parcel.obtain(); |
| 4328 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4329 | data.writeStrongBinder(connection.asBinder()); |
| 4330 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 4331 | reply.readException(); |
| 4332 | boolean res = reply.readInt() != 0; |
| 4333 | data.recycle(); |
| 4334 | reply.recycle(); |
| 4335 | return res; |
| 4336 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4337 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4338 | public void publishService(IBinder token, |
| 4339 | Intent intent, IBinder service) throws RemoteException { |
| 4340 | Parcel data = Parcel.obtain(); |
| 4341 | Parcel reply = Parcel.obtain(); |
| 4342 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4343 | data.writeStrongBinder(token); |
| 4344 | intent.writeToParcel(data, 0); |
| 4345 | data.writeStrongBinder(service); |
| 4346 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 4347 | reply.readException(); |
| 4348 | data.recycle(); |
| 4349 | reply.recycle(); |
| 4350 | } |
| 4351 | |
| 4352 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 4353 | throws RemoteException { |
| 4354 | Parcel data = Parcel.obtain(); |
| 4355 | Parcel reply = Parcel.obtain(); |
| 4356 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4357 | data.writeStrongBinder(token); |
| 4358 | intent.writeToParcel(data, 0); |
| 4359 | data.writeInt(doRebind ? 1 : 0); |
| 4360 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 4361 | reply.readException(); |
| 4362 | data.recycle(); |
| 4363 | reply.recycle(); |
| 4364 | } |
| 4365 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4366 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 4367 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4368 | Parcel data = Parcel.obtain(); |
| 4369 | Parcel reply = Parcel.obtain(); |
| 4370 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4371 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 4372 | data.writeInt(type); |
| 4373 | data.writeInt(startId); |
| 4374 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4375 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 4376 | reply.readException(); |
| 4377 | data.recycle(); |
| 4378 | reply.recycle(); |
| 4379 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 4380 | |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4381 | public IBinder peekService(Intent service, String resolvedType, String callingPackage) |
| 4382 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4383 | Parcel data = Parcel.obtain(); |
| 4384 | Parcel reply = Parcel.obtain(); |
| 4385 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4386 | service.writeToParcel(data, 0); |
| 4387 | data.writeString(resolvedType); |
Svet Ganov | 99b6043 | 2015-06-27 13:15:22 -0700 | [diff] [blame] | 4388 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4389 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 4390 | reply.readException(); |
| 4391 | IBinder binder = reply.readStrongBinder(); |
| 4392 | reply.recycle(); |
| 4393 | data.recycle(); |
| 4394 | return binder; |
| 4395 | } |
| 4396 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4397 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 4398 | throws RemoteException { |
| 4399 | Parcel data = Parcel.obtain(); |
| 4400 | Parcel reply = Parcel.obtain(); |
| 4401 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4402 | app.writeToParcel(data, 0); |
| 4403 | data.writeInt(backupRestoreMode); |
| 4404 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4405 | reply.readException(); |
| 4406 | boolean success = reply.readInt() != 0; |
| 4407 | reply.recycle(); |
| 4408 | data.recycle(); |
| 4409 | return success; |
| 4410 | } |
| 4411 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 4412 | public void clearPendingBackup() throws RemoteException { |
| 4413 | Parcel data = Parcel.obtain(); |
| 4414 | Parcel reply = Parcel.obtain(); |
| 4415 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4416 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 4417 | reply.recycle(); |
| 4418 | data.recycle(); |
| 4419 | } |
| 4420 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 4421 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 4422 | Parcel data = Parcel.obtain(); |
| 4423 | Parcel reply = Parcel.obtain(); |
| 4424 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4425 | data.writeString(packageName); |
| 4426 | data.writeStrongBinder(agent); |
| 4427 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 4428 | reply.recycle(); |
| 4429 | data.recycle(); |
| 4430 | } |
| 4431 | |
| 4432 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 4433 | Parcel data = Parcel.obtain(); |
| 4434 | Parcel reply = Parcel.obtain(); |
| 4435 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4436 | app.writeToParcel(data, 0); |
| 4437 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 4438 | reply.readException(); |
| 4439 | reply.recycle(); |
| 4440 | data.recycle(); |
| 4441 | } |
| 4442 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4443 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4444 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4445 | IUiAutomationConnection connection, int userId, String instructionSet) |
| 4446 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4447 | Parcel data = Parcel.obtain(); |
| 4448 | Parcel reply = Parcel.obtain(); |
| 4449 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4450 | ComponentName.writeToParcel(className, data); |
| 4451 | data.writeString(profileFile); |
| 4452 | data.writeInt(flags); |
| 4453 | data.writeBundle(arguments); |
| 4454 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 4455 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 4456 | data.writeInt(userId); |
Narayan Kamath | 8dcfefd | 2014-05-15 18:12:59 +0100 | [diff] [blame] | 4457 | data.writeString(instructionSet); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4458 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4459 | reply.readException(); |
| 4460 | boolean res = reply.readInt() != 0; |
| 4461 | reply.recycle(); |
| 4462 | data.recycle(); |
| 4463 | return res; |
| 4464 | } |
| 4465 | |
| 4466 | public void finishInstrumentation(IApplicationThread target, |
| 4467 | int resultCode, Bundle results) throws RemoteException { |
| 4468 | Parcel data = Parcel.obtain(); |
| 4469 | Parcel reply = Parcel.obtain(); |
| 4470 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4471 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 4472 | data.writeInt(resultCode); |
| 4473 | data.writeBundle(results); |
| 4474 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 4475 | reply.readException(); |
| 4476 | data.recycle(); |
| 4477 | reply.recycle(); |
| 4478 | } |
| 4479 | public Configuration getConfiguration() throws RemoteException |
| 4480 | { |
| 4481 | Parcel data = Parcel.obtain(); |
| 4482 | Parcel reply = Parcel.obtain(); |
| 4483 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4484 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4485 | reply.readException(); |
| 4486 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 4487 | reply.recycle(); |
| 4488 | data.recycle(); |
| 4489 | return res; |
| 4490 | } |
| 4491 | public void updateConfiguration(Configuration values) throws RemoteException |
| 4492 | { |
| 4493 | Parcel data = Parcel.obtain(); |
| 4494 | Parcel reply = Parcel.obtain(); |
| 4495 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4496 | values.writeToParcel(data, 0); |
| 4497 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4498 | reply.readException(); |
| 4499 | data.recycle(); |
| 4500 | reply.recycle(); |
| 4501 | } |
| 4502 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 4503 | throws RemoteException { |
| 4504 | Parcel data = Parcel.obtain(); |
| 4505 | Parcel reply = Parcel.obtain(); |
| 4506 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4507 | data.writeStrongBinder(token); |
| 4508 | data.writeInt(requestedOrientation); |
| 4509 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4510 | reply.readException(); |
| 4511 | data.recycle(); |
| 4512 | reply.recycle(); |
| 4513 | } |
| 4514 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 4515 | Parcel data = Parcel.obtain(); |
| 4516 | Parcel reply = Parcel.obtain(); |
| 4517 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4518 | data.writeStrongBinder(token); |
| 4519 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 4520 | reply.readException(); |
| 4521 | int res = reply.readInt(); |
| 4522 | data.recycle(); |
| 4523 | reply.recycle(); |
| 4524 | return res; |
| 4525 | } |
| 4526 | public ComponentName getActivityClassForToken(IBinder token) |
| 4527 | throws RemoteException { |
| 4528 | Parcel data = Parcel.obtain(); |
| 4529 | Parcel reply = Parcel.obtain(); |
| 4530 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4531 | data.writeStrongBinder(token); |
| 4532 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4533 | reply.readException(); |
| 4534 | ComponentName res = ComponentName.readFromParcel(reply); |
| 4535 | data.recycle(); |
| 4536 | reply.recycle(); |
| 4537 | return res; |
| 4538 | } |
| 4539 | public String getPackageForToken(IBinder token) throws RemoteException |
| 4540 | { |
| 4541 | Parcel data = Parcel.obtain(); |
| 4542 | Parcel reply = Parcel.obtain(); |
| 4543 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4544 | data.writeStrongBinder(token); |
| 4545 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 4546 | reply.readException(); |
| 4547 | String res = reply.readString(); |
| 4548 | data.recycle(); |
| 4549 | reply.recycle(); |
| 4550 | return res; |
| 4551 | } |
| 4552 | public IIntentSender getIntentSender(int type, |
| 4553 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4554 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4555 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4556 | Parcel data = Parcel.obtain(); |
| 4557 | Parcel reply = Parcel.obtain(); |
| 4558 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4559 | data.writeInt(type); |
| 4560 | data.writeString(packageName); |
| 4561 | data.writeStrongBinder(token); |
| 4562 | data.writeString(resultWho); |
| 4563 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4564 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4565 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 4566 | data.writeTypedArray(intents, 0); |
| 4567 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4568 | } else { |
| 4569 | data.writeInt(0); |
| 4570 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4571 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 4572 | if (options != null) { |
| 4573 | data.writeInt(1); |
| 4574 | options.writeToParcel(data, 0); |
| 4575 | } else { |
| 4576 | data.writeInt(0); |
| 4577 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4578 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4579 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4580 | reply.readException(); |
| 4581 | IIntentSender res = IIntentSender.Stub.asInterface( |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4582 | reply.readStrongBinder()); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4583 | data.recycle(); |
| 4584 | reply.recycle(); |
| 4585 | return res; |
| 4586 | } |
| 4587 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 4588 | Parcel data = Parcel.obtain(); |
| 4589 | Parcel reply = Parcel.obtain(); |
| 4590 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4591 | data.writeStrongBinder(sender.asBinder()); |
| 4592 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4593 | reply.readException(); |
| 4594 | data.recycle(); |
| 4595 | reply.recycle(); |
| 4596 | } |
| 4597 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 4598 | Parcel data = Parcel.obtain(); |
| 4599 | Parcel reply = Parcel.obtain(); |
| 4600 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4601 | data.writeStrongBinder(sender.asBinder()); |
| 4602 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4603 | reply.readException(); |
| 4604 | String res = reply.readString(); |
| 4605 | data.recycle(); |
| 4606 | reply.recycle(); |
| 4607 | return res; |
| 4608 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 4609 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 4610 | Parcel data = Parcel.obtain(); |
| 4611 | Parcel reply = Parcel.obtain(); |
| 4612 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4613 | data.writeStrongBinder(sender.asBinder()); |
| 4614 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4615 | reply.readException(); |
| 4616 | int res = reply.readInt(); |
| 4617 | data.recycle(); |
| 4618 | reply.recycle(); |
| 4619 | return res; |
| 4620 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 4621 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 4622 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 4623 | Parcel data = Parcel.obtain(); |
| 4624 | Parcel reply = Parcel.obtain(); |
| 4625 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4626 | data.writeInt(callingPid); |
| 4627 | data.writeInt(callingUid); |
| 4628 | data.writeInt(userId); |
| 4629 | data.writeInt(allowAll ? 1 : 0); |
| 4630 | data.writeInt(requireFull ? 1 : 0); |
| 4631 | data.writeString(name); |
| 4632 | data.writeString(callerPackage); |
| 4633 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 4634 | reply.readException(); |
| 4635 | int res = reply.readInt(); |
| 4636 | data.recycle(); |
| 4637 | reply.recycle(); |
| 4638 | return res; |
| 4639 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4640 | public void setProcessLimit(int max) throws RemoteException |
| 4641 | { |
| 4642 | Parcel data = Parcel.obtain(); |
| 4643 | Parcel reply = Parcel.obtain(); |
| 4644 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4645 | data.writeInt(max); |
| 4646 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4647 | reply.readException(); |
| 4648 | data.recycle(); |
| 4649 | reply.recycle(); |
| 4650 | } |
| 4651 | public int getProcessLimit() throws RemoteException |
| 4652 | { |
| 4653 | Parcel data = Parcel.obtain(); |
| 4654 | Parcel reply = Parcel.obtain(); |
| 4655 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4656 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 4657 | reply.readException(); |
| 4658 | int res = reply.readInt(); |
| 4659 | data.recycle(); |
| 4660 | reply.recycle(); |
| 4661 | return res; |
| 4662 | } |
| 4663 | public void setProcessForeground(IBinder token, int pid, |
| 4664 | boolean isForeground) throws RemoteException { |
| 4665 | Parcel data = Parcel.obtain(); |
| 4666 | Parcel reply = Parcel.obtain(); |
| 4667 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4668 | data.writeStrongBinder(token); |
| 4669 | data.writeInt(pid); |
| 4670 | data.writeInt(isForeground ? 1 : 0); |
| 4671 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 4672 | reply.readException(); |
| 4673 | data.recycle(); |
| 4674 | reply.recycle(); |
| 4675 | } |
| 4676 | public int checkPermission(String permission, int pid, int uid) |
| 4677 | throws RemoteException { |
| 4678 | Parcel data = Parcel.obtain(); |
| 4679 | Parcel reply = Parcel.obtain(); |
| 4680 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4681 | data.writeString(permission); |
| 4682 | data.writeInt(pid); |
| 4683 | data.writeInt(uid); |
| 4684 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 4685 | reply.readException(); |
| 4686 | int res = reply.readInt(); |
| 4687 | data.recycle(); |
| 4688 | reply.recycle(); |
| 4689 | return res; |
| 4690 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4691 | public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) |
| 4692 | throws RemoteException { |
| 4693 | Parcel data = Parcel.obtain(); |
| 4694 | Parcel reply = Parcel.obtain(); |
| 4695 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4696 | data.writeString(permission); |
| 4697 | data.writeInt(pid); |
| 4698 | data.writeInt(uid); |
| 4699 | data.writeStrongBinder(callerToken); |
| 4700 | mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); |
| 4701 | reply.readException(); |
| 4702 | int res = reply.readInt(); |
| 4703 | data.recycle(); |
| 4704 | reply.recycle(); |
| 4705 | return res; |
| 4706 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4707 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4708 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4709 | Parcel data = Parcel.obtain(); |
| 4710 | Parcel reply = Parcel.obtain(); |
| 4711 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4712 | data.writeString(packageName); |
Christopher Tate | 31b65f9 | 2013-09-09 14:17:27 -0700 | [diff] [blame] | 4713 | data.writeStrongBinder((observer != null) ? observer.asBinder() : null); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 4714 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4715 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 4716 | reply.readException(); |
| 4717 | boolean res = reply.readInt() != 0; |
| 4718 | data.recycle(); |
| 4719 | reply.recycle(); |
| 4720 | return res; |
| 4721 | } |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4722 | public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId, |
| 4723 | IBinder callerToken) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4724 | Parcel data = Parcel.obtain(); |
| 4725 | Parcel reply = Parcel.obtain(); |
| 4726 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4727 | uri.writeToParcel(data, 0); |
| 4728 | data.writeInt(pid); |
| 4729 | data.writeInt(uid); |
| 4730 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4731 | data.writeInt(userId); |
Dianne Hackborn | ff17024 | 2014-11-19 10:59:01 -0800 | [diff] [blame] | 4732 | data.writeStrongBinder(callerToken); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4733 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4734 | reply.readException(); |
| 4735 | int res = reply.readInt(); |
| 4736 | data.recycle(); |
| 4737 | reply.recycle(); |
| 4738 | return res; |
| 4739 | } |
| 4740 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4741 | Uri uri, int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4742 | Parcel data = Parcel.obtain(); |
| 4743 | Parcel reply = Parcel.obtain(); |
| 4744 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4745 | data.writeStrongBinder(caller.asBinder()); |
| 4746 | data.writeString(targetPkg); |
| 4747 | uri.writeToParcel(data, 0); |
| 4748 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4749 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4750 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4751 | reply.readException(); |
| 4752 | data.recycle(); |
| 4753 | reply.recycle(); |
| 4754 | } |
| 4755 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4756 | int mode, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4757 | Parcel data = Parcel.obtain(); |
| 4758 | Parcel reply = Parcel.obtain(); |
| 4759 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4760 | data.writeStrongBinder(caller.asBinder()); |
| 4761 | uri.writeToParcel(data, 0); |
| 4762 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4763 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4764 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4765 | reply.readException(); |
| 4766 | data.recycle(); |
| 4767 | reply.recycle(); |
| 4768 | } |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4769 | |
| 4770 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4771 | public void takePersistableUriPermission(Uri uri, int mode, int userId) |
| 4772 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4773 | Parcel data = Parcel.obtain(); |
| 4774 | Parcel reply = Parcel.obtain(); |
| 4775 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4776 | uri.writeToParcel(data, 0); |
| 4777 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4778 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4779 | mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4780 | reply.readException(); |
| 4781 | data.recycle(); |
| 4782 | reply.recycle(); |
| 4783 | } |
| 4784 | |
| 4785 | @Override |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4786 | public void releasePersistableUriPermission(Uri uri, int mode, int userId) |
| 4787 | throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4788 | Parcel data = Parcel.obtain(); |
| 4789 | Parcel reply = Parcel.obtain(); |
| 4790 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4791 | uri.writeToParcel(data, 0); |
| 4792 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 4793 | data.writeInt(userId); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4794 | mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 4795 | reply.readException(); |
| 4796 | data.recycle(); |
| 4797 | reply.recycle(); |
| 4798 | } |
| 4799 | |
| 4800 | @Override |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4801 | public ParceledListSlice<UriPermission> getPersistedUriPermissions( |
| 4802 | String packageName, boolean incoming) throws RemoteException { |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4803 | Parcel data = Parcel.obtain(); |
| 4804 | Parcel reply = Parcel.obtain(); |
| 4805 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jeff Sharkey | bcaac0a | 2013-10-09 14:21:08 -0700 | [diff] [blame] | 4806 | data.writeString(packageName); |
| 4807 | data.writeInt(incoming ? 1 : 0); |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4808 | mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4809 | reply.readException(); |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4810 | @SuppressWarnings("unchecked") |
Jeff Sharkey | e66c177 | 2013-09-20 14:30:59 -0700 | [diff] [blame] | 4811 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4812 | reply); |
| 4813 | data.recycle(); |
| 4814 | reply.recycle(); |
| 4815 | return perms; |
| 4816 | } |
| 4817 | |
Felipe Leme | f3fa0f8 | 2016-01-07 12:08:19 -0800 | [diff] [blame] | 4818 | @Override |
| 4819 | public ParceledListSlice<UriPermission> getGrantedUriPermissions(String packageName, int userId) |
| 4820 | throws RemoteException { |
| 4821 | Parcel data = Parcel.obtain(); |
| 4822 | Parcel reply = Parcel.obtain(); |
| 4823 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4824 | data.writeString(packageName); |
| 4825 | data.writeInt(userId); |
| 4826 | mRemote.transact(GET_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4827 | reply.readException(); |
| 4828 | @SuppressWarnings("unchecked") |
| 4829 | final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel( |
| 4830 | reply); |
| 4831 | data.recycle(); |
| 4832 | reply.recycle(); |
| 4833 | return perms; |
| 4834 | } |
| 4835 | |
| 4836 | @Override |
| 4837 | public void clearGrantedUriPermissions(String packageName, int userId) throws RemoteException { |
| 4838 | Parcel data = Parcel.obtain(); |
| 4839 | Parcel reply = Parcel.obtain(); |
| 4840 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4841 | data.writeString(packageName); |
| 4842 | data.writeInt(userId); |
| 4843 | mRemote.transact(CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0); |
| 4844 | reply.readException(); |
| 4845 | data.recycle(); |
| 4846 | reply.recycle(); |
| 4847 | } |
| 4848 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4849 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 4850 | throws RemoteException { |
| 4851 | Parcel data = Parcel.obtain(); |
| 4852 | Parcel reply = Parcel.obtain(); |
| 4853 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4854 | data.writeStrongBinder(who.asBinder()); |
| 4855 | data.writeInt(waiting ? 1 : 0); |
| 4856 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 4857 | reply.readException(); |
| 4858 | data.recycle(); |
| 4859 | reply.recycle(); |
| 4860 | } |
| 4861 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 4862 | Parcel data = Parcel.obtain(); |
| 4863 | Parcel reply = Parcel.obtain(); |
| 4864 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4865 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 4866 | reply.readException(); |
| 4867 | outInfo.readFromParcel(reply); |
| 4868 | data.recycle(); |
| 4869 | reply.recycle(); |
| 4870 | } |
| 4871 | public void unhandledBack() throws RemoteException |
| 4872 | { |
| 4873 | Parcel data = Parcel.obtain(); |
| 4874 | Parcel reply = Parcel.obtain(); |
| 4875 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4876 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 4877 | reply.readException(); |
| 4878 | data.recycle(); |
| 4879 | reply.recycle(); |
| 4880 | } |
| 4881 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 4882 | { |
| 4883 | Parcel data = Parcel.obtain(); |
| 4884 | Parcel reply = Parcel.obtain(); |
| 4885 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4886 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 4887 | reply.readException(); |
| 4888 | ParcelFileDescriptor pfd = null; |
| 4889 | if (reply.readInt() != 0) { |
| 4890 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 4891 | } |
| 4892 | data.recycle(); |
| 4893 | reply.recycle(); |
| 4894 | return pfd; |
| 4895 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 4896 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 4897 | { |
| 4898 | Parcel data = Parcel.obtain(); |
| 4899 | Parcel reply = Parcel.obtain(); |
| 4900 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4901 | data.writeInt(shown ? 1 : 0); |
| 4902 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 4903 | reply.readException(); |
| 4904 | data.recycle(); |
| 4905 | reply.recycle(); |
| 4906 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4907 | public void setDebugApp( |
| 4908 | String packageName, boolean waitForDebugger, boolean persistent) |
| 4909 | throws RemoteException |
| 4910 | { |
| 4911 | Parcel data = Parcel.obtain(); |
| 4912 | Parcel reply = Parcel.obtain(); |
| 4913 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4914 | data.writeString(packageName); |
| 4915 | data.writeInt(waitForDebugger ? 1 : 0); |
| 4916 | data.writeInt(persistent ? 1 : 0); |
| 4917 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 4918 | reply.readException(); |
| 4919 | data.recycle(); |
| 4920 | reply.recycle(); |
| 4921 | } |
| 4922 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 4923 | { |
| 4924 | Parcel data = Parcel.obtain(); |
| 4925 | Parcel reply = Parcel.obtain(); |
| 4926 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4927 | data.writeInt(enabled ? 1 : 0); |
| 4928 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 4929 | reply.readException(); |
| 4930 | data.recycle(); |
| 4931 | reply.recycle(); |
| 4932 | } |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 4933 | public void setActivityController(IActivityController watcher, boolean imAMonkey) |
| 4934 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4935 | { |
| 4936 | Parcel data = Parcel.obtain(); |
| 4937 | Parcel reply = Parcel.obtain(); |
| 4938 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4939 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | 4a18c26 | 2016-02-26 17:23:48 -0800 | [diff] [blame] | 4940 | data.writeInt(imAMonkey ? 1 : 0); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 4941 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4942 | reply.readException(); |
| 4943 | data.recycle(); |
| 4944 | reply.recycle(); |
| 4945 | } |
Dianne Hackborn | b2117d1 | 2016-02-16 18:26:35 -0800 | [diff] [blame] | 4946 | public void setLenientBackgroundCheck(boolean enabled) throws RemoteException |
| 4947 | { |
| 4948 | Parcel data = Parcel.obtain(); |
| 4949 | Parcel reply = Parcel.obtain(); |
| 4950 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4951 | data.writeInt(enabled ? 1 : 0); |
| 4952 | mRemote.transact(SET_LENIENT_BACKGROUND_CHECK_TRANSACTION, data, reply, 0); |
| 4953 | reply.readException(); |
| 4954 | data.recycle(); |
| 4955 | reply.recycle(); |
| 4956 | } |
Dianne Hackborn | 970510b | 2016-02-24 16:56:42 -0800 | [diff] [blame] | 4957 | public int getMemoryTrimLevel() throws RemoteException |
| 4958 | { |
| 4959 | Parcel data = Parcel.obtain(); |
| 4960 | Parcel reply = Parcel.obtain(); |
| 4961 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4962 | mRemote.transact(GET_MEMORY_TRIM_LEVEL_TRANSACTION, data, reply, 0); |
| 4963 | reply.readException(); |
| 4964 | int level = reply.readInt(); |
| 4965 | data.recycle(); |
| 4966 | reply.recycle(); |
| 4967 | return level; |
| 4968 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4969 | public void enterSafeMode() throws RemoteException { |
| 4970 | Parcel data = Parcel.obtain(); |
| 4971 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4972 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 4973 | data.recycle(); |
| 4974 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4975 | public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag) |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4976 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4977 | Parcel data = Parcel.obtain(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4978 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 099bc62 | 2014-01-22 13:39:16 -0800 | [diff] [blame] | 4979 | data.writeStrongBinder(sender.asBinder()); |
| 4980 | data.writeInt(sourceUid); |
| 4981 | data.writeString(sourcePkg); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4982 | data.writeString(tag); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4983 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 4984 | data.recycle(); |
| 4985 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 4986 | public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag) |
| 4987 | throws RemoteException { |
| 4988 | Parcel data = Parcel.obtain(); |
| 4989 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4990 | data.writeStrongBinder(sender.asBinder()); |
| 4991 | data.writeInt(sourceUid); |
| 4992 | data.writeString(tag); |
| 4993 | mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0); |
| 4994 | data.recycle(); |
| 4995 | } |
| 4996 | public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) |
| 4997 | throws RemoteException { |
| 4998 | Parcel data = Parcel.obtain(); |
| 4999 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5000 | data.writeStrongBinder(sender.asBinder()); |
| 5001 | data.writeInt(sourceUid); |
| 5002 | data.writeString(tag); |
| 5003 | mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0); |
| 5004 | data.recycle(); |
| 5005 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 5006 | 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] | 5007 | Parcel data = Parcel.obtain(); |
| 5008 | Parcel reply = Parcel.obtain(); |
| 5009 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5010 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 5011 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 5012 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 5013 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 5014 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5015 | boolean res = reply.readInt() != 0; |
| 5016 | data.recycle(); |
| 5017 | reply.recycle(); |
| 5018 | return res; |
| 5019 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 5020 | @Override |
| 5021 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 5022 | Parcel data = Parcel.obtain(); |
| 5023 | Parcel reply = Parcel.obtain(); |
| 5024 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5025 | data.writeString(reason); |
| 5026 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 5027 | boolean res = reply.readInt() != 0; |
| 5028 | data.recycle(); |
| 5029 | reply.recycle(); |
| 5030 | return res; |
| 5031 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5032 | public boolean testIsSystemReady() |
| 5033 | { |
| 5034 | /* this base class version is never called */ |
| 5035 | return true; |
| 5036 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5037 | public void handleApplicationCrash(IBinder app, |
| 5038 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 5039 | { |
| 5040 | Parcel data = Parcel.obtain(); |
| 5041 | Parcel reply = Parcel.obtain(); |
| 5042 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5043 | data.writeStrongBinder(app); |
| 5044 | crashInfo.writeToParcel(data, 0); |
| 5045 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 5046 | reply.readException(); |
| 5047 | reply.recycle(); |
| 5048 | data.recycle(); |
| 5049 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5050 | |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 5051 | public boolean handleApplicationWtf(IBinder app, String tag, boolean system, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5052 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5053 | { |
| 5054 | Parcel data = Parcel.obtain(); |
| 5055 | Parcel reply = Parcel.obtain(); |
| 5056 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5057 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5058 | data.writeString(tag); |
Dianne Hackborn | 5232271 | 2014-08-26 22:47:26 -0700 | [diff] [blame] | 5059 | data.writeInt(system ? 1 : 0); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5060 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5061 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5062 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5063 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5064 | reply.recycle(); |
| 5065 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 5066 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5067 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 5068 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5069 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 5070 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 5071 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5072 | { |
| 5073 | Parcel data = Parcel.obtain(); |
| 5074 | Parcel reply = Parcel.obtain(); |
| 5075 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5076 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 5077 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 5078 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 5079 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 5080 | reply.readException(); |
| 5081 | reply.recycle(); |
| 5082 | data.recycle(); |
| 5083 | } |
| 5084 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5085 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 5086 | Parcel data = Parcel.obtain(); |
| 5087 | Parcel reply = Parcel.obtain(); |
| 5088 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5089 | data.writeInt(sig); |
| 5090 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 5091 | reply.readException(); |
| 5092 | data.recycle(); |
| 5093 | reply.recycle(); |
| 5094 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5095 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5096 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5097 | Parcel data = Parcel.obtain(); |
| 5098 | Parcel reply = Parcel.obtain(); |
| 5099 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5100 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5101 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5102 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5103 | reply.readException(); |
| 5104 | data.recycle(); |
| 5105 | reply.recycle(); |
| 5106 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 5107 | |
| 5108 | public void killAllBackgroundProcesses() throws RemoteException { |
| 5109 | Parcel data = Parcel.obtain(); |
| 5110 | Parcel reply = Parcel.obtain(); |
| 5111 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5112 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 5113 | reply.readException(); |
| 5114 | data.recycle(); |
| 5115 | reply.recycle(); |
| 5116 | } |
| 5117 | |
Gustav Sennton | 6258dcd | 2015-10-30 19:25:37 +0000 | [diff] [blame] | 5118 | public void killPackageDependents(String packageName, int userId) throws RemoteException { |
| 5119 | Parcel data = Parcel.obtain(); |
| 5120 | Parcel reply = Parcel.obtain(); |
| 5121 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5122 | data.writeString(packageName); |
| 5123 | data.writeInt(userId); |
| 5124 | mRemote.transact(KILL_PACKAGE_DEPENDENTS_TRANSACTION, data, reply, 0); |
| 5125 | reply.readException(); |
| 5126 | data.recycle(); |
| 5127 | reply.recycle(); |
| 5128 | } |
| 5129 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5130 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5131 | Parcel data = Parcel.obtain(); |
| 5132 | Parcel reply = Parcel.obtain(); |
| 5133 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5134 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5135 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 5136 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5137 | reply.readException(); |
| 5138 | data.recycle(); |
| 5139 | reply.recycle(); |
| 5140 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5141 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 5142 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 5143 | throws RemoteException |
| 5144 | { |
| 5145 | Parcel data = Parcel.obtain(); |
| 5146 | Parcel reply = Parcel.obtain(); |
| 5147 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5148 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 5149 | reply.readException(); |
| 5150 | outInfo.readFromParcel(reply); |
| 5151 | reply.recycle(); |
| 5152 | data.recycle(); |
| 5153 | } |
| 5154 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5155 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 5156 | { |
| 5157 | Parcel data = Parcel.obtain(); |
| 5158 | Parcel reply = Parcel.obtain(); |
| 5159 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5160 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5161 | reply.readException(); |
| 5162 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 5163 | reply.recycle(); |
| 5164 | data.recycle(); |
| 5165 | return res; |
| 5166 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5167 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5168 | public boolean profileControl(String process, int userId, boolean start, |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5169 | ProfilerInfo profilerInfo, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5170 | { |
| 5171 | Parcel data = Parcel.obtain(); |
| 5172 | Parcel reply = Parcel.obtain(); |
| 5173 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5174 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5175 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5176 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 5177 | data.writeInt(profileType); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5178 | if (profilerInfo != null) { |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5179 | data.writeInt(1); |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5180 | profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 5181 | } else { |
| 5182 | data.writeInt(0); |
| 5183 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 5184 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 5185 | reply.readException(); |
| 5186 | boolean res = reply.readInt() != 0; |
| 5187 | reply.recycle(); |
| 5188 | data.recycle(); |
| 5189 | return res; |
| 5190 | } |
Jeff Hao | 1b012d3 | 2014-08-20 10:35:34 -0700 | [diff] [blame] | 5191 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 5192 | public boolean shutdown(int timeout) throws RemoteException |
| 5193 | { |
| 5194 | Parcel data = Parcel.obtain(); |
| 5195 | Parcel reply = Parcel.obtain(); |
| 5196 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5197 | data.writeInt(timeout); |
| 5198 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 5199 | reply.readException(); |
| 5200 | boolean res = reply.readInt() != 0; |
| 5201 | reply.recycle(); |
| 5202 | data.recycle(); |
| 5203 | return res; |
| 5204 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5205 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5206 | public void stopAppSwitches() throws RemoteException { |
| 5207 | Parcel data = Parcel.obtain(); |
| 5208 | Parcel reply = Parcel.obtain(); |
| 5209 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5210 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5211 | reply.readException(); |
| 5212 | reply.recycle(); |
| 5213 | data.recycle(); |
| 5214 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5215 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 5216 | public void resumeAppSwitches() throws RemoteException { |
| 5217 | Parcel data = Parcel.obtain(); |
| 5218 | Parcel reply = Parcel.obtain(); |
| 5219 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5220 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 5221 | reply.readException(); |
| 5222 | reply.recycle(); |
| 5223 | data.recycle(); |
| 5224 | } |
Dianne Hackborn | fee756f | 2014-07-16 17:31:10 -0700 | [diff] [blame] | 5225 | |
| 5226 | public void addPackageDependency(String packageName) throws RemoteException { |
| 5227 | Parcel data = Parcel.obtain(); |
| 5228 | Parcel reply = Parcel.obtain(); |
| 5229 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5230 | data.writeString(packageName); |
| 5231 | mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0); |
| 5232 | reply.readException(); |
| 5233 | data.recycle(); |
| 5234 | reply.recycle(); |
| 5235 | } |
| 5236 | |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5237 | public void killApplicationWithAppId(String pkg, int appid, String reason) |
| 5238 | throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5239 | Parcel data = Parcel.obtain(); |
| 5240 | Parcel reply = Parcel.obtain(); |
| 5241 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5242 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5243 | data.writeInt(appid); |
Dianne Hackborn | 21d9b56 | 2013-05-28 17:46:59 -0700 | [diff] [blame] | 5244 | data.writeString(reason); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5245 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 5246 | reply.readException(); |
| 5247 | data.recycle(); |
| 5248 | reply.recycle(); |
| 5249 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5250 | |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 5251 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 5252 | Parcel data = Parcel.obtain(); |
| 5253 | Parcel reply = Parcel.obtain(); |
| 5254 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5255 | data.writeString(reason); |
| 5256 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 5257 | reply.readException(); |
| 5258 | data.recycle(); |
| 5259 | reply.recycle(); |
| 5260 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5261 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5262 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5263 | throws RemoteException { |
| 5264 | Parcel data = Parcel.obtain(); |
| 5265 | Parcel reply = Parcel.obtain(); |
| 5266 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5267 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5268 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 5269 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5270 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5271 | data.recycle(); |
| 5272 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 5273 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 5274 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 5275 | |
| 5276 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 5277 | Parcel data = Parcel.obtain(); |
| 5278 | Parcel reply = Parcel.obtain(); |
| 5279 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5280 | data.writeString(processName); |
| 5281 | data.writeInt(uid); |
| 5282 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 5283 | reply.readException(); |
| 5284 | data.recycle(); |
| 5285 | reply.recycle(); |
| 5286 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5287 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 5288 | public void overridePendingTransition(IBinder token, String packageName, |
| 5289 | int enterAnim, int exitAnim) throws RemoteException { |
| 5290 | Parcel data = Parcel.obtain(); |
| 5291 | Parcel reply = Parcel.obtain(); |
| 5292 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5293 | data.writeStrongBinder(token); |
| 5294 | data.writeString(packageName); |
| 5295 | data.writeInt(enterAnim); |
| 5296 | data.writeInt(exitAnim); |
| 5297 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 5298 | reply.readException(); |
| 5299 | data.recycle(); |
| 5300 | reply.recycle(); |
| 5301 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5302 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 5303 | public boolean isUserAMonkey() throws RemoteException { |
| 5304 | Parcel data = Parcel.obtain(); |
| 5305 | Parcel reply = Parcel.obtain(); |
| 5306 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5307 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 5308 | reply.readException(); |
| 5309 | boolean res = reply.readInt() != 0; |
| 5310 | data.recycle(); |
| 5311 | reply.recycle(); |
| 5312 | return res; |
| 5313 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 5314 | |
| 5315 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 5316 | Parcel data = Parcel.obtain(); |
| 5317 | Parcel reply = Parcel.obtain(); |
| 5318 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5319 | data.writeInt(monkey ? 1 : 0); |
| 5320 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 5321 | reply.readException(); |
| 5322 | data.recycle(); |
| 5323 | reply.recycle(); |
| 5324 | } |
| 5325 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 5326 | public void finishHeavyWeightApp() throws RemoteException { |
| 5327 | Parcel data = Parcel.obtain(); |
| 5328 | Parcel reply = Parcel.obtain(); |
| 5329 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5330 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 5331 | reply.readException(); |
| 5332 | data.recycle(); |
| 5333 | reply.recycle(); |
| 5334 | } |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5335 | |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5336 | public boolean convertFromTranslucent(IBinder token) |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5337 | throws RemoteException { |
| 5338 | Parcel data = Parcel.obtain(); |
| 5339 | Parcel reply = Parcel.obtain(); |
| 5340 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5341 | data.writeStrongBinder(token); |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5342 | mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0); |
| 5343 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5344 | boolean res = reply.readInt() != 0; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5345 | data.recycle(); |
| 5346 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5347 | return res; |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5348 | } |
| 5349 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5350 | public boolean convertToTranslucent(IBinder token, ActivityOptions options) |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5351 | throws RemoteException { |
| 5352 | Parcel data = Parcel.obtain(); |
| 5353 | Parcel reply = Parcel.obtain(); |
| 5354 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5355 | data.writeStrongBinder(token); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5356 | if (options == null) { |
| 5357 | data.writeInt(0); |
| 5358 | } else { |
| 5359 | data.writeInt(1); |
| 5360 | data.writeBundle(options.toBundle()); |
| 5361 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 5362 | mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0); |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5363 | reply.readException(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5364 | boolean res = reply.readInt() != 0; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5365 | data.recycle(); |
| 5366 | reply.recycle(); |
Craig Mautner | bc57cd1 | 2013-08-19 15:47:42 -0700 | [diff] [blame] | 5367 | return res; |
Craig Mautner | 4addfc5 | 2013-06-25 08:05:45 -0700 | [diff] [blame] | 5368 | } |
| 5369 | |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5370 | public ActivityOptions getActivityOptions(IBinder token) throws RemoteException { |
| 5371 | Parcel data = Parcel.obtain(); |
| 5372 | Parcel reply = Parcel.obtain(); |
| 5373 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5374 | data.writeStrongBinder(token); |
| 5375 | mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0); |
| 5376 | reply.readException(); |
Chong Zhang | 280d332 | 2015-11-03 17:27:26 -0800 | [diff] [blame] | 5377 | ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle()); |
Craig Mautner | 233ceee | 2014-05-09 17:05:11 -0700 | [diff] [blame] | 5378 | data.recycle(); |
| 5379 | reply.recycle(); |
| 5380 | return options; |
| 5381 | } |
| 5382 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5383 | public void setImmersive(IBinder token, boolean immersive) |
| 5384 | throws RemoteException { |
| 5385 | Parcel data = Parcel.obtain(); |
| 5386 | Parcel reply = Parcel.obtain(); |
| 5387 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5388 | data.writeStrongBinder(token); |
| 5389 | data.writeInt(immersive ? 1 : 0); |
| 5390 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 5391 | reply.readException(); |
| 5392 | data.recycle(); |
| 5393 | reply.recycle(); |
| 5394 | } |
| 5395 | |
| 5396 | public boolean isImmersive(IBinder token) |
| 5397 | throws RemoteException { |
| 5398 | Parcel data = Parcel.obtain(); |
| 5399 | Parcel reply = Parcel.obtain(); |
| 5400 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5401 | data.writeStrongBinder(token); |
| 5402 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5403 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5404 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5405 | data.recycle(); |
| 5406 | reply.recycle(); |
| 5407 | return res; |
| 5408 | } |
| 5409 | |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 5410 | public boolean isTopOfTask(IBinder token) throws RemoteException { |
| 5411 | Parcel data = Parcel.obtain(); |
| 5412 | Parcel reply = Parcel.obtain(); |
| 5413 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5414 | data.writeStrongBinder(token); |
| 5415 | mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0); |
| 5416 | reply.readException(); |
| 5417 | boolean res = reply.readInt() == 1; |
| 5418 | data.recycle(); |
| 5419 | reply.recycle(); |
| 5420 | return res; |
| 5421 | } |
| 5422 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5423 | public boolean isTopActivityImmersive() |
| 5424 | throws RemoteException { |
| 5425 | Parcel data = Parcel.obtain(); |
| 5426 | Parcel reply = Parcel.obtain(); |
| 5427 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5428 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5429 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5430 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 5431 | data.recycle(); |
| 5432 | reply.recycle(); |
| 5433 | return res; |
| 5434 | } |
| 5435 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 5436 | public void crashApplication(int uid, int initialPid, String packageName, |
| 5437 | String message) throws RemoteException { |
| 5438 | Parcel data = Parcel.obtain(); |
| 5439 | Parcel reply = Parcel.obtain(); |
| 5440 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5441 | data.writeInt(uid); |
| 5442 | data.writeInt(initialPid); |
| 5443 | data.writeString(packageName); |
| 5444 | data.writeString(message); |
| 5445 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 5446 | reply.readException(); |
| 5447 | data.recycle(); |
| 5448 | reply.recycle(); |
| 5449 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5450 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5451 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5452 | Parcel data = Parcel.obtain(); |
| 5453 | Parcel reply = Parcel.obtain(); |
| 5454 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5455 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5456 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 5457 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 5458 | reply.readException(); |
| 5459 | String res = reply.readString(); |
| 5460 | data.recycle(); |
| 5461 | reply.recycle(); |
| 5462 | return res; |
| 5463 | } |
| 5464 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5465 | public IBinder newUriPermissionOwner(String name) |
| 5466 | throws RemoteException { |
| 5467 | Parcel data = Parcel.obtain(); |
| 5468 | Parcel reply = Parcel.obtain(); |
| 5469 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5470 | data.writeString(name); |
| 5471 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 5472 | reply.readException(); |
| 5473 | IBinder res = reply.readStrongBinder(); |
| 5474 | data.recycle(); |
| 5475 | reply.recycle(); |
| 5476 | return res; |
| 5477 | } |
| 5478 | |
Vladislav Kaznacheev | b23a757 | 2015-12-18 12:23:43 -0800 | [diff] [blame] | 5479 | public IBinder getUriPermissionOwnerForActivity(IBinder activityToken) throws RemoteException { |
| 5480 | Parcel data = Parcel.obtain(); |
| 5481 | Parcel reply = Parcel.obtain(); |
| 5482 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5483 | data.writeStrongBinder(activityToken); |
| 5484 | mRemote.transact(GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5485 | reply.readException(); |
| 5486 | IBinder res = reply.readStrongBinder(); |
| 5487 | data.recycle(); |
| 5488 | reply.recycle(); |
| 5489 | return res; |
| 5490 | } |
| 5491 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5492 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5493 | Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5494 | Parcel data = Parcel.obtain(); |
| 5495 | Parcel reply = Parcel.obtain(); |
| 5496 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5497 | data.writeStrongBinder(owner); |
| 5498 | data.writeInt(fromUid); |
| 5499 | data.writeString(targetPkg); |
| 5500 | uri.writeToParcel(data, 0); |
| 5501 | data.writeInt(mode); |
Nicolas Prevot | f193990 | 2014-06-25 09:29:02 +0100 | [diff] [blame] | 5502 | data.writeInt(sourceUserId); |
| 5503 | data.writeInt(targetUserId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5504 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5505 | reply.readException(); |
| 5506 | data.recycle(); |
| 5507 | reply.recycle(); |
| 5508 | } |
| 5509 | |
| 5510 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5511 | int mode, int userId) throws RemoteException { |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5512 | Parcel data = Parcel.obtain(); |
| 5513 | Parcel reply = Parcel.obtain(); |
| 5514 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5515 | data.writeStrongBinder(owner); |
| 5516 | if (uri != null) { |
| 5517 | data.writeInt(1); |
| 5518 | uri.writeToParcel(data, 0); |
| 5519 | } else { |
| 5520 | data.writeInt(0); |
| 5521 | } |
| 5522 | data.writeInt(mode); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5523 | data.writeInt(userId); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 5524 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5525 | reply.readException(); |
| 5526 | data.recycle(); |
| 5527 | reply.recycle(); |
| 5528 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 5529 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5530 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5531 | Uri uri, int modeFlags, int userId) throws RemoteException { |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5532 | Parcel data = Parcel.obtain(); |
| 5533 | Parcel reply = Parcel.obtain(); |
| 5534 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5535 | data.writeInt(callingUid); |
| 5536 | data.writeString(targetPkg); |
| 5537 | uri.writeToParcel(data, 0); |
| 5538 | data.writeInt(modeFlags); |
Nicolas Prevot | d85fc72 | 2014-04-16 19:52:08 +0100 | [diff] [blame] | 5539 | data.writeInt(userId); |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 5540 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 5541 | reply.readException(); |
| 5542 | int res = reply.readInt(); |
| 5543 | data.recycle(); |
| 5544 | reply.recycle(); |
| 5545 | return res; |
| 5546 | } |
| 5547 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5548 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5549 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 5550 | Parcel data = Parcel.obtain(); |
| 5551 | Parcel reply = Parcel.obtain(); |
| 5552 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5553 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 5554 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 5555 | data.writeInt(managed ? 1 : 0); |
| 5556 | data.writeString(path); |
| 5557 | if (fd != null) { |
| 5558 | data.writeInt(1); |
| 5559 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 5560 | } else { |
| 5561 | data.writeInt(0); |
| 5562 | } |
| 5563 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 5564 | reply.readException(); |
| 5565 | boolean res = reply.readInt() != 0; |
| 5566 | reply.recycle(); |
| 5567 | data.recycle(); |
| 5568 | return res; |
| 5569 | } |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 5570 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5571 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5572 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5573 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5574 | Parcel data = Parcel.obtain(); |
| 5575 | Parcel reply = Parcel.obtain(); |
| 5576 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5577 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5578 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5579 | data.writeTypedArray(intents, 0); |
| 5580 | data.writeStringArray(resolvedTypes); |
| 5581 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 5582 | if (options != null) { |
| 5583 | data.writeInt(1); |
| 5584 | options.writeToParcel(data, 0); |
| 5585 | } else { |
| 5586 | data.writeInt(0); |
| 5587 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 5588 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 5589 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 5590 | reply.readException(); |
| 5591 | int result = reply.readInt(); |
| 5592 | reply.recycle(); |
| 5593 | data.recycle(); |
| 5594 | return result; |
| 5595 | } |
| 5596 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5597 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 5598 | Parcel data = Parcel.obtain(); |
| 5599 | Parcel reply = Parcel.obtain(); |
| 5600 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5601 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5602 | reply.readException(); |
| 5603 | int mode = reply.readInt(); |
| 5604 | reply.recycle(); |
| 5605 | data.recycle(); |
| 5606 | return mode; |
| 5607 | } |
| 5608 | |
| 5609 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 5610 | Parcel data = Parcel.obtain(); |
| 5611 | Parcel reply = Parcel.obtain(); |
| 5612 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5613 | data.writeInt(mode); |
| 5614 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5615 | reply.readException(); |
| 5616 | reply.recycle(); |
| 5617 | data.recycle(); |
| 5618 | } |
| 5619 | |
| 5620 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 5621 | Parcel data = Parcel.obtain(); |
| 5622 | Parcel reply = Parcel.obtain(); |
| 5623 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5624 | data.writeString(packageName); |
| 5625 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5626 | reply.readException(); |
| 5627 | int mode = reply.readInt(); |
| 5628 | reply.recycle(); |
| 5629 | data.recycle(); |
| 5630 | return mode; |
| 5631 | } |
| 5632 | |
| 5633 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5634 | throws RemoteException { |
| 5635 | Parcel data = Parcel.obtain(); |
| 5636 | Parcel reply = Parcel.obtain(); |
| 5637 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5638 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 5639 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 5640 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 5641 | reply.readException(); |
| 5642 | reply.recycle(); |
| 5643 | data.recycle(); |
| 5644 | } |
| 5645 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 5646 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 5647 | Parcel data = Parcel.obtain(); |
| 5648 | Parcel reply = Parcel.obtain(); |
| 5649 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5650 | data.writeString(packageName); |
| 5651 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5652 | reply.readException(); |
| 5653 | boolean ask = reply.readInt() != 0; |
| 5654 | reply.recycle(); |
| 5655 | data.recycle(); |
| 5656 | return ask; |
| 5657 | } |
| 5658 | |
| 5659 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 5660 | throws RemoteException { |
| 5661 | Parcel data = Parcel.obtain(); |
| 5662 | Parcel reply = Parcel.obtain(); |
| 5663 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5664 | data.writeString(packageName); |
| 5665 | data.writeInt(ask ? 1 : 0); |
| 5666 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 5667 | reply.readException(); |
| 5668 | reply.recycle(); |
| 5669 | data.recycle(); |
| 5670 | } |
| 5671 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5672 | public boolean switchUser(int userid) throws RemoteException { |
| 5673 | Parcel data = Parcel.obtain(); |
| 5674 | Parcel reply = Parcel.obtain(); |
| 5675 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5676 | data.writeInt(userid); |
| 5677 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 5678 | reply.readException(); |
| 5679 | boolean result = reply.readInt() != 0; |
| 5680 | reply.recycle(); |
| 5681 | data.recycle(); |
| 5682 | return result; |
| 5683 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5684 | |
Kenny Guy | 08488bf | 2014-02-21 17:40:37 +0000 | [diff] [blame] | 5685 | public boolean startUserInBackground(int userid) throws RemoteException { |
| 5686 | Parcel data = Parcel.obtain(); |
| 5687 | Parcel reply = Parcel.obtain(); |
| 5688 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5689 | data.writeInt(userid); |
| 5690 | mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0); |
| 5691 | reply.readException(); |
| 5692 | boolean result = reply.readInt() != 0; |
| 5693 | reply.recycle(); |
| 5694 | data.recycle(); |
| 5695 | return result; |
| 5696 | } |
| 5697 | |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5698 | public boolean unlockUser(int userId, byte[] token, byte[] secret) throws RemoteException { |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5699 | Parcel data = Parcel.obtain(); |
| 5700 | Parcel reply = Parcel.obtain(); |
| 5701 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5702 | data.writeInt(userId); |
| 5703 | data.writeByteArray(token); |
Paul Crowley | faeb3eb | 2016-02-08 15:58:29 +0000 | [diff] [blame] | 5704 | data.writeByteArray(secret); |
Jeff Sharkey | ba51235 | 2015-11-12 20:17:45 -0800 | [diff] [blame] | 5705 | mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0); |
| 5706 | reply.readException(); |
| 5707 | boolean result = reply.readInt() != 0; |
| 5708 | reply.recycle(); |
| 5709 | data.recycle(); |
| 5710 | return result; |
| 5711 | } |
| 5712 | |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5713 | public int stopUser(int userid, boolean force, IStopUserCallback callback) |
| 5714 | throws RemoteException { |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5715 | Parcel data = Parcel.obtain(); |
| 5716 | Parcel reply = Parcel.obtain(); |
| 5717 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5718 | data.writeInt(userid); |
Fyodor Kupolov | 9cbfc9e | 2015-10-07 15:52:33 -0700 | [diff] [blame] | 5719 | data.writeInt(force ? 1 : 0); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5720 | data.writeStrongInterface(callback); |
| 5721 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 5722 | reply.readException(); |
| 5723 | int result = reply.readInt(); |
| 5724 | reply.recycle(); |
| 5725 | data.recycle(); |
| 5726 | return result; |
| 5727 | } |
| 5728 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5729 | public UserInfo getCurrentUser() throws RemoteException { |
| 5730 | Parcel data = Parcel.obtain(); |
| 5731 | Parcel reply = Parcel.obtain(); |
| 5732 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 5733 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 5734 | reply.readException(); |
| 5735 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 5736 | reply.recycle(); |
| 5737 | data.recycle(); |
| 5738 | return userInfo; |
| 5739 | } |
| 5740 | |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5741 | public boolean isUserRunning(int userid, int flags) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5742 | Parcel data = Parcel.obtain(); |
| 5743 | Parcel reply = Parcel.obtain(); |
| 5744 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5745 | data.writeInt(userid); |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 5746 | data.writeInt(flags); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 5747 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 5748 | reply.readException(); |
| 5749 | boolean result = reply.readInt() != 0; |
| 5750 | reply.recycle(); |
| 5751 | data.recycle(); |
| 5752 | return result; |
| 5753 | } |
| 5754 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 5755 | public int[] getRunningUserIds() throws RemoteException { |
| 5756 | Parcel data = Parcel.obtain(); |
| 5757 | Parcel reply = Parcel.obtain(); |
| 5758 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5759 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 5760 | reply.readException(); |
| 5761 | int[] result = reply.createIntArray(); |
| 5762 | reply.recycle(); |
| 5763 | data.recycle(); |
| 5764 | return result; |
| 5765 | } |
| 5766 | |
Wale Ogunwale | d54b578 | 2014-10-23 15:55:23 -0700 | [diff] [blame] | 5767 | public boolean removeTask(int taskId) throws RemoteException { |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5768 | Parcel data = Parcel.obtain(); |
| 5769 | Parcel reply = Parcel.obtain(); |
| 5770 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5771 | data.writeInt(taskId); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 5772 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 5773 | reply.readException(); |
| 5774 | boolean result = reply.readInt() != 0; |
| 5775 | reply.recycle(); |
| 5776 | data.recycle(); |
| 5777 | return result; |
| 5778 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5779 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 5780 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5781 | Parcel data = Parcel.obtain(); |
| 5782 | Parcel reply = Parcel.obtain(); |
| 5783 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5784 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5785 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5786 | reply.readException(); |
| 5787 | data.recycle(); |
| 5788 | reply.recycle(); |
| 5789 | } |
| 5790 | |
| 5791 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 5792 | Parcel data = Parcel.obtain(); |
| 5793 | Parcel reply = Parcel.obtain(); |
| 5794 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5795 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5796 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 5797 | reply.readException(); |
| 5798 | data.recycle(); |
| 5799 | reply.recycle(); |
| 5800 | } |
| 5801 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5802 | public void registerUidObserver(IUidObserver observer, int which) throws RemoteException { |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5803 | Parcel data = Parcel.obtain(); |
| 5804 | Parcel reply = Parcel.obtain(); |
| 5805 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5806 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 5807 | data.writeInt(which); |
Dianne Hackborn | d23e0d6 | 2015-05-15 16:36:12 -0700 | [diff] [blame] | 5808 | mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5809 | reply.readException(); |
| 5810 | data.recycle(); |
| 5811 | reply.recycle(); |
| 5812 | } |
| 5813 | |
| 5814 | public void unregisterUidObserver(IUidObserver observer) throws RemoteException { |
| 5815 | Parcel data = Parcel.obtain(); |
| 5816 | Parcel reply = Parcel.obtain(); |
| 5817 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5818 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 5819 | mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0); |
| 5820 | reply.readException(); |
| 5821 | data.recycle(); |
| 5822 | reply.recycle(); |
| 5823 | } |
| 5824 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 5825 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 5826 | Parcel data = Parcel.obtain(); |
| 5827 | Parcel reply = Parcel.obtain(); |
| 5828 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5829 | data.writeStrongBinder(sender.asBinder()); |
| 5830 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 5831 | reply.readException(); |
| 5832 | boolean res = reply.readInt() != 0; |
| 5833 | data.recycle(); |
| 5834 | reply.recycle(); |
| 5835 | return res; |
| 5836 | } |
| 5837 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 5838 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 5839 | Parcel data = Parcel.obtain(); |
| 5840 | Parcel reply = Parcel.obtain(); |
| 5841 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5842 | data.writeStrongBinder(sender.asBinder()); |
| 5843 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 5844 | reply.readException(); |
| 5845 | boolean res = reply.readInt() != 0; |
| 5846 | data.recycle(); |
| 5847 | reply.recycle(); |
| 5848 | return res; |
| 5849 | } |
| 5850 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 5851 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 5852 | Parcel data = Parcel.obtain(); |
| 5853 | Parcel reply = Parcel.obtain(); |
| 5854 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5855 | data.writeStrongBinder(sender.asBinder()); |
| 5856 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5857 | reply.readException(); |
| 5858 | Intent res = reply.readInt() != 0 |
| 5859 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 5860 | data.recycle(); |
| 5861 | reply.recycle(); |
| 5862 | return res; |
| 5863 | } |
| 5864 | |
Dianne Hackborn | a1f1a3c | 2014-02-24 18:12:28 -0800 | [diff] [blame] | 5865 | public String getTagForIntentSender(IIntentSender sender, String prefix) |
| 5866 | throws RemoteException { |
| 5867 | Parcel data = Parcel.obtain(); |
| 5868 | Parcel reply = Parcel.obtain(); |
| 5869 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5870 | data.writeStrongBinder(sender.asBinder()); |
| 5871 | data.writeString(prefix); |
| 5872 | mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 5873 | reply.readException(); |
| 5874 | String res = reply.readString(); |
| 5875 | data.recycle(); |
| 5876 | reply.recycle(); |
| 5877 | return res; |
| 5878 | } |
| 5879 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 5880 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 5881 | { |
| 5882 | Parcel data = Parcel.obtain(); |
| 5883 | Parcel reply = Parcel.obtain(); |
| 5884 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5885 | values.writeToParcel(data, 0); |
| 5886 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 5887 | reply.readException(); |
| 5888 | data.recycle(); |
| 5889 | reply.recycle(); |
| 5890 | } |
| 5891 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 5892 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 5893 | Parcel data = Parcel.obtain(); |
| 5894 | Parcel reply = Parcel.obtain(); |
| 5895 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5896 | data.writeIntArray(pids); |
| 5897 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 5898 | reply.readException(); |
| 5899 | long[] res = reply.createLongArray(); |
| 5900 | data.recycle(); |
| 5901 | reply.recycle(); |
| 5902 | return res; |
| 5903 | } |
| 5904 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 5905 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 5906 | Parcel data = Parcel.obtain(); |
| 5907 | Parcel reply = Parcel.obtain(); |
| 5908 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5909 | TextUtils.writeToParcel(msg, data, 0); |
| 5910 | data.writeInt(always ? 1 : 0); |
| 5911 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 5912 | reply.readException(); |
| 5913 | data.recycle(); |
| 5914 | reply.recycle(); |
| 5915 | } |
| 5916 | |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5917 | public void keyguardWaitingForActivityDrawn() throws RemoteException { |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5918 | Parcel data = Parcel.obtain(); |
| 5919 | Parcel reply = Parcel.obtain(); |
| 5920 | data.writeInterfaceToken(IActivityManager.descriptor); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 5921 | mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 5922 | reply.readException(); |
| 5923 | data.recycle(); |
| 5924 | reply.recycle(); |
| 5925 | } |
| 5926 | |
Jorim Jaggi | 827e0fa | 2015-05-07 11:41:41 -0700 | [diff] [blame] | 5927 | public void keyguardGoingAway(boolean disableWindowAnimations, |
| 5928 | boolean keyguardGoingToNotificationShade) throws RemoteException { |
| 5929 | Parcel data = Parcel.obtain(); |
| 5930 | Parcel reply = Parcel.obtain(); |
| 5931 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5932 | data.writeInt(disableWindowAnimations ? 1 : 0); |
| 5933 | data.writeInt(keyguardGoingToNotificationShade ? 1 : 0); |
| 5934 | mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0); |
| 5935 | reply.readException(); |
| 5936 | data.recycle(); |
| 5937 | reply.recycle(); |
| 5938 | } |
| 5939 | |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5940 | public boolean shouldUpRecreateTask(IBinder token, String destAffinity) |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5941 | throws RemoteException { |
| 5942 | Parcel data = Parcel.obtain(); |
| 5943 | Parcel reply = Parcel.obtain(); |
| 5944 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5945 | data.writeStrongBinder(token); |
| 5946 | data.writeString(destAffinity); |
Dianne Hackborn | 6f4d61f | 2014-08-21 17:50:42 -0700 | [diff] [blame] | 5947 | mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 5948 | reply.readException(); |
| 5949 | boolean result = reply.readInt() != 0; |
| 5950 | data.recycle(); |
| 5951 | reply.recycle(); |
| 5952 | return result; |
| 5953 | } |
| 5954 | |
| 5955 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 5956 | throws RemoteException { |
| 5957 | Parcel data = Parcel.obtain(); |
| 5958 | Parcel reply = Parcel.obtain(); |
| 5959 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5960 | data.writeStrongBinder(token); |
| 5961 | target.writeToParcel(data, 0); |
| 5962 | data.writeInt(resultCode); |
| 5963 | if (resultData != null) { |
| 5964 | data.writeInt(1); |
| 5965 | resultData.writeToParcel(data, 0); |
| 5966 | } else { |
| 5967 | data.writeInt(0); |
| 5968 | } |
| 5969 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 5970 | reply.readException(); |
| 5971 | boolean result = reply.readInt() != 0; |
| 5972 | data.recycle(); |
| 5973 | reply.recycle(); |
| 5974 | return result; |
| 5975 | } |
| 5976 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 5977 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 5978 | Parcel data = Parcel.obtain(); |
| 5979 | Parcel reply = Parcel.obtain(); |
| 5980 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5981 | data.writeStrongBinder(activityToken); |
| 5982 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 5983 | reply.readException(); |
| 5984 | int result = reply.readInt(); |
| 5985 | data.recycle(); |
| 5986 | reply.recycle(); |
| 5987 | return result; |
| 5988 | } |
| 5989 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 5990 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 5991 | Parcel data = Parcel.obtain(); |
| 5992 | Parcel reply = Parcel.obtain(); |
| 5993 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 5994 | data.writeStrongBinder(activityToken); |
| 5995 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 5996 | reply.readException(); |
| 5997 | String result = reply.readString(); |
| 5998 | data.recycle(); |
| 5999 | reply.recycle(); |
| 6000 | return result; |
| 6001 | } |
| 6002 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 6003 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 6004 | Parcel data = Parcel.obtain(); |
| 6005 | Parcel reply = Parcel.obtain(); |
| 6006 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6007 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 6008 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 6009 | reply.readException(); |
| 6010 | data.recycle(); |
| 6011 | reply.recycle(); |
| 6012 | } |
| 6013 | |
| 6014 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 6015 | Parcel data = Parcel.obtain(); |
| 6016 | Parcel reply = Parcel.obtain(); |
| 6017 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6018 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 6019 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 6020 | reply.readException(); |
| 6021 | data.recycle(); |
| 6022 | reply.recycle(); |
| 6023 | } |
| 6024 | |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 6025 | public void requestBugReport(@ActivityManager.BugreportMode int bugreportType) |
| 6026 | throws RemoteException { |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 6027 | Parcel data = Parcel.obtain(); |
| 6028 | Parcel reply = Parcel.obtain(); |
| 6029 | data.writeInterfaceToken(IActivityManager.descriptor); |
Michal Karpinski | 3da5c97 | 2015-12-11 18:16:30 +0000 | [diff] [blame] | 6030 | data.writeInt(bugreportType); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 6031 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 6032 | reply.readException(); |
| 6033 | data.recycle(); |
| 6034 | reply.recycle(); |
| 6035 | } |
| 6036 | |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 6037 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason) |
| 6038 | throws RemoteException { |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 6039 | Parcel data = Parcel.obtain(); |
| 6040 | Parcel reply = Parcel.obtain(); |
| 6041 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6042 | data.writeInt(pid); |
| 6043 | data.writeInt(aboveSystem ? 1 : 0); |
Jeff Brown | bd181bb | 2013-09-10 16:44:24 -0700 | [diff] [blame] | 6044 | data.writeString(reason); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 6045 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 6046 | reply.readException(); |
| 6047 | long res = reply.readInt(); |
| 6048 | data.recycle(); |
| 6049 | reply.recycle(); |
| 6050 | return res; |
| 6051 | } |
| 6052 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6053 | public Bundle getAssistContextExtras(int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6054 | Parcel data = Parcel.obtain(); |
| 6055 | Parcel reply = Parcel.obtain(); |
| 6056 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6057 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6058 | mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6059 | reply.readException(); |
| 6060 | Bundle res = reply.readBundle(); |
| 6061 | data.recycle(); |
| 6062 | reply.recycle(); |
| 6063 | return res; |
| 6064 | } |
| 6065 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6066 | public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver, |
| 6067 | IBinder activityToken) throws RemoteException { |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6068 | Parcel data = Parcel.obtain(); |
| 6069 | Parcel reply = Parcel.obtain(); |
| 6070 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6071 | data.writeInt(requestType); |
| 6072 | data.writeStrongBinder(receiver.asBinder()); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6073 | data.writeStrongBinder(activityToken); |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6074 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
| 6075 | reply.readException(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6076 | boolean res = reply.readInt() != 0; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6077 | data.recycle(); |
| 6078 | reply.recycle(); |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6079 | return res; |
Dianne Hackborn | ae6688b | 2015-02-11 17:02:41 -0800 | [diff] [blame] | 6080 | } |
| 6081 | |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 6082 | public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure, |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 6083 | AssistContent content, Uri referrer) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6084 | Parcel data = Parcel.obtain(); |
| 6085 | Parcel reply = Parcel.obtain(); |
| 6086 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6087 | data.writeStrongBinder(token); |
| 6088 | data.writeBundle(extras); |
Dianne Hackborn | 09d57fe | 2015-05-27 18:05:52 -0700 | [diff] [blame] | 6089 | structure.writeToParcel(data, 0); |
| 6090 | content.writeToParcel(data, 0); |
Dianne Hackborn | a3acdb3 | 2015-06-08 17:07:40 -0700 | [diff] [blame] | 6091 | if (referrer != null) { |
| 6092 | data.writeInt(1); |
| 6093 | referrer.writeToParcel(data, 0); |
| 6094 | } else { |
| 6095 | data.writeInt(0); |
| 6096 | } |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 6097 | mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 6098 | reply.readException(); |
| 6099 | data.recycle(); |
| 6100 | reply.recycle(); |
| 6101 | } |
| 6102 | |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6103 | public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle, |
| 6104 | Bundle args) throws RemoteException { |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6105 | Parcel data = Parcel.obtain(); |
| 6106 | Parcel reply = Parcel.obtain(); |
| 6107 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6108 | intent.writeToParcel(data, 0); |
| 6109 | data.writeInt(requestType); |
| 6110 | data.writeString(hint); |
| 6111 | data.writeInt(userHandle); |
Tim Kilbourn | 0e5f110 | 2015-06-05 16:18:09 -0700 | [diff] [blame] | 6112 | data.writeBundle(args); |
Dianne Hackborn | fdf5b35 | 2014-10-08 17:43:48 -0700 | [diff] [blame] | 6113 | mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); |
| 6114 | reply.readException(); |
| 6115 | boolean res = reply.readInt() != 0; |
| 6116 | data.recycle(); |
| 6117 | reply.recycle(); |
| 6118 | return res; |
| 6119 | } |
| 6120 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6121 | public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException { |
Benjamin Franz | c200f44 | 2015-06-25 18:20:04 +0100 | [diff] [blame] | 6122 | Parcel data = Parcel.obtain(); |
| 6123 | Parcel reply = Parcel.obtain(); |
| 6124 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6125 | mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6126 | reply.readException(); |
| 6127 | boolean res = reply.readInt() != 0; |
| 6128 | data.recycle(); |
| 6129 | reply.recycle(); |
| 6130 | return res; |
| 6131 | } |
| 6132 | |
Dianne Hackborn | 17f6935 | 2015-07-17 18:04:14 -0700 | [diff] [blame] | 6133 | public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException { |
| 6134 | Parcel data = Parcel.obtain(); |
| 6135 | Parcel reply = Parcel.obtain(); |
| 6136 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6137 | data.writeStrongBinder(token); |
| 6138 | data.writeBundle(args); |
| 6139 | mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0); |
| 6140 | reply.readException(); |
| 6141 | boolean res = reply.readInt() != 0; |
| 6142 | data.recycle(); |
| 6143 | reply.recycle(); |
| 6144 | return res; |
| 6145 | } |
| 6146 | |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6147 | public void killUid(int appId, int userId, String reason) throws RemoteException { |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6148 | Parcel data = Parcel.obtain(); |
| 6149 | Parcel reply = Parcel.obtain(); |
| 6150 | data.writeInterfaceToken(IActivityManager.descriptor); |
Svetoslav | aa41add | 2015-08-06 15:03:55 -0700 | [diff] [blame] | 6151 | data.writeInt(appId); |
| 6152 | data.writeInt(userId); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 6153 | data.writeString(reason); |
| 6154 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 6155 | reply.readException(); |
| 6156 | data.recycle(); |
| 6157 | reply.recycle(); |
| 6158 | } |
| 6159 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 6160 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 6161 | Parcel data = Parcel.obtain(); |
| 6162 | Parcel reply = Parcel.obtain(); |
| 6163 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6164 | data.writeStrongBinder(who); |
| 6165 | data.writeInt(allowRestart ? 1 : 0); |
| 6166 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 6167 | reply.readException(); |
| 6168 | data.recycle(); |
| 6169 | reply.recycle(); |
| 6170 | } |
| 6171 | |
Dianne Hackborn | 2286cdc | 2013-07-01 19:10:06 -0700 | [diff] [blame] | 6172 | public void reportActivityFullyDrawn(IBinder token) throws RemoteException { |
| 6173 | Parcel data = Parcel.obtain(); |
| 6174 | Parcel reply = Parcel.obtain(); |
| 6175 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6176 | data.writeStrongBinder(token); |
| 6177 | mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0); |
| 6178 | reply.readException(); |
| 6179 | data.recycle(); |
| 6180 | reply.recycle(); |
| 6181 | } |
| 6182 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 6183 | public void notifyActivityDrawn(IBinder token) throws RemoteException { |
| 6184 | Parcel data = Parcel.obtain(); |
| 6185 | Parcel reply = Parcel.obtain(); |
| 6186 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6187 | data.writeStrongBinder(token); |
| 6188 | mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0); |
| 6189 | reply.readException(); |
| 6190 | data.recycle(); |
| 6191 | reply.recycle(); |
| 6192 | } |
| 6193 | |
Dianne Hackborn | 57a7f59 | 2013-07-22 18:21:32 -0700 | [diff] [blame] | 6194 | public void restart() throws RemoteException { |
| 6195 | Parcel data = Parcel.obtain(); |
| 6196 | Parcel reply = Parcel.obtain(); |
| 6197 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6198 | mRemote.transact(RESTART_TRANSACTION, data, reply, 0); |
| 6199 | reply.readException(); |
| 6200 | data.recycle(); |
| 6201 | reply.recycle(); |
| 6202 | } |
| 6203 | |
Dianne Hackborn | 35f72be | 2013-09-16 10:57:39 -0700 | [diff] [blame] | 6204 | public void performIdleMaintenance() throws RemoteException { |
| 6205 | Parcel data = Parcel.obtain(); |
| 6206 | Parcel reply = Parcel.obtain(); |
| 6207 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6208 | mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0); |
| 6209 | reply.readException(); |
| 6210 | data.recycle(); |
| 6211 | reply.recycle(); |
| 6212 | } |
| 6213 | |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6214 | public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6215 | IActivityContainerCallback callback) throws RemoteException { |
| 6216 | Parcel data = Parcel.obtain(); |
| 6217 | Parcel reply = Parcel.obtain(); |
| 6218 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6219 | data.writeStrongBinder(parentActivityToken); |
Craig Mautner | e3a00d7 | 2014-04-16 08:31:19 -0700 | [diff] [blame] | 6220 | data.writeStrongBinder(callback == null ? null : callback.asBinder()); |
Todd Kennedy | ca4d842 | 2015-01-15 15:19:22 -0800 | [diff] [blame] | 6221 | mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6222 | reply.readException(); |
Craig Mautner | bd503a4 | 2014-01-10 10:16:43 -0800 | [diff] [blame] | 6223 | final int result = reply.readInt(); |
| 6224 | final IActivityContainer res; |
| 6225 | if (result == 1) { |
| 6226 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6227 | } else { |
| 6228 | res = null; |
| 6229 | } |
Craig Mautner | 4a1cb22 | 2013-12-04 16:14:06 -0800 | [diff] [blame] | 6230 | data.recycle(); |
| 6231 | reply.recycle(); |
| 6232 | return res; |
| 6233 | } |
| 6234 | |
Craig Mautner | 95da108 | 2014-02-24 17:54:35 -0800 | [diff] [blame] | 6235 | public void deleteActivityContainer(IActivityContainer activityContainer) |
| 6236 | throws RemoteException { |
| 6237 | Parcel data = Parcel.obtain(); |
| 6238 | Parcel reply = Parcel.obtain(); |
| 6239 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6240 | data.writeStrongBinder(activityContainer.asBinder()); |
| 6241 | mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0); |
| 6242 | reply.readException(); |
| 6243 | data.recycle(); |
| 6244 | reply.recycle(); |
| 6245 | } |
| 6246 | |
Rahul Chaturvedi | 52613f9 | 2015-06-17 23:54:08 -0400 | [diff] [blame] | 6247 | public boolean startBinderTracking() throws RemoteException { |
| 6248 | Parcel data = Parcel.obtain(); |
| 6249 | Parcel reply = Parcel.obtain(); |
| 6250 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6251 | mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0); |
| 6252 | reply.readException(); |
| 6253 | boolean res = reply.readInt() != 0; |
| 6254 | reply.recycle(); |
| 6255 | data.recycle(); |
| 6256 | return res; |
| 6257 | } |
| 6258 | |
| 6259 | public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException { |
| 6260 | Parcel data = Parcel.obtain(); |
| 6261 | Parcel reply = Parcel.obtain(); |
| 6262 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6263 | if (fd != null) { |
| 6264 | data.writeInt(1); |
| 6265 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 6266 | } else { |
| 6267 | data.writeInt(0); |
| 6268 | } |
| 6269 | mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0); |
| 6270 | reply.readException(); |
| 6271 | boolean res = reply.readInt() != 0; |
| 6272 | reply.recycle(); |
| 6273 | data.recycle(); |
| 6274 | return res; |
| 6275 | } |
| 6276 | |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6277 | public int setVrMode(IBinder token, boolean enabled, ComponentName packageName) |
| 6278 | throws RemoteException { |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6279 | Parcel data = Parcel.obtain(); |
| 6280 | Parcel reply = Parcel.obtain(); |
| 6281 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6282 | data.writeStrongBinder(token); |
| 6283 | data.writeInt(enabled ? 1 : 0); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6284 | packageName.writeToParcel(data, 0); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6285 | mRemote.transact(SET_VR_MODE_TRANSACTION, data, reply, 0); |
| 6286 | reply.readException(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6287 | int res = reply.readInt(); |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6288 | data.recycle(); |
| 6289 | reply.recycle(); |
Ruben Brunk | e24b9a6 | 2016-02-16 21:38:24 -0800 | [diff] [blame] | 6290 | return res; |
| 6291 | } |
| 6292 | |
| 6293 | public boolean isVrModePackageEnabled(ComponentName packageName) |
| 6294 | throws RemoteException { |
| 6295 | Parcel data = Parcel.obtain(); |
| 6296 | Parcel reply = Parcel.obtain(); |
| 6297 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6298 | packageName.writeToParcel(data, 0); |
| 6299 | mRemote.transact(IS_VR_PACKAGE_ENABLED_TRANSACTION, data, reply, 0); |
| 6300 | reply.readException(); |
| 6301 | int res = reply.readInt(); |
| 6302 | data.recycle(); |
| 6303 | reply.recycle(); |
| 6304 | return res == 1; |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 6305 | } |
| 6306 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6307 | @Override |
Todd Kennedy | 4900bf9 | 2015-01-16 16:05:14 -0800 | [diff] [blame] | 6308 | public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException { |
| 6309 | Parcel data = Parcel.obtain(); |
| 6310 | Parcel reply = Parcel.obtain(); |
| 6311 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6312 | data.writeInt(displayId); |
| 6313 | mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0); |
| 6314 | reply.readException(); |
| 6315 | final int result = reply.readInt(); |
| 6316 | final IActivityContainer res; |
| 6317 | if (result == 1) { |
| 6318 | res = IActivityContainer.Stub.asInterface(reply.readStrongBinder()); |
| 6319 | } else { |
| 6320 | res = null; |
| 6321 | } |
| 6322 | data.recycle(); |
| 6323 | reply.recycle(); |
| 6324 | return res; |
| 6325 | } |
| 6326 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6327 | @Override |
| 6328 | public int getActivityDisplayId(IBinder activityToken) |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6329 | throws RemoteException { |
| 6330 | Parcel data = Parcel.obtain(); |
| 6331 | Parcel reply = Parcel.obtain(); |
| 6332 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6333 | data.writeStrongBinder(activityToken); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6334 | mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6335 | reply.readException(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6336 | final int displayId = reply.readInt(); |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6337 | data.recycle(); |
| 6338 | reply.recycle(); |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6339 | return displayId; |
Craig Mautner | e0a3884 | 2013-12-16 16:14:02 -0800 | [diff] [blame] | 6340 | } |
| 6341 | |
Craig Mautner | aa7e3ed | 2015-02-17 10:17:21 -0800 | [diff] [blame] | 6342 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6343 | public void startLockTaskMode(int taskId) throws RemoteException { |
| 6344 | Parcel data = Parcel.obtain(); |
| 6345 | Parcel reply = Parcel.obtain(); |
| 6346 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6347 | data.writeInt(taskId); |
| 6348 | mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0); |
| 6349 | reply.readException(); |
| 6350 | data.recycle(); |
| 6351 | reply.recycle(); |
| 6352 | } |
| 6353 | |
| 6354 | @Override |
| 6355 | public void startLockTaskMode(IBinder token) throws RemoteException { |
| 6356 | Parcel data = Parcel.obtain(); |
| 6357 | Parcel reply = Parcel.obtain(); |
| 6358 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6359 | data.writeStrongBinder(token); |
| 6360 | mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0); |
| 6361 | reply.readException(); |
| 6362 | data.recycle(); |
| 6363 | reply.recycle(); |
| 6364 | } |
| 6365 | |
| 6366 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6367 | public void startLockTaskModeOnCurrent() throws RemoteException { |
| 6368 | Parcel data = Parcel.obtain(); |
| 6369 | Parcel reply = Parcel.obtain(); |
| 6370 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6371 | mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6372 | reply.readException(); |
| 6373 | data.recycle(); |
| 6374 | reply.recycle(); |
| 6375 | } |
| 6376 | |
| 6377 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6378 | public void stopLockTaskMode() throws RemoteException { |
| 6379 | Parcel data = Parcel.obtain(); |
| 6380 | Parcel reply = Parcel.obtain(); |
| 6381 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6382 | mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6383 | reply.readException(); |
| 6384 | data.recycle(); |
| 6385 | reply.recycle(); |
| 6386 | } |
| 6387 | |
| 6388 | @Override |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6389 | public void stopLockTaskModeOnCurrent() throws RemoteException { |
| 6390 | Parcel data = Parcel.obtain(); |
| 6391 | Parcel reply = Parcel.obtain(); |
| 6392 | data.writeInterfaceToken(IActivityManager.descriptor); |
Craig Mautner | d61dc20 | 2014-07-07 11:09:11 -0700 | [diff] [blame] | 6393 | mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0); |
Jason Monk | 62515be | 2014-05-21 16:06:19 -0400 | [diff] [blame] | 6394 | reply.readException(); |
| 6395 | data.recycle(); |
| 6396 | reply.recycle(); |
| 6397 | } |
| 6398 | |
| 6399 | @Override |
Craig Mautner | aea74a5 | 2014-03-08 14:23:10 -0800 | [diff] [blame] | 6400 | public boolean isInLockTaskMode() throws RemoteException { |
| 6401 | Parcel data = Parcel.obtain(); |
| 6402 | Parcel reply = Parcel.obtain(); |
| 6403 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6404 | mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0); |
| 6405 | reply.readException(); |
| 6406 | boolean isInLockTaskMode = reply.readInt() == 1; |
| 6407 | data.recycle(); |
| 6408 | reply.recycle(); |
| 6409 | return isInLockTaskMode; |
| 6410 | } |
| 6411 | |
Craig Mautner | 688b510 | 2014-03-27 16:55:03 -0700 | [diff] [blame] | 6412 | @Override |
Benjamin Franz | 4326114 | 2015-02-11 15:59:44 +0000 | [diff] [blame] | 6413 | public int getLockTaskModeState() throws RemoteException { |
| 6414 | Parcel data = Parcel.obtain(); |
| 6415 | Parcel reply = Parcel.obtain(); |
| 6416 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6417 | mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0); |
| 6418 | reply.readException(); |
| 6419 | int lockTaskModeState = reply.readInt(); |
| 6420 | data.recycle(); |
| 6421 | reply.recycle(); |
| 6422 | return lockTaskModeState; |
| 6423 | } |
| 6424 | |
| 6425 | @Override |
Craig Mautner | c21ae9e | 2015-04-15 09:45:42 -0700 | [diff] [blame] | 6426 | public void showLockTaskEscapeMessage(IBinder token) throws RemoteException { |
| 6427 | Parcel data = Parcel.obtain(); |
| 6428 | Parcel reply = Parcel.obtain(); |
| 6429 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6430 | data.writeStrongBinder(token); |
| 6431 | mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply, |
| 6432 | IBinder.FLAG_ONEWAY); |
| 6433 | reply.readException(); |
| 6434 | data.recycle(); |
| 6435 | reply.recycle(); |
| 6436 | } |
| 6437 | |
| 6438 | @Override |
Winson Chung | a449dc0 | 2014-05-16 11:15:04 -0700 | [diff] [blame] | 6439 | public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values) |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6440 | throws RemoteException { |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6441 | Parcel data = Parcel.obtain(); |
| 6442 | Parcel reply = Parcel.obtain(); |
| 6443 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6444 | data.writeStrongBinder(token); |
Winson Chung | 03a9bae | 2014-05-02 09:56:12 -0700 | [diff] [blame] | 6445 | values.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6446 | mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0); |
Craig Mautner | 2fbd754 | 2014-03-21 09:34:07 -0700 | [diff] [blame] | 6447 | reply.readException(); |
| 6448 | data.recycle(); |
| 6449 | reply.recycle(); |
| 6450 | } |
| 6451 | |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6452 | @Override |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6453 | public void setTaskResizeable(int taskId, int resizeableMode) throws RemoteException { |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6454 | Parcel data = Parcel.obtain(); |
| 6455 | Parcel reply = Parcel.obtain(); |
| 6456 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6457 | data.writeInt(taskId); |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 6458 | data.writeInt(resizeableMode); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6459 | mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9d3de4c | 2015-02-01 16:49:44 -0800 | [diff] [blame] | 6460 | reply.readException(); |
| 6461 | data.recycle(); |
| 6462 | reply.recycle(); |
| 6463 | } |
| 6464 | |
| 6465 | @Override |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6466 | public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6467 | { |
| 6468 | Parcel data = Parcel.obtain(); |
| 6469 | Parcel reply = Parcel.obtain(); |
| 6470 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6471 | data.writeInt(taskId); |
Chong Zhang | 87b2172 | 2015-09-21 15:39:51 -0700 | [diff] [blame] | 6472 | data.writeInt(resizeMode); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6473 | r.writeToParcel(data, 0); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6474 | mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 53a29a9 | 2015-02-23 15:42:52 -0800 | [diff] [blame] | 6475 | reply.readException(); |
| 6476 | data.recycle(); |
| 6477 | reply.recycle(); |
| 6478 | } |
| 6479 | |
| 6480 | @Override |
Wale Ogunwale | e4a0c57 | 2015-06-30 08:40:31 -0700 | [diff] [blame] | 6481 | public Rect getTaskBounds(int taskId) throws RemoteException |
| 6482 | { |
| 6483 | Parcel data = Parcel.obtain(); |
| 6484 | Parcel reply = Parcel.obtain(); |
| 6485 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6486 | data.writeInt(taskId); |
| 6487 | mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0); |
| 6488 | reply.readException(); |
| 6489 | Rect rect = Rect.CREATOR.createFromParcel(reply); |
| 6490 | data.recycle(); |
| 6491 | reply.recycle(); |
| 6492 | return rect; |
| 6493 | } |
| 6494 | |
| 6495 | @Override |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6496 | public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException { |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6497 | Parcel data = Parcel.obtain(); |
| 6498 | Parcel reply = Parcel.obtain(); |
| 6499 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6500 | data.writeString(filename); |
Suprabh Shukla | 2359314 | 2015-11-03 17:31:15 -0800 | [diff] [blame] | 6501 | data.writeInt(userId); |
Craig Mautner | 648f69b | 2014-09-18 14:16:26 -0700 | [diff] [blame] | 6502 | mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0); |
| 6503 | reply.readException(); |
| 6504 | final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply); |
| 6505 | data.recycle(); |
| 6506 | reply.recycle(); |
| 6507 | return icon; |
| 6508 | } |
| 6509 | |
| 6510 | @Override |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6511 | public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options) |
| 6512 | throws RemoteException { |
| 6513 | Parcel data = Parcel.obtain(); |
| 6514 | Parcel reply = Parcel.obtain(); |
| 6515 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6516 | if (options == null) { |
| 6517 | data.writeInt(0); |
| 6518 | } else { |
| 6519 | data.writeInt(1); |
| 6520 | data.writeBundle(options.toBundle()); |
| 6521 | } |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6522 | mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0); |
Winson Chung | 044d529 | 2014-11-06 11:05:19 -0800 | [diff] [blame] | 6523 | reply.readException(); |
| 6524 | data.recycle(); |
| 6525 | reply.recycle(); |
| 6526 | } |
| 6527 | |
| 6528 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6529 | public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6530 | Parcel data = Parcel.obtain(); |
| 6531 | Parcel reply = Parcel.obtain(); |
| 6532 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6533 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6534 | data.writeInt(visible ? 1 : 0); |
| 6535 | mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6536 | reply.readException(); |
| 6537 | boolean success = reply.readInt() > 0; |
| 6538 | data.recycle(); |
| 6539 | reply.recycle(); |
| 6540 | return success; |
| 6541 | } |
| 6542 | |
| 6543 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6544 | public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6545 | Parcel data = Parcel.obtain(); |
| 6546 | Parcel reply = Parcel.obtain(); |
| 6547 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6548 | data.writeStrongBinder(token); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6549 | mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6550 | reply.readException(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6551 | final boolean visible = reply.readInt() > 0; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6552 | data.recycle(); |
| 6553 | reply.recycle(); |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6554 | return visible; |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6555 | } |
| 6556 | |
| 6557 | @Override |
Jose Lima | 4b6c669 | 2014-08-12 17:41:12 -0700 | [diff] [blame] | 6558 | public void backgroundResourcesReleased(IBinder token) throws RemoteException { |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6559 | Parcel data = Parcel.obtain(); |
| 6560 | Parcel reply = Parcel.obtain(); |
| 6561 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6562 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6563 | mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0); |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 6564 | reply.readException(); |
| 6565 | data.recycle(); |
| 6566 | reply.recycle(); |
| 6567 | } |
| 6568 | |
| 6569 | @Override |
| 6570 | public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException { |
| 6571 | Parcel data = Parcel.obtain(); |
| 6572 | Parcel reply = Parcel.obtain(); |
| 6573 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6574 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6575 | mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | ee2e45a | 2014-06-27 12:10:03 -0700 | [diff] [blame] | 6576 | reply.readException(); |
| 6577 | data.recycle(); |
| 6578 | reply.recycle(); |
| 6579 | } |
| 6580 | |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6581 | @Override |
| 6582 | public void notifyEnterAnimationComplete(IBinder token) throws RemoteException { |
| 6583 | Parcel data = Parcel.obtain(); |
| 6584 | Parcel reply = Parcel.obtain(); |
| 6585 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6586 | data.writeStrongBinder(token); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6587 | mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 6588 | reply.readException(); |
| 6589 | data.recycle(); |
| 6590 | reply.recycle(); |
| 6591 | } |
| 6592 | |
Craig Mautner | 6e2f395 | 2014-09-09 14:26:41 -0700 | [diff] [blame] | 6593 | @Override |
| 6594 | public void bootAnimationComplete() throws RemoteException { |
| 6595 | Parcel data = Parcel.obtain(); |
| 6596 | Parcel reply = Parcel.obtain(); |
| 6597 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6598 | mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0); |
| 6599 | reply.readException(); |
| 6600 | data.recycle(); |
| 6601 | reply.recycle(); |
| 6602 | } |
| 6603 | |
Wale Ogunwale | 18795a2 | 2014-12-03 11:38:33 -0800 | [diff] [blame] | 6604 | @Override |
Jeff Sharkey | 605eb79 | 2014-11-04 13:34:06 -0800 | [diff] [blame] | 6605 | public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException { |
| 6606 | Parcel data = Parcel.obtain(); |
| 6607 | Parcel reply = Parcel.obtain(); |
| 6608 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6609 | data.writeInt(uid); |
| 6610 | data.writeByteArray(firstPacket); |
| 6611 | mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0); |
| 6612 | reply.readException(); |
| 6613 | data.recycle(); |
| 6614 | reply.recycle(); |
| 6615 | } |
| 6616 | |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6617 | @Override |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6618 | public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, |
| 6619 | String reportPackage) throws RemoteException { |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6620 | Parcel data = Parcel.obtain(); |
| 6621 | Parcel reply = Parcel.obtain(); |
| 6622 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6623 | data.writeString(processName); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6624 | data.writeInt(uid); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6625 | data.writeLong(maxMemSize); |
Dianne Hackborn | d59a5d5 | 2015-04-04 14:52:14 -0700 | [diff] [blame] | 6626 | data.writeString(reportPackage); |
Dianne Hackborn | b9a5e4a | 2015-03-03 17:04:12 -0800 | [diff] [blame] | 6627 | mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); |
| 6628 | reply.readException(); |
| 6629 | data.recycle(); |
| 6630 | reply.recycle(); |
| 6631 | } |
| 6632 | |
| 6633 | @Override |
| 6634 | public void dumpHeapFinished(String path) throws RemoteException { |
| 6635 | Parcel data = Parcel.obtain(); |
| 6636 | Parcel reply = Parcel.obtain(); |
| 6637 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6638 | data.writeString(path); |
| 6639 | mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0); |
| 6640 | reply.readException(); |
| 6641 | data.recycle(); |
| 6642 | reply.recycle(); |
| 6643 | } |
| 6644 | |
Dianne Hackborn | 3d07c94 | 2015-03-13 18:02:54 -0700 | [diff] [blame] | 6645 | @Override |
| 6646 | public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake) |
| 6647 | throws RemoteException { |
| 6648 | Parcel data = Parcel.obtain(); |
| 6649 | Parcel reply = Parcel.obtain(); |
| 6650 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6651 | data.writeStrongBinder(session.asBinder()); |
| 6652 | data.writeInt(keepAwake ? 1 : 0); |
| 6653 | mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0); |
| 6654 | reply.readException(); |
| 6655 | data.recycle(); |
| 6656 | reply.recycle(); |
| 6657 | } |
| 6658 | |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6659 | @Override |
| 6660 | public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { |
| 6661 | Parcel data = Parcel.obtain(); |
| 6662 | Parcel reply = Parcel.obtain(); |
| 6663 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6664 | data.writeInt(userId); |
| 6665 | data.writeStringArray(packages); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6666 | mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); |
Craig Mautner | e560077 | 2015-04-03 21:36:37 -0700 | [diff] [blame] | 6667 | reply.readException(); |
| 6668 | data.recycle(); |
| 6669 | reply.recycle(); |
| 6670 | } |
| 6671 | |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6672 | @Override |
Makoto Onuki | 219bbaf | 2015-11-12 01:38:47 +0000 | [diff] [blame] | 6673 | public void updateDeviceOwner(String packageName) throws RemoteException { |
| 6674 | Parcel data = Parcel.obtain(); |
| 6675 | Parcel reply = Parcel.obtain(); |
| 6676 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6677 | data.writeString(packageName); |
| 6678 | mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0); |
| 6679 | reply.readException(); |
| 6680 | data.recycle(); |
| 6681 | reply.recycle(); |
| 6682 | } |
| 6683 | |
| 6684 | @Override |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6685 | public int getPackageProcessState(String packageName, String callingPackage) |
| 6686 | throws RemoteException { |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6687 | Parcel data = Parcel.obtain(); |
| 6688 | Parcel reply = Parcel.obtain(); |
| 6689 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6690 | data.writeString(packageName); |
Adam Lesinski | c30454c | 2015-06-24 13:24:35 -0700 | [diff] [blame] | 6691 | data.writeString(callingPackage); |
Dianne Hackborn | 1e38382 | 2015-04-10 14:02:33 -0700 | [diff] [blame] | 6692 | mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0); |
| 6693 | reply.readException(); |
| 6694 | int res = reply.readInt(); |
| 6695 | data.recycle(); |
| 6696 | reply.recycle(); |
| 6697 | return res; |
| 6698 | } |
| 6699 | |
Stefan Kuhne | 16045c2 | 2015-06-05 07:18:06 -0700 | [diff] [blame] | 6700 | @Override |
| 6701 | public boolean setProcessMemoryTrimLevel(String process, int userId, int level) |
| 6702 | throws RemoteException { |
| 6703 | Parcel data = Parcel.obtain(); |
| 6704 | Parcel reply = Parcel.obtain(); |
| 6705 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6706 | data.writeString(process); |
| 6707 | data.writeInt(userId); |
| 6708 | data.writeInt(level); |
| 6709 | mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0); |
| 6710 | reply.readException(); |
| 6711 | int res = reply.readInt(); |
| 6712 | data.recycle(); |
| 6713 | reply.recycle(); |
| 6714 | return res != 0; |
| 6715 | } |
| 6716 | |
Dianne Hackborn | fb81d09 | 2015-08-03 17:14:46 -0700 | [diff] [blame] | 6717 | @Override |
| 6718 | public boolean isRootVoiceInteraction(IBinder token) throws RemoteException { |
| 6719 | Parcel data = Parcel.obtain(); |
| 6720 | Parcel reply = Parcel.obtain(); |
| 6721 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6722 | data.writeStrongBinder(token); |
| 6723 | mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0); |
| 6724 | reply.readException(); |
| 6725 | int res = reply.readInt(); |
| 6726 | data.recycle(); |
| 6727 | reply.recycle(); |
| 6728 | return res != 0; |
| 6729 | } |
| 6730 | |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6731 | @Override |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6732 | public void exitFreeformMode(IBinder token) throws RemoteException { |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6733 | Parcel data = Parcel.obtain(); |
| 6734 | Parcel reply = Parcel.obtain(); |
| 6735 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6736 | data.writeStrongBinder(token); |
Filip Gruszczynski | 411c06f | 2016-01-07 09:44:44 -0800 | [diff] [blame] | 6737 | mRemote.transact(EXIT_FREEFORM_MODE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 868a5e1 | 2015-08-02 16:19:20 -0700 | [diff] [blame] | 6738 | reply.readException(); |
| 6739 | data.recycle(); |
| 6740 | reply.recycle(); |
| 6741 | } |
| 6742 | |
| 6743 | @Override |
| 6744 | public int getActivityStackId(IBinder token) throws RemoteException { |
| 6745 | Parcel data = Parcel.obtain(); |
| 6746 | Parcel reply = Parcel.obtain(); |
| 6747 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6748 | data.writeStrongBinder(token); |
| 6749 | mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0); |
| 6750 | reply.readException(); |
| 6751 | int stackId = reply.readInt(); |
| 6752 | data.recycle(); |
| 6753 | reply.recycle(); |
| 6754 | return stackId; |
| 6755 | } |
| 6756 | |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6757 | @Override |
| 6758 | public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration, |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6759 | int[] verticalSizeConfigurations, int[] smallestSizeConfigurations) |
| 6760 | throws RemoteException { |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6761 | Parcel data = Parcel.obtain(); |
| 6762 | Parcel reply = Parcel.obtain(); |
| 6763 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6764 | data.writeStrongBinder(token); |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6765 | writeIntArray(horizontalSizeConfiguration, data); |
| 6766 | writeIntArray(verticalSizeConfigurations, data); |
| 6767 | writeIntArray(smallestSizeConfigurations, data); |
Filip Gruszczynski | 2349332 | 2015-07-29 17:02:59 -0700 | [diff] [blame] | 6768 | mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0); |
| 6769 | reply.readException(); |
| 6770 | data.recycle(); |
| 6771 | reply.recycle(); |
| 6772 | } |
| 6773 | |
Filip Gruszczynski | 20aa0ae | 2015-10-30 10:08:27 -0700 | [diff] [blame] | 6774 | private static void writeIntArray(int[] array, Parcel data) { |
| 6775 | if (array == null) { |
| 6776 | data.writeInt(0); |
| 6777 | } else { |
| 6778 | data.writeInt(array.length); |
| 6779 | data.writeIntArray(array); |
| 6780 | } |
| 6781 | } |
| 6782 | |
Wale Ogunwale | 83301a9 | 2015-09-24 15:54:08 -0700 | [diff] [blame] | 6783 | @Override |
| 6784 | public void suppressResizeConfigChanges(boolean suppress) throws RemoteException { |
| 6785 | Parcel data = Parcel.obtain(); |
| 6786 | Parcel reply = Parcel.obtain(); |
| 6787 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6788 | data.writeInt(suppress ? 1 : 0); |
| 6789 | mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0); |
| 6790 | reply.readException(); |
| 6791 | data.recycle(); |
| 6792 | reply.recycle(); |
| 6793 | } |
| 6794 | |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6795 | @Override |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6796 | public void moveTasksToFullscreenStack(int fromStackId, boolean onTop) throws RemoteException { |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6797 | Parcel data = Parcel.obtain(); |
| 6798 | Parcel reply = Parcel.obtain(); |
| 6799 | data.writeInterfaceToken(IActivityManager.descriptor); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6800 | data.writeInt(fromStackId); |
Wale Ogunwale | 9101d26 | 2016-01-15 08:56:11 -0800 | [diff] [blame] | 6801 | data.writeInt(onTop ? 1 : 0); |
Filip Gruszczynski | b3da834 | 2015-12-10 16:40:01 -0800 | [diff] [blame] | 6802 | mRemote.transact(MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION, data, reply, 0); |
Filip Gruszczynski | 57b6cce | 2015-10-06 09:50:51 -0700 | [diff] [blame] | 6803 | reply.readException(); |
| 6804 | data.recycle(); |
| 6805 | reply.recycle(); |
| 6806 | } |
| 6807 | |
Dianne Hackborn | bef28fe | 2015-10-29 17:57:11 -0700 | [diff] [blame] | 6808 | @Override |
| 6809 | public int getAppStartMode(int uid, String packageName) throws RemoteException { |
| 6810 | Parcel data = Parcel.obtain(); |
| 6811 | Parcel reply = Parcel.obtain(); |
| 6812 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6813 | data.writeInt(uid); |
| 6814 | data.writeString(packageName); |
| 6815 | mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0); |
| 6816 | reply.readException(); |
| 6817 | int res = reply.readInt(); |
| 6818 | data.recycle(); |
| 6819 | reply.recycle(); |
| 6820 | return res; |
| 6821 | } |
| 6822 | |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6823 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6824 | public boolean inMultiWindow(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6825 | Parcel data = Parcel.obtain(); |
| 6826 | Parcel reply = Parcel.obtain(); |
| 6827 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6828 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6829 | mRemote.transact(IN_MULTI_WINDOW_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6830 | reply.readException(); |
| 6831 | final boolean multiWindowMode = reply.readInt() == 1 ? true : false; |
| 6832 | data.recycle(); |
| 6833 | reply.recycle(); |
| 6834 | return multiWindowMode; |
| 6835 | } |
| 6836 | |
| 6837 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6838 | public boolean inPictureInPicture(IBinder token) throws RemoteException { |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6839 | Parcel data = Parcel.obtain(); |
| 6840 | Parcel reply = Parcel.obtain(); |
| 6841 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6842 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6843 | mRemote.transact(IN_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 5f98609 | 2015-12-04 15:35:38 -0800 | [diff] [blame] | 6844 | reply.readException(); |
| 6845 | final boolean pipMode = reply.readInt() == 1 ? true : false; |
| 6846 | data.recycle(); |
| 6847 | reply.recycle(); |
| 6848 | return pipMode; |
| 6849 | } |
| 6850 | |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6851 | @Override |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6852 | public void enterPictureInPicture(IBinder token) throws RemoteException { |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6853 | Parcel data = Parcel.obtain(); |
| 6854 | Parcel reply = Parcel.obtain(); |
| 6855 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6856 | data.writeStrongBinder(token); |
Wale Ogunwale | 3b93a4d | 2016-01-29 17:46:53 -0800 | [diff] [blame] | 6857 | mRemote.transact(ENTER_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0); |
Wale Ogunwale | 9c604c7 | 2015-12-06 18:42:57 -0800 | [diff] [blame] | 6858 | reply.readException(); |
| 6859 | data.recycle(); |
| 6860 | reply.recycle(); |
| 6861 | } |
| 6862 | |
Christopher Tate | 63fec3e | 2015-12-11 18:35:28 -0800 | [diff] [blame] | 6863 | @Override |
| 6864 | public boolean isAppForeground(int uid) throws RemoteException { |
| 6865 | Parcel data = Parcel.obtain(); |
| 6866 | Parcel reply = Parcel.obtain(); |
| 6867 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6868 | data.writeInt(uid); |
| 6869 | mRemote.transact(IS_APP_FOREGROUND_TRANSACTION, data, reply, 0); |
| 6870 | final boolean isForeground = reply.readInt() == 1 ? true : false; |
| 6871 | data.recycle(); |
| 6872 | reply.recycle(); |
| 6873 | return isForeground; |
| 6874 | }; |
| 6875 | |
Wale Ogunwale | 480dca0 | 2016-02-06 13:58:29 -0800 | [diff] [blame] | 6876 | @Override |
| 6877 | public void notifyPinnedStackAnimationEnded() throws RemoteException { |
| 6878 | Parcel data = Parcel.obtain(); |
| 6879 | Parcel reply = Parcel.obtain(); |
| 6880 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6881 | mRemote.transact(NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION, data, reply, 0); |
| 6882 | data.recycle(); |
| 6883 | reply.recycle(); |
| 6884 | }; |
| 6885 | |
Wale Ogunwale | 06e8ee0 | 2016-02-12 12:56:32 -0800 | [diff] [blame] | 6886 | @Override |
| 6887 | public void removeStack(int stackId) throws RemoteException { |
| 6888 | Parcel data = Parcel.obtain(); |
| 6889 | Parcel reply = Parcel.obtain(); |
| 6890 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 6891 | data.writeInt(stackId); |
| 6892 | mRemote.transact(REMOVE_STACK, data, reply, 0); |
| 6893 | reply.readException(); |
| 6894 | data.recycle(); |
| 6895 | reply.recycle(); |
| 6896 | } |
| 6897 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6898 | private IBinder mRemote; |
| 6899 | } |