@Override public void onSignalStrengthsChanged(SignalStrength signalStrength) { super.onSignalStrengthsChanged(signalStrength); if (signalStrength.isGsm()) { int asu = signalStrength.getGsmSignalStrength(); int RSSIindBM = -113 + 2 * asu; NotificationHelper notificationHelper = new NotificationHelper(getApplicationContext()); SharedPreferences settings = getSharedPreferences("TiTiPreferences", 0); int threshold = settings.getInt("NetworkSignalStrengthThreshold", -90); if (RSSIindBM < threshold) { if (GlobalValuesNStatus.getInstance().muteSignalStrengthAlertForNTimes <= 0) { notificationHelper.createNotification( "TiTi", "Network Signal is getting poor... " + RSSIindBM + "db Calls may drop", 6767, new Intent(getApplicationContext(), NetworkSignalStrengthSettings.class), true, false, "serious"); GlobalValuesNStatus.getInstance().muteSignalStrengthAlertForNTimes = 5; // mute for 5 occurrence } else { GlobalValuesNStatus.getInstance().muteSignalStrengthAlertForNTimes--; } } else { NotificationManager nMgr = (NotificationManager) getApplicationContext() .getSystemService(getApplicationContext().NOTIFICATION_SERVICE); nMgr.cancel(6767); // Signals improved cancel notification GlobalValuesNStatus.getInstance().muteSignalStrengthAlertForNTimes = 0; } } }
public final void onSignalStrengthsChanged(SignalStrength paramSignalStrength) { super.onSignalStrengthsChanged(paramSignalStrength); if (!paramSignalStrength.isGsm()) { ba.lL(paramSignalStrength.getCdmaDbm()); return; } ba.lL(paramSignalStrength.getGsmSignalStrength()); }
@Override public void onSignalStrengthsChanged(SignalStrength signalStrength) { CellLocationInfo.Params p = new CellLocationInfo.Params(baseStation); p.time = System.nanoTime(); if (signalStrength.isGsm()) { p.asu = signalStrength.getGsmSignalStrength(); } else { p.dbm = signalStrength.getCdmaDbm(); } baseStation = new CellLocationInfo(p); notifyListeners(EVENT_CELL_STRENGTH); }