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