Search in sources :

Example 1 with CellSignalStrength

use of android.telephony.CellSignalStrength in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class NetworkOperatorPreference method refresh.

/**
 * Refresh the NetworkOperatorPreference by updating the title and the icon.
 */
public void refresh() {
    if (DBG)
        Log.d(TAG, "refresh the network: " + CellInfoUtil.getNetworkTitle(mCellInfo));
    String networkTitle = CellInfoUtil.getNetworkTitle(mCellInfo);
    if (CellInfoUtil.isForbidden(mCellInfo, mForbiddenPlmns)) {
        networkTitle += " " + getContext().getResources().getString(R.string.forbidden_network);
    }
    setTitle(networkTitle);
    final CellSignalStrength signalStrength = mCellInfo.getCellSignalStrength();
    final int level = signalStrength != null ? signalStrength.getLevel() : LEVEL_NONE;
    if (DBG)
        Log.d(TAG, "refresh level: " + String.valueOf(level));
    if (mLevel != level) {
        mLevel = level;
        updateIcon(mLevel);
    }
}
Also used : CellSignalStrength(android.telephony.CellSignalStrength)

Aggregations

CellSignalStrength (android.telephony.CellSignalStrength)1