记录:ota升级后recovery没有显示升级字符

语言环境在印度尼西亚语,执行ota后出现的recovery界面,观察没有提示的字符,其他语言都有。

在 recovery.cpp 中这里打log

  Device::BuiltinAction start_recovery(Device* device, const std::vector& args) {
   ......
  std::vector title_lines =
      android::base::Split(android::base::GetProperty("ro.bootimage.build.fingerprint", ""), ":");
  title_lines.insert(std::begin(title_lines), "Android Recovery");
  ui->SetTitle(title_lines);

  ui->ResetKeyInterruptStatus();
  device->StartRecovery();

  printf("Command:");
  for (const auto& arg : args) {
    printf(" =====\"%s\"", arg.c_str());
  }
  printf("\n\n");

  property_list(print_property, nullptr);
  printf("\n");
  ui->Print("Supported API: %d\n", kRecoveryApiVersion);

编译烧录,执行ota升级,再到recovery完成
adb pull cache/recovery/last_log C:\Users\xxx\Desktop\recovery
打开查看到如下图:输出的命令是 --locale=id-ID

图片.png

对比settings中设置语言应该是 in-ID,
所以测试将语言--locale=id-ID 改成 --locale=in-ID

修改command 输入的地方修改语言成 in-ID
所以找到 RecoverySystem.java

public static void installPackage(Context context, File packageFile, boolean processed)
        throws IOException {
 ......

        final String filenameArg = "--update_package=" + filename + "\n";
        String str = Locale.getDefault().toLanguageTag();
        if(str.equals("id-ID")){
            str = "in-ID";
        }//fix for recovery ui ,show text
        final String localeArg = "--locale=" + str + "\n";
        final String securityArg = "--security\n";

......
}

最后测试,成功显示出来!

图片.png

你可能感兴趣的:(记录:ota升级后recovery没有显示升级字符)