Add setting to disable screenshot separately (2/2)
Bug: 22063668 Change-Id: I85b255ac114184e0edbd71010d517b337ad935e5
This commit is contained in:
@@ -6757,7 +6757,14 @@
|
|||||||
<string name="assist_access_context_title">Use current context</string>
|
<string name="assist_access_context_title">Use current context</string>
|
||||||
|
|
||||||
<!-- Summary for the "context" preference to determine whether assist can access the data currently displayed on-screen [CHAR LIMIT=NONE] -->
|
<!-- Summary for the "context" preference to determine whether assist can access the data currently displayed on-screen [CHAR LIMIT=NONE] -->
|
||||||
<string name="assist_access_context_summary">When you open the assist app, let it see what you\u2019ve been doing on your screen</string>
|
<string name="assist_access_context_summary">Allow the assist app to access content and metadata from the app you\u2019re using</string>
|
||||||
|
|
||||||
|
<!-- Title for the "screenshot" preference to determine whether assist can access the screenshot of your screen [CHAR LIMIT=40] -->
|
||||||
|
<string name="assist_access_screenshot_title">Use screenshots</string>
|
||||||
|
|
||||||
|
<!-- Summary for the "screenshot" preference to determine whether assist can access the screenshot of your screen [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="assist_access_screenshot_summary">Allow the assist app to analyze images of the app you\u2019re using</string>
|
||||||
|
|
||||||
|
|
||||||
<!-- Footer text in the manage assist screen. [CHAR LIMIT=NONE] -->
|
<!-- Footer text in the manage assist screen. [CHAR LIMIT=NONE] -->
|
||||||
<string name="assist_footer">Assist apps help you identify and act on useful information without having to ask. Some apps support both launcher and voice input services to give you integrated assistance.</string>
|
<string name="assist_footer">Assist apps help you identify and act on useful information without having to ask. Some apps support both launcher and voice input services to give you integrated assistance.</string>
|
||||||
|
@@ -31,6 +31,12 @@
|
|||||||
android:summary="@string/assist_access_context_summary"
|
android:summary="@string/assist_access_context_summary"
|
||||||
android:persistent="false"/>
|
android:persistent="false"/>
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="screenshot"
|
||||||
|
android:title="@string/assist_access_screenshot_title"
|
||||||
|
android:summary="@string/assist_access_screenshot_summary"
|
||||||
|
android:persistent="false"/>
|
||||||
|
|
||||||
<com.android.settings.voice.VoiceInputListPreference
|
<com.android.settings.voice.VoiceInputListPreference
|
||||||
android:key="voice_input_settings"
|
android:key="voice_input_settings"
|
||||||
android:title="@string/voice_input_settings_title"
|
android:title="@string/voice_input_settings_title"
|
||||||
|
@@ -38,10 +38,12 @@ public class ManageAssist extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
private static final String KEY_DEFAULT_ASSIST = "default_assist";
|
private static final String KEY_DEFAULT_ASSIST = "default_assist";
|
||||||
private static final String KEY_CONTEXT = "context";
|
private static final String KEY_CONTEXT = "context";
|
||||||
|
private static final String KEY_SCREENSHOT = "screenshot";
|
||||||
private static final String KEY_VOICE_INPUT = "voice_input_settings";
|
private static final String KEY_VOICE_INPUT = "voice_input_settings";
|
||||||
|
|
||||||
private DefaultAssistPreference mDefaultAssitPref;
|
private DefaultAssistPreference mDefaultAssitPref;
|
||||||
private SwitchPreference mContextPref;
|
private SwitchPreference mContextPref;
|
||||||
|
private SwitchPreference mScreenshotPref;
|
||||||
private VoiceInputListPreference mVoiceInputPref;
|
private VoiceInputListPreference mVoiceInputPref;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -57,6 +59,11 @@ public class ManageAssist extends SettingsPreferenceFragment
|
|||||||
Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1) != 0);
|
Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1) != 0);
|
||||||
mContextPref.setOnPreferenceChangeListener(this);
|
mContextPref.setOnPreferenceChangeListener(this);
|
||||||
|
|
||||||
|
mScreenshotPref = (SwitchPreference) findPreference(KEY_SCREENSHOT);
|
||||||
|
mScreenshotPref.setChecked(Settings.Secure.getInt(getContentResolver(),
|
||||||
|
Settings.Secure.ASSIST_SCREENSHOT_ENABLED, 1) != 0);
|
||||||
|
mScreenshotPref.setOnPreferenceChangeListener(this);
|
||||||
|
|
||||||
mVoiceInputPref = (VoiceInputListPreference) findPreference(KEY_VOICE_INPUT);
|
mVoiceInputPref = (VoiceInputListPreference) findPreference(KEY_VOICE_INPUT);
|
||||||
updateUi();
|
updateUi();
|
||||||
}
|
}
|
||||||
@@ -73,6 +80,11 @@ public class ManageAssist extends SettingsPreferenceFragment
|
|||||||
(boolean) newValue ? 1 : 0);
|
(boolean) newValue ? 1 : 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (preference == mScreenshotPref) {
|
||||||
|
Settings.Secure.putInt(getContentResolver(), Settings.Secure.ASSIST_SCREENSHOT_ENABLED,
|
||||||
|
(boolean) newValue ? 1 : 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (preference == mDefaultAssitPref) {
|
if (preference == mDefaultAssitPref) {
|
||||||
String newAssitPackage = (String)newValue;
|
String newAssitPackage = (String)newValue;
|
||||||
if (newAssitPackage == null ||
|
if (newAssitPackage == null ||
|
||||||
|
Reference in New Issue
Block a user