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