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