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

Commit 4366ceea authored by SongFerngWang's avatar SongFerngWang
Browse files

Remove the phone number at Rename page

Bug: 318310357
Bug: 298898436
Bug: 298891941
Test: Build pass
Change-Id: I6e77f2a8858e17e3e56c01769e6eb5b4fd478a04
parent 0a7fb7fe
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -80,13 +80,15 @@
                android:paddingTop="@dimen/sim_label_padding"
                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead"
                android:textColor="?android:attr/textColorPrimary"
                android:text="@string/status_operator"/>
                android:text="@string/status_operator"
                android:visibility="gone"/>

            <TextView
                android:id="@+id/operator_name_value"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/device_info_not_available"/>
                android:text="@string/device_info_not_available"
                android:visibility="gone"/>

            <TextView
                android:id="@+id/number_label"
@@ -95,13 +97,15 @@
                android:paddingTop="@dimen/sim_label_padding"
                android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead"
                android:textColor="?android:attr/textColorPrimary"
                android:text="@string/status_number_sim_status"/>
                android:text="@string/status_number_sim_status"
                android:visibility="gone"/>

            <TextView
                android:id="@+id/number_value"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/device_info_not_available"/>
                android:text="@string/device_info_not_available"
                android:visibility="gone"/>

        </LinearLayout>

+11 −1
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import androidx.appcompat.app.AlertDialog;

import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.flags.Flags;
import com.android.settings.network.SubscriptionUtil;

import com.google.common.collect.ImmutableMap;
@@ -131,7 +132,7 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen
                LayoutInflater.class);
        final View view = layoutInflater.inflate(R.layout.dialog_mobile_network_rename, null);
        populateView(view);
        builder.setTitle(R.string.mobile_network_sim_name)
        builder.setTitle(R.string.mobile_network_sim_label_color_title)
                .setView(view)
                .setPositiveButton(R.string.mobile_network_sim_name_rename, (dialog, which) -> {
                    mSubscriptionManager.setDisplayName(mNameView.getText().toString(), mSubId,
@@ -175,14 +176,23 @@ public class RenameMobileNetworkDialogFragment extends InstrumentedDialogFragmen
        mColorSpinner.setAdapter(adapter);
        mColorSpinner.setSelection(getSimColorIndex(info.getIconTint()));

        if(Flags.isDualSimOnboardingEnabled()){
            return;
        }

        final TextView operatorTitle = view.findViewById(R.id.operator_name_label);
        operatorTitle.setVisibility(View.VISIBLE);

        final TextView operatorName = view.findViewById(R.id.operator_name_value);
        mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubId);
        operatorName.setVisibility(View.VISIBLE);
        operatorName.setText(info.getCarrierName());

        final TextView phoneTitle = view.findViewById(R.id.number_label);
        phoneTitle.setVisibility(info.isOpportunistic() ? View.GONE : View.VISIBLE);

        final TextView phoneNumber = view.findViewById(R.id.number_value);
        phoneNumber.setVisibility(View.VISIBLE);
        final String pn = SubscriptionUtil.getBidiFormattedPhoneNumber(getContext(), info);
        if (!TextUtils.isEmpty(pn)) {
            phoneNumber.setText(pn);