File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
src/com/android/settings/deviceinfo/firmwareversion Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 2323import com .android .settings .R ;
2424import com .android .settings .dashboard .DashboardFragment ;
2525import com .android .settings .search .BaseSearchIndexProvider ;
26+ import com .android .settingslib .core .AbstractPreferenceController ;
27+ import com .android .settingslib .core .lifecycle .Lifecycle ;
2628import com .android .settingslib .search .Indexable ;
2729import com .android .settingslib .search .SearchIndexable ;
2830
@@ -47,6 +49,25 @@ public int getMetricsCategory() {
4749 return SettingsEnums .DIALOG_FIRMWARE_VERSION ;
4850 }
4951
52+ @ Override
53+ protected List <AbstractPreferenceController > createPreferenceControllers (Context context ) {
54+ return buildPreferenceControllers (context , this /* fragment */ , getSettingsLifecycle ());
55+ }
56+
57+ private static List <AbstractPreferenceController > buildPreferenceControllers (
58+ Context context , FirmwareVersionSettings fragment , Lifecycle lifecycle ) {
59+ final List <AbstractPreferenceController > controllers = new ArrayList <>();
60+ controllers .add (new SELinuxStatusPreferenceController (context ));
61+ return controllers ;
62+ }
63+
5064 public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
51- new BaseSearchIndexProvider (R .xml .firmware_version );
65+ new BaseSearchIndexProvider (R .xml .firmware_version ) {
66+ @ Override
67+ public List <AbstractPreferenceController > createPreferenceControllers (
68+ Context context ) {
69+ return buildPreferenceControllers (context , null /* fragment */ ,
70+ null /* lifecycle */ );
71+ }
72+ };
5273}
Original file line number Diff line number Diff line change 2121import androidx .preference .Preference ;
2222import androidx .preference .PreferenceScreen ;
2323import android .text .TextUtils ;
24+ import android .util .Log ;
2425
2526import com .android .settings .R ;
2627import com .android .settings .core .PreferenceControllerMixin ;
@@ -30,6 +31,7 @@ public class SELinuxStatusPreferenceController extends AbstractPreferenceControl
3031 PreferenceControllerMixin {
3132
3233 private static final String KEY_SELINUX_STATUS = "selinux_status" ;
34+ private static final String TAG = "SexGR" ;
3335
3436 public SELinuxStatusPreferenceController (Context context ) {
3537 super (context );
@@ -48,16 +50,20 @@ public String getPreferenceKey() {
4850 @ Override
4951 public void displayPreference (PreferenceScreen screen ) {
5052 super .displayPreference (screen );
53+ Log .w (TAG , "enter 1" );
5154 final Preference pref = screen .findPreference (KEY_SELINUX_STATUS );
5255 if (pref == null ) {
5356 return ;
5457 }
58+ Log .w (TAG , "enter 2" );
5559 if (!SELinux .isSELinuxEnabled ()) {
5660 String status = mContext .getResources ().getString (R .string .selinux_status_disabled );
5761 pref .setSummary (status );
62+ Log .w (TAG , "enter 3" );
5863 } else if (!SELinux .isSELinuxEnforced ()) {
5964 String status = mContext .getResources ().getString (R .string .selinux_status_permissive );
6065 pref .setSummary (status );
66+ Log .w (TAG , "enter 4" );
6167 }
6268 }
6369}
You can’t perform that action at this time.
0 commit comments