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