Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a85d10e authored by kaiyiz's avatar kaiyiz
Browse files

Settings: Fix default name of SIM 1/2 all display incorrect

The max length of the display name is too short.

Change the max length.

CRs-Fixed: 753104

Change-Id: Ie2e2e97798808850eb0dfc62d88a417d29f9275b
parent 77d00e35
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        android:dialogTitle="@string/sim_naming_title"
        android:persistent="false"
        android:singleLine="true"
        android:maxLength="6"
        android:maxLength="@integer/sim_name_length"
        android:layout_marginLeft="16dip"
        android:inputType="textNoSuggestions"/>
</PreferenceScreen>
+4 −3
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ public class SimConfiguration extends PreferenceActivity implements TextWatcher

    private static final Uri SYSTEM_SETTINGS_URI = Uri.parse("content://settings/system");

    private static final int CHANNEL_NAME_MAX_LENGTH = 6;
    private int mChannelNameMaxLength;
    //The default legth to dispaly a character
    private static final int CHAR_LEN = 1;

@@ -159,6 +159,7 @@ public class SimConfiguration extends PreferenceActivity implements TextWatcher
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.multi_sim_configuration);

        mChannelNameMaxLength = getResources().getInteger(R.integer.sim_name_length);
        Intent intent = getIntent();
        mSubscription = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
                PhoneConstants.SUB1);
@@ -296,8 +297,8 @@ public class SimConfiguration extends PreferenceActivity implements TextWatcher
            }

            // Too many characters,cut off the new added characters
            if (wholeLen > CHANNEL_NAME_MAX_LENGTH) {
                int cutNum = wholeLen - CHANNEL_NAME_MAX_LENGTH;
            if (wholeLen > mChannelNameMaxLength) {
                int cutNum = wholeLen - mChannelNameMaxLength;
                // Get start position of characters that will be cut off
                int changeEndPos = mChangeStartPos + mChangeCount - 1;
                int cutLen = 0;