Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40285448 authored by wilsonshih's avatar wilsonshih Committed by Wei Sheng Shih
Browse files

Add NonNull annotation in ActivityManager.

Add NonNull annotation at isActivityStartAllowedOnDisplay.

Fix: 126698001
Test: build pass.

Change-Id: I46b10aeb6b83de284de35863197665da8949928f
parent 62727a76
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3944,7 +3944,7 @@ package android.app {
    method public android.app.PendingIntent getRunningServiceControlPanel(android.content.ComponentName) throws java.lang.SecurityException;
    method public android.app.PendingIntent getRunningServiceControlPanel(android.content.ComponentName) throws java.lang.SecurityException;
    method @Deprecated public java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int) throws java.lang.SecurityException;
    method @Deprecated public java.util.List<android.app.ActivityManager.RunningServiceInfo> getRunningServices(int) throws java.lang.SecurityException;
    method @Deprecated public java.util.List<android.app.ActivityManager.RunningTaskInfo> getRunningTasks(int) throws java.lang.SecurityException;
    method @Deprecated public java.util.List<android.app.ActivityManager.RunningTaskInfo> getRunningTasks(int) throws java.lang.SecurityException;
    method public boolean isActivityStartAllowedOnDisplay(android.content.Context, int, android.content.Intent);
    method public boolean isActivityStartAllowedOnDisplay(@NonNull android.content.Context, int, @NonNull android.content.Intent);
    method public boolean isBackgroundRestricted();
    method public boolean isBackgroundRestricted();
    method @Deprecated public boolean isInLockTaskMode();
    method @Deprecated public boolean isInLockTaskMode();
    method public boolean isLowRamDevice();
    method public boolean isLowRamDevice();
+2 −1
Original line number Original line Diff line number Diff line
@@ -2018,7 +2018,8 @@ public class ActivityManager {
     * @return {@code true} if a call to start an activity on the target display is allowed for the
     * @return {@code true} if a call to start an activity on the target display is allowed for the
     * provided context and no {@link SecurityException} will be thrown, {@code false} otherwise.
     * provided context and no {@link SecurityException} will be thrown, {@code false} otherwise.
     */
     */
    public boolean isActivityStartAllowedOnDisplay(Context context, int displayId, Intent intent) {
    public boolean isActivityStartAllowedOnDisplay(@NonNull Context context, int displayId,
            @NonNull Intent intent) {
        try {
        try {
            return getTaskService().isActivityStartAllowedOnDisplay(displayId, intent,
            return getTaskService().isActivityStartAllowedOnDisplay(displayId, intent,
                    intent.resolveTypeIfNeeded(context.getContentResolver()), context.getUserId());
                    intent.resolveTypeIfNeeded(context.getContentResolver()), context.getUserId());