本文整理汇总了Java中android.telephony.CellIdentityLte.getTac方法的典型用法代码示例。如果您正苦于以下问题:Java CellIdentityLte.getTac方法的具体用法?Java CellIdentityLte.getTac怎么用?Java CellIdentityLte.getTac使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.telephony.CellIdentityLte
的用法示例。
在下文中一共展示了CellIdentityLte.getTac方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fill
import android.telephony.CellIdentityLte; //导入方法依赖的package包/类
public static void fill(TheDictionary map, CellIdentityLte value) throws Exception {
if (value != null) {
map.put("type", "4");
int i;
i = value.getMcc();
if (i != Integer.MAX_VALUE && i > 0 && i < 1000) map.put("mcc", i);
i = value.getMnc();
if (i != Integer.MAX_VALUE && i > 0 && i < 1000) map.put("mnc", i);
i = value.getTac();
if (i != Integer.MAX_VALUE && i > 0) map.put("tac", i);
i = value.getPci();
if (i != Integer.MAX_VALUE && i > 0) map.put("pci", i);
i = value.getCi();
if (i != Integer.MAX_VALUE && i > 0) map.put("cid", i);
}
}
示例2: fill
import android.telephony.CellIdentityLte; //导入方法依赖的package包/类
public static void fill(TheDictionary map, CellIdentityLte value) throws Exception {
if (value != null) {
map.put("type", "4");
int i;
i = value.getMcc(); if (i != Integer.MAX_VALUE && i > 0 && i < 1000) map.put("mcc", i);
i = value.getMnc(); if (i != Integer.MAX_VALUE && i > 0 && i < 1000) map.put("mnc", i);
i = value.getTac(); if (i != Integer.MAX_VALUE && i > 0) map.put("tac", i);
i = value.getPci(); if (i != Integer.MAX_VALUE && i > 0) map.put("pci", i);
i = value.getCi(); if (i != Integer.MAX_VALUE && i > 0) map.put("ci", i);
}
}
示例3: update
import android.telephony.CellIdentityLte; //导入方法依赖的package包/类
/**
* Adds or updates a cell tower.
* <p>
* If the cell tower is already in the list, its data is updated; if not, a
* new entry is created.
* <p>
* This method will set the cell's identity data, its signal strength and
* whether it is the currently serving cell.
* @return The new or updated entry.
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public CellTowerLte update(CellInfoLte cell) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)
return null;
CellIdentityLte cid = cell.getCellIdentity();
CellTowerLte result = null;
CellTowerLte cand = this.get(cid.getMcc(), cid.getMnc(), cid.getTac(), cid.getCi());
if ((cand != null) && CellTower.matches(cid.getPci(), cand.getPci()))
result = cand;
if (result == null) {
cand = this.get(cid.getPci());
if ((cand != null)
&& ((cid.getMcc() == Integer.MAX_VALUE) || CellTower.matches(cid.getMcc(), cand.getMcc()))
&& ((cid.getMnc() == Integer.MAX_VALUE) || CellTower.matches(cid.getMnc(), cand.getMnc()))
&& ((cid.getTac() == Integer.MAX_VALUE) || CellTower.matches(cid.getTac(), cand.getTac()))
&& ((cid.getCi() == Integer.MAX_VALUE) ||CellTower.matches(cid.getCi(), cand.getCi())))
result = cand;
}
if (result == null)
result = new CellTowerLte(cid.getMcc(), cid.getMnc(), cid.getTac(), cid.getCi(), cid.getPci());
if (result.getMcc() == CellTower.UNKNOWN)
result.setMcc(cid.getMcc());
if (result.getMnc() == CellTower.UNKNOWN)
result.setMnc(cid.getMnc());
if (result.getTac() == CellTower.UNKNOWN)
result.setTac(cid.getTac());
if (result.getCi() == CellTower.UNKNOWN)
result.setCi(cid.getCi());
if (result.getPci() == CellTower.UNKNOWN)
result.setPci(cid.getPci());
this.put(result.getText(), result);
this.put(result.getAltText(), result);
result.setCellInfo(true);
result.setDbm(cell.getCellSignalStrength().getDbm());
result.setServing(cell.isRegistered());
Log.d(this.getClass().getSimpleName(), String.format("Added CellInfoLte for %s, %d G, %d dBm",
result.getText(),
result.getGeneration(),
result.getDbm()));
return result;
}