| 1 |
/* |
| 2 |
* Copyright (C) 2020 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.ActivityManager; |
| 20 |
import android.app.ICompatCameraControlCallback; |
| 21 |
import android.app.IRequestFinishCallback; |
| 22 |
import android.app.PictureInPictureParams; |
| 23 |
import android.content.ComponentName; |
| 24 |
import android.content.Intent; |
| 25 |
import android.content.res.Configuration; |
| 26 |
import android.os.Bundle; |
| 27 |
import android.os.PersistableBundle; |
| 28 |
import android.view.RemoteAnimationDefinition; |
| 29 |
import android.window.SizeConfigurationBuckets; |
| 30 |
|
| 31 |
import com.android.internal.policy.IKeyguardDismissCallback; |
| 32 |
|
| 33 |
/** |
| 34 |
* Interface for the callback and request from an activity to system. |
| 35 |
* |
| 36 |
* {@hide} |
| 37 |
*/ |
| 38 |
interface IActivityClientController { |
| 39 |
oneway void activityIdle(in IBinder token, in Configuration config, in boolean stopProfiling); |
| 40 |
oneway void activityResumed(in IBinder token, in boolean handleSplashScreenExit); |
| 41 |
oneway void activityRefreshed(in IBinder token); |
| 42 |
/** |
| 43 |
* This call is not one-way because {@link #activityPaused()) is not one-way, or |
| 44 |
* the top-resumed-lost could be reported after activity paused. |
| 45 |
*/ |
| 46 |
void activityTopResumedStateLost(); |
| 47 |
/** |
| 48 |
* Notifies that the activity has completed paused. This call is not one-way because it can make |
| 49 |
* consecutive launch in the same process more coherent. About the order of binder call, it |
| 50 |
* should be fine with other one-way calls because if pause hasn't completed on the server side, |
| 51 |
* there won't be other lifecycle changes. |
| 52 |
*/ |
| 53 |
void activityPaused(in IBinder token); |
| 54 |
oneway void activityStopped(in IBinder token, in Bundle state, |
| 55 |
in PersistableBundle persistentState, in CharSequence description); |
| 56 |
oneway void activityDestroyed(in IBinder token); |
| 57 |
oneway void activityLocalRelaunch(in IBinder token); |
| 58 |
oneway void activityRelaunched(in IBinder token); |
| 59 |
|
| 60 |
oneway void reportSizeConfigurations(in IBinder token, |
| 61 |
in SizeConfigurationBuckets sizeConfigurations); |
| 62 |
boolean moveActivityTaskToBack(in IBinder token, boolean nonRoot); |
| 63 |
boolean shouldUpRecreateTask(in IBinder token, in String destAffinity); |
| 64 |
boolean navigateUpTo(in IBinder token, in Intent target, in String resolvedType, |
| 65 |
int resultCode, in Intent resultData); |
| 66 |
boolean releaseActivityInstance(in IBinder token); |
| 67 |
boolean finishActivity(in IBinder token, int code, in Intent data, int finishTask); |
| 68 |
boolean finishActivityAffinity(in IBinder token); |
| 69 |
/** Finish all activities that were started for result from the specified activity. */ |
| 70 |
void finishSubActivity(in IBinder token, in String resultWho, int requestCode); |
| 71 |
/** |
| 72 |
* Indicates that when the activity finsihes, the result should be immediately sent to the |
| 73 |
* originating activity. Must only be invoked during MediaProjection setup. |
| 74 |
*/ |
| 75 |
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_MEDIA_PROJECTION)") |
| 76 |
void setForceSendResultForMediaProjection(in IBinder token); |
| 77 |
|
| 78 |
boolean isTopOfTask(in IBinder token); |
| 79 |
boolean willActivityBeVisible(in IBinder token); |
| 80 |
int getDisplayId(in IBinder activityToken); |
| 81 |
int getTaskForActivity(in IBinder token, in boolean onlyRoot); |
| 82 |
/** |
| 83 |
* Returns the {@link Configuration} of the task which hosts the Activity, or {@code null} if |
| 84 |
* the task {@link Configuration} cannot be obtained. |
| 85 |
*/ |
| 86 |
Configuration getTaskConfiguration(in IBinder activityToken); |
| 87 |
IBinder getActivityTokenBelow(IBinder token); |
| 88 |
ComponentName getCallingActivity(in IBinder token); |
| 89 |
String getCallingPackage(in IBinder token); |
| 90 |
int getLaunchedFromUid(in IBinder token); |
| 91 |
String getLaunchedFromPackage(in IBinder token); |
| 92 |
|
| 93 |
void setRequestedOrientation(in IBinder token, int requestedOrientation); |
| 94 |
int getRequestedOrientation(in IBinder token); |
| 95 |
|
| 96 |
boolean convertFromTranslucent(in IBinder token); |
| 97 |
boolean convertToTranslucent(in IBinder token, in Bundle options); |
| 98 |
|
| 99 |
boolean isImmersive(in IBinder token); |
| 100 |
void setImmersive(in IBinder token, boolean immersive); |
| 101 |
|
| 102 |
boolean enterPictureInPictureMode(in IBinder token, in PictureInPictureParams params); |
| 103 |
void setPictureInPictureParams(in IBinder token, in PictureInPictureParams params); |
| 104 |
oneway void setShouldDockBigOverlays(in IBinder token, in boolean shouldDockBigOverlays); |
| 105 |
void toggleFreeformWindowingMode(in IBinder token); |
| 106 |
|
| 107 |
oneway void startLockTaskModeByToken(in IBinder token); |
| 108 |
oneway void stopLockTaskModeByToken(in IBinder token); |
| 109 |
oneway void showLockTaskEscapeMessage(in IBinder token); |
| 110 |
void setTaskDescription(in IBinder token, in ActivityManager.TaskDescription values); |
| 111 |
|
| 112 |
boolean showAssistFromActivity(in IBinder token, in Bundle args); |
| 113 |
boolean isRootVoiceInteraction(in IBinder token); |
| 114 |
void startLocalVoiceInteraction(in IBinder token, in Bundle options); |
| 115 |
void stopLocalVoiceInteraction(in IBinder token); |
| 116 |
|
| 117 |
oneway void setShowWhenLocked(in IBinder token, boolean showWhenLocked); |
| 118 |
oneway void setInheritShowWhenLocked(in IBinder token, boolean setInheritShownWhenLocked); |
| 119 |
oneway void setTurnScreenOn(in IBinder token, boolean turnScreenOn); |
| 120 |
oneway void reportActivityFullyDrawn(in IBinder token, boolean restoredFromBundle); |
| 121 |
/** |
| 122 |
* Overrides the animation of activity pending transition. This call is not one-way because |
| 123 |
* the method is usually used after startActivity or Activity#finish. If this is non-blocking, |
| 124 |
* the calling activity may proceed to complete pause and become stopping state, which will |
| 125 |
* cause the request to be ignored. Besides, startActivity and Activity#finish are blocking |
| 126 |
* calls, so this method should be the same as them to keep the invocation order. |
| 127 |
*/ |
| 128 |
void overridePendingTransition(in IBinder token, in String packageName, |
| 129 |
int enterAnim, int exitAnim, int backgroundColor); |
| 130 |
int setVrMode(in IBinder token, boolean enabled, in ComponentName packageName); |
| 131 |
|
| 132 |
/** See {@link android.app.Activity#setRecentsScreenshotEnabled}. */ |
| 133 |
oneway void setRecentsScreenshotEnabled(in IBinder token, boolean enabled); |
| 134 |
|
| 135 |
/** |
| 136 |
* It should only be called from home activity to remove its outdated snapshot. The home |
| 137 |
* snapshot is used to speed up entering home from screen off. If the content of home activity |
| 138 |
* is significantly different from before taking the snapshot, then the home activity can use |
| 139 |
* this method to avoid inconsistent transition. |
| 140 |
*/ |
| 141 |
void invalidateHomeTaskSnapshot(IBinder homeToken); |
| 142 |
|
| 143 |
void dismissKeyguard(in IBinder token, in IKeyguardDismissCallback callback, |
| 144 |
in CharSequence message); |
| 145 |
|
| 146 |
/** Registers remote animations for a specific activity. */ |
| 147 |
void registerRemoteAnimations(in IBinder token, in RemoteAnimationDefinition definition); |
| 148 |
|
| 149 |
/** Unregisters all remote animations for a specific activity. */ |
| 150 |
void unregisterRemoteAnimations(in IBinder token); |
| 151 |
|
| 152 |
/** |
| 153 |
* Reports that an Activity received a back key press. |
| 154 |
*/ |
| 155 |
oneway void onBackPressed(in IBinder activityToken, |
| 156 |
in IRequestFinishCallback callback); |
| 157 |
|
| 158 |
/** Reports that the splash screen view has attached to activity. */ |
| 159 |
oneway void splashScreenAttached(in IBinder token); |
| 160 |
|
| 161 |
/** |
| 162 |
* Shows or hides a Camera app compat toggle for stretched issues with the requested state. |
| 163 |
* |
| 164 |
* @param token The token for the window that needs a control. |
| 165 |
* @param showControl Whether the control should be shown or hidden. |
| 166 |
* @param transformationApplied Whether the treatment is already applied. |
| 167 |
* @param callback The callback executed when the user clicks on a control. |
| 168 |
*/ |
| 169 |
oneway void requestCompatCameraControl(in IBinder token, boolean showControl, |
| 170 |
boolean transformationApplied, in ICompatCameraControlCallback callback); |
| 171 |
} |