Merge "[VoiceInteraction] Update nullability to showSession methods"
This commit is contained in:
committed by
Android (Google) Code Review
commit
3b021bc8d8
@@ -39,7 +39,7 @@ public abstract class VoiceInteractionManagerInternal {
|
||||
* @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
|
||||
|
||||
@@ -81,7 +81,7 @@ public class AssistUtils {
|
||||
* 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 @@ public class AssistUtils {
|
||||
* @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 @@ public class AssistUtils {
|
||||
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) {
|
||||
|
||||
@@ -230,7 +230,7 @@ public class VoiceInteractionManagerService extends SystemService {
|
||||
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 @@ public class VoiceInteractionManagerService extends SystemService {
|
||||
|
||||
// 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 @@ public class VoiceInteractionManagerService extends SystemService {
|
||||
}
|
||||
|
||||
@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 @@ public class VoiceInteractionManagerService extends SystemService {
|
||||
}
|
||||
|
||||
@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 @@ public class VoiceInteractionManagerService extends SystemService {
|
||||
|
||||
@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) {
|
||||
|
||||
Reference in New Issue
Block a user