Merge "[VoiceInteraction] Update nullability to showSession methods"
diff --git a/core/java/android/service/voice/VoiceInteractionManagerInternal.java b/core/java/android/service/voice/VoiceInteractionManagerInternal.java
index c47fdd3..270f848 100644
--- a/core/java/android/service/voice/VoiceInteractionManagerInternal.java
+++ b/core/java/android/service/voice/VoiceInteractionManagerInternal.java
@@ -39,7 +39,7 @@
* @param options A Bundle of private arguments to the current voice interaction service
*/
public abstract void startLocalVoiceInteraction(@NonNull IBinder callingActivity,
- @Nullable String attributionTag, @NonNull Bundle options);
+ @Nullable String attributionTag, @Nullable Bundle options);
/**
* Returns whether the currently selected voice interaction service supports local voice
diff --git a/core/java/com/android/internal/app/AssistUtils.java b/core/java/com/android/internal/app/AssistUtils.java
index fc5cb4b..d4ff794 100644
--- a/core/java/com/android/internal/app/AssistUtils.java
+++ b/core/java/com/android/internal/app/AssistUtils.java
@@ -81,7 +81,7 @@
* IVoiceInteractionSessionShowCallback, IBinder)} instead
*/
@Deprecated
- public boolean showSessionForActiveService(@NonNull Bundle args, int sourceFlags,
+ public boolean showSessionForActiveService(@Nullable Bundle args, int sourceFlags,
@Nullable IVoiceInteractionSessionShowCallback showCallback,
@Nullable IBinder activityToken) {
return showSessionForActiveServiceInternal(args, sourceFlags, /* attributionTag */ null,
@@ -99,7 +99,7 @@
* @param showCallback optional callback to be notified when the session was shown
* @param activityToken optional token of activity that needs to be on top
*/
- public boolean showSessionForActiveService(@NonNull Bundle args, int sourceFlags,
+ public boolean showSessionForActiveService(@Nullable Bundle args, int sourceFlags,
@Nullable String attributionTag,
@Nullable IVoiceInteractionSessionShowCallback showCallback,
@Nullable IBinder activityToken) {
@@ -107,7 +107,7 @@
activityToken);
}
- private boolean showSessionForActiveServiceInternal(@NonNull Bundle args, int sourceFlags,
+ private boolean showSessionForActiveServiceInternal(@Nullable Bundle args, int sourceFlags,
@Nullable String attributionTag,
@Nullable IVoiceInteractionSessionShowCallback showCallback,
@Nullable IBinder activityToken) {
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
index 0abed0b..717f4e7 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
@@ -230,7 +230,7 @@
class LocalService extends VoiceInteractionManagerInternal {
@Override
public void startLocalVoiceInteraction(@NonNull IBinder callingActivity,
- @Nullable String attributionTag, @NonNull Bundle options) {
+ @Nullable String attributionTag, @Nullable Bundle options) {
if (DEBUG) {
Slog.i(TAG, "startLocalVoiceInteraction " + callingActivity);
}
@@ -426,7 +426,7 @@
// TODO: VI Make sure the caller is the current user or profile
void startLocalVoiceInteraction(@NonNull final IBinder token,
- @Nullable String attributionTag, @NonNull Bundle options) {
+ @Nullable String attributionTag, @Nullable Bundle options) {
if (mImpl == null) return;
final int callingUid = Binder.getCallingUid();
@@ -945,7 +945,7 @@
}
@Override
- public void showSession(@NonNull Bundle args, int flags, @Nullable String attributionTag) {
+ public void showSession(@Nullable Bundle args, int flags, @Nullable String attributionTag) {
synchronized (this) {
enforceIsCurrentVoiceInteractionService();
@@ -976,7 +976,7 @@
}
@Override
- public boolean showSessionFromSession(@NonNull IBinder token, @NonNull Bundle sessionArgs,
+ public boolean showSessionFromSession(@NonNull IBinder token, @Nullable Bundle sessionArgs,
int flags, @Nullable String attributionTag) {
synchronized (this) {
if (mImpl == null) {
@@ -1828,7 +1828,7 @@
@android.annotation.EnforcePermission(android.Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE)
@Override
- public boolean showSessionForActiveService(@NonNull Bundle args, int sourceFlags,
+ public boolean showSessionForActiveService(@Nullable Bundle args, int sourceFlags,
@Nullable String attributionTag,
@Nullable IVoiceInteractionSessionShowCallback showCallback,
@Nullable IBinder activityToken) {