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 | |
| 19 | import android.content.ComponentName; |
| 20 | import android.content.Intent; |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 21 | import android.content.IIntentReceiver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.content.pm.ActivityInfo; |
| 23 | import android.content.pm.ApplicationInfo; |
| 24 | import android.content.pm.ProviderInfo; |
| 25 | import android.content.pm.ServiceInfo; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 26 | import android.content.res.CompatibilityInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 | import android.content.res.Configuration; |
| 28 | import android.os.Binder; |
| 29 | import android.os.Bundle; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 30 | import android.os.Debug; |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 31 | import android.os.Parcelable; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | import android.os.RemoteException; |
| 33 | import android.os.IBinder; |
| 34 | import android.os.Parcel; |
| 35 | import android.os.ParcelFileDescriptor; |
| 36 | |
| 37 | import java.io.FileDescriptor; |
| 38 | import java.io.IOException; |
| 39 | import java.util.HashMap; |
| 40 | import java.util.List; |
| 41 | import java.util.Map; |
| 42 | |
| 43 | /** {@hide} */ |
| 44 | public abstract class ApplicationThreadNative extends Binder |
| 45 | implements IApplicationThread { |
| 46 | /** |
| 47 | * Cast a Binder object into an application thread interface, generating |
| 48 | * a proxy if needed. |
| 49 | */ |
| 50 | static public IApplicationThread asInterface(IBinder obj) { |
| 51 | if (obj == null) { |
| 52 | return null; |
| 53 | } |
| 54 | IApplicationThread in = |
| 55 | (IApplicationThread)obj.queryLocalInterface(descriptor); |
| 56 | if (in != null) { |
| 57 | return in; |
| 58 | } |
| 59 | |
| 60 | return new ApplicationThreadProxy(obj); |
| 61 | } |
| 62 | |
| 63 | public ApplicationThreadNative() { |
| 64 | attachInterface(this, descriptor); |
| 65 | } |
| 66 | |
| 67 | @Override |
| 68 | public boolean onTransact(int code, Parcel data, Parcel reply, int flags) |
| 69 | throws RemoteException { |
| 70 | switch (code) { |
| 71 | case SCHEDULE_PAUSE_ACTIVITY_TRANSACTION: |
| 72 | { |
| 73 | data.enforceInterface(IApplicationThread.descriptor); |
| 74 | IBinder b = data.readStrongBinder(); |
| 75 | boolean finished = data.readInt() != 0; |
| 76 | boolean userLeaving = data.readInt() != 0; |
| 77 | int configChanges = data.readInt(); |
| 78 | schedulePauseActivity(b, finished, userLeaving, configChanges); |
| 79 | return true; |
| 80 | } |
| 81 | |
| 82 | case SCHEDULE_STOP_ACTIVITY_TRANSACTION: |
| 83 | { |
| 84 | data.enforceInterface(IApplicationThread.descriptor); |
| 85 | IBinder b = data.readStrongBinder(); |
| 86 | boolean show = data.readInt() != 0; |
| 87 | int configChanges = data.readInt(); |
| 88 | scheduleStopActivity(b, show, configChanges); |
| 89 | return true; |
| 90 | } |
| 91 | |
| 92 | case SCHEDULE_WINDOW_VISIBILITY_TRANSACTION: |
| 93 | { |
| 94 | data.enforceInterface(IApplicationThread.descriptor); |
| 95 | IBinder b = data.readStrongBinder(); |
| 96 | boolean show = data.readInt() != 0; |
| 97 | scheduleWindowVisibility(b, show); |
| 98 | return true; |
| 99 | } |
| 100 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 101 | case SCHEDULE_SLEEPING_TRANSACTION: |
| 102 | { |
| 103 | data.enforceInterface(IApplicationThread.descriptor); |
| 104 | IBinder b = data.readStrongBinder(); |
| 105 | boolean sleeping = data.readInt() != 0; |
| 106 | scheduleSleeping(b, sleeping); |
| 107 | return true; |
| 108 | } |
| 109 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 110 | case SCHEDULE_RESUME_ACTIVITY_TRANSACTION: |
| 111 | { |
| 112 | data.enforceInterface(IApplicationThread.descriptor); |
| 113 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 114 | int procState = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 115 | boolean isForward = data.readInt() != 0; |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 116 | scheduleResumeActivity(b, procState, isForward); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 117 | return true; |
| 118 | } |
| 119 | |
| 120 | case SCHEDULE_SEND_RESULT_TRANSACTION: |
| 121 | { |
| 122 | data.enforceInterface(IApplicationThread.descriptor); |
| 123 | IBinder b = data.readStrongBinder(); |
| 124 | List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR); |
| 125 | scheduleSendResult(b, ri); |
| 126 | return true; |
| 127 | } |
| 128 | |
| 129 | case SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION: |
| 130 | { |
| 131 | data.enforceInterface(IApplicationThread.descriptor); |
| 132 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 133 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 134 | int ident = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 135 | ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data); |
Dianne Hackborn | 58f42a5 | 2011-10-10 13:46:34 -0700 | [diff] [blame] | 136 | Configuration curConfig = Configuration.CREATOR.createFromParcel(data); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 137 | CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 138 | int procState = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 139 | Bundle state = data.readBundle(); |
| 140 | List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR); |
| 141 | List<Intent> pi = data.createTypedArrayList(Intent.CREATOR); |
| 142 | boolean notResumed = data.readInt() != 0; |
| 143 | boolean isForward = data.readInt() != 0; |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 144 | String profileName = data.readString(); |
| 145 | ParcelFileDescriptor profileFd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 146 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 147 | boolean autoStopProfiler = data.readInt() != 0; |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 148 | scheduleLaunchActivity(intent, b, ident, info, curConfig, compatInfo, procState, state, |
| 149 | ri, pi, notResumed, isForward, profileName, profileFd, autoStopProfiler); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 150 | return true; |
| 151 | } |
| 152 | |
| 153 | case SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION: |
| 154 | { |
| 155 | data.enforceInterface(IApplicationThread.descriptor); |
| 156 | IBinder b = data.readStrongBinder(); |
| 157 | List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR); |
| 158 | List<Intent> pi = data.createTypedArrayList(Intent.CREATOR); |
| 159 | int configChanges = data.readInt(); |
| 160 | boolean notResumed = data.readInt() != 0; |
Dianne Hackborn | 871ecdc | 2009-12-11 15:24:33 -0800 | [diff] [blame] | 161 | Configuration config = null; |
| 162 | if (data.readInt() != 0) { |
| 163 | config = Configuration.CREATOR.createFromParcel(data); |
| 164 | } |
| 165 | scheduleRelaunchActivity(b, ri, pi, configChanges, notResumed, config); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 166 | return true; |
| 167 | } |
| 168 | |
| 169 | case SCHEDULE_NEW_INTENT_TRANSACTION: |
| 170 | { |
| 171 | data.enforceInterface(IApplicationThread.descriptor); |
| 172 | List<Intent> pi = data.createTypedArrayList(Intent.CREATOR); |
| 173 | IBinder b = data.readStrongBinder(); |
| 174 | scheduleNewIntent(pi, b); |
| 175 | return true; |
| 176 | } |
| 177 | |
| 178 | case SCHEDULE_FINISH_ACTIVITY_TRANSACTION: |
| 179 | { |
| 180 | data.enforceInterface(IApplicationThread.descriptor); |
| 181 | IBinder b = data.readStrongBinder(); |
| 182 | boolean finishing = data.readInt() != 0; |
| 183 | int configChanges = data.readInt(); |
| 184 | scheduleDestroyActivity(b, finishing, configChanges); |
| 185 | return true; |
| 186 | } |
| 187 | |
| 188 | case SCHEDULE_RECEIVER_TRANSACTION: |
| 189 | { |
| 190 | data.enforceInterface(IApplicationThread.descriptor); |
| 191 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 192 | ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 193 | CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 194 | int resultCode = data.readInt(); |
| 195 | String resultData = data.readString(); |
| 196 | Bundle resultExtras = data.readBundle(); |
| 197 | boolean sync = data.readInt() != 0; |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 198 | int sendingUser = data.readInt(); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 199 | int processState = data.readInt(); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 200 | scheduleReceiver(intent, info, compatInfo, resultCode, resultData, |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 201 | resultExtras, sync, sendingUser, processState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 202 | return true; |
| 203 | } |
| 204 | |
| 205 | case SCHEDULE_CREATE_SERVICE_TRANSACTION: { |
| 206 | data.enforceInterface(IApplicationThread.descriptor); |
| 207 | IBinder token = data.readStrongBinder(); |
| 208 | ServiceInfo info = ServiceInfo.CREATOR.createFromParcel(data); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 209 | CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 210 | int processState = data.readInt(); |
| 211 | scheduleCreateService(token, info, compatInfo, processState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 212 | return true; |
| 213 | } |
| 214 | |
| 215 | case SCHEDULE_BIND_SERVICE_TRANSACTION: { |
| 216 | data.enforceInterface(IApplicationThread.descriptor); |
| 217 | IBinder token = data.readStrongBinder(); |
| 218 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 219 | boolean rebind = data.readInt() != 0; |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 220 | int processState = data.readInt(); |
| 221 | scheduleBindService(token, intent, rebind, processState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 222 | return true; |
| 223 | } |
| 224 | |
| 225 | case SCHEDULE_UNBIND_SERVICE_TRANSACTION: { |
| 226 | data.enforceInterface(IApplicationThread.descriptor); |
| 227 | IBinder token = data.readStrongBinder(); |
| 228 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 229 | scheduleUnbindService(token, intent); |
| 230 | return true; |
| 231 | } |
| 232 | |
| 233 | case SCHEDULE_SERVICE_ARGS_TRANSACTION: |
| 234 | { |
| 235 | data.enforceInterface(IApplicationThread.descriptor); |
| 236 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 237 | boolean taskRemoved = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 238 | int startId = data.readInt(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 239 | int fl = data.readInt(); |
| 240 | Intent args; |
| 241 | if (data.readInt() != 0) { |
| 242 | args = Intent.CREATOR.createFromParcel(data); |
| 243 | } else { |
| 244 | args = null; |
| 245 | } |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 246 | scheduleServiceArgs(token, taskRemoved, startId, fl, args); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 247 | return true; |
| 248 | } |
| 249 | |
| 250 | case SCHEDULE_STOP_SERVICE_TRANSACTION: |
| 251 | { |
| 252 | data.enforceInterface(IApplicationThread.descriptor); |
| 253 | IBinder token = data.readStrongBinder(); |
| 254 | scheduleStopService(token); |
| 255 | return true; |
| 256 | } |
| 257 | |
| 258 | case BIND_APPLICATION_TRANSACTION: |
| 259 | { |
| 260 | data.enforceInterface(IApplicationThread.descriptor); |
| 261 | String packageName = data.readString(); |
| 262 | ApplicationInfo info = |
| 263 | ApplicationInfo.CREATOR.createFromParcel(data); |
| 264 | List<ProviderInfo> providers = |
| 265 | data.createTypedArrayList(ProviderInfo.CREATOR); |
| 266 | ComponentName testName = (data.readInt() != 0) |
| 267 | ? new ComponentName(data) : null; |
| 268 | String profileName = data.readString(); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 269 | ParcelFileDescriptor profileFd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 270 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 271 | boolean autoStopProfiler = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 272 | Bundle testArgs = data.readBundle(); |
| 273 | IBinder binder = data.readStrongBinder(); |
| 274 | IInstrumentationWatcher testWatcher = IInstrumentationWatcher.Stub.asInterface(binder); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 275 | binder = data.readStrongBinder(); |
| 276 | IUiAutomationConnection uiAutomationConnection = |
| 277 | IUiAutomationConnection.Stub.asInterface(binder); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 278 | int testMode = data.readInt(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 279 | boolean openGlTrace = data.readInt() != 0; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 280 | boolean restrictedBackupMode = (data.readInt() != 0); |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 281 | boolean persistent = (data.readInt() != 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 282 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 283 | CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 284 | HashMap<String, IBinder> services = data.readHashMap(null); |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 285 | Bundle coreSettings = data.readBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 286 | bindApplication(packageName, info, |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 287 | providers, testName, profileName, profileFd, autoStopProfiler, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 288 | testArgs, testWatcher, uiAutomationConnection, testMode, |
| 289 | openGlTrace, restrictedBackupMode, persistent, config, compatInfo, |
| 290 | services, coreSettings); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 291 | return true; |
| 292 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 293 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 294 | case SCHEDULE_EXIT_TRANSACTION: |
| 295 | { |
| 296 | data.enforceInterface(IApplicationThread.descriptor); |
| 297 | scheduleExit(); |
| 298 | return true; |
| 299 | } |
| 300 | |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 301 | case SCHEDULE_SUICIDE_TRANSACTION: |
| 302 | { |
| 303 | data.enforceInterface(IApplicationThread.descriptor); |
| 304 | scheduleSuicide(); |
| 305 | return true; |
| 306 | } |
| 307 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 308 | case REQUEST_THUMBNAIL_TRANSACTION: |
| 309 | { |
| 310 | data.enforceInterface(IApplicationThread.descriptor); |
| 311 | IBinder b = data.readStrongBinder(); |
| 312 | requestThumbnail(b); |
| 313 | return true; |
| 314 | } |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 315 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 316 | case SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION: |
| 317 | { |
| 318 | data.enforceInterface(IApplicationThread.descriptor); |
| 319 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 320 | scheduleConfigurationChanged(config); |
| 321 | return true; |
| 322 | } |
| 323 | |
| 324 | case UPDATE_TIME_ZONE_TRANSACTION: { |
| 325 | data.enforceInterface(IApplicationThread.descriptor); |
| 326 | updateTimeZone(); |
| 327 | return true; |
| 328 | } |
| 329 | |
Robert Greenwalt | 03595d0 | 2010-11-02 14:08:23 -0700 | [diff] [blame] | 330 | case CLEAR_DNS_CACHE_TRANSACTION: { |
| 331 | data.enforceInterface(IApplicationThread.descriptor); |
| 332 | clearDnsCache(); |
| 333 | return true; |
| 334 | } |
| 335 | |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 336 | case SET_HTTP_PROXY_TRANSACTION: { |
| 337 | data.enforceInterface(IApplicationThread.descriptor); |
| 338 | final String proxy = data.readString(); |
| 339 | final String port = data.readString(); |
| 340 | final String exclList = data.readString(); |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 341 | final String pacFileUrl = data.readString(); |
| 342 | setHttpProxy(proxy, port, exclList, pacFileUrl); |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 343 | return true; |
| 344 | } |
| 345 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 346 | case PROCESS_IN_BACKGROUND_TRANSACTION: { |
| 347 | data.enforceInterface(IApplicationThread.descriptor); |
| 348 | processInBackground(); |
| 349 | return true; |
| 350 | } |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 351 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 352 | case DUMP_SERVICE_TRANSACTION: { |
| 353 | data.enforceInterface(IApplicationThread.descriptor); |
| 354 | ParcelFileDescriptor fd = data.readFileDescriptor(); |
| 355 | final IBinder service = data.readStrongBinder(); |
| 356 | final String[] args = data.readStringArray(); |
| 357 | if (fd != null) { |
| 358 | dumpService(fd.getFileDescriptor(), service, args); |
| 359 | try { |
| 360 | fd.close(); |
| 361 | } catch (IOException e) { |
| 362 | } |
| 363 | } |
| 364 | return true; |
| 365 | } |
| 366 | |
Marco Nelissen | 18cb287 | 2011-11-15 11:19:53 -0800 | [diff] [blame] | 367 | case DUMP_PROVIDER_TRANSACTION: { |
| 368 | data.enforceInterface(IApplicationThread.descriptor); |
| 369 | ParcelFileDescriptor fd = data.readFileDescriptor(); |
| 370 | final IBinder service = data.readStrongBinder(); |
| 371 | final String[] args = data.readStringArray(); |
| 372 | if (fd != null) { |
| 373 | dumpProvider(fd.getFileDescriptor(), service, args); |
| 374 | try { |
| 375 | fd.close(); |
| 376 | } catch (IOException e) { |
| 377 | } |
| 378 | } |
| 379 | return true; |
| 380 | } |
| 381 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 382 | case SCHEDULE_REGISTERED_RECEIVER_TRANSACTION: { |
| 383 | data.enforceInterface(IApplicationThread.descriptor); |
| 384 | IIntentReceiver receiver = IIntentReceiver.Stub.asInterface( |
| 385 | data.readStrongBinder()); |
| 386 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 387 | int resultCode = data.readInt(); |
| 388 | String dataStr = data.readString(); |
| 389 | Bundle extras = data.readBundle(); |
| 390 | boolean ordered = data.readInt() != 0; |
Dianne Hackborn | 68d881c | 2009-10-05 13:58:17 -0700 | [diff] [blame] | 391 | boolean sticky = data.readInt() != 0; |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 392 | int sendingUser = data.readInt(); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 393 | int processState = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 394 | scheduleRegisteredReceiver(receiver, intent, |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 395 | resultCode, dataStr, extras, ordered, sticky, sendingUser, processState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 396 | return true; |
| 397 | } |
| 398 | |
| 399 | case SCHEDULE_LOW_MEMORY_TRANSACTION: |
| 400 | { |
Vairavan Srinivasan | e94a3e7 | 2012-02-01 23:17:14 -0800 | [diff] [blame] | 401 | data.enforceInterface(IApplicationThread.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 402 | scheduleLowMemory(); |
| 403 | return true; |
| 404 | } |
| 405 | |
| 406 | case SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION: |
| 407 | { |
| 408 | data.enforceInterface(IApplicationThread.descriptor); |
| 409 | IBinder b = data.readStrongBinder(); |
| 410 | scheduleActivityConfigurationChanged(b); |
| 411 | return true; |
| 412 | } |
| 413 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 414 | case PROFILER_CONTROL_TRANSACTION: |
| 415 | { |
| 416 | data.enforceInterface(IApplicationThread.descriptor); |
| 417 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 418 | int profileType = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 419 | String path = data.readString(); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 420 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 421 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Romain Guy | 7eabe55 | 2011-07-21 14:56:34 -0700 | [diff] [blame] | 422 | profilerControl(start, path, fd, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 423 | return true; |
| 424 | } |
Dianne Hackborn | 06de2ea | 2009-05-21 12:56:43 -0700 | [diff] [blame] | 425 | |
| 426 | case SET_SCHEDULING_GROUP_TRANSACTION: |
| 427 | { |
| 428 | data.enforceInterface(IApplicationThread.descriptor); |
| 429 | int group = data.readInt(); |
| 430 | setSchedulingGroup(group); |
| 431 | return true; |
| 432 | } |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 433 | |
| 434 | case SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION: |
| 435 | { |
| 436 | data.enforceInterface(IApplicationThread.descriptor); |
| 437 | ApplicationInfo appInfo = ApplicationInfo.CREATOR.createFromParcel(data); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 438 | CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 439 | int backupMode = data.readInt(); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 440 | scheduleCreateBackupAgent(appInfo, compatInfo, backupMode); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 441 | return true; |
| 442 | } |
Christopher Tate | 1885b37 | 2009-06-04 15:00:33 -0700 | [diff] [blame] | 443 | |
| 444 | case SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION: |
| 445 | { |
| 446 | data.enforceInterface(IApplicationThread.descriptor); |
| 447 | ApplicationInfo appInfo = ApplicationInfo.CREATOR.createFromParcel(data); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 448 | CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data); |
| 449 | scheduleDestroyBackupAgent(appInfo, compatInfo); |
Christopher Tate | 1885b37 | 2009-06-04 15:00:33 -0700 | [diff] [blame] | 450 | return true; |
| 451 | } |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 452 | |
Dianne Hackborn | 4416c3d | 2010-05-04 17:22:49 -0700 | [diff] [blame] | 453 | case DISPATCH_PACKAGE_BROADCAST_TRANSACTION: |
| 454 | { |
| 455 | data.enforceInterface(IApplicationThread.descriptor); |
| 456 | int cmd = data.readInt(); |
| 457 | String[] packages = data.readStringArray(); |
| 458 | dispatchPackageBroadcast(cmd, packages); |
| 459 | return true; |
| 460 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 461 | |
| 462 | case SCHEDULE_CRASH_TRANSACTION: |
| 463 | { |
| 464 | data.enforceInterface(IApplicationThread.descriptor); |
| 465 | String msg = data.readString(); |
| 466 | scheduleCrash(msg); |
| 467 | return true; |
| 468 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 469 | |
| 470 | case DUMP_HEAP_TRANSACTION: |
| 471 | { |
| 472 | data.enforceInterface(IApplicationThread.descriptor); |
| 473 | boolean managed = data.readInt() != 0; |
| 474 | String path = data.readString(); |
| 475 | ParcelFileDescriptor fd = data.readInt() != 0 |
Amith Yamasani | c2be0d6 | 2013-09-23 11:16:28 -0700 | [diff] [blame] | 476 | ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null; |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 477 | dumpHeap(managed, path, fd); |
| 478 | return true; |
| 479 | } |
Dianne Hackborn | 625ac27 | 2010-09-17 18:29:22 -0700 | [diff] [blame] | 480 | |
| 481 | case DUMP_ACTIVITY_TRANSACTION: { |
| 482 | data.enforceInterface(IApplicationThread.descriptor); |
| 483 | ParcelFileDescriptor fd = data.readFileDescriptor(); |
| 484 | final IBinder activity = data.readStrongBinder(); |
Dianne Hackborn | 30d7189 | 2010-12-11 10:37:55 -0800 | [diff] [blame] | 485 | final String prefix = data.readString(); |
Dianne Hackborn | 625ac27 | 2010-09-17 18:29:22 -0700 | [diff] [blame] | 486 | final String[] args = data.readStringArray(); |
| 487 | if (fd != null) { |
Dianne Hackborn | 30d7189 | 2010-12-11 10:37:55 -0800 | [diff] [blame] | 488 | dumpActivity(fd.getFileDescriptor(), activity, prefix, args); |
Dianne Hackborn | 625ac27 | 2010-09-17 18:29:22 -0700 | [diff] [blame] | 489 | try { |
| 490 | fd.close(); |
| 491 | } catch (IOException e) { |
| 492 | } |
| 493 | } |
| 494 | return true; |
| 495 | } |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 496 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 497 | case SET_CORE_SETTINGS_TRANSACTION: { |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 498 | data.enforceInterface(IApplicationThread.descriptor); |
| 499 | Bundle settings = data.readBundle(); |
| 500 | setCoreSettings(settings); |
| 501 | return true; |
| 502 | } |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 503 | |
| 504 | case UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION: { |
| 505 | data.enforceInterface(IApplicationThread.descriptor); |
| 506 | String pkg = data.readString(); |
| 507 | CompatibilityInfo compat = CompatibilityInfo.CREATOR.createFromParcel(data); |
| 508 | updatePackageCompatibilityInfo(pkg, compat); |
| 509 | return true; |
| 510 | } |
Dianne Hackborn | ce86ba8 | 2011-07-13 19:33:41 -0700 | [diff] [blame] | 511 | |
| 512 | case SCHEDULE_TRIM_MEMORY_TRANSACTION: { |
| 513 | data.enforceInterface(IApplicationThread.descriptor); |
| 514 | int level = data.readInt(); |
| 515 | scheduleTrimMemory(level); |
| 516 | return true; |
| 517 | } |
Dianne Hackborn | 0e3328f | 2011-07-17 13:31:17 -0700 | [diff] [blame] | 518 | |
| 519 | case DUMP_MEM_INFO_TRANSACTION: |
| 520 | { |
| 521 | data.enforceInterface(IApplicationThread.descriptor); |
| 522 | ParcelFileDescriptor fd = data.readFileDescriptor(); |
Dianne Hackborn | 3bc8f78d | 2013-09-19 13:34:35 -0700 | [diff] [blame] | 523 | Debug.MemoryInfo mi = Debug.MemoryInfo.CREATOR.createFromParcel(data); |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 524 | boolean checkin = data.readInt() != 0; |
Dianne Hackborn | 64770d1 | 2013-05-23 17:51:19 -0700 | [diff] [blame] | 525 | boolean dumpInfo = data.readInt() != 0; |
| 526 | boolean dumpDalvik = data.readInt() != 0; |
Dianne Hackborn | 0e3328f | 2011-07-17 13:31:17 -0700 | [diff] [blame] | 527 | String[] args = data.readStringArray(); |
Dianne Hackborn | 0e3328f | 2011-07-17 13:31:17 -0700 | [diff] [blame] | 528 | if (fd != null) { |
| 529 | try { |
Dianne Hackborn | 3bc8f78d | 2013-09-19 13:34:35 -0700 | [diff] [blame] | 530 | dumpMemInfo(fd.getFileDescriptor(), mi, checkin, dumpInfo, dumpDalvik, args); |
Dianne Hackborn | 0e3328f | 2011-07-17 13:31:17 -0700 | [diff] [blame] | 531 | } finally { |
| 532 | try { |
| 533 | fd.close(); |
| 534 | } catch (IOException e) { |
| 535 | // swallowed, not propagated back to the caller |
| 536 | } |
| 537 | } |
| 538 | } |
| 539 | reply.writeNoException(); |
Dianne Hackborn | 0e3328f | 2011-07-17 13:31:17 -0700 | [diff] [blame] | 540 | return true; |
| 541 | } |
| 542 | |
| 543 | case DUMP_GFX_INFO_TRANSACTION: |
| 544 | { |
| 545 | data.enforceInterface(IApplicationThread.descriptor); |
| 546 | ParcelFileDescriptor fd = data.readFileDescriptor(); |
| 547 | String[] args = data.readStringArray(); |
| 548 | if (fd != null) { |
| 549 | try { |
| 550 | dumpGfxInfo(fd.getFileDescriptor(), args); |
| 551 | } finally { |
| 552 | try { |
| 553 | fd.close(); |
| 554 | } catch (IOException e) { |
| 555 | // swallowed, not propagated back to the caller |
| 556 | } |
| 557 | } |
| 558 | } |
| 559 | reply.writeNoException(); |
| 560 | return true; |
| 561 | } |
Jeff Brown | 6754ba2 | 2011-12-14 20:20:01 -0800 | [diff] [blame] | 562 | |
| 563 | case DUMP_DB_INFO_TRANSACTION: |
| 564 | { |
| 565 | data.enforceInterface(IApplicationThread.descriptor); |
| 566 | ParcelFileDescriptor fd = data.readFileDescriptor(); |
| 567 | String[] args = data.readStringArray(); |
| 568 | if (fd != null) { |
| 569 | try { |
| 570 | dumpDbInfo(fd.getFileDescriptor(), args); |
| 571 | } finally { |
| 572 | try { |
| 573 | fd.close(); |
| 574 | } catch (IOException e) { |
| 575 | // swallowed, not propagated back to the caller |
| 576 | } |
| 577 | } |
| 578 | } |
| 579 | reply.writeNoException(); |
| 580 | return true; |
| 581 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 582 | |
| 583 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: |
| 584 | { |
| 585 | data.enforceInterface(IApplicationThread.descriptor); |
| 586 | IBinder provider = data.readStrongBinder(); |
| 587 | unstableProviderDied(provider); |
| 588 | reply.writeNoException(); |
| 589 | return true; |
| 590 | } |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 591 | |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 592 | case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 593 | { |
| 594 | data.enforceInterface(IApplicationThread.descriptor); |
| 595 | IBinder activityToken = data.readStrongBinder(); |
| 596 | IBinder requestToken = data.readStrongBinder(); |
| 597 | int requestType = data.readInt(); |
Adam Skory | 7140a25 | 2013-09-11 12:04:58 +0100 | [diff] [blame] | 598 | requestAssistContextExtras(activityToken, requestToken, requestType); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 599 | reply.writeNoException(); |
| 600 | return true; |
| 601 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 602 | |
| 603 | case SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION: |
| 604 | { |
| 605 | data.enforceInterface(IApplicationThread.descriptor); |
| 606 | IBinder token = data.readStrongBinder(); |
| 607 | boolean timeout = data.readInt() == 1; |
| 608 | scheduleTranslucentConversionComplete(token, timeout); |
| 609 | reply.writeNoException(); |
| 610 | return true; |
| 611 | } |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 612 | |
| 613 | case SET_PROCESS_STATE_TRANSACTION: |
| 614 | { |
| 615 | data.enforceInterface(IApplicationThread.descriptor); |
| 616 | int state = data.readInt(); |
| 617 | setProcessState(state); |
| 618 | reply.writeNoException(); |
| 619 | return true; |
| 620 | } |
Jeff Sharkey | dd97f42 | 2013-10-08 17:01:30 -0700 | [diff] [blame] | 621 | |
| 622 | case SCHEDULE_INSTALL_PROVIDER_TRANSACTION: |
| 623 | { |
| 624 | data.enforceInterface(IApplicationThread.descriptor); |
| 625 | ProviderInfo provider = ProviderInfo.CREATOR.createFromParcel(data); |
| 626 | scheduleInstallProvider(provider); |
| 627 | reply.writeNoException(); |
| 628 | return true; |
| 629 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 630 | } |
| 631 | |
| 632 | return super.onTransact(code, data, reply, flags); |
| 633 | } |
| 634 | |
| 635 | public IBinder asBinder() |
| 636 | { |
| 637 | return this; |
| 638 | } |
| 639 | } |
| 640 | |
| 641 | class ApplicationThreadProxy implements IApplicationThread { |
| 642 | private final IBinder mRemote; |
| 643 | |
| 644 | public ApplicationThreadProxy(IBinder remote) { |
| 645 | mRemote = remote; |
| 646 | } |
| 647 | |
| 648 | public final IBinder asBinder() { |
| 649 | return mRemote; |
| 650 | } |
| 651 | |
| 652 | public final void schedulePauseActivity(IBinder token, boolean finished, |
| 653 | boolean userLeaving, int configChanges) throws RemoteException { |
| 654 | Parcel data = Parcel.obtain(); |
| 655 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 656 | data.writeStrongBinder(token); |
| 657 | data.writeInt(finished ? 1 : 0); |
| 658 | data.writeInt(userLeaving ? 1 :0); |
| 659 | data.writeInt(configChanges); |
| 660 | mRemote.transact(SCHEDULE_PAUSE_ACTIVITY_TRANSACTION, data, null, |
| 661 | IBinder.FLAG_ONEWAY); |
| 662 | data.recycle(); |
| 663 | } |
| 664 | |
| 665 | public final void scheduleStopActivity(IBinder token, boolean showWindow, |
| 666 | int configChanges) throws RemoteException { |
| 667 | Parcel data = Parcel.obtain(); |
| 668 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 669 | data.writeStrongBinder(token); |
| 670 | data.writeInt(showWindow ? 1 : 0); |
| 671 | data.writeInt(configChanges); |
| 672 | mRemote.transact(SCHEDULE_STOP_ACTIVITY_TRANSACTION, data, null, |
| 673 | IBinder.FLAG_ONEWAY); |
| 674 | data.recycle(); |
| 675 | } |
| 676 | |
| 677 | public final void scheduleWindowVisibility(IBinder token, |
| 678 | boolean showWindow) throws RemoteException { |
| 679 | Parcel data = Parcel.obtain(); |
| 680 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 681 | data.writeStrongBinder(token); |
| 682 | data.writeInt(showWindow ? 1 : 0); |
| 683 | mRemote.transact(SCHEDULE_WINDOW_VISIBILITY_TRANSACTION, data, null, |
| 684 | IBinder.FLAG_ONEWAY); |
| 685 | data.recycle(); |
| 686 | } |
| 687 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 688 | public final void scheduleSleeping(IBinder token, |
| 689 | boolean sleeping) throws RemoteException { |
| 690 | Parcel data = Parcel.obtain(); |
| 691 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 692 | data.writeStrongBinder(token); |
| 693 | data.writeInt(sleeping ? 1 : 0); |
| 694 | mRemote.transact(SCHEDULE_SLEEPING_TRANSACTION, data, null, |
| 695 | IBinder.FLAG_ONEWAY); |
| 696 | data.recycle(); |
| 697 | } |
| 698 | |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 699 | public final void scheduleResumeActivity(IBinder token, int procState, boolean isForward) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 700 | throws RemoteException { |
| 701 | Parcel data = Parcel.obtain(); |
| 702 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 703 | data.writeStrongBinder(token); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 704 | data.writeInt(procState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 705 | data.writeInt(isForward ? 1 : 0); |
| 706 | mRemote.transact(SCHEDULE_RESUME_ACTIVITY_TRANSACTION, data, null, |
| 707 | IBinder.FLAG_ONEWAY); |
| 708 | data.recycle(); |
| 709 | } |
| 710 | |
| 711 | public final void scheduleSendResult(IBinder token, List<ResultInfo> results) |
| 712 | throws RemoteException { |
| 713 | Parcel data = Parcel.obtain(); |
| 714 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 715 | data.writeStrongBinder(token); |
| 716 | data.writeTypedList(results); |
| 717 | mRemote.transact(SCHEDULE_SEND_RESULT_TRANSACTION, data, null, |
| 718 | IBinder.FLAG_ONEWAY); |
| 719 | data.recycle(); |
| 720 | } |
| 721 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 722 | public final void scheduleLaunchActivity(Intent intent, IBinder token, int ident, |
Dianne Hackborn | 58f42a5 | 2011-10-10 13:46:34 -0700 | [diff] [blame] | 723 | ActivityInfo info, Configuration curConfig, CompatibilityInfo compatInfo, |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 724 | int procState, Bundle state, List<ResultInfo> pendingResults, |
Dianne Hackborn | 58f42a5 | 2011-10-10 13:46:34 -0700 | [diff] [blame] | 725 | List<Intent> pendingNewIntents, boolean notResumed, boolean isForward, |
| 726 | String profileName, ParcelFileDescriptor profileFd, boolean autoStopProfiler) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 727 | throws RemoteException { |
| 728 | Parcel data = Parcel.obtain(); |
| 729 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 730 | intent.writeToParcel(data, 0); |
| 731 | data.writeStrongBinder(token); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 732 | data.writeInt(ident); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 733 | info.writeToParcel(data, 0); |
Dianne Hackborn | 58f42a5 | 2011-10-10 13:46:34 -0700 | [diff] [blame] | 734 | curConfig.writeToParcel(data, 0); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 735 | compatInfo.writeToParcel(data, 0); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 736 | data.writeInt(procState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 737 | data.writeBundle(state); |
| 738 | data.writeTypedList(pendingResults); |
| 739 | data.writeTypedList(pendingNewIntents); |
| 740 | data.writeInt(notResumed ? 1 : 0); |
| 741 | data.writeInt(isForward ? 1 : 0); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 742 | data.writeString(profileName); |
| 743 | if (profileFd != null) { |
| 744 | data.writeInt(1); |
| 745 | profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 746 | } else { |
| 747 | data.writeInt(0); |
| 748 | } |
| 749 | data.writeInt(autoStopProfiler ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 750 | mRemote.transact(SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION, data, null, |
| 751 | IBinder.FLAG_ONEWAY); |
| 752 | data.recycle(); |
| 753 | } |
| 754 | |
| 755 | public final void scheduleRelaunchActivity(IBinder token, |
| 756 | List<ResultInfo> pendingResults, List<Intent> pendingNewIntents, |
Dianne Hackborn | 871ecdc | 2009-12-11 15:24:33 -0800 | [diff] [blame] | 757 | int configChanges, boolean notResumed, Configuration config) |
| 758 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 759 | Parcel data = Parcel.obtain(); |
| 760 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 761 | data.writeStrongBinder(token); |
| 762 | data.writeTypedList(pendingResults); |
| 763 | data.writeTypedList(pendingNewIntents); |
| 764 | data.writeInt(configChanges); |
| 765 | data.writeInt(notResumed ? 1 : 0); |
Dianne Hackborn | 871ecdc | 2009-12-11 15:24:33 -0800 | [diff] [blame] | 766 | if (config != null) { |
| 767 | data.writeInt(1); |
| 768 | config.writeToParcel(data, 0); |
| 769 | } else { |
| 770 | data.writeInt(0); |
| 771 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 772 | mRemote.transact(SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION, data, null, |
| 773 | IBinder.FLAG_ONEWAY); |
| 774 | data.recycle(); |
| 775 | } |
| 776 | |
| 777 | public void scheduleNewIntent(List<Intent> intents, IBinder token) |
| 778 | throws RemoteException { |
| 779 | Parcel data = Parcel.obtain(); |
| 780 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 781 | data.writeTypedList(intents); |
| 782 | data.writeStrongBinder(token); |
| 783 | mRemote.transact(SCHEDULE_NEW_INTENT_TRANSACTION, data, null, |
| 784 | IBinder.FLAG_ONEWAY); |
| 785 | data.recycle(); |
| 786 | } |
| 787 | |
| 788 | public final void scheduleDestroyActivity(IBinder token, boolean finishing, |
| 789 | int configChanges) throws RemoteException { |
| 790 | Parcel data = Parcel.obtain(); |
| 791 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 792 | data.writeStrongBinder(token); |
| 793 | data.writeInt(finishing ? 1 : 0); |
| 794 | data.writeInt(configChanges); |
| 795 | mRemote.transact(SCHEDULE_FINISH_ACTIVITY_TRANSACTION, data, null, |
| 796 | IBinder.FLAG_ONEWAY); |
| 797 | data.recycle(); |
| 798 | } |
| 799 | |
| 800 | public final void scheduleReceiver(Intent intent, ActivityInfo info, |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 801 | CompatibilityInfo compatInfo, int resultCode, String resultData, |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 802 | Bundle map, boolean sync, int sendingUser, int processState) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 803 | Parcel data = Parcel.obtain(); |
| 804 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 805 | intent.writeToParcel(data, 0); |
| 806 | info.writeToParcel(data, 0); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 807 | compatInfo.writeToParcel(data, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 808 | data.writeInt(resultCode); |
| 809 | data.writeString(resultData); |
| 810 | data.writeBundle(map); |
| 811 | data.writeInt(sync ? 1 : 0); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 812 | data.writeInt(sendingUser); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 813 | data.writeInt(processState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 814 | mRemote.transact(SCHEDULE_RECEIVER_TRANSACTION, data, null, |
| 815 | IBinder.FLAG_ONEWAY); |
| 816 | data.recycle(); |
| 817 | } |
| 818 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 819 | public final void scheduleCreateBackupAgent(ApplicationInfo app, |
| 820 | CompatibilityInfo compatInfo, int backupMode) throws RemoteException { |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 821 | Parcel data = Parcel.obtain(); |
| 822 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 823 | app.writeToParcel(data, 0); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 824 | compatInfo.writeToParcel(data, 0); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 825 | data.writeInt(backupMode); |
Christopher Tate | d884f43 | 2009-07-23 14:40:13 -0700 | [diff] [blame] | 826 | mRemote.transact(SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION, data, null, |
| 827 | IBinder.FLAG_ONEWAY); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 828 | data.recycle(); |
| 829 | } |
| 830 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 831 | public final void scheduleDestroyBackupAgent(ApplicationInfo app, |
| 832 | CompatibilityInfo compatInfo) throws RemoteException { |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 833 | Parcel data = Parcel.obtain(); |
| 834 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 835 | app.writeToParcel(data, 0); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 836 | compatInfo.writeToParcel(data, 0); |
Christopher Tate | d884f43 | 2009-07-23 14:40:13 -0700 | [diff] [blame] | 837 | mRemote.transact(SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION, data, null, |
| 838 | IBinder.FLAG_ONEWAY); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 839 | data.recycle(); |
| 840 | } |
| 841 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 842 | public final void scheduleCreateService(IBinder token, ServiceInfo info, |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 843 | CompatibilityInfo compatInfo, int processState) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 844 | Parcel data = Parcel.obtain(); |
| 845 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 846 | data.writeStrongBinder(token); |
| 847 | info.writeToParcel(data, 0); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 848 | compatInfo.writeToParcel(data, 0); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 849 | data.writeInt(processState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 850 | mRemote.transact(SCHEDULE_CREATE_SERVICE_TRANSACTION, data, null, |
| 851 | IBinder.FLAG_ONEWAY); |
| 852 | data.recycle(); |
| 853 | } |
| 854 | |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 855 | public final void scheduleBindService(IBinder token, Intent intent, boolean rebind, |
| 856 | int processState) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 857 | Parcel data = Parcel.obtain(); |
| 858 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 859 | data.writeStrongBinder(token); |
| 860 | intent.writeToParcel(data, 0); |
| 861 | data.writeInt(rebind ? 1 : 0); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 862 | data.writeInt(processState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 863 | mRemote.transact(SCHEDULE_BIND_SERVICE_TRANSACTION, data, null, |
| 864 | IBinder.FLAG_ONEWAY); |
| 865 | data.recycle(); |
| 866 | } |
| 867 | |
| 868 | public final void scheduleUnbindService(IBinder token, Intent intent) |
| 869 | throws RemoteException { |
| 870 | Parcel data = Parcel.obtain(); |
| 871 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 872 | data.writeStrongBinder(token); |
| 873 | intent.writeToParcel(data, 0); |
| 874 | mRemote.transact(SCHEDULE_UNBIND_SERVICE_TRANSACTION, data, null, |
| 875 | IBinder.FLAG_ONEWAY); |
| 876 | data.recycle(); |
| 877 | } |
| 878 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 879 | public final void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId, |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 880 | int flags, Intent args) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 881 | Parcel data = Parcel.obtain(); |
| 882 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 883 | data.writeStrongBinder(token); |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 884 | data.writeInt(taskRemoved ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 885 | data.writeInt(startId); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 886 | data.writeInt(flags); |
| 887 | if (args != null) { |
| 888 | data.writeInt(1); |
| 889 | args.writeToParcel(data, 0); |
| 890 | } else { |
| 891 | data.writeInt(0); |
| 892 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 893 | mRemote.transact(SCHEDULE_SERVICE_ARGS_TRANSACTION, data, null, |
| 894 | IBinder.FLAG_ONEWAY); |
| 895 | data.recycle(); |
| 896 | } |
| 897 | |
| 898 | public final void scheduleStopService(IBinder token) |
| 899 | throws RemoteException { |
| 900 | Parcel data = Parcel.obtain(); |
| 901 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 902 | data.writeStrongBinder(token); |
| 903 | mRemote.transact(SCHEDULE_STOP_SERVICE_TRANSACTION, data, null, |
| 904 | IBinder.FLAG_ONEWAY); |
| 905 | data.recycle(); |
| 906 | } |
| 907 | |
| 908 | public final void bindApplication(String packageName, ApplicationInfo info, |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 909 | List<ProviderInfo> providers, ComponentName testName, String profileName, |
| 910 | ParcelFileDescriptor profileFd, boolean autoStopProfiler, Bundle testArgs, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 911 | IInstrumentationWatcher testWatcher, |
| 912 | IUiAutomationConnection uiAutomationConnection, int debugMode, |
| 913 | boolean openGlTrace, boolean restrictedBackupMode, boolean persistent, |
| 914 | Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services, |
| 915 | Bundle coreSettings) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 916 | Parcel data = Parcel.obtain(); |
| 917 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 918 | data.writeString(packageName); |
| 919 | info.writeToParcel(data, 0); |
| 920 | data.writeTypedList(providers); |
| 921 | if (testName == null) { |
| 922 | data.writeInt(0); |
| 923 | } else { |
| 924 | data.writeInt(1); |
| 925 | testName.writeToParcel(data, 0); |
| 926 | } |
| 927 | data.writeString(profileName); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 928 | if (profileFd != null) { |
| 929 | data.writeInt(1); |
| 930 | profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 931 | } else { |
| 932 | data.writeInt(0); |
| 933 | } |
| 934 | data.writeInt(autoStopProfiler ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 935 | data.writeBundle(testArgs); |
| 936 | data.writeStrongInterface(testWatcher); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 937 | data.writeStrongInterface(uiAutomationConnection); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 938 | data.writeInt(debugMode); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 939 | data.writeInt(openGlTrace ? 1 : 0); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 940 | data.writeInt(restrictedBackupMode ? 1 : 0); |
Dianne Hackborn | 5d927c2 | 2011-09-02 12:22:18 -0700 | [diff] [blame] | 941 | data.writeInt(persistent ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 942 | config.writeToParcel(data, 0); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 943 | compatInfo.writeToParcel(data, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 944 | data.writeMap(services); |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 945 | data.writeBundle(coreSettings); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 946 | mRemote.transact(BIND_APPLICATION_TRANSACTION, data, null, |
| 947 | IBinder.FLAG_ONEWAY); |
| 948 | data.recycle(); |
| 949 | } |
| 950 | |
| 951 | public final void scheduleExit() throws RemoteException { |
| 952 | Parcel data = Parcel.obtain(); |
| 953 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 954 | mRemote.transact(SCHEDULE_EXIT_TRANSACTION, data, null, |
| 955 | IBinder.FLAG_ONEWAY); |
| 956 | data.recycle(); |
| 957 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 958 | |
| 959 | public final void scheduleSuicide() throws RemoteException { |
| 960 | Parcel data = Parcel.obtain(); |
| 961 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 962 | mRemote.transact(SCHEDULE_SUICIDE_TRANSACTION, data, null, |
| 963 | IBinder.FLAG_ONEWAY); |
| 964 | data.recycle(); |
| 965 | } |
| 966 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 967 | public final void requestThumbnail(IBinder token) |
| 968 | throws RemoteException { |
| 969 | Parcel data = Parcel.obtain(); |
| 970 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 971 | data.writeStrongBinder(token); |
| 972 | mRemote.transact(REQUEST_THUMBNAIL_TRANSACTION, data, null, |
| 973 | IBinder.FLAG_ONEWAY); |
| 974 | data.recycle(); |
| 975 | } |
| 976 | |
| 977 | public final void scheduleConfigurationChanged(Configuration config) |
| 978 | throws RemoteException { |
| 979 | Parcel data = Parcel.obtain(); |
| 980 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 981 | config.writeToParcel(data, 0); |
| 982 | mRemote.transact(SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION, data, null, |
| 983 | IBinder.FLAG_ONEWAY); |
| 984 | data.recycle(); |
| 985 | } |
| 986 | |
| 987 | public void updateTimeZone() throws RemoteException { |
| 988 | Parcel data = Parcel.obtain(); |
| 989 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 990 | mRemote.transact(UPDATE_TIME_ZONE_TRANSACTION, data, null, |
| 991 | IBinder.FLAG_ONEWAY); |
| 992 | data.recycle(); |
| 993 | } |
| 994 | |
Robert Greenwalt | 03595d0 | 2010-11-02 14:08:23 -0700 | [diff] [blame] | 995 | public void clearDnsCache() throws RemoteException { |
| 996 | Parcel data = Parcel.obtain(); |
| 997 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 998 | mRemote.transact(CLEAR_DNS_CACHE_TRANSACTION, data, null, |
| 999 | IBinder.FLAG_ONEWAY); |
| 1000 | data.recycle(); |
| 1001 | } |
| 1002 | |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 1003 | public void setHttpProxy(String proxy, String port, String exclList, |
| 1004 | String pacFileUrl) throws RemoteException { |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 1005 | Parcel data = Parcel.obtain(); |
| 1006 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1007 | data.writeString(proxy); |
| 1008 | data.writeString(port); |
| 1009 | data.writeString(exclList); |
Jason Monk | 602b232 | 2013-07-03 17:04:33 -0400 | [diff] [blame] | 1010 | data.writeString(pacFileUrl); |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 1011 | mRemote.transact(SET_HTTP_PROXY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
| 1012 | data.recycle(); |
| 1013 | } |
| 1014 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1015 | public void processInBackground() throws RemoteException { |
| 1016 | Parcel data = Parcel.obtain(); |
| 1017 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1018 | mRemote.transact(PROCESS_IN_BACKGROUND_TRANSACTION, data, null, |
| 1019 | IBinder.FLAG_ONEWAY); |
| 1020 | data.recycle(); |
| 1021 | } |
| 1022 | |
| 1023 | public void dumpService(FileDescriptor fd, IBinder token, String[] args) |
| 1024 | throws RemoteException { |
| 1025 | Parcel data = Parcel.obtain(); |
| 1026 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1027 | data.writeFileDescriptor(fd); |
| 1028 | data.writeStrongBinder(token); |
| 1029 | data.writeStringArray(args); |
Dianne Hackborn | e17aeb3 | 2011-04-07 15:11:57 -0700 | [diff] [blame] | 1030 | mRemote.transact(DUMP_SERVICE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1031 | data.recycle(); |
| 1032 | } |
| 1033 | |
Marco Nelissen | 18cb287 | 2011-11-15 11:19:53 -0800 | [diff] [blame] | 1034 | public void dumpProvider(FileDescriptor fd, IBinder token, String[] args) |
| 1035 | throws RemoteException { |
| 1036 | Parcel data = Parcel.obtain(); |
| 1037 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1038 | data.writeFileDescriptor(fd); |
| 1039 | data.writeStrongBinder(token); |
| 1040 | data.writeStringArray(args); |
| 1041 | mRemote.transact(DUMP_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
| 1042 | data.recycle(); |
| 1043 | } |
| 1044 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1045 | public void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 1046 | int resultCode, String dataStr, Bundle extras, boolean ordered, |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 1047 | boolean sticky, int sendingUser, int processState) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1048 | Parcel data = Parcel.obtain(); |
| 1049 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1050 | data.writeStrongBinder(receiver.asBinder()); |
| 1051 | intent.writeToParcel(data, 0); |
| 1052 | data.writeInt(resultCode); |
| 1053 | data.writeString(dataStr); |
| 1054 | data.writeBundle(extras); |
| 1055 | data.writeInt(ordered ? 1 : 0); |
Dianne Hackborn | 68d881c | 2009-10-05 13:58:17 -0700 | [diff] [blame] | 1056 | data.writeInt(sticky ? 1 : 0); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 1057 | data.writeInt(sendingUser); |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 1058 | data.writeInt(processState); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1059 | mRemote.transact(SCHEDULE_REGISTERED_RECEIVER_TRANSACTION, data, null, |
| 1060 | IBinder.FLAG_ONEWAY); |
| 1061 | data.recycle(); |
| 1062 | } |
| 1063 | |
| 1064 | public final void scheduleLowMemory() throws RemoteException { |
| 1065 | Parcel data = Parcel.obtain(); |
| 1066 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1067 | mRemote.transact(SCHEDULE_LOW_MEMORY_TRANSACTION, data, null, |
| 1068 | IBinder.FLAG_ONEWAY); |
| 1069 | data.recycle(); |
| 1070 | } |
| 1071 | |
| 1072 | public final void scheduleActivityConfigurationChanged( |
| 1073 | IBinder token) throws RemoteException { |
| 1074 | Parcel data = Parcel.obtain(); |
| 1075 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1076 | data.writeStrongBinder(token); |
| 1077 | mRemote.transact(SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION, data, null, |
| 1078 | IBinder.FLAG_ONEWAY); |
| 1079 | data.recycle(); |
| 1080 | } |
| 1081 | |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 1082 | public void profilerControl(boolean start, String path, |
Romain Guy | 7eabe55 | 2011-07-21 14:56:34 -0700 | [diff] [blame] | 1083 | ParcelFileDescriptor fd, int profileType) throws RemoteException { |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1084 | Parcel data = Parcel.obtain(); |
| 1085 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1086 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1087 | data.writeInt(profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1088 | data.writeString(path); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 1089 | if (fd != null) { |
| 1090 | data.writeInt(1); |
| 1091 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1092 | } else { |
| 1093 | data.writeInt(0); |
| 1094 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1095 | mRemote.transact(PROFILER_CONTROL_TRANSACTION, data, null, |
| 1096 | IBinder.FLAG_ONEWAY); |
| 1097 | data.recycle(); |
| 1098 | } |
Dianne Hackborn | 06de2ea | 2009-05-21 12:56:43 -0700 | [diff] [blame] | 1099 | |
| 1100 | public void setSchedulingGroup(int group) throws RemoteException { |
| 1101 | Parcel data = Parcel.obtain(); |
| 1102 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1103 | data.writeInt(group); |
| 1104 | mRemote.transact(SET_SCHEDULING_GROUP_TRANSACTION, data, null, |
| 1105 | IBinder.FLAG_ONEWAY); |
| 1106 | data.recycle(); |
| 1107 | } |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1108 | |
Dianne Hackborn | 4416c3d | 2010-05-04 17:22:49 -0700 | [diff] [blame] | 1109 | public void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException { |
| 1110 | Parcel data = Parcel.obtain(); |
| 1111 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1112 | data.writeInt(cmd); |
| 1113 | data.writeStringArray(packages); |
| 1114 | mRemote.transact(DISPATCH_PACKAGE_BROADCAST_TRANSACTION, data, null, |
| 1115 | IBinder.FLAG_ONEWAY); |
| 1116 | data.recycle(); |
| 1117 | |
| 1118 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1119 | |
| 1120 | public void scheduleCrash(String msg) throws RemoteException { |
| 1121 | Parcel data = Parcel.obtain(); |
| 1122 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1123 | data.writeString(msg); |
| 1124 | mRemote.transact(SCHEDULE_CRASH_TRANSACTION, data, null, |
| 1125 | IBinder.FLAG_ONEWAY); |
| 1126 | data.recycle(); |
| 1127 | |
| 1128 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1129 | |
| 1130 | public void dumpHeap(boolean managed, String path, |
| 1131 | ParcelFileDescriptor fd) throws RemoteException { |
| 1132 | Parcel data = Parcel.obtain(); |
| 1133 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1134 | data.writeInt(managed ? 1 : 0); |
| 1135 | data.writeString(path); |
| 1136 | if (fd != null) { |
| 1137 | data.writeInt(1); |
| 1138 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1139 | } else { |
| 1140 | data.writeInt(0); |
| 1141 | } |
| 1142 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, null, |
| 1143 | IBinder.FLAG_ONEWAY); |
| 1144 | data.recycle(); |
| 1145 | } |
Dianne Hackborn | 625ac27 | 2010-09-17 18:29:22 -0700 | [diff] [blame] | 1146 | |
Dianne Hackborn | 30d7189 | 2010-12-11 10:37:55 -0800 | [diff] [blame] | 1147 | public void dumpActivity(FileDescriptor fd, IBinder token, String prefix, String[] args) |
Dianne Hackborn | 625ac27 | 2010-09-17 18:29:22 -0700 | [diff] [blame] | 1148 | throws RemoteException { |
| 1149 | Parcel data = Parcel.obtain(); |
| 1150 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1151 | data.writeFileDescriptor(fd); |
| 1152 | data.writeStrongBinder(token); |
Dianne Hackborn | 30d7189 | 2010-12-11 10:37:55 -0800 | [diff] [blame] | 1153 | data.writeString(prefix); |
Dianne Hackborn | 625ac27 | 2010-09-17 18:29:22 -0700 | [diff] [blame] | 1154 | data.writeStringArray(args); |
Dianne Hackborn | e17aeb3 | 2011-04-07 15:11:57 -0700 | [diff] [blame] | 1155 | mRemote.transact(DUMP_ACTIVITY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
Dianne Hackborn | 625ac27 | 2010-09-17 18:29:22 -0700 | [diff] [blame] | 1156 | data.recycle(); |
| 1157 | } |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 1158 | |
| 1159 | public void setCoreSettings(Bundle coreSettings) throws RemoteException { |
| 1160 | Parcel data = Parcel.obtain(); |
| 1161 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1162 | data.writeBundle(coreSettings); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1163 | mRemote.transact(SET_CORE_SETTINGS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
| 1164 | } |
| 1165 | |
| 1166 | public void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info) |
| 1167 | throws RemoteException { |
| 1168 | Parcel data = Parcel.obtain(); |
| 1169 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1170 | data.writeString(pkg); |
| 1171 | info.writeToParcel(data, 0); |
| 1172 | mRemote.transact(UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION, data, null, |
| 1173 | IBinder.FLAG_ONEWAY); |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 1174 | } |
Dianne Hackborn | ce86ba8 | 2011-07-13 19:33:41 -0700 | [diff] [blame] | 1175 | |
| 1176 | public void scheduleTrimMemory(int level) throws RemoteException { |
| 1177 | Parcel data = Parcel.obtain(); |
| 1178 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1179 | data.writeInt(level); |
| 1180 | mRemote.transact(SCHEDULE_TRIM_MEMORY_TRANSACTION, data, null, |
| 1181 | IBinder.FLAG_ONEWAY); |
| 1182 | } |
Dianne Hackborn | 0e3328f | 2011-07-17 13:31:17 -0700 | [diff] [blame] | 1183 | |
Dianne Hackborn | 3bc8f78d | 2013-09-19 13:34:35 -0700 | [diff] [blame] | 1184 | public void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin, |
| 1185 | boolean dumpInfo, boolean dumpDalvik, String[] args) throws RemoteException { |
Dianne Hackborn | 0e3328f | 2011-07-17 13:31:17 -0700 | [diff] [blame] | 1186 | Parcel data = Parcel.obtain(); |
| 1187 | Parcel reply = Parcel.obtain(); |
| 1188 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1189 | data.writeFileDescriptor(fd); |
Dianne Hackborn | 3bc8f78d | 2013-09-19 13:34:35 -0700 | [diff] [blame] | 1190 | mem.writeToParcel(data, 0); |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 1191 | data.writeInt(checkin ? 1 : 0); |
Dianne Hackborn | 64770d1 | 2013-05-23 17:51:19 -0700 | [diff] [blame] | 1192 | data.writeInt(dumpInfo ? 1 : 0); |
| 1193 | data.writeInt(dumpDalvik ? 1 : 0); |
Dianne Hackborn | 0e3328f | 2011-07-17 13:31:17 -0700 | [diff] [blame] | 1194 | data.writeStringArray(args); |
| 1195 | mRemote.transact(DUMP_MEM_INFO_TRANSACTION, data, reply, 0); |
| 1196 | reply.readException(); |
Dianne Hackborn | 0e3328f | 2011-07-17 13:31:17 -0700 | [diff] [blame] | 1197 | data.recycle(); |
| 1198 | reply.recycle(); |
Dianne Hackborn | 0e3328f | 2011-07-17 13:31:17 -0700 | [diff] [blame] | 1199 | } |
| 1200 | |
| 1201 | public void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException { |
| 1202 | Parcel data = Parcel.obtain(); |
| 1203 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1204 | data.writeFileDescriptor(fd); |
| 1205 | data.writeStringArray(args); |
| 1206 | mRemote.transact(DUMP_GFX_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
| 1207 | data.recycle(); |
| 1208 | } |
Jeff Brown | 6754ba2 | 2011-12-14 20:20:01 -0800 | [diff] [blame] | 1209 | |
| 1210 | public void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException { |
| 1211 | Parcel data = Parcel.obtain(); |
| 1212 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1213 | data.writeFileDescriptor(fd); |
| 1214 | data.writeStringArray(args); |
| 1215 | mRemote.transact(DUMP_DB_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
| 1216 | data.recycle(); |
| 1217 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1218 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1219 | @Override |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 1220 | public void unstableProviderDied(IBinder provider) throws RemoteException { |
| 1221 | Parcel data = Parcel.obtain(); |
| 1222 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1223 | data.writeStrongBinder(provider); |
| 1224 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
| 1225 | data.recycle(); |
| 1226 | } |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 1227 | |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1228 | @Override |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 1229 | public void requestAssistContextExtras(IBinder activityToken, IBinder requestToken, |
Adam Skory | 7140a25 | 2013-09-11 12:04:58 +0100 | [diff] [blame] | 1230 | int requestType) throws RemoteException { |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 1231 | Parcel data = Parcel.obtain(); |
| 1232 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1233 | data.writeStrongBinder(activityToken); |
| 1234 | data.writeStrongBinder(requestToken); |
| 1235 | data.writeInt(requestType); |
Adam Skory | dfc7fd7 | 2013-08-05 19:23:41 -0700 | [diff] [blame] | 1236 | mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, null, |
| 1237 | IBinder.FLAG_ONEWAY); |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 1238 | data.recycle(); |
| 1239 | } |
Craig Mautner | 5eda9b3 | 2013-07-02 11:58:16 -0700 | [diff] [blame] | 1240 | |
| 1241 | @Override |
| 1242 | public void scheduleTranslucentConversionComplete(IBinder token, boolean timeout) |
| 1243 | throws RemoteException { |
| 1244 | Parcel data = Parcel.obtain(); |
| 1245 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1246 | data.writeStrongBinder(token); |
| 1247 | data.writeInt(timeout ? 1 : 0); |
| 1248 | mRemote.transact(SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
| 1249 | data.recycle(); |
| 1250 | } |
Dianne Hackborn | a413dc0 | 2013-07-12 12:02:55 -0700 | [diff] [blame] | 1251 | |
| 1252 | @Override |
| 1253 | public void setProcessState(int state) throws RemoteException { |
| 1254 | Parcel data = Parcel.obtain(); |
| 1255 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1256 | data.writeInt(state); |
| 1257 | mRemote.transact(SET_PROCESS_STATE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
| 1258 | data.recycle(); |
| 1259 | } |
Jeff Sharkey | dd97f42 | 2013-10-08 17:01:30 -0700 | [diff] [blame] | 1260 | |
| 1261 | @Override |
| 1262 | public void scheduleInstallProvider(ProviderInfo provider) throws RemoteException { |
| 1263 | Parcel data = Parcel.obtain(); |
| 1264 | data.writeInterfaceToken(IApplicationThread.descriptor); |
| 1265 | provider.writeToParcel(data, 0); |
| 1266 | mRemote.transact(SCHEDULE_INSTALL_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); |
| 1267 | data.recycle(); |
| 1268 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1269 | } |