diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-05-19 04:40:08 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-19 04:40:15 +0000 |
commit | c6767354c5c2e32648c7404b73878a8ae66dd3c8 (patch) | |
tree | 8c76c34ea2b2018629ba5e22c9f5f3744a3e44fb /services/voiceinteraction | |
parent | 2b0196a7d3d6c952c8df17acd9fcdf61ec735b5c (diff) | |
parent | 9d91083034654b37461c891308a1d426054170a8 (diff) | |
download | frameworks_base-c6767354c5c2e32648c7404b73878a8ae66dd3c8.zip frameworks_base-c6767354c5c2e32648c7404b73878a8ae66dd3c8.tar.gz frameworks_base-c6767354c5c2e32648c7404b73878a8ae66dd3c8.tar.bz2 |
Merge "Add setting to disable assist data (1/2)" into mnc-dev
Diffstat (limited to 'services/voiceinteraction')
-rw-r--r-- | services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java index d79b31c..03abfba 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java @@ -35,6 +35,7 @@ import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; +import android.provider.Settings; import android.service.voice.IVoiceInteractionSession; import android.service.voice.IVoiceInteractionSessionService; import android.service.voice.VoiceInteractionService; @@ -192,7 +193,8 @@ final class VoiceInteractionSessionConnection implements ServiceConnection { mHaveAssistData = false; if ((flags&VoiceInteractionService.START_WITH_ASSIST) != 0) { if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ASSIST_STRUCTURE, mCallingUid, - mSessionComponentName.getPackageName()) == AppOpsManager.MODE_ALLOWED) { + mSessionComponentName.getPackageName()) == AppOpsManager.MODE_ALLOWED + && isStructureEnabled()) { try { mAm.requestAssistContextExtras(ActivityManager.ASSIST_CONTEXT_FULL, mAssistReceiver); @@ -457,6 +459,11 @@ final class VoiceInteractionSessionConnection implements ServiceConnection { } } + private boolean isStructureEnabled() { + return Settings.Secure.getIntForUser(mContext.getContentResolver(), + Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1, mUser) != 0; + } + public void dump(String prefix, PrintWriter pw) { pw.print(prefix); pw.print("mToken="); pw.println(mToken); pw.print(prefix); pw.print("mShown="); pw.println(mShown); |