Skip to content

Commit 4391682

Browse files
committed
Print additional info in the log stream when android_models.properties is missing or in the wrong form. Also added a reference to the current version used in wp-android.
1 parent 023ee88 commit 4391682

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

WordPressUtils/src/main/java/org/wordpress/android/util/AppLog.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public static ArrayList<String> toHtmlList(Context context) {
251251
}
252252

253253
// add version & device info - be sure to change HEADER_LINE_COUNT if additional lines are added
254-
items.add("<strong>" + appName + " - " + PackageUtils.getVersionName(context) + " - Version code:" + PackageUtils.getVersionCode(context) + "</strong>");
254+
items.add("<strong>" + appName + " - " + PackageUtils.getVersionName(context) + " - Version code: " + PackageUtils.getVersionCode(context) + "</strong>");
255255
items.add("<strong>Android device name: " + DeviceUtils.getInstance().getDeviceName(context) + "</strong>");
256256

257257
Iterator<LogEntry> it = mLogEntries.iterator();
@@ -282,7 +282,7 @@ public static String toPlainText(Context context) {
282282

283283
// add version & device info
284284
sb.append(appName).append(" - ").append(PackageUtils.getVersionName(context))
285-
.append(" - Version code:").append(PackageUtils.getVersionCode(context)).append("\n")
285+
.append(" - Version code: ").append(PackageUtils.getVersionCode(context)).append("\n")
286286
.append("Android device name: ").append(DeviceUtils.getInstance().getDeviceName(context)).append("\n\n");
287287

288288
Iterator<LogEntry> it = mLogEntries.iterator();

WordPressUtils/src/main/java/org/wordpress/android/util/DeviceUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public String getDeviceName(Context context) {
6767
model = decodedModel;
6868
}
6969
} catch (IOException e) {
70-
AppLog.e(T.UTILS, e.getMessage());
70+
AppLog.e(T.UTILS, "Can't read `android_models.properties` file from assets, or it's in the wrong form.", e);
71+
AppLog.d(T.UTILS, "If you need more info about the file, please check the reference implementation available " +
72+
"here: https://github.com/wordpress-mobile/WordPress-Android/blob/dd989429bd701a66bcba911de08f2e8d336798ef/WordPress/src/main/assets/android_models.properties");
7173
}
7274

7375
if (model == null) { //Device model not found in the list

0 commit comments

Comments
 (0)