CellLocationController.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:localcloud_fe 作者:
/**
 * 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");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号