summaryrefslogtreecommitdiffstats
path: root/services/voiceinteraction
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-06-16 18:12:31 -0700
committerDianne Hackborn <hackbod@google.com>2015-06-16 18:12:31 -0700
commit216f5c33472bf4014cb1951deeb2b7c09f4cae37 (patch)
treeb0a00a0cf1242d97c955876df1bec6e0eda9f931 /services/voiceinteraction
parentece811dac9a2784b4a2937a4ece75b58d0db9e8b (diff)
downloadframeworks_base-216f5c33472bf4014cb1951deeb2b7c09f4cae37.zip
frameworks_base-216f5c33472bf4014cb1951deeb2b7c09f4cae37.tar.gz
frameworks_base-216f5c33472bf4014cb1951deeb2b7c09f4cae37.tar.bz2
Bring back screenshot API.
Change-Id: Ia6bdfa300398d39119239f6a88c9992673edb3e0
Diffstat (limited to 'services/voiceinteraction')
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java
index 0b430ca..47a230a 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java
@@ -180,8 +180,6 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
public boolean showLocked(Bundle args, int flags,
IVoiceInteractionSessionShowCallback showCallback) {
- // For now we never allow screenshots.
- flags &= ~VoiceInteractionSession.SHOW_WITH_SCREENSHOT;
if (mBound) {
if (!mFullyBound) {
mFullyBound = mContext.bindServiceAsUser(mBindIntent, mFullConnection,
@@ -190,13 +188,15 @@ 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;
mShowArgs = args;
mShowFlags = flags;
mHaveAssistData = false;
if ((flags& VoiceInteractionSession.SHOW_WITH_ASSIST) != 0) {
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ASSIST_STRUCTURE, mCallingUid,
mSessionComponentName.getPackageName()) == AppOpsManager.MODE_ALLOWED
- && isStructureEnabled()) {
+ && allDataEnabled) {
try {
mAm.requestAssistContextExtras(ActivityManager.ASSIST_CONTEXT_FULL,
mAssistReceiver);
@@ -212,7 +212,8 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
mHaveScreenshot = false;
if ((flags& VoiceInteractionSession.SHOW_WITH_SCREENSHOT) != 0) {
if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ASSIST_SCREENSHOT, mCallingUid,
- mSessionComponentName.getPackageName()) == AppOpsManager.MODE_ALLOWED) {
+ mSessionComponentName.getPackageName()) == AppOpsManager.MODE_ALLOWED
+ && allDataEnabled) {
try {
mIWindowManager.requestAssistScreenshot(mScreenshotReceiver);
} catch (RemoteException e) {
@@ -466,11 +467,6 @@ final class VoiceInteractionSessionConnection implements ServiceConnection {
mService = null;
}
- 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);