Jeff Brown | 13014b5 | 2014-04-07 19:45:27 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 | |
Jeff Brown | 061ea99 | 2015-04-17 19:55:47 -0700 | [diff] [blame] | 19 | import android.annotation.NonNull; |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 20 | import android.annotation.Nullable; |
Wale Ogunwale | 5378374 | 2018-09-16 10:21:51 -0700 | [diff] [blame] | 21 | import android.content.ComponentName; |
Wale Ogunwale | ee6eca1 | 2018-09-19 20:37:53 -0700 | [diff] [blame] | 22 | import android.content.IIntentReceiver; |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 23 | import android.content.IIntentSender; |
Makoto Onuki | ea11db1 | 2016-06-24 15:17:44 -0700 | [diff] [blame] | 24 | import android.content.Intent; |
Wale Ogunwale | 342fbe9 | 2018-10-09 08:44:10 -0700 | [diff] [blame] | 25 | import android.content.pm.ActivityInfo; |
Wale Ogunwale | a6191b4 | 2018-05-09 07:41:32 -0700 | [diff] [blame] | 26 | import android.content.pm.ApplicationInfo; |
Wale Ogunwale | 86b7446 | 2018-07-02 08:42:43 -0700 | [diff] [blame] | 27 | import android.content.pm.UserInfo; |
Wale Ogunwale | ee6eca1 | 2018-09-19 20:37:53 -0700 | [diff] [blame] | 28 | import android.os.Bundle; |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 29 | import android.os.IBinder; |
Wale Ogunwale | ee6eca1 | 2018-09-19 20:37:53 -0700 | [diff] [blame] | 30 | import android.os.TransactionTooLargeException; |
Jorim Jaggi | bc2aabe | 2018-03-08 17:27:43 +0100 | [diff] [blame] | 31 | import android.view.RemoteAnimationAdapter; |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 32 | |
Wale Ogunwale | 9e4f3e0 | 2018-05-17 09:35:39 -0700 | [diff] [blame] | 33 | import java.util.ArrayList; |
Amith Yamasani | e8222e5 | 2016-04-08 15:28:47 -0700 | [diff] [blame] | 34 | import java.util.List; |
| 35 | |
Jeff Brown | 13014b5 | 2014-04-07 19:45:27 -0700 | [diff] [blame] | 36 | /** |
| 37 | * Activity manager local system service interface. |
| 38 | * |
| 39 | * @hide Only for use within the system server. |
| 40 | */ |
| 41 | public abstract class ActivityManagerInternal { |
Jorim Jaggi | 275561a | 2016-02-23 10:11:02 -0500 | [diff] [blame] | 42 | |
Winson Chung | ec1ef09 | 2017-10-25 16:22:34 -0700 | [diff] [blame] | 43 | |
Wale Ogunwale | a6191b4 | 2018-05-09 07:41:32 -0700 | [diff] [blame] | 44 | // Access modes for handleIncomingUser. |
| 45 | public static final int ALLOW_NON_FULL = 0; |
| 46 | public static final int ALLOW_NON_FULL_IN_PROFILE = 1; |
| 47 | public static final int ALLOW_FULL_ONLY = 2; |
| 48 | |
Winson Chung | ec1ef09 | 2017-10-25 16:22:34 -0700 | [diff] [blame] | 49 | /** |
Jeff Sharkey | 923e0b8 | 2016-11-16 17:22:48 -0700 | [diff] [blame] | 50 | * Verify that calling app has access to the given provider. |
| 51 | */ |
| 52 | public abstract String checkContentProviderAccess(String authority, int userId); |
| 53 | |
Jeff Brown | 13014b5 | 2014-04-07 19:45:27 -0700 | [diff] [blame] | 54 | // Called by the power manager. |
Jeff Brown | fbe9670 | 2014-11-19 18:30:58 -0800 | [diff] [blame] | 55 | public abstract void onWakefulnessChanged(int wakefulness); |
| 56 | |
Sudheer Shanka | f669010 | 2017-10-16 10:20:32 -0700 | [diff] [blame] | 57 | /** |
| 58 | * @return {@code true} if process start is successful, {@code false} otherwise. |
| 59 | */ |
| 60 | public abstract boolean startIsolatedProcess(String entryPoint, String[] mainArgs, |
Primiano Tucci | 810c052 | 2014-07-25 18:03:16 +0100 | [diff] [blame] | 61 | String processName, String abiOverride, int uid, Runnable crashHandler); |
Jeff Brown | 061ea99 | 2015-04-17 19:55:47 -0700 | [diff] [blame] | 62 | |
| 63 | /** |
Rubin Xu | f8451b9 | 2016-04-01 15:50:58 +0100 | [diff] [blame] | 64 | * Kill foreground apps from the specified user. |
| 65 | */ |
| 66 | public abstract void killForegroundAppsForUser(int userHandle); |
Felipe Leme | a1b79bf | 2016-05-24 13:06:54 -0700 | [diff] [blame] | 67 | |
| 68 | /** |
| 69 | * Sets how long a {@link PendingIntent} can be temporarily whitelist to by bypass restrictions |
| 70 | * such as Power Save mode. |
| 71 | */ |
Dianne Hackborn | 9830552 | 2017-05-05 17:53:53 -0700 | [diff] [blame] | 72 | public abstract void setPendingIntentWhitelistDuration(IIntentSender target, |
| 73 | IBinder whitelistToken, long duration); |
Suprabh Shukla | 6472501 | 2016-06-15 13:19:28 -0700 | [diff] [blame] | 74 | |
| 75 | /** |
Michal Karpinski | ac116df | 2018-12-10 17:51:42 +0000 | [diff] [blame] | 76 | * Allows for a {@link PendingIntent} to be whitelisted to start activities from background. |
| 77 | */ |
| 78 | public abstract void setPendingIntentAllowBgActivityStarts( |
| 79 | IIntentSender target, IBinder whitelistToken, int flags); |
| 80 | |
| 81 | /** |
Dianne Hackborn | 85e3564 | 2017-01-12 15:10:57 -0800 | [diff] [blame] | 82 | * Allow DeviceIdleController to tell us about what apps are whitelisted. |
| 83 | */ |
Makoto Onuki | af8ff4f | 2018-06-04 14:44:19 -0700 | [diff] [blame] | 84 | public abstract void setDeviceIdleWhitelist(int[] allAppids, int[] exceptIdleAppids); |
Dianne Hackborn | 85e3564 | 2017-01-12 15:10:57 -0800 | [diff] [blame] | 85 | |
| 86 | /** |
| 87 | * Update information about which app IDs are on the temp whitelist. |
| 88 | */ |
| 89 | public abstract void updateDeviceIdleTempWhitelist(int[] appids, int changingAppId, |
| 90 | boolean adding); |
| 91 | |
| 92 | /** |
Makoto Onuki | 33525d2 | 2016-08-03 15:45:24 -0700 | [diff] [blame] | 93 | * Get the procstate for the UID. The return value will be between |
| 94 | * {@link ActivityManager#MIN_PROCESS_STATE} and {@link ActivityManager#MAX_PROCESS_STATE}. |
| 95 | * Note if the UID doesn't exist, it'll return {@link ActivityManager#PROCESS_STATE_NONEXISTENT} |
| 96 | * (-1). |
| 97 | */ |
| 98 | public abstract int getUidProcessState(int uid); |
Jorim Jaggi | fe76234 | 2016-10-13 14:33:27 +0200 | [diff] [blame] | 99 | |
| 100 | /** |
Sudheer Shanka | fc46e9b | 2016-10-21 17:55:27 -0700 | [diff] [blame] | 101 | * @return {@code true} if system is ready, {@code false} otherwise. |
| 102 | */ |
| 103 | public abstract boolean isSystemReady(); |
Jorim Jaggi | e69c931 | 2016-10-31 18:24:38 -0700 | [diff] [blame] | 104 | |
| 105 | /** |
Wale Ogunwale | d993a57 | 2017-02-05 13:52:09 -0800 | [diff] [blame] | 106 | * Sets if the given pid has an overlay UI or not. |
| 107 | * |
| 108 | * @param pid The pid we are setting overlay UI for. |
| 109 | * @param hasOverlayUi True if the process has overlay UI. |
| 110 | * @see android.view.WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY |
| 111 | */ |
| 112 | public abstract void setHasOverlayUi(int pid, boolean hasOverlayUi); |
Sudheer Shanka | e736185 | 2017-03-07 11:51:46 -0800 | [diff] [blame] | 113 | |
| 114 | /** |
Jorim Jaggi | bc2aabe | 2018-03-08 17:27:43 +0100 | [diff] [blame] | 115 | * Sets if the given pid is currently running a remote animation, which is taken a signal for |
| 116 | * determining oom adjustment and scheduling behavior. |
| 117 | * |
| 118 | * @param pid The pid we are setting overlay UI for. |
| 119 | * @param runningRemoteAnimation True if the process is running a remote animation, false |
| 120 | * otherwise. |
| 121 | * @see RemoteAnimationAdapter |
| 122 | */ |
| 123 | public abstract void setRunningRemoteAnimation(int pid, boolean runningRemoteAnimation); |
| 124 | |
| 125 | /** |
Sudheer Shanka | e736185 | 2017-03-07 11:51:46 -0800 | [diff] [blame] | 126 | * Called after the network policy rules are updated by |
| 127 | * {@link com.android.server.net.NetworkPolicyManagerService} for a specific {@param uid} and |
| 128 | * {@param procStateSeq}. |
| 129 | */ |
| 130 | public abstract void notifyNetworkPolicyRulesUpdated(int uid, long procStateSeq); |
Karthik Ravi Shankar | 99493db | 2017-03-08 18:30:19 -0800 | [diff] [blame] | 131 | |
| 132 | /** |
Makoto Onuki | e098b759 | 2017-11-27 17:50:41 -0800 | [diff] [blame] | 133 | * @return true if runtime was restarted, false if it's normal boot |
| 134 | */ |
| 135 | public abstract boolean isRuntimeRestarted(); |
Felipe Leme | 2a580d1 | 2017-12-11 14:37:35 -0800 | [diff] [blame] | 136 | |
| 137 | /** |
Alex Chau | b6ef869 | 2018-01-09 14:16:36 +0000 | [diff] [blame] | 138 | * Returns if more users can be started without stopping currently running users. |
| 139 | */ |
| 140 | public abstract boolean canStartMoreUsers(); |
Alex Chau | 93ae42b | 2018-01-11 15:10:12 +0000 | [diff] [blame] | 141 | |
| 142 | /** |
| 143 | * Sets the user switcher message for switching from {@link android.os.UserHandle#SYSTEM}. |
| 144 | */ |
| 145 | public abstract void setSwitchingFromSystemUserMessage(String switchingFromSystemUserMessage); |
| 146 | |
| 147 | /** |
| 148 | * Sets the user switcher message for switching to {@link android.os.UserHandle#SYSTEM}. |
| 149 | */ |
| 150 | public abstract void setSwitchingToSystemUserMessage(String switchingToSystemUserMessage); |
Alex Chau | c12189b | 2018-01-16 15:01:15 +0000 | [diff] [blame] | 151 | |
| 152 | /** |
| 153 | * Returns maximum number of users that can run simultaneously. |
| 154 | */ |
| 155 | public abstract int getMaxRunningUsers(); |
Tony Mak | e839d70 | 2018-01-22 15:34:46 +0000 | [diff] [blame] | 156 | |
| 157 | /** |
Makoto Onuki | e491821 | 2018-02-06 11:30:15 -0800 | [diff] [blame] | 158 | * Whether an UID is active or idle. |
| 159 | */ |
| 160 | public abstract boolean isUidActive(int uid); |
Rajeev Kumar | 22d92b7 | 2018-02-07 18:38:36 -0800 | [diff] [blame] | 161 | |
| 162 | /** |
| 163 | * Returns a list that contains the memory stats for currently running processes. |
Rafal Slawik | 0862158 | 2018-10-15 14:53:07 +0100 | [diff] [blame] | 164 | * |
| 165 | * Only processes managed by ActivityManagerService are included. |
Rajeev Kumar | 22d92b7 | 2018-02-07 18:38:36 -0800 | [diff] [blame] | 166 | */ |
| 167 | public abstract List<ProcessMemoryState> getMemoryStateForProcesses(); |
Wale Ogunwale | a6191b4 | 2018-05-09 07:41:32 -0700 | [diff] [blame] | 168 | |
| 169 | /** |
Rafal Slawik | 3bea895 | 2018-11-15 12:39:33 +0000 | [diff] [blame] | 170 | * Returns a list that contains the memory high-water mark for currently running processes. |
| 171 | * |
| 172 | * Only processes managed by ActivityManagerService are included. |
| 173 | */ |
| 174 | public abstract List<ProcessMemoryHighWaterMark> getMemoryHighWaterMarkForProcesses(); |
| 175 | |
| 176 | /** |
Wale Ogunwale | a6191b4 | 2018-05-09 07:41:32 -0700 | [diff] [blame] | 177 | * Checks to see if the calling pid is allowed to handle the user. Returns adjusted user id as |
| 178 | * needed. |
| 179 | */ |
| 180 | public abstract int handleIncomingUser(int callingPid, int callingUid, int userId, |
| 181 | boolean allowAll, int allowMode, String name, String callerPackage); |
| 182 | |
| 183 | /** Checks if the calling binder pid as the permission. */ |
| 184 | public abstract void enforceCallingPermission(String permission, String func); |
| 185 | |
| 186 | /** Returns the current user id. */ |
| 187 | public abstract int getCurrentUserId(); |
| 188 | |
| 189 | /** Returns true if the user is running. */ |
| 190 | public abstract boolean isUserRunning(int userId, int flags); |
| 191 | |
| 192 | /** Trims memory usage in the system by removing/stopping unused application processes. */ |
| 193 | public abstract void trimApplications(); |
| 194 | |
Wale Ogunwale | 9e4f3e0 | 2018-05-17 09:35:39 -0700 | [diff] [blame] | 195 | /** Kill the processes in the list due to their tasks been removed. */ |
| 196 | public abstract void killProcessesForRemovedTask(ArrayList<Object> procsToKill); |
| 197 | |
| 198 | /** |
| 199 | * Returns {@code true} if {@code uid} is running an activity from {@code packageName}. |
| 200 | */ |
| 201 | public abstract boolean hasRunningActivity(int uid, @Nullable String packageName); |
Wale Ogunwale | f673393 | 2018-06-27 05:14:34 -0700 | [diff] [blame] | 202 | |
| 203 | public abstract void updateOomAdj(); |
Wale Ogunwale | 5378374 | 2018-09-16 10:21:51 -0700 | [diff] [blame] | 204 | public abstract void updateCpuStats(); |
Hui Yu | 03d1240 | 2018-12-06 18:00:37 -0800 | [diff] [blame] | 205 | |
| 206 | /** |
| 207 | * Update battery stats on activity usage. |
| 208 | * @param activity |
| 209 | * @param uid |
| 210 | * @param userId |
| 211 | * @param started |
| 212 | */ |
| 213 | public abstract void updateBatteryStats( |
Wale Ogunwale | 5378374 | 2018-09-16 10:21:51 -0700 | [diff] [blame] | 214 | ComponentName activity, int uid, int userId, boolean resumed); |
Hui Yu | 03d1240 | 2018-12-06 18:00:37 -0800 | [diff] [blame] | 215 | |
| 216 | /** |
| 217 | * Update UsageStats of the activity. |
| 218 | * @param activity |
| 219 | * @param userId |
| 220 | * @param event |
| 221 | * @param appToken ActivityRecord's appToken. |
Michael Wachenschwanz | 0b4ab1f | 2019-01-07 13:59:10 -0800 | [diff] [blame] | 222 | * @param taskRoot TaskRecord's root |
Hui Yu | 03d1240 | 2018-12-06 18:00:37 -0800 | [diff] [blame] | 223 | */ |
| 224 | public abstract void updateActivityUsageStats( |
Michael Wachenschwanz | 0b4ab1f | 2019-01-07 13:59:10 -0800 | [diff] [blame] | 225 | ComponentName activity, int userId, int event, IBinder appToken, |
| 226 | ComponentName taskRoot); |
Wale Ogunwale | 5378374 | 2018-09-16 10:21:51 -0700 | [diff] [blame] | 227 | public abstract void updateForegroundTimeIfOnBattery( |
| 228 | String packageName, int uid, long cpuTimeDiff); |
Wale Ogunwale | f673393 | 2018-06-27 05:14:34 -0700 | [diff] [blame] | 229 | public abstract void sendForegroundProfileChanged(int userId); |
Wale Ogunwale | 86b7446 | 2018-07-02 08:42:43 -0700 | [diff] [blame] | 230 | |
| 231 | /** |
| 232 | * Returns whether the given user requires credential entry at this time. This is used to |
| 233 | * intercept activity launches for work apps when the Work Challenge is present. |
| 234 | */ |
| 235 | public abstract boolean shouldConfirmCredentials(int userId); |
Jorim Jaggi | 402d78e | 2018-07-09 17:57:10 +0200 | [diff] [blame] | 236 | |
Wale Ogunwale | 86b7446 | 2018-07-02 08:42:43 -0700 | [diff] [blame] | 237 | public abstract int[] getCurrentProfileIds(); |
| 238 | public abstract UserInfo getCurrentUser(); |
| 239 | public abstract void ensureNotSpecialUser(int userId); |
| 240 | public abstract boolean isCurrentProfile(int userId); |
| 241 | public abstract boolean hasStartedUserState(int userId); |
| 242 | public abstract void finishUserSwitch(Object uss); |
Wale Ogunwale | 906f9c6 | 2018-07-23 11:23:44 -0700 | [diff] [blame] | 243 | |
| 244 | /** Schedule the execution of all pending app GCs. */ |
| 245 | public abstract void scheduleAppGcs(); |
Felipe Leme | 8d7f7f4 | 2018-07-31 16:14:39 -0700 | [diff] [blame] | 246 | |
| 247 | /** Gets the task id for a given activity. */ |
| 248 | public abstract int getTaskIdForActivity(@NonNull IBinder token, boolean onlyRoot); |
Wale Ogunwale | 5378374 | 2018-09-16 10:21:51 -0700 | [diff] [blame] | 249 | |
| 250 | public abstract void setBooting(boolean booting); |
| 251 | public abstract boolean isBooting(); |
| 252 | public abstract void setBooted(boolean booted); |
| 253 | public abstract boolean isBooted(); |
| 254 | public abstract void finishBooting(); |
Wale Ogunwale | ee6eca1 | 2018-09-19 20:37:53 -0700 | [diff] [blame] | 255 | |
| 256 | public abstract void tempWhitelistForPendingIntent(int callerPid, int callerUid, int targetUid, |
| 257 | long duration, String tag); |
| 258 | public abstract int broadcastIntentInPackage(String packageName, int uid, Intent intent, |
| 259 | String resolvedType, IIntentReceiver resultTo, int resultCode, String resultData, |
| 260 | Bundle resultExtras, String requiredPermission, Bundle bOptions, boolean serialized, |
Michal Karpinski | ac116df | 2018-12-10 17:51:42 +0000 | [diff] [blame] | 261 | boolean sticky, int userId, boolean allowBackgroundActivityStarts); |
Wale Ogunwale | ee6eca1 | 2018-09-19 20:37:53 -0700 | [diff] [blame] | 262 | public abstract ComponentName startServiceInPackage(int uid, Intent service, |
Michal Karpinski | c8aa91b | 2019-01-10 16:45:59 +0000 | [diff] [blame] | 263 | String resolvedType, boolean fgRequired, String callingPackage, int userId, |
| 264 | boolean allowBackgroundActivityStarts) throws TransactionTooLargeException; |
Wale Ogunwale | c4e63a4 | 2018-10-02 13:19:54 -0700 | [diff] [blame] | 265 | |
| 266 | public abstract void disconnectActivityFromServices(Object connectionHolder); |
Wale Ogunwale | 342fbe9 | 2018-10-09 08:44:10 -0700 | [diff] [blame] | 267 | public abstract void cleanUpServices(int userId, ComponentName component, Intent baseIntent); |
| 268 | public abstract ActivityInfo getActivityInfoForUser(ActivityInfo aInfo, int userId); |
| 269 | public abstract void ensureBootCompleted(); |
| 270 | public abstract void updateOomLevelsForDisplay(int displayId); |
| 271 | public abstract boolean isActivityStartsLoggingEnabled(); |
Michal Karpinski | 8596ded | 2018-11-14 14:43:48 +0000 | [diff] [blame] | 272 | /** Returns true if the background activity starts is enabled. */ |
| 273 | public abstract boolean isBackgroundActivityStartsEnabled(); |
Wale Ogunwale | 342fbe9 | 2018-10-09 08:44:10 -0700 | [diff] [blame] | 274 | public abstract void reportCurKeyguardUsageEvent(boolean keyguardShowing); |
Wale Ogunwale | 51cc98a | 2018-10-15 10:41:05 -0700 | [diff] [blame] | 275 | |
| 276 | /** Input dispatch timeout to a window, start the ANR process. */ |
| 277 | public abstract long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason); |
| 278 | public abstract boolean inputDispatchingTimedOut(Object proc, String activityShortComponentName, |
| 279 | ApplicationInfo aInfo, String parentShortComponentName, Object parentProc, |
| 280 | boolean aboveSystem, String reason); |
Wale Ogunwale | 2ea36d4 | 2018-10-18 10:27:31 -0700 | [diff] [blame] | 281 | |
| 282 | /** |
| 283 | * Sends {@link android.content.Intent#ACTION_CONFIGURATION_CHANGED} with all the appropriate |
| 284 | * flags. |
| 285 | */ |
| 286 | public abstract void broadcastGlobalConfigurationChanged(int changes, boolean initLocale); |
| 287 | |
| 288 | /** |
| 289 | * Sends {@link android.content.Intent#ACTION_CLOSE_SYSTEM_DIALOGS} with all the appropriate |
| 290 | * flags. |
| 291 | */ |
| 292 | public abstract void broadcastCloseSystemDialogs(String reason); |
Wale Ogunwale | 5c91870 | 2018-10-18 11:06:33 -0700 | [diff] [blame] | 293 | |
| 294 | /** |
| 295 | * Kills all background processes, except those matching any of the specified properties. |
| 296 | * |
| 297 | * @param minTargetSdk the target SDK version at or above which to preserve processes, |
| 298 | * or {@code -1} to ignore the target SDK |
| 299 | * @param maxProcState the process state at or below which to preserve processes, |
| 300 | * or {@code -1} to ignore the process state |
| 301 | */ |
| 302 | public abstract void killAllBackgroundProcessesExcept(int minTargetSdk, int maxProcState); |
| 303 | |
| 304 | /** Starts a given process. */ |
| 305 | public abstract void startProcess(String processName, ApplicationInfo info, |
| 306 | boolean knownToBeDead, String hostingType, ComponentName hostingName); |
Wale Ogunwale | 7056a06 | 2018-10-18 15:02:50 -0700 | [diff] [blame] | 307 | |
Vishnu Nair | 006ee3f | 2018-11-09 08:36:01 -0800 | [diff] [blame] | 308 | /** Starts up the starting activity process for debugging if needed. |
| 309 | * This function needs to be called synchronously from WindowManager context so the caller |
| 310 | * passes a lock {@code wmLock} and waits to be notified. |
| 311 | * |
| 312 | * @param wmLock calls {@code notify} on the object to wake up the caller. |
| 313 | */ |
Wale Ogunwale | 7056a06 | 2018-10-18 15:02:50 -0700 | [diff] [blame] | 314 | public abstract void setDebugFlagsForStartingActivity(ActivityInfo aInfo, int startFlags, |
Vishnu Nair | 006ee3f | 2018-11-09 08:36:01 -0800 | [diff] [blame] | 315 | ProfilerInfo profilerInfo, Object wmLock); |
Sudheer Shanka | 87915d6 | 2018-11-06 10:57:35 -0800 | [diff] [blame] | 316 | |
Sudheer Shanka | 3a0df3b | 2018-12-12 12:43:43 -0800 | [diff] [blame] | 317 | /** Returns mount mode for process running with given pid */ |
| 318 | public abstract int getStorageMountMode(int pid, int uid); |
Varun Shah | 98c84e1 | 2019-01-03 19:24:24 -0800 | [diff] [blame] | 319 | |
| 320 | /** Returns true if the given uid is the app in the foreground. */ |
| 321 | public abstract boolean isAppForeground(int uid); |
Chandan Nath | 2c9ae09 | 2019-01-15 12:54:28 +0000 | [diff] [blame] | 322 | |
| 323 | /** Remove pending backup for the given userId. */ |
| 324 | public abstract void clearPendingBackup(int userId); |
Hui Yu | b1d243a | 2018-12-13 12:02:00 -0800 | [diff] [blame] | 325 | |
| 326 | /** |
| 327 | * When power button is very long pressed, call this interface to do some pre-shutdown work |
| 328 | * like persisting database etc. |
| 329 | */ |
| 330 | public abstract void prepareForPossibleShutdown(); |
Jeff Brown | 13014b5 | 2014-04-07 19:45:27 -0700 | [diff] [blame] | 331 | } |