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