OSDN Git Service

Improved wipe reason information for RecoverySystem
authorYutaro Maruyama <yutaro.maruyama@sony.com>
Fri, 30 Mar 2018 04:36:37 +0000 (12:36 +0800)
committerYutaro Maruyama <Yutaro.Maruyama@sony.com>
Wed, 13 Feb 2019 01:53:16 +0000 (10:53 +0900)
More information will be useful to investigate unintentional wipe
for users. Added timestamp information into reason text.

Bug: 120586954
Change-Id: I26dd4eff815d736bf34e944be6843cbb80515ca9

core/java/android/os/RecoverySystem.java

index 8492b0c..3ee54ce 100644 (file)
@@ -32,6 +32,7 @@ import android.content.pm.PackageManager;
 import android.provider.Settings;
 import android.telephony.euicc.EuiccManager;
 import android.text.TextUtils;
+import android.text.format.DateFormat;
 import android.util.Log;
 import android.view.Display;
 import android.view.WindowManager;
@@ -762,7 +763,8 @@ public class RecoverySystem {
 
         String reasonArg = null;
         if (!TextUtils.isEmpty(reason)) {
-            reasonArg = "--reason=" + sanitizeArg(reason);
+            String timeStamp = DateFormat.format("yyyy-MM-ddTHH:mm:ssZ", System.currentTimeMillis()).toString();
+            reasonArg = "--reason=" + sanitizeArg(reason + "," + timeStamp);
         }
 
         final String localeArg = "--locale=" + Locale.getDefault().toLanguageTag() ;