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