Merge \"Add callbacks to VoiceInteractionManagerService\" into nyc-mr1-dev
am: d58f07f58a
Change-Id: I6a9c537b71084696915e744102a6a12f532942d5
This commit is contained in:
@@ -132,6 +132,16 @@ public class AssistUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public void registerVoiceInteractionSessionListener(IVoiceInteractionSessionListener listener) {
|
||||
try {
|
||||
if (mVoiceInteractionManagerService != null) {
|
||||
mVoiceInteractionManagerService.registerVoiceInteractionSessionListener(listener);
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.w(TAG, "Failed to register voice interaction listener", e);
|
||||
}
|
||||
}
|
||||
|
||||
public ComponentName getAssistComponentForUser(int userId) {
|
||||
final String setting = Settings.Secure.getStringForUser(mContext.getContentResolver(),
|
||||
Settings.Secure.ASSISTANT, userId);
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.os.Bundle;
|
||||
|
||||
import com.android.internal.app.IVoiceInteractionSessionShowCallback;
|
||||
import com.android.internal.app.IVoiceInteractor;
|
||||
import com.android.internal.app.IVoiceInteractionSessionListener;
|
||||
import android.hardware.soundtrigger.IRecognitionStatusCallback;
|
||||
import android.hardware.soundtrigger.SoundTrigger;
|
||||
import android.service.voice.IVoiceInteractionService;
|
||||
@@ -136,4 +137,9 @@ interface IVoiceInteractionManagerService {
|
||||
* Called when the lockscreen got shown.
|
||||
*/
|
||||
void onLockscreenShown();
|
||||
|
||||
/**
|
||||
* Register a voice interaction listener.
|
||||
*/
|
||||
void registerVoiceInteractionSessionListener(IVoiceInteractionSessionListener listener);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.internal.app;
|
||||
|
||||
oneway interface IVoiceInteractionSessionListener {
|
||||
/**
|
||||
* Called when a voice session is shown.
|
||||
*/
|
||||
void onVoiceSessionShown();
|
||||
|
||||
/**
|
||||
* Called when a voice session is hidden.
|
||||
*/
|
||||
void onVoiceSessionHidden();
|
||||
}
|
||||
Reference in New Issue
Block a user