Merge "Fix BiDi issues in app error dialogs" into nyc-dev
diff --git a/services/core/java/com/android/server/am/AppErrorDialog.java b/services/core/java/com/android/server/am/AppErrorDialog.java
index 86cdbcc..ddfab4d 100644
--- a/services/core/java/com/android/server/am/AppErrorDialog.java
+++ b/services/core/java/com/android/server/am/AppErrorDialog.java
@@ -25,6 +25,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
+import android.text.BidiFormatter;
import android.util.Slog;
import android.view.LayoutInflater;
import android.view.View;
@@ -68,18 +69,21 @@
mProc = data.proc;
mResult = data.result;
mRepeating = data.repeating;
+ BidiFormatter bidi = BidiFormatter.getInstance();
+
if ((mProc.pkgList.size() == 1) &&
(mName = context.getPackageManager().getApplicationLabel(mProc.info)) != null) {
setTitle(res.getString(
mRepeating ? com.android.internal.R.string.aerr_application_repeated
: com.android.internal.R.string.aerr_application,
- mName.toString(), mProc.info.processName));
+ bidi.unicodeWrap(mName.toString()),
+ bidi.unicodeWrap(mProc.info.processName)));
} else {
mName = mProc.processName;
setTitle(res.getString(
mRepeating ? com.android.internal.R.string.aerr_process_repeated
: com.android.internal.R.string.aerr_process,
- mName.toString()));
+ bidi.unicodeWrap(mName.toString())));
}
setCancelable(false);
diff --git a/services/core/java/com/android/server/am/AppNotRespondingDialog.java b/services/core/java/com/android/server/am/AppNotRespondingDialog.java
index 6d1d9f3..c6befd7 100644
--- a/services/core/java/com/android/server/am/AppNotRespondingDialog.java
+++ b/services/core/java/com/android/server/am/AppNotRespondingDialog.java
@@ -27,6 +27,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
+import android.text.BidiFormatter;
import android.util.Slog;
import android.view.LayoutInflater;
import android.view.View;
@@ -84,9 +85,11 @@
}
}
+ BidiFormatter bidi = BidiFormatter.getInstance();
+
setTitle(name2 != null
- ? res.getString(resid, name1.toString(), name2.toString())
- : res.getString(resid, name1.toString()));
+ ? res.getString(resid, bidi.unicodeWrap(name1.toString()), bidi.unicodeWrap(name2.toString()))
+ : res.getString(resid, bidi.unicodeWrap(name1.toString())));
if (aboveSystem) {
getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);