From 402854484f789d5e484c1e0f6eedd7d331e06d2a Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Fri, 8 Mar 2019 15:09:53 +0800 Subject: [PATCH] Add NonNull annotation in ActivityManager. Add NonNull annotation at isActivityStartAllowedOnDisplay. Fix: 126698001 Test: build pass. Change-Id: I46b10aeb6b83de284de35863197665da8949928f --- api/current.txt | 2 +- core/java/android/app/ActivityManager.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/current.txt b/api/current.txt index 5c6689920f596..35e6a26719843 100644 --- a/api/current.txt +++ b/api/current.txt @@ -3944,7 +3944,7 @@ package android.app { method public android.app.PendingIntent getRunningServiceControlPanel(android.content.ComponentName) throws java.lang.SecurityException; method @Deprecated public java.util.List getRunningServices(int) throws java.lang.SecurityException; method @Deprecated public java.util.List 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 @Deprecated public boolean isInLockTaskMode(); method public boolean isLowRamDevice(); diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index c067f9d0ce1c9..023371d3b443a 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -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 * 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 { return getTaskService().isActivityStartAllowedOnDisplay(displayId, intent, intent.resolveTypeIfNeeded(context.getContentResolver()), context.getUserId());