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