Merge "Fix crash due to over limited length." into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
60dd62bbc1
@@ -46,7 +46,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:paddingTop="@dimen/sim_label_padding"
|
android:paddingTop="@dimen/sim_label_padding"
|
||||||
android:maxLength="50"
|
android:maxLength="@integer/sim_label_max_length"
|
||||||
android:singleLine="true"/>
|
android:singleLine="true"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@@ -42,4 +42,6 @@
|
|||||||
<integer name="pointer_scale_seek_bar_end">3</integer>
|
<integer name="pointer_scale_seek_bar_end">3</integer>
|
||||||
|
|
||||||
<integer name="max_integer">2147483647</integer>
|
<integer name="max_integer">2147483647</integer>
|
||||||
|
|
||||||
|
<integer name="sim_label_max_length">50</integer>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -165,9 +165,9 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen
|
|||||||
}
|
}
|
||||||
final CharSequence displayName = SubscriptionUtil.getUniqueSubscriptionDisplayName(
|
final CharSequence displayName = SubscriptionUtil.getUniqueSubscriptionDisplayName(
|
||||||
info, getContext());
|
info, getContext());
|
||||||
mNameView.setText(displayName);
|
|
||||||
if (!TextUtils.isEmpty(displayName)) {
|
if (!TextUtils.isEmpty(displayName)) {
|
||||||
mNameView.setSelection(displayName.length());
|
mNameView.setSelection(Math.min(displayName.length(),
|
||||||
|
getResources().getInteger(R.integer.sim_label_max_length)));
|
||||||
}
|
}
|
||||||
|
|
||||||
mColorSpinner = view.findViewById(R.id.color_spinner);
|
mColorSpinner = view.findViewById(R.id.color_spinner);
|
||||||
@@ -176,7 +176,7 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen
|
|||||||
mColorSpinner.setAdapter(adapter);
|
mColorSpinner.setAdapter(adapter);
|
||||||
mColorSpinner.setSelection(getSimColorIndex(info.getIconTint()));
|
mColorSpinner.setSelection(getSimColorIndex(info.getIconTint()));
|
||||||
|
|
||||||
if(Flags.isDualSimOnboardingEnabled()){
|
if (Flags.isDualSimOnboardingEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,10 +293,10 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the color index from previous color that defined in Android OS
|
* Get the color index from previous color that defined in Android OS
|
||||||
* (frameworks/base/core/res/res/values/arrays.xml). If can't find the color, continue to look
|
* (frameworks/base/core/res/res/values/arrays.xml). If can't find the color, continue to look
|
||||||
* for it in the new color plattee. If not, give it the first index.
|
* for it in the new color plattee. If not, give it the first index.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private int getSimColorIndex(int color) {
|
private int getSimColorIndex(int color) {
|
||||||
int index = -1;
|
int index = -1;
|
||||||
|
Reference in New Issue
Block a user