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.IInstrumentationWatcher;
20 import android.app.IUiAutomationConnection;
21 import android.app.ProfilerInfo;
22 import android.app.ResultInfo;
23 import android.app.servertransaction.ClientTransaction;
24 import android.content.ComponentName;
25 import android.content.IIntentReceiver;
26 import android.content.Intent;
27 import android.content.pm.ActivityInfo;
28 import android.content.pm.ApplicationInfo;
29 import android.content.pm.ParceledListSlice;
30 import android.content.pm.ProviderInfo;
31 import android.content.pm.ServiceInfo;
32 import android.content.res.CompatibilityInfo;
33 import android.content.res.Configuration;
34 import android.net.Uri;
35 import android.os.Bundle;
36 import android.os.Debug;
37 import android.os.IBinder;
38 import android.os.IInterface;
39 import android.os.ParcelFileDescriptor;
40 import android.os.PersistableBundle;
41 
42 import com.android.internal.app.IVoiceInteractor;
43 import com.android.internal.content.ReferrerIntent;
44 
45 import java.util.List;
46 import java.util.Map;
47 
48 /**
49  * System private API for communicating with the application.  This is given to
50  * the activity manager by an application  when it starts up, for the activity
51  * manager to tell the application about things it needs to do.
52  *
53  * {@hide}
54  */
55 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)56     void scheduleReceiver(in Intent intent, in ActivityInfo info,
57             in CompatibilityInfo compatInfo,
58             int resultCode, in String data, in Bundle extras, boolean sync,
59             int sendingUser, int processState);
scheduleCreateService(IBinder token, in ServiceInfo info, in CompatibilityInfo compatInfo, int processState)60     void scheduleCreateService(IBinder token, in ServiceInfo info,
61             in CompatibilityInfo compatInfo, int processState);
scheduleStopService(IBinder token)62     void scheduleStopService(IBinder token);
bindApplication(in String packageName, in ApplicationInfo info, in List<ProviderInfo> providers, 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, boolean isAutofillCompatEnabled)63     void bindApplication(in String packageName, in ApplicationInfo info,
64             in List<ProviderInfo> providers, in ComponentName testName,
65             in ProfilerInfo profilerInfo, in Bundle testArguments,
66             IInstrumentationWatcher testWatcher, IUiAutomationConnection uiAutomationConnection,
67             int debugMode, boolean enableBinderTracking, boolean trackAllocation,
68             boolean restrictedBackupMode, boolean persistent, in Configuration config,
69             in CompatibilityInfo compatInfo, in Map services,
70             in Bundle coreSettings, in String buildSerial, boolean isAutofillCompatEnabled);
runIsolatedEntryPoint(in String entryPoint, in String[] entryPointArgs)71     void runIsolatedEntryPoint(in String entryPoint, in String[] entryPointArgs);
scheduleExit()72     void scheduleExit();
scheduleServiceArgs(IBinder token, in ParceledListSlice args)73     void scheduleServiceArgs(IBinder token, in ParceledListSlice args);
updateTimeZone()74     void updateTimeZone();
processInBackground()75     void processInBackground();
scheduleBindService(IBinder token, in Intent intent, boolean rebind, int processState)76     void scheduleBindService(IBinder token,
77             in Intent intent, boolean rebind, int processState);
scheduleUnbindService(IBinder token, in Intent intent)78     void scheduleUnbindService(IBinder token,
79             in Intent intent);
dumpService(in ParcelFileDescriptor fd, IBinder servicetoken, in String[] args)80     void dumpService(in ParcelFileDescriptor fd, IBinder servicetoken,
81             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)82     void scheduleRegisteredReceiver(IIntentReceiver receiver, in Intent intent,
83             int resultCode, in String data, in Bundle extras, boolean ordered,
84             boolean sticky, int sendingUser, int processState);
scheduleLowMemory()85     void scheduleLowMemory();
scheduleSleeping(IBinder token, boolean sleeping)86     void scheduleSleeping(IBinder token, boolean sleeping);
profilerControl(boolean start, in ProfilerInfo profilerInfo, int profileType)87     void profilerControl(boolean start, in ProfilerInfo profilerInfo, int profileType);
setSchedulingGroup(int group)88     void setSchedulingGroup(int group);
scheduleCreateBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo, int backupMode)89     void scheduleCreateBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo,
90             int backupMode);
scheduleDestroyBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo)91     void scheduleDestroyBackupAgent(in ApplicationInfo app,
92             in CompatibilityInfo compatInfo);
scheduleOnNewActivityOptions(IBinder token, in Bundle options)93     void scheduleOnNewActivityOptions(IBinder token, in Bundle options);
scheduleSuicide()94     void scheduleSuicide();
dispatchPackageBroadcast(int cmd, in String[] packages)95     void dispatchPackageBroadcast(int cmd, in String[] packages);
scheduleCrash(in String msg)96     void scheduleCrash(in String msg);
dumpHeap(boolean managed, boolean mallocInfo, boolean runGc, in String path, in ParcelFileDescriptor fd)97     void dumpHeap(boolean managed, boolean mallocInfo, boolean runGc, in String path,
98             in ParcelFileDescriptor fd);
dumpActivity(in ParcelFileDescriptor fd, IBinder servicetoken, in String prefix, in String[] args)99     void dumpActivity(in ParcelFileDescriptor fd, IBinder servicetoken, in String prefix,
100             in String[] args);
clearDnsCache()101     void clearDnsCache();
setHttpProxy(in String proxy, in String port, in String exclList, in Uri pacFileUrl)102     void setHttpProxy(in String proxy, in String port, in String exclList,
103             in Uri pacFileUrl);
setCoreSettings(in Bundle coreSettings)104     void setCoreSettings(in Bundle coreSettings);
updatePackageCompatibilityInfo(in String pkg, in CompatibilityInfo info)105     void updatePackageCompatibilityInfo(in String pkg, in CompatibilityInfo info);
scheduleTrimMemory(int level)106     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)107     void dumpMemInfo(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem, boolean checkin,
108             boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable,
109             in String[] args);
dumpMemInfoProto(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem, boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable, in String[] args)110     void dumpMemInfoProto(in ParcelFileDescriptor fd, in Debug.MemoryInfo mem,
111             boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly, boolean dumpUnreachable,
112             in String[] args);
dumpGfxInfo(in ParcelFileDescriptor fd, in String[] args)113     void dumpGfxInfo(in ParcelFileDescriptor fd, in String[] args);
dumpProvider(in ParcelFileDescriptor fd, IBinder servicetoken, in String[] args)114     void dumpProvider(in ParcelFileDescriptor fd, IBinder servicetoken,
115             in String[] args);
dumpDbInfo(in ParcelFileDescriptor fd, in String[] args)116     void dumpDbInfo(in ParcelFileDescriptor fd, in String[] args);
unstableProviderDied(IBinder provider)117     void unstableProviderDied(IBinder provider);
requestAssistContextExtras(IBinder activityToken, IBinder requestToken, int requestType, int sessionId, int flags)118     void requestAssistContextExtras(IBinder activityToken, IBinder requestToken,
119             int requestType, int sessionId, int flags);
scheduleTranslucentConversionComplete(IBinder token, boolean timeout)120     void scheduleTranslucentConversionComplete(IBinder token, boolean timeout);
setProcessState(int state)121     void setProcessState(int state);
scheduleInstallProvider(in ProviderInfo provider)122     void scheduleInstallProvider(in ProviderInfo provider);
updateTimePrefs(int timeFormatPreference)123     void updateTimePrefs(int timeFormatPreference);
scheduleEnterAnimationComplete(IBinder token)124     void scheduleEnterAnimationComplete(IBinder token);
notifyCleartextNetwork(in byte[] firstPacket)125     void notifyCleartextNetwork(in byte[] firstPacket);
startBinderTracking()126     void startBinderTracking();
stopBinderTrackingAndDump(in ParcelFileDescriptor fd)127     void stopBinderTrackingAndDump(in ParcelFileDescriptor fd);
scheduleLocalVoiceInteractionStarted(IBinder token, IVoiceInteractor voiceInteractor)128     void scheduleLocalVoiceInteractionStarted(IBinder token,
129             IVoiceInteractor voiceInteractor);
handleTrustStorageUpdate()130     void handleTrustStorageUpdate();
attachAgent(String path)131     void attachAgent(String path);
scheduleApplicationInfoChanged(in ApplicationInfo ai)132     void scheduleApplicationInfoChanged(in ApplicationInfo ai);
setNetworkBlockSeq(long procStateSeq)133     void setNetworkBlockSeq(long procStateSeq);
scheduleTransaction(in ClientTransaction transaction)134     void scheduleTransaction(in ClientTransaction transaction);
135 }
136