Loading core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -5443,6 +5443,14 @@ public final class Settings { */ public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; /** * Specifies whether a screenshot of the screen contents will be sent to the assist * application (active voice interaction service). * * @hide */ public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; /** * Names of the service components that the current user has explicitly allowed to * see all of the user's notifications, separated by ':'. Loading services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java +7 −4 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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, Loading @@ -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); Loading Loading
core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -5443,6 +5443,14 @@ public final class Settings { */ public static final String ASSIST_STRUCTURE_ENABLED = "assist_structure_enabled"; /** * Specifies whether a screenshot of the screen contents will be sent to the assist * application (active voice interaction service). * * @hide */ public static final String ASSIST_SCREENSHOT_ENABLED = "assist_screenshot_enabled"; /** * Names of the service components that the current user has explicitly allowed to * see all of the user's notifications, separated by ':'. Loading
services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionSessionConnection.java +7 −4 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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, Loading @@ -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); Loading