summaryrefslogtreecommitdiffstats
path: root/Settings
diff options
context:
space:
mode:
authorTony Mantler <nicoya@google.com>2015-08-26 21:00:48 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-26 21:00:48 +0000
commite4200126a9feec613408c73d48b6e16596a7f1a4 (patch)
tree26ff2df4e5f52bc2e26c2b4e4f2589c793276bb1 /Settings
parent702569ad533c86386f1482febd2769bf9367839b (diff)
parent6d951a21b9df1dd454d24d1e06036c7c14c5261d (diff)
downloadandroid_packages_apps_TvSettings-e4200126a9feec613408c73d48b6e16596a7f1a4.tar.gz
android_packages_apps_TvSettings-e4200126a9feec613408c73d48b6e16596a7f1a4.tar.bz2
android_packages_apps_TvSettings-e4200126a9feec613408c73d48b6e16596a7f1a4.zip
am 6d951a21: Add security patch level to about screen
* commit '6d951a21b9df1dd454d24d1e06036c7c14c5261d': Add security patch level to about screen
Diffstat (limited to 'Settings')
-rw-r--r--Settings/res/values/strings.xml2
-rw-r--r--Settings/src/com/android/tv/settings/about/AboutActivity.java23
2 files changed, 25 insertions, 0 deletions
diff --git a/Settings/res/values/strings.xml b/Settings/res/values/strings.xml
index 9232d2a2..40413a1e 100644
--- a/Settings/res/values/strings.xml
+++ b/Settings/res/values/strings.xml
@@ -1303,5 +1303,7 @@
<!-- Summary of number of apps currently granted a single permission [CHAR LIMIT=45] -->
<string name="app_permissions_group_summary"><xliff:g id="count" example="10">%d</xliff:g> of <xliff:g id="count" example="10">%d</xliff:g> apps allowed</string>
+ <!-- About phone screen, status item label [CHAR LIMIT=60] -->
+ <string name="security_patch">Android security patch level</string>
</resources>
diff --git a/Settings/src/com/android/tv/settings/about/AboutActivity.java b/Settings/src/com/android/tv/settings/about/AboutActivity.java
index 6fa28ef8..58a736b8 100644
--- a/Settings/src/com/android/tv/settings/about/AboutActivity.java
+++ b/Settings/src/com/android/tv/settings/about/AboutActivity.java
@@ -33,6 +33,8 @@ import android.support.annotation.NonNull;
import android.support.v17.leanback.app.GuidedStepFragment;
import android.support.v17.leanback.widget.GuidanceStylist;
import android.support.v17.leanback.widget.GuidedAction;
+import android.text.TextUtils;
+import android.text.format.DateFormat;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
@@ -43,7 +45,11 @@ import com.android.tv.settings.dialog.Layout;
import com.android.tv.settings.dialog.SettingsLayoutActivity;
import com.android.tv.settings.name.DeviceManager;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
import java.util.List;
+import java.util.Locale;
/**
* Activity which shows the build / model / legal info / etc.
@@ -219,6 +225,23 @@ public class AboutActivity extends SettingsLayoutActivity {
.title(R.string.about_model)
.description(Build.MODEL)
.build());
+
+ String patch = Build.VERSION.SECURITY_PATCH;
+ if (!TextUtils.isEmpty(patch)) {
+ try {
+ SimpleDateFormat template = new SimpleDateFormat("yyyy-MM-dd");
+ Date patchDate = template.parse(patch);
+ String format = DateFormat.getBestDateTimePattern(Locale.getDefault(), "dMMMMyyyy");
+ patch = DateFormat.format(format, patchDate).toString();
+ } catch (ParseException e) {
+ // broken parse; fall through and use the raw string
+ }
+ header.add(new Layout.Status.Builder(res)
+ .title(R.string.security_patch)
+ .description(patch)
+ .build());
+ }
+
header.add(new Layout.Action.Builder(res, KEY_VERSION)
.title(R.string.about_version)
.description(Build.VERSION.RELEASE)