File tree Expand file tree Collapse file tree 3 files changed +52
-0
lines changed
src/com/android/settings/security Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -220,4 +220,5 @@ Duress PIN works the same way duress password does."</string>
220220 <string name =" app_play_integrity_api_not_blocked" >Not blocked</string >
221221 <string name =" app_play_integrity_see_all_apps" >Show apps that used the Play Integrity API</string >
222222
223+ <string name =" patch_level_expiry_warning_disable_title" >Disable patch level expiry warnings</string >
223224</resources >
Original file line number Diff line number Diff line change 231231 settings : keywords =" @string/keywords_app_pinning"
232232 settings : controller =" com.android.settings.security.ScreenPinningPreferenceController" />
233233
234+ <SwitchPreferenceCompat
235+ android : order =" 281"
236+ android : key =" expiry_warning_disable"
237+ android : title =" @string/patch_level_expiry_warning_disable_title"
238+ settings : controller =" com.android.settings.security.ExpiryWarningDisablePreferenceController"
239+ />
240+
234241 <SwitchPreferenceCompat
235242 android : order =" 281"
236243 android : key =" show_system_process_crash_notifs"
Original file line number Diff line number Diff line change 1+ package com .android .settings .security ;
2+
3+ import android .content .Context ;
4+ import android .ext .settings .ExtSettings ;
5+
6+ import com .android .settings .core .TogglePreferenceController ;
7+ import com .android .settings .ext .ExtSettingControllerHelper ;
8+
9+ public class ExpiryWarningDisablePreferenceController extends TogglePreferenceController {
10+ public ExpiryWarningDisablePreferenceController (Context context ,
11+ String preferenceKey ) {
12+ super (context , preferenceKey );
13+ }
14+
15+ @ Override
16+ public boolean isChecked () {
17+ return ExtSettings .USER_DISABLE_PATCH_LEVEL_EXPIRY_WARNING .get (mContext );
18+ }
19+
20+ @ Override
21+ public boolean setChecked (boolean isChecked ) {
22+ return ExtSettings .USER_DISABLE_PATCH_LEVEL_EXPIRY_WARNING .put (mContext , isChecked );
23+ }
24+
25+ @ Override
26+ public boolean isSliceable () {
27+ return false ;
28+ }
29+
30+ @ Override
31+ public int getSliceHighlightMenuRes () {
32+ // not needed since it's not sliceable
33+ return NO_RES ;
34+ }
35+
36+ @ Override
37+ public int getAvailabilityStatus () {
38+ if (ExtSettings .DEVICE_DISABLED_PATCH_LEVEL_EXPIRY_WARNING .get ()) {
39+ return UNSUPPORTED_ON_DEVICE ;
40+ }
41+
42+ return ExtSettingControllerHelper .getGlobalSettingAvailability (mContext );
43+ }
44+ }
You can’t perform that action at this time.
0 commit comments