diff options
author | Benjamin Franz <bfranz@google.com> | 2015-06-25 18:20:04 +0100 |
---|---|---|
committer | Benjamin Franz <bfranz@google.com> | 2015-06-26 11:16:49 +0100 |
commit | c200f44c46b7d6ddb104c0f09f2a4c679e218d0b (patch) | |
tree | 4ada2d00b4eef76dd92fa546e6fc1c023b362d29 /services/voiceinteraction/java | |
parent | 107cb81f9054a406b94e249c99fd7d64be71faec (diff) | |
download | frameworks_base-c200f44c46b7d6ddb104c0f09f2a4c679e218d0b.zip frameworks_base-c200f44c46b7d6ddb104c0f09f2a4c679e218d0b.tar.gz frameworks_base-c200f44c46b7d6ddb104c0f09f2a4c679e218d0b.tar.bz2 |
Block assist when screenshots are disabled by policy
When a device or profile owner disables screen capture, we also want to
block context data being collected for the assist structure.
Bug: 21797707
Change-Id: Ib8716c6dd71d538a027c04e1e907c87e2afa0ac8
Diffstat (limited to 'services/voiceinteraction/java')
-rw-r--r-- | services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java index cc6a9c5..549a511 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java @@ -193,8 +193,14 @@ final class VoiceInteractionSessionConnection implements ServiceConnection { new UserHandle(mUser)); } mShown = true; - boolean allDataEnabled = Settings.Secure.getIntForUser(mContext.getContentResolver(), - Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1, mUser) != 0; + boolean isScreenCaptureAllowed = true; + try { + isScreenCaptureAllowed = mAm.isScreenCaptureAllowedOnCurrentActivity(); + } catch (RemoteException e) { + } + boolean allDataEnabled = (Settings.Secure.getIntForUser(mContext.getContentResolver(), + Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1, mUser) != 0) + && isScreenCaptureAllowed; mShowArgs = args; mShowFlags = flags; mHaveAssistData = false; |