private static CellLocation getDefacedCellLocation(int uid) {
int cid = (Integer) PrivacyManager.getDefacedProp(uid, "CID");
int lac = (Integer) PrivacyManager.getDefacedProp(uid, "LAC");
if (cid > 0 && lac > 0) {
GsmCellLocation cellLocation = new GsmCellLocation();
cellLocation.setLacAndCid(lac, cid);
return cellLocation;
} else
return CellLocation.getEmpty();
}
java类android.telephony.CellLocation的实例源码
XTelephonyManager.java 文件源码
项目:xprivacy-mod
阅读 31
收藏 0
点赞 0
评论 0
LibPhoneStateListener.java 文件源码
项目:android-QoS
阅读 37
收藏 0
点赞 0
评论 0
private void checkCDMACellSID (CellLocation cell)
{
if (cell instanceof CdmaCellLocation)
{
CdmaCellLocation cdmaCell = (CdmaCellLocation)cell;
if (cdmaCell.getSystemId() <= 0)
{
Field getSIDPointer = null;
Field getNIDPointer = null;
int SID = 0, NID = 0, BID = cdmaCell.getBaseStationId();
try {
getSIDPointer = mPhoneState.previousServiceStateObj.getClass().getDeclaredField("mSystemId");
if (getSIDPointer != null)
{
getSIDPointer.setAccessible(true);
SID = (int) getSIDPointer.getInt(cdmaCell);
}
getNIDPointer = mPhoneState.previousServiceStateObj.getClass().getDeclaredField("mNetworkId");
if (getNIDPointer != null)
{
getNIDPointer.setAccessible(true);
NID = (int) getNIDPointer.getInt(cdmaCell);
}
cdmaCell.setCellLocationData(BID, cdmaCell.getBaseStationLatitude(), cdmaCell.getBaseStationLongitude(),
SID, NID); // Update the SID and NID that we read from teh Servicestate
} catch (Exception e) {
//MMCLogger.logToFile(MMCLogger.Level.ERROR, TAG, "checkInnerGsmCellLocation","Field does not exist - mGsmCellLoc");
}
}
}
}
CDMADevice.java 文件源码
项目:android-QoS
阅读 58
收藏 0
点赞 0
评论 0
/**
* @return The System id, or -1 if it is unknown
*/
public int getSid() {
CellLocation cellLoc = mTelephonyManager.getCellLocation();
if(cellLoc != null && cellLoc instanceof CdmaCellLocation) {
return ((CdmaCellLocation) cellLoc).getSystemId();
}
else {
return -1;
}
}
EventLogBuilder.java 文件源码
项目:dd-collector
阅读 16
收藏 0
点赞 0
评论 0
public static final CellLocation getCellLocation() {
try {
return AirplugAnalyticTracker.telephonyManager.getCellLocation();
} catch (SecurityException e) {
return null;
}
}
CellBackendHelper.java 文件源码
项目:android_external_UnifiedNlpApi
阅读 20
收藏 0
点赞 0
评论 0
@SuppressWarnings("deprecation")
private synchronized void fallbackScan() {
if (lastScan + MIN_UPDATE_INTERVAL > System.currentTimeMillis()) return;
List<CellInfo> allCellInfo = telephonyManager.getAllCellInfo();
if ((allCellInfo == null || allCellInfo.isEmpty()) && telephonyManager.getNetworkType() > 0) {
allCellInfo = new ArrayList<CellInfo>();
CellLocation cellLocation = telephonyManager.getCellLocation();
CellInfo cellInfo = fromCellLocation(cellLocation);
if (cellInfo != null) allCellInfo.add(cellInfo);
}
onCellsChanged(allCellInfo);
}
PhoneStateScanner.java 文件源码
项目:PhoneProfilesPlus
阅读 26
收藏 0
点赞 0
评论 0
private void getCellLocation(CellLocation location) {
if (location!=null) {
if (Permissions.checkLocation(context.getApplicationContext())) {
if (location instanceof GsmCellLocation) {
GsmCellLocation gcLoc = (GsmCellLocation) location;
//PPApplication.logE("PhoneStateScanner.getCellLocation", "gsm location="+gcLoc);
if (gcLoc.getCid() != -1) {
//PPApplication.logE("PhoneStateScanner.getCellLocation", "gsm mCid="+gcLoc.getCid());
registeredCell = gcLoc.getCid();
lastConnectedTime = Calendar.getInstance().getTimeInMillis();
}
} else if (location instanceof CdmaCellLocation) {
CdmaCellLocation ccLoc = (CdmaCellLocation) location;
//PPApplication.logE("PhoneStateScanner.getCellLocation", "cdma location="+ccLoc);
if (ccLoc.getBaseStationId() != -1) {
//PPApplication.logE("PhoneStateScanner.getCellLocation", "cdma mCid="+ccLoc.getBaseStationId());
registeredCell = ccLoc.getBaseStationId();
lastConnectedTime = Calendar.getInstance().getTimeInMillis();
}
}
//else {
// PPApplication.logE("PhoneStateScanner.getCellLocation", "unknown location="+location);
//}
PPApplication.logE("PhoneStateScanner.getCellLocation", "registeredCell=" + registeredCell);
}
}
else
PPApplication.logE("PhoneStateScanner.getCellLocation", "location is null");
}
PhoneStateScanner.java 文件源码
项目:PhoneProfilesPlus
阅读 23
收藏 0
点赞 0
评论 0
@SuppressLint("MissingPermission")
private void getCellLocation() {
if (telephonyManager != null) {
CellLocation location = null;
if (Permissions.checkLocation(context.getApplicationContext()))
location = telephonyManager.getCellLocation();
getCellLocation(location);
}
}
WirelessEnvListener.java 文件源码
项目:tabulae
阅读 18
收藏 0
点赞 0
评论 0
public void run() {
//if (DEBUG) Log.d(TAG, "run:");
try {
onCellInfoChanged(null);
telephonyManager.listen(this, PhoneStateListener.LISTEN_CELL_INFO | PhoneStateListener.LISTEN_SERVICE_STATE);
CellLocation.requestLocationUpdate();
}
catch (Exception ignore) {
}
}
ai.java 文件源码
项目:MiBandDecompiled
阅读 33
收藏 0
点赞 0
评论 0
protected final List a(float f1)
{
ArrayList arraylist;
label0:
{
arraylist = new ArrayList();
long l1 = System.currentTimeMillis();
if (Math.abs(f1) <= 1.0F)
{
f1 = 1.0F;
}
if (c())
{
CellLocation celllocation = (CellLocation)j().get(1);
if (celllocation != null && (celllocation instanceof GsmCellLocation))
{
arraylist.add(Integer.valueOf(((GsmCellLocation)celllocation).getLac()));
arraylist.add(Integer.valueOf(((GsmCellLocation)celllocation).getCid()));
if ((double)(l1 - ((Long)j().get(0)).longValue()) > 50000D / (double)f1)
{
break label0;
}
arraylist.add(Integer.valueOf(1));
}
}
return arraylist;
}
arraylist.add(Integer.valueOf(0));
return arraylist;
}
ai.java 文件源码
项目:MiBandDecompiled
阅读 32
收藏 0
点赞 0
评论 0
protected final List b(float f1)
{
ArrayList arraylist;
label0:
{
arraylist = new ArrayList();
long l1 = System.currentTimeMillis();
if (Math.abs(f1) <= 1.0F)
{
f1 = 1.0F;
}
if (c())
{
CellLocation celllocation = (CellLocation)j().get(1);
if (celllocation != null && (celllocation instanceof CdmaCellLocation))
{
CdmaCellLocation cdmacelllocation = (CdmaCellLocation)celllocation;
arraylist.add(Integer.valueOf(cdmacelllocation.getSystemId()));
arraylist.add(Integer.valueOf(cdmacelllocation.getNetworkId()));
arraylist.add(Integer.valueOf(cdmacelllocation.getBaseStationId()));
arraylist.add(Integer.valueOf(cdmacelllocation.getBaseStationLongitude()));
arraylist.add(Integer.valueOf(cdmacelllocation.getBaseStationLatitude()));
if ((double)(l1 - ((Long)j().get(0)).longValue()) > 50000D / (double)f1)
{
break label0;
}
arraylist.add(Integer.valueOf(1));
}
}
return arraylist;
}
arraylist.add(Integer.valueOf(0));
return arraylist;
}