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