### Question:
WearCellularMediator implements
        PowerTracker.Listener,
        UserAbsentRadiosOffObserver.Listener,
        SignalStateDetector.Listener { public void updateProxyConnected(boolean isProxyConnected) { mIsProxyConnected = isProxyConnected; updateRadioPower(); } WearCellularMediator(
            Context context,
            TelephonyManager telephonyManager,
            WearCellularMediatorSettings settings,
            PowerTracker powerTracker,
            UserAbsentRadiosOffObserver userAbsentRadiosOffObserver); @VisibleForTesting  WearCellularMediator(
            Context context,
            ContentResolver contentResolver,
            TelephonyManager telephonyManager,
            WearCellularMediatorSettings wearCellularMediatorSettings,
            PowerTracker powerTracker,
            UserAbsentRadiosOffObserver userAbsentRadiosOffObserver,
            SignalStateDetector signalStateDetector); void onBootCompleted(boolean proxyConnected); @Override void onPowerSaveModeChanged(); @Override void onChargingStateChanged(); @Override void onDeviceIdleModeChanged(); void updateActivityMode(boolean activeMode); @Override void onUserAbsentRadiosOffChanged(boolean isEnabled); void updateProxyConnected(boolean isProxyConnected); void updateNumHighBandwidthRequests(int numHighBandwidthRequests); void updateNumCellularRequests(int numCellularRequests); void updateDetectorState(boolean signalDetectorAllowed); @Override void onSignalStateChanged(int signalState); void dump(IndentingPrintWriter ipw); static final String TAG; static final String CELL_AUTO_SETTING_KEY; static final int CELL_AUTO_OFF; static final int CELL_AUTO_ON; static final int CELL_AUTO_SETTING_DEFAULT; static final Uri CELL_AUTO_SETTING_URI; static final Uri CELL_ON_URI; static final int RADIO_ON_STATE_UNKNOWN; static final int RADIO_ON_STATE_ON; static final int RADIO_ON_STATE_OFF; }### Answer:
@Test public void testProxyDisconnect() { mMediator.updateProxyConnected(false); verifyPowerChange(WearCellularMediator.MSG_ENABLE_CELL, WearCellularMediator.Reason.ON_PROXY_DISCONNECTED); }
@Test public void testSimCardAbsent() { mMediator.updateProxyConnected(false); reset(mockTelephonyManager); Intent simIntent = new Intent(TelephonyIntents.ACTION_SIM_STATE_CHANGED); simIntent.putExtra(IccCardConstants.INTENT_KEY_ICC_STATE, IccCardConstants.INTENT_VALUE_ICC_ABSENT); shadowApplication.sendBroadcast(simIntent); verifyPowerChange(WearCellularMediator.MSG_DISABLE_CELL, WearCellularMediator.Reason.OFF_SIM_ABSENT); Intent intent = new Intent(PhoneConstants.ACTION_SUBSCRIPTION_PHONE_STATE_CHANGED); intent.putExtra(TelephonyManager.EXTRA_STATE, TelephonyManager.EXTRA_STATE_OFFHOOK); shadowApplication.sendBroadcast(intent); verifyPowerChange(WearCellularMediator.MSG_ENABLE_CELL, WearCellularMediator.Reason.ON_PHONE_CALL); }