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