Fix arabic language % character in wrong place
info.batteryPercentString is applied language format. We don't need to format it again in BidiFormatter. Fixes: 136699046 Test: visual Change-Id: Ie89823c23fd23bd6a9a97821f3062cad4dfb3709
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
package com.android.settings.fuelgauge;
|
package com.android.settings.fuelgauge;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.BidiFormatter;
|
|
||||||
|
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
import androidx.preference.PreferenceScreen;
|
import androidx.preference.PreferenceScreen;
|
||||||
@@ -49,8 +48,8 @@ public class TopLevelBatteryPreferenceController extends BasePreferenceControlle
|
|||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
return mContext.getResources().getBoolean(R.bool.config_show_top_level_battery)
|
return mContext.getResources().getBoolean(R.bool.config_show_top_level_battery)
|
||||||
? AVAILABLE_UNSEARCHABLE
|
? AVAILABLE_UNSEARCHABLE
|
||||||
: UNSUPPORTED_ON_DEVICE;
|
: UNSUPPORTED_ON_DEVICE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -79,15 +78,14 @@ public class TopLevelBatteryPreferenceController extends BasePreferenceControlle
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
CharSequence label;
|
CharSequence label;
|
||||||
final BidiFormatter formatter = BidiFormatter.getInstance();
|
|
||||||
if (!info.discharging && info.chargeLabel != null) {
|
if (!info.discharging && info.chargeLabel != null) {
|
||||||
label = info.chargeLabel;
|
label = info.chargeLabel;
|
||||||
} else if (info.remainingLabel == null) {
|
} else if (info.remainingLabel == null) {
|
||||||
label = info.batteryPercentString;
|
label = info.batteryPercentString;
|
||||||
} else {
|
} else {
|
||||||
label = context.getString(R.string.power_remaining_settings_home_page,
|
label = context.getString(R.string.power_remaining_settings_home_page,
|
||||||
formatter.unicodeWrap(info.batteryPercentString),
|
info.batteryPercentString,
|
||||||
formatter.unicodeWrap(info.remainingLabel));
|
info.remainingLabel);
|
||||||
}
|
}
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user