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 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)74     void bindApplication(in String packageName, in ApplicationInfo info,
75             in ProviderInfoList providerList, in ComponentName testName,
76             in ProfilerInfo profilerInfo, in Bundle testArguments,
77             IInstrumentationWatcher testWatcher, IUiAutomationConnection uiAutomationConnection,
78             int debugMode, boolean enableBinderTracking, boolean trackAllocation,
79             boolean restrictedBackupMode, boolean persistent, in Configuration config,
80             in CompatibilityInfo compatInfo, in Map services,
81             in Bundle coreSettings, in String buildSerial, in AutofillOptions autofillOptions,
82             in ContentCaptureOptions contentCaptureOptions, in long[] disabledCompatChanges,
83             in SharedMemory serializedSystemFontMap);
runIsolatedEntryPoint(in String entryPoint, in String[] entryPointArgs)84     void runIsolatedEntryPoint(in String entryPoint, in String[] entryPointArgs);
scheduleExit()85     void scheduleExit();
scheduleServiceArgs(IBinder token, in ParceledListSlice args)86     void scheduleServiceArgs(IBinder token, in ParceledListSlice args);
updateTimeZone()87     void updateTimeZone();
processInBackground()88     void processInBackground();
89     @UnsupportedAppUsage
scheduleBindService(IBinder token, in Intent intent, boolean rebind, int processState)90     void scheduleBindService(IBinder token,
91             in Intent intent, boolean rebind, int processState);
92     @UnsupportedAppUsage
scheduleUnbindService(IBinder token, in Intent intent)93     void scheduleUnbindService(IBinder token,
94             in Intent intent);
dumpService(in ParcelFileDescriptor fd, IBinder servicetoken, in String[] args)95     void dumpService(in ParcelFileDescriptor fd, IBinder servicetoken,
96             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)97     void scheduleRegisteredReceiver(IIntentReceiver receiver, in Intent intent,
98             int resultCode, in String data, in Bundle extras, boolean ordered,
99             boolean sticky, int sendingUser, int processState);
scheduleLowMemory()100     void scheduleLowMemory();
profilerControl(boolean start, in ProfilerInfo profilerInfo, int profileType)101     void profilerControl(boolean start, in ProfilerInfo profilerInfo, int profileType);
setSchedulingGroup(int group)102     void setSchedulingGroup(int group);
scheduleCreateBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo, int backupMode, int userId, int operationType)103     void scheduleCreateBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo,
104             int backupMode, int userId, int operationType);
scheduleDestroyBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo, int userId)105     void scheduleDestroyBackupAgent(in ApplicationInfo app,
106             in CompatibilityInfo compatInfo, int userId);
scheduleOnNewActivityOptions(IBinder token, in Bundle options)107     void scheduleOnNewActivityOptions(IBinder token, in Bundle options);
scheduleSuicide()108     void scheduleSuicide();
dispatchPackageBroadcast(int cmd, in String[] packages)109     void dispatchPackageBroadcast(int cmd, in String[] packages);
scheduleCrash(in String msg, int typeId, in Bundle extras)110     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)111     void dumpHeap(boolean managed, boolean mallocInfo, boolean runGc, in String path,
112             in ParcelFileDescriptor fd, in RemoteCallback finishCallback);
dumpActivity(in ParcelFileDescriptor fd, IBinder servicetoken, in String prefix, in String[] args)113     void dumpActivity(in ParcelFileDescriptor fd, IBinder servicetoken, in String prefix,
114             in String[] args);
clearDnsCache()115     void clearDnsCache();
updateHttpProxy()116     void updateHttpProxy();
setCoreSettings(in Bundle coreSettings)117     void setCoreSettings(in Bundle coreSettings);
updatePackageCompatibilityInfo(in String pkg, in CompatibilityInfo info)118     void updatePackageCompatibilityInfo(in String pkg, in CompatibilityInfo info);
119     @UnsupportedAppUsage
scheduleTrimMemory(int level)120     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)121     void dumpMemInfo(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem, boolean checkin,
122             boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable,
123             in String[] args);
dumpMemInfoProto(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem, boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable, in String[] args)124     void dumpMemInfoProto(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem,
125             boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable,
126             in String[] args);
dumpGfxInfo(in ParcelFileDescriptor fd, in String[] args)127     void dumpGfxInfo(in ParcelFileDescriptor fd, in String[] args);
dumpCacheInfo(in ParcelFileDescriptor fd, in String[] args)128     void dumpCacheInfo(in ParcelFileDescriptor fd, in String[] args);
dumpProvider(in ParcelFileDescriptor fd, IBinder servicetoken, in String[] args)129     void dumpProvider(in ParcelFileDescriptor fd, IBinder servicetoken,
130             in String[] args);
dumpDbInfo(in ParcelFileDescriptor fd, in String[] args)131     void dumpDbInfo(in ParcelFileDescriptor fd, in String[] args);
unstableProviderDied(IBinder provider)132     void unstableProviderDied(IBinder provider);
requestAssistContextExtras(IBinder activityToken, IBinder requestToken, int requestType, int sessionId, int flags)133     void requestAssistContextExtras(IBinder activityToken, IBinder requestToken,
134             int requestType, int sessionId, int flags);
scheduleTranslucentConversionComplete(IBinder token, boolean timeout)135     void scheduleTranslucentConversionComplete(IBinder token, boolean timeout);
setProcessState(int state)136     void setProcessState(int state);
scheduleInstallProvider(in ProviderInfo provider)137     void scheduleInstallProvider(in ProviderInfo provider);
updateTimePrefs(int timeFormatPreference)138     void updateTimePrefs(int timeFormatPreference);
scheduleEnterAnimationComplete(IBinder token)139     void scheduleEnterAnimationComplete(IBinder token);
notifyCleartextNetwork(in byte[] firstPacket)140     void notifyCleartextNetwork(in byte[] firstPacket);
startBinderTracking()141     void startBinderTracking();
stopBinderTrackingAndDump(in ParcelFileDescriptor fd)142     void stopBinderTrackingAndDump(in ParcelFileDescriptor fd);
scheduleLocalVoiceInteractionStarted(IBinder token, IVoiceInteractor voiceInteractor)143     void scheduleLocalVoiceInteractionStarted(IBinder token,
144             IVoiceInteractor voiceInteractor);
handleTrustStorageUpdate()145     void handleTrustStorageUpdate();
attachAgent(String path)146     void attachAgent(String path);
attachStartupAgents(String dataDir)147     void attachStartupAgents(String dataDir);
scheduleApplicationInfoChanged(in ApplicationInfo ai)148     void scheduleApplicationInfoChanged(in ApplicationInfo ai);
setNetworkBlockSeq(long procStateSeq)149     void setNetworkBlockSeq(long procStateSeq);
scheduleTransaction(in ClientTransaction transaction)150     void scheduleTransaction(in ClientTransaction transaction);
requestDirectActions(IBinder activityToken, IVoiceInteractor intractor, in RemoteCallback cancellationCallback, in RemoteCallback callback)151     void requestDirectActions(IBinder activityToken, IVoiceInteractor intractor,
152             in RemoteCallback cancellationCallback, in RemoteCallback callback);
performDirectAction(IBinder activityToken, String actionId, in Bundle arguments, in RemoteCallback cancellationCallback, in RemoteCallback resultCallback)153     void performDirectAction(IBinder activityToken, String actionId,
154             in Bundle arguments, in RemoteCallback cancellationCallback,
155             in RemoteCallback resultCallback);
notifyContentProviderPublishStatus(in ContentProviderHolder holder, String authorities, int userId, boolean published)156     void notifyContentProviderPublishStatus(in ContentProviderHolder holder, String authorities,
157             int userId, boolean published);
instrumentWithoutRestart(in ComponentName instrumentationName, in Bundle instrumentationArgs, IInstrumentationWatcher instrumentationWatcher, IUiAutomationConnection instrumentationUiConnection, in ApplicationInfo targetInfo)158     void instrumentWithoutRestart(in ComponentName instrumentationName,
159             in Bundle instrumentationArgs,
160             IInstrumentationWatcher instrumentationWatcher,
161             IUiAutomationConnection instrumentationUiConnection,
162             in ApplicationInfo targetInfo);
updateUiTranslationState(IBinder activityToken, int state, in TranslationSpec sourceSpec, in TranslationSpec targetSpec, in List<AutofillId> viewIds, in UiTranslationSpec uiTranslationSpec)163     void updateUiTranslationState(IBinder activityToken, int state, in TranslationSpec sourceSpec,
164             in TranslationSpec targetSpec, in List<AutofillId> viewIds,
165             in UiTranslationSpec uiTranslationSpec);
166 }
167