调试窗

状态中心增加后台运行是否优化状态以及设置入口
This commit is contained in:
xuxinchao
2022-06-23 18:12:32 +08:00
parent c4aed44ad9
commit 862541f5ea
3 changed files with 33 additions and 3 deletions

View File

@@ -103,7 +103,7 @@ dependencies {
api rootProject.ext.dependencies.mogo_core_function_api
implementation project(':libraries:map-usbcamera')
implementation project(':libraries:mogo-adas-other')
} else {
api project(':foudations:mogo-aicloud-services-sdk')
api project(':foudations:mogo-commons')
@@ -137,6 +137,7 @@ dependencies {
api project(':core:mogo-core-function-api')
api project(':libraries:map-usbcamera')
api project(':libraries:mogo-adas-other')
}
}

View File

@@ -6,7 +6,6 @@ import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.graphics.Color
import android.media.RingtoneManager
import android.os.Build
import android.text.Html
import android.util.AttributeSet
@@ -65,8 +64,8 @@ import com.mogo.map.MogoMap
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import com.mogo.module.service.routeoverlay.*
import com.tencent.liteav.basic.datareport.a.B
import com.zhidao.easysocket.utils.L
import com.zhidao.support.adas.high.other.permission.BackgrounderPermission
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
@@ -74,6 +73,7 @@ import java.text.SimpleDateFormat
import java.util.*
import kotlin.math.abs
/**
* @author xiaoyuzhou
* @date 2021/9/30 8:46 下午
@@ -741,6 +741,23 @@ class DebugSettingView @JvmOverloads constructor(
ToastUtils.showLong("经纬度复制成功")
}
//状态中心-后台优化状态
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){
val backgroundStatus = "后台运行:" + if (BackgrounderPermission.getInstance()
.isPermissionLongBackgroundRunning(context)
) "<font color='green'>已优化</font>" else "<font color='red'>未优化</font>"
tvBackgroundOperation.text = Html.fromHtml(backgroundStatus, Html.FROM_HTML_MODE_LEGACY)
tvBackgroundOperation.setOnClickListener {
BackgrounderPermission.getInstance().showPermissionLongBackgroundRunningDialog(context)
}
BackgrounderPermission.getInstance().setListener {
val str =
"后台运行:" + if (it) "<font color='green'>已优化</font>" else "<font color='red'>未优化</font>"
tvBackgroundOperation.text = Html.fromHtml(str, Html.FROM_HTML_MODE_LEGACY)
}
}else {
tvBackgroundOperation.visibility = GONE
}
}
/**

View File

@@ -561,6 +561,18 @@
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvBackgroundOperation"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
</LinearLayout>
<ToggleButton