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