From ba61f71ff37e3b577fdbc274faed988a83fd6fc0 Mon Sep 17 00:00:00 2001 From: Mocy Sheng Date: Mon, 11 May 2020 10:16:24 -0500 Subject: [PATCH] Fix nullable annotation to match overriden method in super class Bug: 156238511 Test: Treehugger Change-Id: I349e8628ea77d3051f40f903c3438c3fc0a489ea --- api/current.txt | 6 +++--- core/java/android/app/Activity.java | 10 ++++++---- core/java/android/content/ContextWrapper.java | 8 +++++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/api/current.txt b/api/current.txt index 6d65cf4ec5cf7..eb4d60e73ff56 100644 --- a/api/current.txt +++ b/api/current.txt @@ -3987,7 +3987,7 @@ package android.app { method public boolean startActivityIfNeeded(@NonNull @RequiresPermission android.content.Intent, int); method public boolean startActivityIfNeeded(@NonNull @RequiresPermission android.content.Intent, int, @Nullable android.os.Bundle); method public void startIntentSenderForResult(android.content.IntentSender, int, @Nullable android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException; - method public void startIntentSenderForResult(android.content.IntentSender, int, @Nullable android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException; + method public void startIntentSenderForResult(android.content.IntentSender, int, @Nullable android.content.Intent, int, int, int, @Nullable android.os.Bundle) throws android.content.IntentSender.SendIntentException; method @Deprecated public void startIntentSenderFromChild(android.app.Activity, android.content.IntentSender, int, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException; method @Deprecated public void startIntentSenderFromChild(android.app.Activity, android.content.IntentSender, int, android.content.Intent, int, int, int, @Nullable android.os.Bundle) throws android.content.IntentSender.SendIntentException; method public void startLocalVoiceInteraction(android.os.Bundle); @@ -10350,8 +10350,8 @@ package android.content { method public void startActivity(android.content.Intent, android.os.Bundle); method public android.content.ComponentName startForegroundService(android.content.Intent); method public boolean startInstrumentation(android.content.ComponentName, String, android.os.Bundle); - method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException; - method public void startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int, android.os.Bundle) throws android.content.IntentSender.SendIntentException; + method public void startIntentSender(android.content.IntentSender, @Nullable android.content.Intent, int, int, int) throws android.content.IntentSender.SendIntentException; + method public void startIntentSender(android.content.IntentSender, @Nullable android.content.Intent, int, int, int, @Nullable android.os.Bundle) throws android.content.IntentSender.SendIntentException; method public android.content.ComponentName startService(android.content.Intent); method public boolean stopService(android.content.Intent); method public void unbindService(android.content.ServiceConnection); diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 34065e1641d02..ffd91104dd72a 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -5371,7 +5371,7 @@ public class Activity extends ContextThemeWrapper return mActivityTransitionState.isTransitionRunning(); } - private Bundle transferSpringboardActivityOptions(Bundle options) { + private Bundle transferSpringboardActivityOptions(@Nullable Bundle options) { if (options == null && (mWindow != null && !mWindow.isActive())) { final ActivityOptions activityOptions = getActivityOptions(); if (activityOptions != null && @@ -5539,7 +5539,7 @@ public class Activity extends ContextThemeWrapper */ public void startIntentSenderForResult(IntentSender intent, int requestCode, @Nullable Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, - Bundle options) throws IntentSender.SendIntentException { + @Nullable Bundle options) throws IntentSender.SendIntentException { if (mParent == null) { startIntentSenderForResultInner(intent, mEmbeddedID, requestCode, fillInIntent, flagsMask, flagsValues, options); @@ -5556,7 +5556,7 @@ public class Activity extends ContextThemeWrapper private void startIntentSenderForResultInner(IntentSender intent, String who, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, - Bundle options) + @Nullable Bundle options) throws IntentSender.SendIntentException { try { options = transferSpringboardActivityOptions(options); @@ -5717,6 +5717,7 @@ public class Activity extends ContextThemeWrapper * flagsMask * @param extraFlags Always set to 0. */ + @Override public void startIntentSender(IntentSender intent, @Nullable Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags) throws IntentSender.SendIntentException { @@ -5744,9 +5745,10 @@ public class Activity extends ContextThemeWrapper * have also been supplied by the IntentSender, options given here will * override any that conflict with those given by the IntentSender. */ + @Override public void startIntentSender(IntentSender intent, @Nullable Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, - Bundle options) throws IntentSender.SendIntentException { + @Nullable Bundle options) throws IntentSender.SendIntentException { if (options != null) { startIntentSenderForResult(intent, -1, fillInIntent, flagsMask, flagsValues, extraFlags, options); diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java index 5dc41e483640a..565f34a149bd4 100644 --- a/core/java/android/content/ContextWrapper.java +++ b/core/java/android/content/ContextWrapper.java @@ -449,7 +449,8 @@ public class ContextWrapper extends Context { @Override public void startIntentSender(IntentSender intent, - Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags) + @Nullable Intent fillInIntent, int flagsMask, int flagsValues, + int extraFlags) throws IntentSender.SendIntentException { mBase.startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags); @@ -457,8 +458,9 @@ public class ContextWrapper extends Context { @Override public void startIntentSender(IntentSender intent, - Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, - Bundle options) throws IntentSender.SendIntentException { + @Nullable Intent fillInIntent, int flagsMask, int flagsValues, + int extraFlags, @Nullable Bundle options) + throws IntentSender.SendIntentException { mBase.startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags, options); }