1 /* 2 * Copyright (C) 2016 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.app.IInstrumentationWatcher; 20 import android.app.IUiAutomationConnection; 21 import android.app.ProfilerInfo; 22 import android.app.ResultInfo; 23 import android.app.servertransaction.ClientTransaction; 24 import android.content.AutofillOptions; 25 import android.content.ComponentName; 26 import android.content.ContentCaptureOptions; 27 import android.content.IIntentReceiver; 28 import android.content.Intent; 29 import android.content.pm.ActivityInfo; 30 import android.content.pm.ApplicationInfo; 31 import android.content.pm.ParceledListSlice; 32 import android.content.pm.ProviderInfo; 33 import android.content.pm.ServiceInfo; 34 import android.content.res.CompatibilityInfo; 35 import android.content.res.Configuration; 36 import android.net.Uri; 37 import android.os.Bundle; 38 import android.os.Debug; 39 import android.os.IBinder; 40 import android.os.IInterface; 41 import android.os.ParcelFileDescriptor; 42 import android.os.PersistableBundle; 43 import android.os.RemoteCallback; 44 45 import com.android.internal.app.IVoiceInteractor; 46 import com.android.internal.content.ReferrerIntent; 47 48 import java.util.List; 49 import java.util.Map; 50 51 /** 52 * System private API for communicating with the application. This is given to 53 * the activity manager by an application when it starts up, for the activity 54 * manager to tell the application about things it needs to do. 55 * 56 * {@hide} 57 */ 58 oneway interface IApplicationThread { scheduleReceiver(in Intent intent, in ActivityInfo info, in CompatibilityInfo compatInfo, int resultCode, in String data, in Bundle extras, boolean sync, int sendingUser, int processState)59 void scheduleReceiver(in Intent intent, in ActivityInfo info, 60 in CompatibilityInfo compatInfo, 61 int resultCode, in String data, in Bundle extras, boolean sync, 62 int sendingUser, int processState); 63 @UnsupportedAppUsage scheduleCreateService(IBinder token, in ServiceInfo info, in CompatibilityInfo compatInfo, int processState)64 void scheduleCreateService(IBinder token, in ServiceInfo info, 65 in CompatibilityInfo compatInfo, int processState); 66 @UnsupportedAppUsage scheduleStopService(IBinder token)67 void scheduleStopService(IBinder token); bindApplication(in String packageName, in ApplicationInfo info, in List<ProviderInfo> providers, in ComponentName testName, in ProfilerInfo profilerInfo, in Bundle testArguments, IInstrumentationWatcher testWatcher, IUiAutomationConnection uiAutomationConnection, int debugMode, boolean enableBinderTracking, boolean trackAllocation, boolean restrictedBackupMode, boolean persistent, in Configuration config, in CompatibilityInfo compatInfo, in Map services, in Bundle coreSettings, in String buildSerial, in AutofillOptions autofillOptions, in ContentCaptureOptions contentCaptureOptions, in long[] disabledCompatChanges)68 void bindApplication(in String packageName, in ApplicationInfo info, 69 in List<ProviderInfo> providers, in ComponentName testName, 70 in ProfilerInfo profilerInfo, in Bundle testArguments, 71 IInstrumentationWatcher testWatcher, IUiAutomationConnection uiAutomationConnection, 72 int debugMode, boolean enableBinderTracking, boolean trackAllocation, 73 boolean restrictedBackupMode, boolean persistent, in Configuration config, 74 in CompatibilityInfo compatInfo, in Map services, 75 in Bundle coreSettings, in String buildSerial, in AutofillOptions autofillOptions, 76 in ContentCaptureOptions contentCaptureOptions, in long[] disabledCompatChanges); runIsolatedEntryPoint(in String entryPoint, in String[] entryPointArgs)77 void runIsolatedEntryPoint(in String entryPoint, in String[] entryPointArgs); scheduleExit()78 void scheduleExit(); scheduleServiceArgs(IBinder token, in ParceledListSlice args)79 void scheduleServiceArgs(IBinder token, in ParceledListSlice args); updateTimeZone()80 void updateTimeZone(); processInBackground()81 void processInBackground(); 82 @UnsupportedAppUsage scheduleBindService(IBinder token, in Intent intent, boolean rebind, int processState)83 void scheduleBindService(IBinder token, 84 in Intent intent, boolean rebind, int processState); 85 @UnsupportedAppUsage scheduleUnbindService(IBinder token, in Intent intent)86 void scheduleUnbindService(IBinder token, 87 in Intent intent); dumpService(in ParcelFileDescriptor fd, IBinder servicetoken, in String[] args)88 void dumpService(in ParcelFileDescriptor fd, IBinder servicetoken, 89 in String[] args); scheduleRegisteredReceiver(IIntentReceiver receiver, in Intent intent, int resultCode, in String data, in Bundle extras, boolean ordered, boolean sticky, int sendingUser, int processState)90 void scheduleRegisteredReceiver(IIntentReceiver receiver, in Intent intent, 91 int resultCode, in String data, in Bundle extras, boolean ordered, 92 boolean sticky, int sendingUser, int processState); scheduleLowMemory()93 void scheduleLowMemory(); scheduleSleeping(IBinder token, boolean sleeping)94 void scheduleSleeping(IBinder token, boolean sleeping); profilerControl(boolean start, in ProfilerInfo profilerInfo, int profileType)95 void profilerControl(boolean start, in ProfilerInfo profilerInfo, int profileType); setSchedulingGroup(int group)96 void setSchedulingGroup(int group); scheduleCreateBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo, int backupMode, int userId)97 void scheduleCreateBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo, 98 int backupMode, int userId); scheduleDestroyBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo, int userId)99 void scheduleDestroyBackupAgent(in ApplicationInfo app, 100 in CompatibilityInfo compatInfo, int userId); scheduleOnNewActivityOptions(IBinder token, in Bundle options)101 void scheduleOnNewActivityOptions(IBinder token, in Bundle options); scheduleSuicide()102 void scheduleSuicide(); dispatchPackageBroadcast(int cmd, in String[] packages)103 void dispatchPackageBroadcast(int cmd, in String[] packages); scheduleCrash(in String msg)104 void scheduleCrash(in String msg); dumpHeap(boolean managed, boolean mallocInfo, boolean runGc, in String path, in ParcelFileDescriptor fd, in RemoteCallback finishCallback)105 void dumpHeap(boolean managed, boolean mallocInfo, boolean runGc, in String path, 106 in ParcelFileDescriptor fd, in RemoteCallback finishCallback); dumpActivity(in ParcelFileDescriptor fd, IBinder servicetoken, in String prefix, in String[] args)107 void dumpActivity(in ParcelFileDescriptor fd, IBinder servicetoken, in String prefix, 108 in String[] args); clearDnsCache()109 void clearDnsCache(); updateHttpProxy()110 void updateHttpProxy(); setCoreSettings(in Bundle coreSettings)111 void setCoreSettings(in Bundle coreSettings); updatePackageCompatibilityInfo(in String pkg, in CompatibilityInfo info)112 void updatePackageCompatibilityInfo(in String pkg, in CompatibilityInfo info); 113 @UnsupportedAppUsage scheduleTrimMemory(int level)114 void scheduleTrimMemory(int level); dumpMemInfo(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem, boolean checkin, boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable, in String[] args)115 void dumpMemInfo(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem, boolean checkin, 116 boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable, 117 in String[] args); dumpMemInfoProto(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem, boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable, in String[] args)118 void dumpMemInfoProto(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem, 119 boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable, 120 in String[] args); dumpGfxInfo(in ParcelFileDescriptor fd, in String[] args)121 void dumpGfxInfo(in ParcelFileDescriptor fd, in String[] args); dumpProvider(in ParcelFileDescriptor fd, IBinder servicetoken, in String[] args)122 void dumpProvider(in ParcelFileDescriptor fd, IBinder servicetoken, 123 in String[] args); dumpDbInfo(in ParcelFileDescriptor fd, in String[] args)124 void dumpDbInfo(in ParcelFileDescriptor fd, in String[] args); unstableProviderDied(IBinder provider)125 void unstableProviderDied(IBinder provider); requestAssistContextExtras(IBinder activityToken, IBinder requestToken, int requestType, int sessionId, int flags)126 void requestAssistContextExtras(IBinder activityToken, IBinder requestToken, 127 int requestType, int sessionId, int flags); scheduleTranslucentConversionComplete(IBinder token, boolean timeout)128 void scheduleTranslucentConversionComplete(IBinder token, boolean timeout); setProcessState(int state)129 void setProcessState(int state); scheduleInstallProvider(in ProviderInfo provider)130 void scheduleInstallProvider(in ProviderInfo provider); updateTimePrefs(int timeFormatPreference)131 void updateTimePrefs(int timeFormatPreference); scheduleEnterAnimationComplete(IBinder token)132 void scheduleEnterAnimationComplete(IBinder token); notifyCleartextNetwork(in byte[] firstPacket)133 void notifyCleartextNetwork(in byte[] firstPacket); startBinderTracking()134 void startBinderTracking(); stopBinderTrackingAndDump(in ParcelFileDescriptor fd)135 void stopBinderTrackingAndDump(in ParcelFileDescriptor fd); scheduleLocalVoiceInteractionStarted(IBinder token, IVoiceInteractor voiceInteractor)136 void scheduleLocalVoiceInteractionStarted(IBinder token, 137 IVoiceInteractor voiceInteractor); handleTrustStorageUpdate()138 void handleTrustStorageUpdate(); attachAgent(String path)139 void attachAgent(String path); attachStartupAgents(String dataDir)140 void attachStartupAgents(String dataDir); scheduleApplicationInfoChanged(in ApplicationInfo ai)141 void scheduleApplicationInfoChanged(in ApplicationInfo ai); setNetworkBlockSeq(long procStateSeq)142 void setNetworkBlockSeq(long procStateSeq); scheduleTransaction(in ClientTransaction transaction)143 void scheduleTransaction(in ClientTransaction transaction); requestDirectActions(IBinder activityToken, IVoiceInteractor intractor, in RemoteCallback cancellationCallback, in RemoteCallback callback)144 void requestDirectActions(IBinder activityToken, IVoiceInteractor intractor, 145 in RemoteCallback cancellationCallback, in RemoteCallback callback); performDirectAction(IBinder activityToken, String actionId, in Bundle arguments, in RemoteCallback cancellationCallback, in RemoteCallback resultCallback)146 void performDirectAction(IBinder activityToken, String actionId, 147 in Bundle arguments, in RemoteCallback cancellationCallback, 148 in RemoteCallback resultCallback); 149 } 150