Merge branch 'qa' into dev_custom_map
This commit is contained in:
@@ -109,7 +109,7 @@ public class AbsMogoApplication extends Application {
|
||||
// 2 - 本地缓存,聚合上报,积累30条埋点上报,或者积累60秒上报一次。
|
||||
AnalyticsConfig.getInstance( sApp ).setMode( DebugConfig.isDebug() ? 0 : 2 );
|
||||
AnalyticsConfig.getInstance( sApp ).shouldLog( DebugConfig.isDebug() );
|
||||
|
||||
Devices.init( getApp() );
|
||||
Devices.checkBindState();
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
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.utils.ThreadPoolService;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public
|
||||
/**
|
||||
@@ -15,10 +19,28 @@ public
|
||||
*/
|
||||
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();
|
||||
Logger.d( TAG, "lock status changed. the last val = " + sIsBind );
|
||||
} );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测车机激活状态
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user