am 5d72b272
: Merge "Add support for SE Android to the Settings app."
* commit '5d72b2726797374e402943182d8132045ed32d3a': Add support for SE Android to the Settings app.
This commit is contained in:
committed by
Android Git Automerger
commit
7526636406
@@ -1780,6 +1780,8 @@
|
|||||||
<string name="kernel_version">Kernel version</string>
|
<string name="kernel_version">Kernel version</string>
|
||||||
<!-- About phone screen, setting option name-->
|
<!-- About phone screen, setting option name-->
|
||||||
<string name="build_number">Build number</string>
|
<string name="build_number">Build number</string>
|
||||||
|
<!-- About phone screen, setting option name-->
|
||||||
|
<string name="selinux_status">SELinux status</string>
|
||||||
|
|
||||||
<!-- About phone screen, show when a value of some status item is unavailable. -->
|
<!-- About phone screen, show when a value of some status item is unavailable. -->
|
||||||
<string name="device_info_not_available">Not available</string>
|
<string name="device_info_not_available">Not available</string>
|
||||||
@@ -4054,6 +4056,11 @@
|
|||||||
from their cell phone carrier. The use of the string is similar to the string
|
from their cell phone carrier. The use of the string is similar to the string
|
||||||
"system_update_settings_list_item_title" in this project. [CHAR LIMIT=25] -->
|
"system_update_settings_list_item_title" in this project. [CHAR LIMIT=25] -->
|
||||||
<string name="additional_system_update_settings_list_item_title">Additional system updates</string>
|
<string name="additional_system_update_settings_list_item_title">Additional system updates</string>
|
||||||
|
<!-- These statuses are displayed when a device was built with SE Android supoprt.
|
||||||
|
These are displayed by the settings app in the about section. -->
|
||||||
|
<string name="selinux_status_disabled">Disabled</string>
|
||||||
|
<string name="selinux_status_permissive">Permissive</string>
|
||||||
|
<string name="selinux_status_enforcing">Enforcing</string>
|
||||||
|
|
||||||
<!-- User settings -->
|
<!-- User settings -->
|
||||||
<skip/>
|
<skip/>
|
||||||
|
@@ -125,4 +125,10 @@
|
|||||||
android:title="@string/build_number"
|
android:title="@string/build_number"
|
||||||
android:summary="@string/device_info_default"/>
|
android:summary="@string/device_info_default"/>
|
||||||
|
|
||||||
|
<!-- SELinux status information -->
|
||||||
|
<Preference android:key="selinux_status"
|
||||||
|
style="?android:preferenceInformationStyle"
|
||||||
|
android:title="@string/selinux_status"
|
||||||
|
android:summary="@string/selinux_status_enforcing"/>
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@@ -23,6 +23,7 @@ import android.content.pm.PackageManager;
|
|||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.SELinux;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.os.SystemProperties;
|
import android.os.SystemProperties;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
@@ -53,9 +54,11 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
|
|||||||
private static final String KEY_COPYRIGHT = "copyright";
|
private static final String KEY_COPYRIGHT = "copyright";
|
||||||
private static final String KEY_SYSTEM_UPDATE_SETTINGS = "system_update_settings";
|
private static final String KEY_SYSTEM_UPDATE_SETTINGS = "system_update_settings";
|
||||||
private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal";
|
private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal";
|
||||||
|
private static final String PROPERTY_SELINUX_STATUS = "ro.build.selinux";
|
||||||
private static final String KEY_KERNEL_VERSION = "kernel_version";
|
private static final String KEY_KERNEL_VERSION = "kernel_version";
|
||||||
private static final String KEY_BUILD_NUMBER = "build_number";
|
private static final String KEY_BUILD_NUMBER = "build_number";
|
||||||
private static final String KEY_DEVICE_MODEL = "device_model";
|
private static final String KEY_DEVICE_MODEL = "device_model";
|
||||||
|
private static final String KEY_SELINUX_STATUS = "selinux_status";
|
||||||
private static final String KEY_BASEBAND_VERSION = "baseband_version";
|
private static final String KEY_BASEBAND_VERSION = "baseband_version";
|
||||||
private static final String KEY_FIRMWARE_VERSION = "firmware_version";
|
private static final String KEY_FIRMWARE_VERSION = "firmware_version";
|
||||||
private static final String KEY_UPDATE_SETTING = "additional_system_update_settings";
|
private static final String KEY_UPDATE_SETTING = "additional_system_update_settings";
|
||||||
@@ -79,6 +82,18 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
|
|||||||
setStringSummary(KEY_BUILD_NUMBER, Build.DISPLAY);
|
setStringSummary(KEY_BUILD_NUMBER, Build.DISPLAY);
|
||||||
findPreference(KEY_KERNEL_VERSION).setSummary(getFormattedKernelVersion());
|
findPreference(KEY_KERNEL_VERSION).setSummary(getFormattedKernelVersion());
|
||||||
|
|
||||||
|
if (!SELinux.isSELinuxEnabled()) {
|
||||||
|
String status = getResources().getString(R.string.selinux_status_disabled);
|
||||||
|
setStringSummary(KEY_SELINUX_STATUS, status);
|
||||||
|
} else if (!SELinux.isSELinuxEnforced()) {
|
||||||
|
String status = getResources().getString(R.string.selinux_status_permissive);
|
||||||
|
setStringSummary(KEY_SELINUX_STATUS, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove selinux information if property is not present
|
||||||
|
removePreferenceIfPropertyMissing(getPreferenceScreen(), KEY_SELINUX_STATUS,
|
||||||
|
PROPERTY_SELINUX_STATUS);
|
||||||
|
|
||||||
// Remove Safety information preference if PROPERTY_URL_SAFETYLEGAL is not set
|
// Remove Safety information preference if PROPERTY_URL_SAFETYLEGAL is not set
|
||||||
removePreferenceIfPropertyMissing(getPreferenceScreen(), "safetylegal",
|
removePreferenceIfPropertyMissing(getPreferenceScreen(), "safetylegal",
|
||||||
PROPERTY_URL_SAFETYLEGAL);
|
PROPERTY_URL_SAFETYLEGAL);
|
||||||
|
Reference in New Issue
Block a user