[Feat]添加杀死App功能
This commit is contained in:
@@ -16,6 +16,11 @@ if (!isAndroidTestBuild()) {
|
||||
logLevel "DEBUG"
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAndroidTestBuild()) {
|
||||
apply plugin: 'bytex.notsticky.service'
|
||||
}
|
||||
|
||||
if (!isAndroidTestBuild()) {
|
||||
apply plugin: 'chain.log.hook'
|
||||
hooklog{
|
||||
|
||||
@@ -35,6 +35,7 @@ buildscript {
|
||||
classpath 'com.mogo.thread.opt:plg:2.1.5'
|
||||
classpath 'com.mogo.cloud:systrace:1.0.1'
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
|
||||
classpath 'com.mogo.sticky:service:1.0.8'
|
||||
|
||||
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
|
||||
}
|
||||
|
||||
@@ -2,10 +2,11 @@ package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Process
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
@@ -29,6 +30,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.view_auto_pilot_check.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
/**
|
||||
* @author ChenFufeng
|
||||
@@ -97,6 +99,9 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
ivCloseIcon.setOnClickListener {
|
||||
clickListener?.onClose(it)
|
||||
}
|
||||
rlKillLayout.setOnClickListener {
|
||||
killApp()
|
||||
}
|
||||
viewCheckStatus.setOnClickListener {
|
||||
clickListener?.go2CheckPage()
|
||||
}
|
||||
@@ -170,6 +175,16 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun killApp() {
|
||||
Intent(Intent.ACTION_MAIN).apply {
|
||||
addCategory(Intent.CATEGORY_HOME)
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
context.startActivity(this)
|
||||
Process.killProcess(Process.myPid())
|
||||
exitProcess(0)
|
||||
}
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class MogoMainService extends Service implements IMogoLocationListener {
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
return START_STICKY;
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
|
||||
private void initAndStartLocation() {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -107,6 +107,31 @@
|
||||
android:textSize="32px" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rlKillLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="142px">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivKillImg"
|
||||
android:layout_width="150px"
|
||||
android:layout_height="150px"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/close_nor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvKillContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="42px"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="23px"
|
||||
android:text="杀死APP"
|
||||
android:textColor="@color/color_FFA7B6F0"
|
||||
android:textSize="32px" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -63,27 +63,27 @@ SERVICE_CHAIN_VERSION=1.1.0
|
||||
LOGLIB_VERSION=1.3.38
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 网络请求LOGLIB_VERSION
|
||||
MOGO_NETWORK_VERSION=1.4.3.24
|
||||
MOGO_NETWORK_VERSION=1.4.3.25
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.4.3.24
|
||||
MOGO_PASSPORT_VERSION=1.4.3.25
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.4.3.24
|
||||
MOGO_SOCKET_VERSION=1.4.3.25
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.4.3.24
|
||||
MOGO_REALTIME_VERSION=1.4.3.25
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.4.3.24
|
||||
MOGO_TANLU_VERSION=1.4.3.25
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.4.3.24
|
||||
MOGO_LIVE_VERSION=1.4.3.25
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.4.3.24
|
||||
MOGO_TRAFFICLIVE_VERSION=1.4.3.25
|
||||
# 定位服务
|
||||
MOGO_LOCATION_VERSION=1.4.3.24
|
||||
MOGO_LOCATION_VERSION=1.4.3.25
|
||||
# 远程通讯模块
|
||||
MOGO_TELEMATIC_VERSION=1.4.3.24
|
||||
MOGO_TELEMATIC_VERSION=1.4.3.25
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.4.2.3
|
||||
MAP_SDK_OPERATION_VERSION=1.1.2
|
||||
MAP_SDK_VERSION=2.4.1.9
|
||||
MAP_SDK_OPERATION_VERSION=1.0.13
|
||||
# websocket
|
||||
WEBSOCKET_VERSION=1.1.7
|
||||
## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级
|
||||
|
||||
Reference in New Issue
Block a user