From 9e0189bac66ae8cf80faebb4ddc8b978566ee21f Mon Sep 17 00:00:00 2001 From: Jon Spivack Date: Tue, 11 May 2021 19:02:58 -0700 Subject: [PATCH] Default screen context permissions for NIU Actions This updates the checks for ASSIST_STRUCTURE_ENABLED and ASSIST_SCREENSHOT_ENABLED to return 1 if the settings do not exist. This matches the logic in the Settings app iself, which has the toggle boxes on by default but does not actually initialize those values until they are toggled for the first time. Bug: 187868947 Test: Manual (tested on Pixel 3A) Change-Id: I4ef067dcf21b40eea71199e057d7a00d1d8fb2b3 --- .../src/com/android/quickstep/TaskOverlayFactoryGo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java index 67e9d898e5..907767551c 100644 --- a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java +++ b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java @@ -170,9 +170,9 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { public void checkPermissions() { ContentResolver contentResolver = mApplicationContext.getContentResolver(); boolean structureEnabled = Settings.Secure.getInt(contentResolver, - Settings.Secure.ASSIST_STRUCTURE_ENABLED, 0) != 0; + Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1) != 0; boolean screenshotEnabled = Settings.Secure.getInt(contentResolver, - Settings.Secure.ASSIST_SCREENSHOT_ENABLED, 0) != 0; + Settings.Secure.ASSIST_SCREENSHOT_ENABLED, 1) != 0; mAssistPermissionsEnabled = structureEnabled && screenshotEnabled; }