From a78b2d22568d47492ba937fde87e6c6996a995a4 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Fri, 6 Jan 2017 11:44:40 -0800 Subject: Update background text images in recovery Locale texts are missing in the recovery log due to an extra empty locale chunk in the png file. Fix the bug in the app and regenerate all the background texts and compress the file with pngcrush + zopflipng. Bug: 34054052 Test: Locale texts logged successfully on angler Change-Id: I89f823a53c1eb69756183e8e11113216d093304f --- res-hdpi/images/erasing_text.png | Bin 50373 -> 50680 bytes res-hdpi/images/error_text.png | Bin 35720 -> 36036 bytes res-hdpi/images/installing_security_text.png | Bin 111582 -> 113819 bytes res-hdpi/images/installing_text.png | Bin 102734 -> 104768 bytes res-hdpi/images/no_command_text.png | Bin 61665 -> 62037 bytes res-mdpi/images/erasing_text.png | Bin 29558 -> 29898 bytes res-mdpi/images/error_text.png | Bin 20926 -> 21147 bytes res-mdpi/images/installing_security_text.png | Bin 69709 -> 70010 bytes res-mdpi/images/installing_text.png | Bin 61548 -> 61701 bytes res-mdpi/images/no_command_text.png | Bin 34232 -> 34683 bytes res-xhdpi/images/erasing_text.png | Bin 72595 -> 73361 bytes res-xhdpi/images/error_text.png | Bin 51739 -> 52019 bytes res-xhdpi/images/installing_security_text.png | Bin 195507 -> 196871 bytes res-xhdpi/images/installing_text.png | Bin 174877 -> 175570 bytes res-xhdpi/images/no_command_text.png | Bin 85999 -> 86622 bytes res-xxhdpi/images/erasing_text.png | Bin 119060 -> 121386 bytes res-xxhdpi/images/error_text.png | Bin 84432 -> 85555 bytes res-xxhdpi/images/installing_security_text.png | Bin 447442 -> 387979 bytes res-xxhdpi/images/installing_text.png | Bin 416541 -> 355503 bytes res-xxhdpi/images/no_command_text.png | Bin 243828 -> 148704 bytes res-xxxhdpi/images/erasing_text.png | Bin 264753 -> 257605 bytes res-xxxhdpi/images/error_text.png | Bin 178491 -> 173381 bytes res-xxxhdpi/images/installing_security_text.png | Bin 611664 -> 620933 bytes res-xxxhdpi/images/installing_text.png | Bin 569291 -> 581822 bytes res-xxxhdpi/images/no_command_text.png | Bin 333053 -> 322613 bytes .../src/com/android/recovery_l10n/Main.java | 22 +++++++++++++++++++-- 26 files changed, 20 insertions(+), 2 deletions(-) diff --git a/res-hdpi/images/erasing_text.png b/res-hdpi/images/erasing_text.png index 2186c1950..684fc7c6c 100644 Binary files a/res-hdpi/images/erasing_text.png and b/res-hdpi/images/erasing_text.png differ diff --git a/res-hdpi/images/error_text.png b/res-hdpi/images/error_text.png index 9700f459f..00c485d70 100644 Binary files a/res-hdpi/images/error_text.png and b/res-hdpi/images/error_text.png differ diff --git a/res-hdpi/images/installing_security_text.png b/res-hdpi/images/installing_security_text.png index 0f605952c..dadcfc32b 100644 Binary files a/res-hdpi/images/installing_security_text.png and b/res-hdpi/images/installing_security_text.png differ diff --git a/res-hdpi/images/installing_text.png b/res-hdpi/images/installing_text.png index ec8b875a5..abe73b4b9 100644 Binary files a/res-hdpi/images/installing_text.png and b/res-hdpi/images/installing_text.png differ diff --git a/res-hdpi/images/no_command_text.png b/res-hdpi/images/no_command_text.png index 3eddcbbed..958e10613 100644 Binary files a/res-hdpi/images/no_command_text.png and b/res-hdpi/images/no_command_text.png differ diff --git a/res-mdpi/images/erasing_text.png b/res-mdpi/images/erasing_text.png index b0dd3c6d3..10e317829 100644 Binary files a/res-mdpi/images/erasing_text.png and b/res-mdpi/images/erasing_text.png differ diff --git a/res-mdpi/images/error_text.png b/res-mdpi/images/error_text.png index 6a47a5956..0022d10c1 100644 Binary files a/res-mdpi/images/error_text.png and b/res-mdpi/images/error_text.png differ diff --git a/res-mdpi/images/installing_security_text.png b/res-mdpi/images/installing_security_text.png index 149939862..7a4cd414b 100644 Binary files a/res-mdpi/images/installing_security_text.png and b/res-mdpi/images/installing_security_text.png differ diff --git a/res-mdpi/images/installing_text.png b/res-mdpi/images/installing_text.png index 01e9bfefb..ee95e569c 100644 Binary files a/res-mdpi/images/installing_text.png and b/res-mdpi/images/installing_text.png differ diff --git a/res-mdpi/images/no_command_text.png b/res-mdpi/images/no_command_text.png index d340df518..af7660908 100644 Binary files a/res-mdpi/images/no_command_text.png and b/res-mdpi/images/no_command_text.png differ diff --git a/res-xhdpi/images/erasing_text.png b/res-xhdpi/images/erasing_text.png index 2f8b46918..91cc35871 100644 Binary files a/res-xhdpi/images/erasing_text.png and b/res-xhdpi/images/erasing_text.png differ diff --git a/res-xhdpi/images/error_text.png b/res-xhdpi/images/error_text.png index ad18851c5..772b139e6 100644 Binary files a/res-xhdpi/images/error_text.png and b/res-xhdpi/images/error_text.png differ diff --git a/res-xhdpi/images/installing_security_text.png b/res-xhdpi/images/installing_security_text.png index acc6a7c2b..a7113a04a 100644 Binary files a/res-xhdpi/images/installing_security_text.png and b/res-xhdpi/images/installing_security_text.png differ diff --git a/res-xhdpi/images/installing_text.png b/res-xhdpi/images/installing_text.png index 32897d0f0..566eb0658 100644 Binary files a/res-xhdpi/images/installing_text.png and b/res-xhdpi/images/installing_text.png differ diff --git a/res-xhdpi/images/no_command_text.png b/res-xhdpi/images/no_command_text.png index eb43c59c5..b8da125cb 100644 Binary files a/res-xhdpi/images/no_command_text.png and b/res-xhdpi/images/no_command_text.png differ diff --git a/res-xxhdpi/images/erasing_text.png b/res-xxhdpi/images/erasing_text.png index 8ff2b2fcf..8e8dfc450 100644 Binary files a/res-xxhdpi/images/erasing_text.png and b/res-xxhdpi/images/erasing_text.png differ diff --git a/res-xxhdpi/images/error_text.png b/res-xxhdpi/images/error_text.png index 658d4ea56..7fd1983d5 100644 Binary files a/res-xxhdpi/images/error_text.png and b/res-xxhdpi/images/error_text.png differ diff --git a/res-xxhdpi/images/installing_security_text.png b/res-xxhdpi/images/installing_security_text.png index 23fcaa441..9779927ef 100644 Binary files a/res-xxhdpi/images/installing_security_text.png and b/res-xxhdpi/images/installing_security_text.png differ diff --git a/res-xxhdpi/images/installing_text.png b/res-xxhdpi/images/installing_text.png index fd8e58464..fa488960e 100644 Binary files a/res-xxhdpi/images/installing_text.png and b/res-xxhdpi/images/installing_text.png differ diff --git a/res-xxhdpi/images/no_command_text.png b/res-xxhdpi/images/no_command_text.png index 23932d6b7..d72a840e9 100644 Binary files a/res-xxhdpi/images/no_command_text.png and b/res-xxhdpi/images/no_command_text.png differ diff --git a/res-xxxhdpi/images/erasing_text.png b/res-xxxhdpi/images/erasing_text.png index 031529371..7c198176d 100644 Binary files a/res-xxxhdpi/images/erasing_text.png and b/res-xxxhdpi/images/erasing_text.png differ diff --git a/res-xxxhdpi/images/error_text.png b/res-xxxhdpi/images/error_text.png index dba127f02..4cd2a8cc4 100644 Binary files a/res-xxxhdpi/images/error_text.png and b/res-xxxhdpi/images/error_text.png differ diff --git a/res-xxxhdpi/images/installing_security_text.png b/res-xxxhdpi/images/installing_security_text.png index 6cdbef48e..d84c5d9a9 100644 Binary files a/res-xxxhdpi/images/installing_security_text.png and b/res-xxxhdpi/images/installing_security_text.png differ diff --git a/res-xxxhdpi/images/installing_text.png b/res-xxxhdpi/images/installing_text.png index 32511a9c5..ffe1474f9 100644 Binary files a/res-xxxhdpi/images/installing_text.png and b/res-xxxhdpi/images/installing_text.png differ diff --git a/res-xxxhdpi/images/no_command_text.png b/res-xxxhdpi/images/no_command_text.png index b6cdd7718..f4f13003b 100644 Binary files a/res-xxxhdpi/images/no_command_text.png and b/res-xxxhdpi/images/no_command_text.png differ diff --git a/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java b/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java index ac94bde1c..30d45f6ae 100644 --- a/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java +++ b/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java @@ -38,6 +38,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Comparator; import java.util.HashMap; import java.util.Locale; @@ -148,11 +149,28 @@ public class Main extends Activity { mText = (TextView) findViewById(R.id.text); String[] localeNames = getAssets().getLocales(); - Arrays.sort(localeNames); + Arrays.sort(localeNames, new Comparator() { + // Override the string comparator so that en is sorted behind en_US. + // As a result, en_US will be matched first in recovery. + @Override + public int compare(String s1, String s2) { + if (s1.equals(s2)) { + return 0; + } else if (s1.startsWith(s2)) { + return -1; + } else if (s2.startsWith(s1)) { + return 1; + } + return s1.compareTo(s2); + } + }); + ArrayList locales = new ArrayList(); for (String localeName : localeNames) { Log.i(TAG, "locale = " + localeName); - locales.add(Locale.forLanguageTag(localeName)); + if (!localeName.isEmpty()) { + locales.add(Locale.forLanguageTag(localeName)); + } } final Runnable seq = buildSequence(locales.toArray(new Locale[0])); -- cgit v1.2.3