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