Merge "[Settings] Provide carrier name when manual network select" into rvc-d1-dev
This commit is contained in:
@@ -37,6 +37,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
|
|
||||||
|
import com.android.internal.telephony.OperatorInfo;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -175,6 +176,15 @@ public class NetworkOperatorPreference extends Preference {
|
|||||||
return CellInfoUtil.getNetworkTitle(mCellId, getOperatorNumeric());
|
return CellInfoUtil.getNetworkTitle(mCellId, getOperatorNumeric());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operator info of this cell
|
||||||
|
*/
|
||||||
|
public OperatorInfo getOperatorInfo() {
|
||||||
|
return new OperatorInfo(Objects.toString(mCellId.getOperatorAlphaLong(), ""),
|
||||||
|
Objects.toString(mCellId.getOperatorAlphaShort(), ""),
|
||||||
|
getOperatorNumeric());
|
||||||
|
}
|
||||||
|
|
||||||
private int getIconIdForCell(CellInfo ci) {
|
private int getIconIdForCell(CellInfo ci) {
|
||||||
if (ci instanceof CellInfoGsm) {
|
if (ci instanceof CellInfoGsm) {
|
||||||
return R.drawable.signal_strength_g;
|
return R.drawable.signal_strength_g;
|
||||||
|
@@ -40,6 +40,7 @@ import androidx.annotation.VisibleForTesting;
|
|||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
import androidx.preference.PreferenceCategory;
|
import androidx.preference.PreferenceCategory;
|
||||||
|
|
||||||
|
import com.android.internal.telephony.OperatorInfo;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.dashboard.DashboardFragment;
|
import com.android.settings.dashboard.DashboardFragment;
|
||||||
import com.android.settings.overlay.FeatureFactory;
|
import com.android.settings.overlay.FeatureFactory;
|
||||||
@@ -185,12 +186,12 @@ public class NetworkSelectSettings extends DashboardFragment {
|
|||||||
|
|
||||||
mRequestIdManualNetworkSelect = getNewRequestId();
|
mRequestIdManualNetworkSelect = getNewRequestId();
|
||||||
mWaitingForNumberOfScanResults = MIN_NUMBER_OF_SCAN_REQUIRED;
|
mWaitingForNumberOfScanResults = MIN_NUMBER_OF_SCAN_REQUIRED;
|
||||||
final String operatorNumeric = mSelectedPreference.getOperatorNumeric();
|
final OperatorInfo operator = mSelectedPreference.getOperatorInfo();
|
||||||
ThreadUtils.postOnBackgroundThread(() -> {
|
ThreadUtils.postOnBackgroundThread(() -> {
|
||||||
final Message msg = mHandler.obtainMessage(
|
final Message msg = mHandler.obtainMessage(
|
||||||
EVENT_SET_NETWORK_SELECTION_MANUALLY_DONE);
|
EVENT_SET_NETWORK_SELECTION_MANUALLY_DONE);
|
||||||
msg.obj = mTelephonyManager.setNetworkSelectionModeManual(
|
msg.obj = mTelephonyManager.setNetworkSelectionModeManual(
|
||||||
operatorNumeric, true /* persistSelection */);
|
operator, true /* persistSelection */);
|
||||||
msg.sendToTarget();
|
msg.sendToTarget();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user