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.content.ComponentName;
24 import android.content.IIntentReceiver;
25 import android.content.Intent;
26 import android.content.pm.ActivityInfo;
27 import android.content.pm.ApplicationInfo;
28 import android.content.pm.ParceledListSlice;
29 import android.content.pm.ProviderInfo;
30 import android.content.pm.ServiceInfo;
31 import android.content.res.CompatibilityInfo;
32 import android.content.res.Configuration;
33 import android.net.Uri;
34 import android.os.Bundle;
35 import android.os.Debug;
36 import android.os.IBinder;
37 import android.os.IInterface;
38 import android.os.ParcelFileDescriptor;
39 import android.os.PersistableBundle;
40 
41 import com.android.internal.app.IVoiceInteractor;
42 import com.android.internal.content.ReferrerIntent;
43 
44 import java.util.List;
45 import java.util.Map;
46 
47 /**
48  * System private API for communicating with the application.  This is given to
49  * the activity manager by an application  when it starts up, for the activity
50  * manager to tell the application about things it needs to do.
51  *
52  * {@hide}
53  */
54 oneway interface IApplicationThread {
schedulePauseActivity(IBinder token, boolean finished, boolean userLeaving, int configChanges, boolean dontReport)55     void schedulePauseActivity(IBinder token, boolean finished, boolean userLeaving,
56             int configChanges, boolean dontReport);
scheduleStopActivity(IBinder token, boolean showWindow, int configChanges)57     void scheduleStopActivity(IBinder token, boolean showWindow,
58             int configChanges);
scheduleWindowVisibility(IBinder token, boolean showWindow)59     void scheduleWindowVisibility(IBinder token, boolean showWindow);
scheduleResumeActivity(IBinder token, int procState, boolean isForward, in Bundle resumeArgs)60     void scheduleResumeActivity(IBinder token, int procState, boolean isForward,
61             in Bundle resumeArgs);
scheduleSendResult(IBinder token, in List<ResultInfo> results)62     void scheduleSendResult(IBinder token, in List<ResultInfo> results);
scheduleLaunchActivity(in Intent intent, IBinder token, int ident, in ActivityInfo info, in Configuration curConfig, in Configuration overrideConfig, in CompatibilityInfo compatInfo, in String referrer, IVoiceInteractor voiceInteractor, int procState, in Bundle state, in PersistableBundle persistentState, in List<ResultInfo> pendingResults, in List<ReferrerIntent> pendingNewIntents, boolean notResumed, boolean isForward, in ProfilerInfo profilerInfo)63     void scheduleLaunchActivity(in Intent intent, IBinder token, int ident,
64             in ActivityInfo info, in Configuration curConfig, in Configuration overrideConfig,
65             in CompatibilityInfo compatInfo, in String referrer, IVoiceInteractor voiceInteractor,
66             int procState, in Bundle state, in PersistableBundle persistentState,
67             in List<ResultInfo> pendingResults, in List<ReferrerIntent> pendingNewIntents,
68             boolean notResumed, boolean isForward, in ProfilerInfo profilerInfo);
scheduleNewIntent( in List<ReferrerIntent> intent, IBinder token, boolean andPause)69     void scheduleNewIntent(
70             in List<ReferrerIntent> intent, IBinder token, boolean andPause);
scheduleDestroyActivity(IBinder token, boolean finished, int configChanges)71     void scheduleDestroyActivity(IBinder token, boolean finished,
72             int configChanges);
scheduleReceiver(in Intent intent, in ActivityInfo info, in CompatibilityInfo compatInfo, int resultCode, in String data, in Bundle extras, boolean sync, int sendingUser, int processState)73     void scheduleReceiver(in Intent intent, in ActivityInfo info,
74             in CompatibilityInfo compatInfo,
75             int resultCode, in String data, in Bundle extras, boolean sync,
76             int sendingUser, int processState);
scheduleCreateService(IBinder token, in ServiceInfo info, in CompatibilityInfo compatInfo, int processState)77     void scheduleCreateService(IBinder token, in ServiceInfo info,
78             in CompatibilityInfo compatInfo, int processState);
scheduleStopService(IBinder token)79     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)80     void bindApplication(in String packageName, in ApplicationInfo info,
81             in List<ProviderInfo> providers, 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);
scheduleExit()88     void scheduleExit();
scheduleConfigurationChanged(in Configuration config)89     void scheduleConfigurationChanged(in Configuration config);
scheduleServiceArgs(IBinder token, in ParceledListSlice args)90     void scheduleServiceArgs(IBinder token, in ParceledListSlice args);
updateTimeZone()91     void updateTimeZone();
processInBackground()92     void processInBackground();
scheduleBindService(IBinder token, in Intent intent, boolean rebind, int processState)93     void scheduleBindService(IBinder token,
94             in Intent intent, boolean rebind, int processState);
scheduleUnbindService(IBinder token, in Intent intent)95     void scheduleUnbindService(IBinder token,
96             in Intent intent);
dumpService(in ParcelFileDescriptor fd, IBinder servicetoken, in String[] args)97     void dumpService(in ParcelFileDescriptor fd, IBinder servicetoken,
98             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)99     void scheduleRegisteredReceiver(IIntentReceiver receiver, in Intent intent,
100             int resultCode, in String data, in Bundle extras, boolean ordered,
101             boolean sticky, int sendingUser, int processState);
scheduleLowMemory()102     void scheduleLowMemory();
scheduleActivityConfigurationChanged(IBinder token, in Configuration overrideConfig)103     void scheduleActivityConfigurationChanged(IBinder token, in Configuration overrideConfig);
scheduleActivityMovedToDisplay(IBinder token, int displayId, in Configuration overrideConfig)104     void scheduleActivityMovedToDisplay(IBinder token, int displayId,
105             in Configuration overrideConfig);
scheduleRelaunchActivity(IBinder token, in List<ResultInfo> pendingResults, in List<ReferrerIntent> pendingNewIntents, int configChanges, boolean notResumed, in Configuration config, in Configuration overrideConfig, boolean preserveWindow)106     void scheduleRelaunchActivity(IBinder token, in List<ResultInfo> pendingResults,
107             in List<ReferrerIntent> pendingNewIntents, int configChanges, boolean notResumed,
108             in Configuration config, in Configuration overrideConfig, boolean preserveWindow);
scheduleSleeping(IBinder token, boolean sleeping)109     void scheduleSleeping(IBinder token, boolean sleeping);
profilerControl(boolean start, in ProfilerInfo profilerInfo, int profileType)110     void profilerControl(boolean start, in ProfilerInfo profilerInfo, int profileType);
setSchedulingGroup(int group)111     void setSchedulingGroup(int group);
scheduleCreateBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo, int backupMode)112     void scheduleCreateBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo,
113             int backupMode);
scheduleDestroyBackupAgent(in ApplicationInfo app, in CompatibilityInfo compatInfo)114     void scheduleDestroyBackupAgent(in ApplicationInfo app,
115             in CompatibilityInfo compatInfo);
scheduleOnNewActivityOptions(IBinder token, in Bundle options)116     void scheduleOnNewActivityOptions(IBinder token, in Bundle options);
scheduleSuicide()117     void scheduleSuicide();
dispatchPackageBroadcast(int cmd, in String[] packages)118     void dispatchPackageBroadcast(int cmd, in String[] packages);
scheduleCrash(in String msg)119     void scheduleCrash(in String msg);
dumpHeap(boolean managed, in String path, in ParcelFileDescriptor fd)120     void dumpHeap(boolean managed, in String path, in ParcelFileDescriptor fd);
dumpActivity(in ParcelFileDescriptor fd, IBinder servicetoken, in String prefix, in String[] args)121     void dumpActivity(in ParcelFileDescriptor fd, IBinder servicetoken, in String prefix,
122             in String[] args);
clearDnsCache()123     void clearDnsCache();
setHttpProxy(in String proxy, in String port, in String exclList, in Uri pacFileUrl)124     void setHttpProxy(in String proxy, in String port, in String exclList,
125             in Uri pacFileUrl);
setCoreSettings(in Bundle coreSettings)126     void setCoreSettings(in Bundle coreSettings);
updatePackageCompatibilityInfo(in String pkg, in CompatibilityInfo info)127     void updatePackageCompatibilityInfo(in String pkg, in CompatibilityInfo info);
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);
dumpGfxInfo(in ParcelFileDescriptor fd, in String[] args)132     void dumpGfxInfo(in ParcelFileDescriptor fd, in String[] args);
dumpProvider(in ParcelFileDescriptor fd, IBinder servicetoken, in String[] args)133     void dumpProvider(in ParcelFileDescriptor fd, IBinder servicetoken,
134             in String[] args);
dumpDbInfo(in ParcelFileDescriptor fd, in String[] args)135     void dumpDbInfo(in ParcelFileDescriptor fd, in String[] args);
unstableProviderDied(IBinder provider)136     void unstableProviderDied(IBinder provider);
requestAssistContextExtras(IBinder activityToken, IBinder requestToken, int requestType, int sessionId, int flags)137     void requestAssistContextExtras(IBinder activityToken, IBinder requestToken,
138             int requestType, int sessionId, int flags);
scheduleTranslucentConversionComplete(IBinder token, boolean timeout)139     void scheduleTranslucentConversionComplete(IBinder token, boolean timeout);
setProcessState(int state)140     void setProcessState(int state);
scheduleInstallProvider(in ProviderInfo provider)141     void scheduleInstallProvider(in ProviderInfo provider);
updateTimePrefs(int timeFormatPreference)142     void updateTimePrefs(int timeFormatPreference);
scheduleCancelVisibleBehind(IBinder token)143     void scheduleCancelVisibleBehind(IBinder token);
scheduleBackgroundVisibleBehindChanged(IBinder token, boolean enabled)144     void scheduleBackgroundVisibleBehindChanged(IBinder token, boolean enabled);
scheduleEnterAnimationComplete(IBinder token)145     void scheduleEnterAnimationComplete(IBinder token);
notifyCleartextNetwork(in byte[] firstPacket)146     void notifyCleartextNetwork(in byte[] firstPacket);
startBinderTracking()147     void startBinderTracking();
stopBinderTrackingAndDump(in ParcelFileDescriptor fd)148     void stopBinderTrackingAndDump(in ParcelFileDescriptor fd);
scheduleMultiWindowModeChanged(IBinder token, boolean isInMultiWindowMode, in Configuration newConfig)149     void scheduleMultiWindowModeChanged(IBinder token, boolean isInMultiWindowMode,
150             in Configuration newConfig);
schedulePictureInPictureModeChanged(IBinder token, boolean isInPictureInPictureMode, in Configuration newConfig)151     void schedulePictureInPictureModeChanged(IBinder token, boolean isInPictureInPictureMode,
152             in Configuration newConfig);
scheduleLocalVoiceInteractionStarted(IBinder token, IVoiceInteractor voiceInteractor)153     void scheduleLocalVoiceInteractionStarted(IBinder token,
154             IVoiceInteractor voiceInteractor);
handleTrustStorageUpdate()155     void handleTrustStorageUpdate();
attachAgent(String path)156     void attachAgent(String path);
scheduleApplicationInfoChanged(in ApplicationInfo ai)157     void scheduleApplicationInfoChanged(in ApplicationInfo ai);
setNetworkBlockSeq(long procStateSeq)158     void setNetworkBlockSeq(long procStateSeq);
159 }
160