diff --git a/res/values/strings.xml b/res/values/strings.xml index cc40094d626..36790575d3c 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -7498,6 +7498,9 @@ Automatic system updates + + Binderized HALs (requires reboot) + Usage diff --git a/res/xml/development_prefs.xml b/res/xml/development_prefs.xml index 22327c3b1c4..b8043c9657e 100644 --- a/res/xml/development_prefs.xml +++ b/res/xml/development_prefs.xml @@ -88,6 +88,10 @@ android:title="@string/color_temperature" android:summary="@string/color_temperature_desc" /> + + diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index 749eb115e42..a5b405991ed 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -227,6 +227,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment private static final String KEY_CONVERT_FBE = "convert_to_file_encryption"; private static final String OTA_DISABLE_AUTOMATIC_UPDATE_KEY = "ota_disable_automatic_update"; + private static final String ENABLE_HAL_BINDERIZATION_KEY = "enable_hal_binderization"; + private static final String ENABLE_HAL_BINDERIZATION_PROPERTY = "persist.hal.binderization"; private static final int RESULT_DEBUG_APP = 1000; private static final int RESULT_MOCK_LOCATION_APP = 1001; @@ -288,6 +290,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment private ListPreference mBluetoothSelectA2dpLdacPlaybackQuality; private SwitchPreference mOtaDisableAutomaticUpdate; + private SwitchPreference mEnableHalBinderization; private SwitchPreference mWifiAllowScansWithTraffic; private SwitchPreference mStrictMode; private SwitchPreference mPointerLocation; @@ -539,6 +542,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment mOtaDisableAutomaticUpdate = findAndInitSwitchPref(OTA_DISABLE_AUTOMATIC_UPDATE_KEY); + mEnableHalBinderization = findAndInitSwitchPref(ENABLE_HAL_BINDERIZATION_KEY); + mColorModePreference = (ColorModePreference) findPreference(KEY_COLOR_MODE); mColorModePreference.updateCurrentAndSupported(); if (mColorModePreference.getColorModeCount() < 2) { @@ -782,6 +787,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment updateShowAllANRsOptions(); updateVerifyAppsOverUsbOptions(); updateOtaDisableAutomaticUpdateOptions(); + updateEnableHalBinderizationOptions(); updateBugreportOptions(); updateForceRtlOptions(); updateLogdSizeValues(); @@ -1025,6 +1031,17 @@ public class DevelopmentSettings extends RestrictedSettingsFragment mOtaDisableAutomaticUpdate.isChecked() ? 0 : 1); } + private void updateEnableHalBinderizationOptions() { + updateSwitchPreference(mEnableHalBinderization, + SystemProperties.getBoolean(ENABLE_HAL_BINDERIZATION_PROPERTY, false)); + } + + private void writeEnableHalBinderizationOptions() { + SystemProperties.set(ENABLE_HAL_BINDERIZATION_PROPERTY, + mEnableHalBinderization.isChecked() ? "true" : "false"); + pokeSystemProperties(); + } + private boolean enableVerifierSetting() { final ContentResolver cr = getActivity().getContentResolver(); if (Settings.Global.getInt(cr, Settings.Global.ADB_ENABLED, 0) == 0) { @@ -2382,6 +2399,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment writeVerifyAppsOverUsbOptions(); } else if (preference == mOtaDisableAutomaticUpdate) { writeOtaDisableAutomaticUpdateOptions(); + } else if (preference == mEnableHalBinderization) { + writeEnableHalBinderizationOptions(); } else if (preference == mStrictMode) { writeStrictModeVisualOptions(); } else if (preference == mPointerLocation) {