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