From b80c3cd1cff815d3d08a0996d7f73ca09f6e9032 Mon Sep 17 00:00:00 2001 From: aquanox Date: Sat, 2 Sep 2017 01:49:50 +0800 Subject: [PATCH] support chinese character for ota package's path It had been tested work well for both english characters and chinese english misc characters. Because utf-8 is supported in recovery mode, so if we stored message by utf-8 encoding, we can handle non-ascii character for ota packages's path. Change-Id: I19555dc75640bbfd481f23009bff511c07ae0bdb Signed-off-by: aquanox --- services/core/java/com/android/server/RecoverySystemService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/RecoverySystemService.java b/services/core/java/com/android/server/RecoverySystemService.java index 3c8c699a65bb..1517887efec2 100644 --- a/services/core/java/com/android/server/RecoverySystemService.java +++ b/services/core/java/com/android/server/RecoverySystemService.java @@ -285,8 +285,9 @@ public final class RecoverySystemService extends SystemService { // Send the BCB commands if it's to setup BCB. if (isSetup) { - dos.writeInt(command.length()); - dos.writeBytes(command); + byte[] cmdUtf8 = command.getBytes("UTF-8"); + dos.writeInt(cmdUtf8.length); + dos.write(cmdUtf8, 0, cmdUtf8.length); dos.flush(); } -- 2.11.0