diff options
author | Selim Cinek <cinek@google.com> | 2015-04-24 16:46:13 -0700 |
---|---|---|
committer | Selim Cinek <cinek@google.com> | 2015-05-05 14:52:52 -0700 |
commit | e70d6535237d2e6f03adcd0bdc11e45ea714dc97 (patch) | |
tree | 342b22ff5e17567563e008f2b684bfcd3ba3f932 /services/voiceinteraction | |
parent | 08e474ca24c024be29ed8a593cbd2748abde44ce (diff) | |
download | frameworks_base-e70d6535237d2e6f03adcd0bdc11e45ea714dc97.zip frameworks_base-e70d6535237d2e6f03adcd0bdc11e45ea714dc97.tar.gz frameworks_base-e70d6535237d2e6f03adcd0bdc11e45ea714dc97.tar.bz2 |
The voice assist may now be launched above the lockscreen
A possibility was introduced to launch voice assist over
the lockscreen using the left keyguard affordance.
Change-Id: Ic4618d24256b65441a50d77d0ef59b0ec99b6ead
Diffstat (limited to 'services/voiceinteraction')
2 files changed, 39 insertions, 1 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java index 56b2fa5..2897c61 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java @@ -28,7 +28,6 @@ import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; -import android.content.res.Configuration; import android.content.res.Resources; import android.database.ContentObserver; import android.hardware.soundtrigger.IRecognitionStatusCallback; @@ -726,6 +725,24 @@ public class VoiceInteractionManagerService extends SystemService { } @Override + public void launchVoiceAssistFromKeyguard() { + enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE); + synchronized (this) { + if (mImpl == null) { + Slog.w(TAG, "launchVoiceAssistFromKeyguard without running voice interaction" + + "service"); + return; + } + final long caller = Binder.clearCallingIdentity(); + try { + mImpl.launchVoiceAssistFromKeyguard(); + } finally { + Binder.restoreCallingIdentity(caller); + } + } + } + + @Override public boolean isSessionRunning() { enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE); synchronized (this) { @@ -742,6 +759,14 @@ public class VoiceInteractionManagerService extends SystemService { } @Override + public boolean activeServiceSupportsLaunchFromKeyguard() throws RemoteException { + enforceCallingPermission(Manifest.permission.ACCESS_VOICE_INTERACTION_SERVICE); + synchronized (this) { + return mImpl != null && mImpl.mInfo.getSupportsLaunchFromKeyguard(); + } + } + + @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { if (mContext.checkCallingOrSelfPermission(Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) { diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java index f439915..0a5b668 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java @@ -235,6 +235,18 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne } } + public void launchVoiceAssistFromKeyguard() { + if (mService == null) { + Slog.w(TAG, "Not bound to voice interaction service " + mComponent); + return; + } + try { + mService.launchVoiceAssistFromKeyguard(); + } catch (RemoteException e) { + Slog.w(TAG, "RemoteException while calling launchVoiceAssistFromKeyguard", e); + } + } + void shutdownLocked() { try { if (mService != null) { @@ -256,6 +268,7 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne void notifySoundModelsChangedLocked() { if (mService == null) { Slog.w(TAG, "Not bound to voice interaction service " + mComponent); + return; } try { mService.soundModelsChanged(); |