1. 修改时间策略

This commit is contained in:
wangcongtao
2020-08-21 20:20:20 +08:00
parent 98445dec50
commit 95d282b377

View File

@@ -39,8 +39,8 @@ class LauncherCardRefresher {
public static final int MSG_REFRESH = 2020;
public static final int MSG_TTS_TIP = 2021;
public static final long ONE_MINUTE = 60 * 1000L;
public static final long HALF_ONE_MINUTE = 30 * 1000L;
public static final long ONE_MINUTE = 15 * 1000L;
public static final long ONE_DAY = 24 * 60 * ONE_MINUTE;
private LauncherCardRefresher( Context context ) {
mContext = context;
@@ -117,7 +117,7 @@ class LauncherCardRefresher {
int counter = SharedPrefsMgr.getInstance( mContext ).getInt( KEY_LauncherCardTipCounter, 0 );
if ( counter >= 5 ) {
long lastTipTime = SharedPrefsMgr.getInstance( mContext ).getLong( KEY_LauncherCardTipLastTipTime, 0L );
if ( System.currentTimeMillis() - lastTipTime < /*10 * 24 * 60 **/ ONE_MINUTE ) {
if ( System.currentTimeMillis() - lastTipTime < 10 * ONE_DAY ) {
stop();
return;
} else {
@@ -224,15 +224,15 @@ class LauncherCardRefresher {
return false;
}
int size = response.getResult().getExploreWay().size();
speakTTS( String.format( tts, size, mRefreshStrategy.getDesc() ) );
notifyLauncherCard( String.format( info, size, mRefreshStrategy.getDesc() ), size );
speakTTS( tts = String.format( tts, size, mRefreshStrategy.getDesc() ) );
notifyLauncherCard( String.format( info, size, mRefreshStrategy.getDesc() ), size, tts );
} else {
if ( response.getResult().getOnlineCar() == null || response.getResult().getOnlineCar().isEmpty() ) {
return false;
}
int size = response.getResult().getOnlineCar().size();
speakTTS( String.format( tts, size, mRefreshStrategy.getDesc() ) );
notifyLauncherCard( String.format( info, size, mRefreshStrategy.getDesc() ), size );
speakTTS( tts = String.format( tts, size, mRefreshStrategy.getDesc() ) );
notifyLauncherCard( String.format( info, size, mRefreshStrategy.getDesc() ), size , tts);
}
return true;
}
@@ -245,7 +245,7 @@ class LauncherCardRefresher {
AIAssist.getInstance( mContext ).speakTTSVoice( msg );
}
private void notifyLauncherCard( String info, int amount ) {
private void notifyLauncherCard( String info, int amount, String tts ) {
Intent intent = new Intent( "com.mogo.launcher.v2x" );
intent.putExtra( "v2x_warning_type", 20000 );
intent.putExtra( "v2x_warining_timeout", 20 * 1000L );
@@ -253,6 +253,7 @@ class LauncherCardRefresher {
intent.putExtra( "v2x_warning_eventCount", amount );
intent.putExtra( "v2x_warning_info", info );
mContext.sendBroadcast( intent );
Logger.d( TAG, "发送广播到桌面卡片." );
}
private void playTTS() {