resolved conflicts for merge of 59561e0a
to master
Change-Id: I9d031ce8f9627bb5e8b28f867e2890c354856df9
This commit is contained in:
@@ -17,7 +17,10 @@
|
||||
package com.android.settings;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
@@ -25,11 +28,13 @@ import android.os.SystemProperties;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceGroup;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -44,15 +49,26 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
|
||||
private static final String KEY_COPYRIGHT = "copyright";
|
||||
private static final String KEY_SYSTEM_UPDATE_SETTINGS = "system_update_settings";
|
||||
private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal";
|
||||
|
||||
|
||||
long[] mHits = new long[3];
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
|
||||
|
||||
addPreferencesFromResource(R.xml.device_info_settings);
|
||||
|
||||
|
||||
// If we don't have an IME tutorial, remove that option
|
||||
String currentIme = Settings.Secure.getString(getContentResolver(),
|
||||
Settings.Secure.DEFAULT_INPUT_METHOD);
|
||||
ComponentName component = ComponentName.unflattenFromString(currentIme);
|
||||
Intent imeIntent = new Intent(component.getPackageName() + ".tutorial");
|
||||
PackageManager pm = getPackageManager();
|
||||
List<ResolveInfo> tutorials = pm.queryIntentActivities(imeIntent, 0);
|
||||
if(tutorials == null || tutorials.isEmpty()) {
|
||||
getPreferenceScreen().removePreference(findPreference("system_tutorial"));
|
||||
}
|
||||
|
||||
setStringSummary("firmware_version", Build.VERSION.RELEASE);
|
||||
findPreference("firmware_version").setEnabled(true);
|
||||
setValueSummary("baseband_version", "gsm.version.baseband");
|
||||
@@ -79,7 +95,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
|
||||
Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
|
||||
Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_TEAM,
|
||||
Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
|
||||
|
||||
|
||||
// These are contained by the root preference screen
|
||||
parentPreference = getPreferenceScreen();
|
||||
Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference,
|
||||
@@ -88,7 +104,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
|
||||
Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_CONTRIBUTORS,
|
||||
Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
|
||||
if (preference.getKey().equals("firmware_version")) {
|
||||
@@ -129,11 +145,11 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
|
||||
getResources().getString(R.string.device_info_default));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setValueSummary(String preference, String property) {
|
||||
try {
|
||||
findPreference(preference).setSummary(
|
||||
SystemProperties.get(property,
|
||||
SystemProperties.get(property,
|
||||
getResources().getString(R.string.device_info_default)));
|
||||
} catch (RuntimeException e) {
|
||||
|
||||
@@ -176,7 +192,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
|
||||
m.group(2)).append(" ").append(m.group(3)).append("\n")
|
||||
.append(m.group(4))).toString();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG,
|
||||
"IO Exception when getting kernel version for Device Info screen",
|
||||
e);
|
||||
|
Reference in New Issue
Block a user