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