e587589cda
This commit is part of a large scale change to fix errorprone errors that have been downgraded to warnings in the android source tree, so that they can be promoted to errors again. The full list of changes include the following, but not all will be present in any one individual commit: BadAnnotationImplementation BadShiftAmount BanJNDI BoxedPrimitiveEquality ComparableType ComplexBooleanConstant CollectionToArraySafeParameter ConditionalExpressionNumericPromotion DangerousLiteralNull DoubleBraceInitialization DurationFrom DurationTemporalUnit EmptyTopLevelDeclaration EqualsNull EqualsReference FormatString FromTemporalAccessor GetClassOnAnnotation GetClassOnClass HashtableContains IdentityBinaryExpression IdentityHashMapBoxing InstantTemporalUnit InvalidTimeZoneID InvalidZoneId IsInstanceIncompatibleType JUnitParameterMethodNotFound LockOnBoxedPrimitive MathRoundIntLong MislabeledAndroidString MisusedDayOfYear MissingSuperCall MisusedWeekYear ModifyingCollectionWithItself NoCanIgnoreReturnValueOnClasses NonRuntimeAnnotation NullableOnContainingClass NullTernary OverridesJavaxInjectableMethod ParcelableCreator PeriodFrom PreconditionsInvalidPlaceholder ProtoBuilderReturnValueIgnored ProtoFieldNullComparison RandomModInteger RectIntersectReturnValueIgnored ReturnValueIgnored SelfAssignment SelfComparison SelfEquals SizeGreaterThanOrEqualsZero StringBuilderInitWithChar TreeToString TryFailThrowable UnnecessaryCheckNotNull UnusedCollectionModifiedInPlace XorPower See https://errorprone.info/bugpatterns for more information on the checks. Bug: 253827323 Test: m RUN_ERROR_PRONE=true javac-check Change-Id: I9393ceac22201e2bde4d5af7ec13e90d94956ed7 |
||
---|---|---|
.. | ||
Android.bp | ||
ImageGenerator.java | ||
ImageGenerator.mf | ||
README.md |
Recovery Image Generator
This program uses java.awt.Graphics2D to generate the background text files used under recovery mode. And thus we don't need to do the manual work by running emulators with different dpi.
Usage:
java -jar path_to_jar --image_width imageWidth --text_name textName --font_dir fontDirectory --resource_dir resourceDirectory --output_file outputFilename
Description of the parameters:
imageWidth
: The number of pixels per line; and the text strings will be wrapped accordingly.textName
: The description of the text string, e.g. "recovery_erasing", "recovery_installing_security"fontDirectory
: The directory that contains all the support .ttf | .ttc files, e.g. $OUT/system/fonts/resourceDirectory
: The resource directory that contains all the translated strings in xml format, e.g. bootable/recovery/tools/recovery_l10n/res/outputFilename
: Path to the generated image.
Locales
Supported locales and background texts are located in tools/recovery_l10n/res/. For each background text, the tool renders a localized image for every supported locale.
Each individual localized image contains an encoded locale header string, and the rendered
background text. The locale header string is generated by Locale.forLanguageTag
. And sample
result include en-US
, zh-CN
, etc. These individual images are then concatenated together to
form the final resource image that locates in res/images, e.g. install_text.png