[2.13.0] remove unuse code
This commit is contained in:
@@ -18,7 +18,6 @@ import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.device.Devices
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.network.NetConfigUtils
|
||||
import com.mogo.commons.network.Utils
|
||||
@@ -231,10 +230,6 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
*/
|
||||
private fun asyncInit() {
|
||||
ThreadPoolService.execute {
|
||||
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
|
||||
Devices.init(AbsMogoApplication.getApp())
|
||||
Devices.checkBindState()
|
||||
}
|
||||
//初始化网络配置
|
||||
NetConfigUtils.init()
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.mogo.commons.device;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.database.ContentObserver;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadPoolService;
|
||||
|
||||
public
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/6/8
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class Devices {
|
||||
|
||||
private static final String TAG = "Devices";
|
||||
|
||||
public static final Uri CONTENT_URI_BIND = Uri.parse( "content://com.zhidao.guide.lock.product.bindstatus/status" );
|
||||
|
||||
private static boolean sIsBind = false;
|
||||
|
||||
public static void init( Context context ) {
|
||||
if ( context == null ) {
|
||||
return;
|
||||
}
|
||||
context.getContentResolver().registerContentObserver( CONTENT_URI_BIND, true, new ContentObserver( null ) {
|
||||
@Override
|
||||
public void onChange( boolean selfChange ) {
|
||||
super.onChange( selfChange );
|
||||
ThreadPoolService.execute( () -> {
|
||||
checkBindState();
|
||||
} );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测车机激活状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkBindState() {
|
||||
try {
|
||||
ContentResolver resolver = AbsMogoApplication.getApp().getContentResolver();
|
||||
if ( resolver == null ) {
|
||||
return false;
|
||||
}
|
||||
try ( Cursor cursor = resolver.query( CONTENT_URI_BIND, null, null, null, null ) ) {
|
||||
if ( cursor == null || !cursor.moveToFirst() ) {
|
||||
return false;
|
||||
}
|
||||
int status = cursor.getInt( cursor.getColumnIndex( "lock_status" ) );
|
||||
return sIsBind = ( status == 1 );
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isBind() {
|
||||
return sIsBind;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user