/**
* Full stop using brute force. Works with many Android versions.
*/
public void stopLocation(){
if(_phoneStateListener != null && _telephonyManager != null){
_telephonyManager.listen(_phoneStateListener, PhoneStateListener.LISTEN_NONE);
_telephonyManager.listen(_signalStrengthListener, PhoneStateListener.LISTEN_NONE);
_phoneStateListener = null;
_signalStrengthListener = null;
_telephonyManager = null;
try {
Thread.currentThread().interrupt();
}
catch(SecurityException exc){
Log.e(TAG, exc.getMessage());
sendCallback(PluginResult.Status.ERROR,
JSONHelper.errorJSON(CELLINFO_PROVIDER, ErrorMessages.FAILED_THREAD_INTERRUPT()));
}
Log.d(TAG, "Stopping cell location listeners");
}
}
CellLocationController.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:cordova-plugin-advanced-geolocation
作者:
评论列表
文章目录