summaryrefslogtreecommitdiffstats
path: root/services/voiceinteraction
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2015-06-26 16:40:00 -0700
committerJorim Jaggi <jjaggi@google.com>2015-06-29 17:16:33 -0700
commita133f0b522f66b45d4105f6d514a8a17120833ad (patch)
tree99fc0a8bb313339a446e7e6f5ce7deaa7ae1ca0d /services/voiceinteraction
parent4daf600ee0fb9fbc70f224e92c73e49f44b2bbbb (diff)
downloadframeworks_base-a133f0b522f66b45d4105f6d514a8a17120833ad.zip
frameworks_base-a133f0b522f66b45d4105f6d514a8a17120833ad.tar.gz
frameworks_base-a133f0b522f66b45d4105f6d514a8a17120833ad.tar.bz2
Add setting to disable screenshot separately (1/2)
Bug: 22063668 Change-Id: Ief704004a8ab0a65d34753f9098003ba695726df
Diffstat (limited to 'services/voiceinteraction')
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java
index 549a511..bd043ac 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java
@@ -198,8 +198,11 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
isScreenCaptureAllowed = mAm.isScreenCaptureAllowedOnCurrentActivity();
} catch (RemoteException e) {
}
- boolean allDataEnabled = (Settings.Secure.getIntForUser(mContext.getContentResolver(),
- Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1, mUser) != 0)
+ boolean structureEnabled = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1, mUser) != 0
+ && isScreenCaptureAllowed;
+ boolean screenshotEnabled = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ASSIST_SCREENSHOT_ENABLED, 1, mUser) != 0
&& isScreenCaptureAllowed;
mShowArgs = args;
mShowFlags = flags;
@@ -208,7 +211,7 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
if ((flags& VoiceInteractionSession.SHOW_WITH_ASSIST) != 0) {
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ASSIST_STRUCTURE, mCallingUid,
mSessionComponentName.getPackageName()) == AppOpsManager.MODE_ALLOWED
- && allDataEnabled) {
+ && structureEnabled) {
try {
needDisclosure = true;
mAm.requestAssistContextExtras(ActivityManager.ASSIST_CONTEXT_FULL,
@@ -226,7 +229,7 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
if ((flags& VoiceInteractionSession.SHOW_WITH_SCREENSHOT) != 0) {
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ASSIST_SCREENSHOT, mCallingUid,
mSessionComponentName.getPackageName()) == AppOpsManager.MODE_ALLOWED
- && allDataEnabled) {
+ && screenshotEnabled) {
try {
needDisclosure = true;
mIWindowManager.requestAssistScreenshot(mScreenshotReceiver);