@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;
     }
   }
 }
Esempio n. 2
0
File: bp.java Progetto: ZoneMo/test
 public final void onSignalStrengthsChanged(SignalStrength paramSignalStrength) {
   super.onSignalStrengthsChanged(paramSignalStrength);
   if (bo.a(this.geG) == 2) bo.ep(paramSignalStrength.getCdmaDbm());
   if (bo.a(this.geG) == 1) bo.ep(-113 + 2 * paramSignalStrength.getGsmSignalStrength());
   if (bo.b(this.geG) != null) bo.b(this.geG).listen(bo.c(this.geG), 0);
   bo.d(this.geG);
 }
Esempio n. 3
0
File: bb.java Progetto: ZoneMo/test
 public final void onSignalStrengthsChanged(SignalStrength paramSignalStrength) {
   super.onSignalStrengthsChanged(paramSignalStrength);
   if (!paramSignalStrength.isGsm()) {
     ba.lL(paramSignalStrength.getCdmaDbm());
     return;
   }
   ba.lL(paramSignalStrength.getGsmSignalStrength());
 }
Esempio n. 4
0
 // Get the Signal strength from the provider, each time there is an update
 @Override
 public void onSignalStrengthsChanged(SignalStrength signalStrength) {
   super.onSignalStrengthsChanged(signalStrength);
   sigLevel = signalStrength.getGsmSignalStrength();
   GsmCellLocation gsmInfo = (GsmCellLocation) phoneStateManager.getCellLocation();
   cellID = gsmInfo.getCid() / 10; // cut off sector ID
   postSignalLocation();
 }
  private void sendLog() {
    if (mKaaStarted) {

      mSentLogCount++;
      mLastLogTime = System.currentTimeMillis();

      /*
       * Create an instance of a cell monitor log record and populate it with the latest values.
       */
      CellMonitorLog cellMonitorLog = new CellMonitorLog();
      cellMonitorLog.setLogTime(mLastLogTime);
      String networkOperator = mTelephonyManager.getNetworkOperator();
      if (networkOperator == null || networkOperator.isEmpty()) {
        cellMonitorLog.setNetworkOperatorCode(UNDEFINED);
      } else {
        cellMonitorLog.setNetworkOperatorCode(
            Integer.valueOf(mTelephonyManager.getNetworkOperator()));
      }
      cellMonitorLog.setNetworkOperatorName(mTelephonyManager.getNetworkOperatorName());

      int cid = UNDEFINED;
      int lac = UNDEFINED;

      if (mCellLocation != null && mCellLocation instanceof GsmCellLocation) {
        GsmCellLocation gsmCellLocation = (GsmCellLocation) mCellLocation;
        cid = gsmCellLocation.getCid();
        lac = gsmCellLocation.getLac();
      }

      cellMonitorLog.setGsmCellId(cid);
      cellMonitorLog.setGsmLac(lac);

      int gsmSignalStrength = UNDEFINED;

      if (mSignalStrength != null) {
        gsmSignalStrength = mSignalStrength.getGsmSignalStrength();
      }
      cellMonitorLog.setSignalStrength(gsmSignalStrength);

      org.kaaproject.kaa.demo.cellmonitor.Location phoneLocation =
          new org.kaaproject.kaa.demo.cellmonitor.Location();
      if (mGpsLocation != null) {
        phoneLocation.setLatitude(mGpsLocation.getLatitude());
        phoneLocation.setLongitude(mGpsLocation.getLongitude());
      }
      cellMonitorLog.setPhoneGpsLocation(phoneLocation);

      /*
       * Pass a cell monitor log record to the Kaa client. The Kaa client will upload
       * the log record according to the defined log upload strategy.
       */
      mClient.addLogRecord(cellMonitorLog);

      mEventBus.post(new LogSent());
    }
  }
Esempio n. 6
0
 @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);
 }
Esempio n. 7
0
 public final void onSignalStrengthsChanged(SignalStrength paramSignalStrength) {
   super.onSignalStrengthsChanged(paramSignalStrength);
   if (at.a(iau) == 2) {
     at.iY(paramSignalStrength.getCdmaDbm());
   }
   if (at.a(iau) == 1) {
     at.iY(paramSignalStrength.getGsmSignalStrength() * 2 - 113);
   }
   if (at.b(iau) != null) {
     at.b(iau).listen(at.c(iau), 0);
   }
   at.d(iau);
 }
Esempio n. 8
0
 @Override
 public void onSignalStrengthsChanged(SignalStrength signalStrength) {
   super.onSignalStrengthsChanged(signalStrength);
   m_ss = signalStrength.getGsmSignalStrength();
 }
  @Override
  public LinkQualityInfo getLinkQualityInfo() {
    if (mNetworkInfo == null || mNetworkInfo.getType() == ConnectivityManager.TYPE_NONE) {
      // no data available yet; just return
      return null;
    }

    MobileLinkQualityInfo li = new MobileLinkQualityInfo();

    li.setNetworkType(mNetworkInfo.getType());

    mSamplingDataTracker.setCommonLinkQualityInfoFields(li);

    if (mNetworkInfo.getSubtype() != TelephonyManager.NETWORK_TYPE_UNKNOWN) {
      li.setMobileNetworkType(mNetworkInfo.getSubtype());

      NetworkDataEntry entry = getNetworkDataEntry(mNetworkInfo.getSubtype());
      if (entry != null) {
        li.setTheoreticalRxBandwidth(entry.downloadBandwidth);
        li.setTheoreticalRxBandwidth(entry.uploadBandwidth);
        li.setTheoreticalLatency(entry.latency);
      }

      if (mSignalStrength != null) {
        li.setNormalizedSignalStrength(
            getNormalizedSignalStrength(li.getMobileNetworkType(), mSignalStrength));
      }
    }

    SignalStrength ss = mSignalStrength;
    if (ss != null) {

      li.setRssi(ss.getGsmSignalStrength());
      li.setGsmErrorRate(ss.getGsmBitErrorRate());
      li.setCdmaDbm(ss.getCdmaDbm());
      li.setCdmaEcio(ss.getCdmaEcio());
      li.setEvdoDbm(ss.getEvdoDbm());
      li.setEvdoEcio(ss.getEvdoEcio());
      li.setEvdoSnr(ss.getEvdoSnr());
      li.setLteSignalStrength(ss.getLteSignalStrength());
      li.setLteRsrp(ss.getLteRsrp());
      li.setLteRsrq(ss.getLteRsrq());
      li.setLteRssnr(ss.getLteRssnr());
      li.setLteCqi(ss.getLteCqi());
    }

    if (VDBG) {
      Slog.d(
          TAG,
          "Returning LinkQualityInfo with"
              + " MobileNetworkType = "
              + String.valueOf(li.getMobileNetworkType())
              + " Theoretical Rx BW = "
              + String.valueOf(li.getTheoreticalRxBandwidth())
              + " gsm Signal Strength = "
              + String.valueOf(li.getRssi())
              + " cdma Signal Strength = "
              + String.valueOf(li.getCdmaDbm())
              + " evdo Signal Strength = "
              + String.valueOf(li.getEvdoDbm())
              + " Lte Signal Strength = "
              + String.valueOf(li.getLteSignalStrength()));
    }

    return li;
  }