Procházet zdrojové kódy

1.修改系统日志根据版本设置是否展示。

20241218TB223FC(测试jar包)
wangwanlei před 3 měsíci
rodič
revize
50bc8c19aa

+ 4
- 4
app/src/main/java/com/xhly/manageapp/broadcastreceiver/AppInstallReceiver.kt Zobrazit soubor

@@ -8,6 +8,7 @@ import android.util.Log
8 8
 import android.widget.Toast
9 9
 import com.xhly.corelib.Const
10 10
 import com.xhly.corelib.eventbus.UIEvent
11
+import com.xhly.corelib.utils.LogShow
11 12
 import com.xhly.manageapp.utils.InstallUtils
12 13
 
13 14
 //(自定义广播类)  --自己命名的 XXXXReceiver
@@ -15,20 +16,19 @@ class AppInstallReceiver : BroadcastReceiver() {
15 16
     private val TAG = this.javaClass.simpleName
16 17
     override fun onReceive(context: Context, intent: Intent) {
17 18
         val pm = context.packageManager
18
-        Log.i("执行监听", "--------应用监听" + intent.data!!.schemeSpecificPart)
19 19
         if (TextUtils.equals(intent.action, Intent.ACTION_PACKAGE_ADDED)) {
20 20
             val packageName = intent.data!!.schemeSpecificPart
21
-            Log.i(TAG, "--------安装成功$packageName")
22 21
             //Toast.makeText(context, "安装成功$packageName", Toast.LENGTH_LONG).show()
22
+            LogShow("--------安装成功$packageName")
23 23
             InstallUtils.installSuccess(packageName)
24 24
             UIEvent(Const.APPINSTALL).setMessage(packageName).post()
25 25
         } else if (TextUtils.equals(intent.action, Intent.ACTION_PACKAGE_REPLACED)) {
26 26
             val packageName = intent.data!!.schemeSpecificPart
27
-            Log.i(TAG, "--------替换成功$packageName")
27
+            LogShow("--------替换成功$packageName")
28 28
            // Toast.makeText(context, "替换成功$packageName", Toast.LENGTH_LONG).show()
29 29
         } else if (TextUtils.equals(intent.action, Intent.ACTION_PACKAGE_REMOVED)) {
30 30
             val packageName = intent.data!!.schemeSpecificPart
31
-            Log.i(TAG, "--------卸载成功$packageName")
31
+            LogShow("--------卸载成功$packageName")
32 32
           //  Toast.makeText(context, "卸载成功$packageName", Toast.LENGTH_LONG).show()
33 33
             UIEvent(Const.APPUNINSTALL).setMessage(packageName).post()
34 34
         }

+ 2
- 1
app/src/main/java/com/xhly/manageapp/broadcastreceiver/BLEStateReceiver.kt Zobrazit soubor

@@ -8,6 +8,7 @@ import android.util.Log
8 8
 import android.widget.Toast
9 9
 import com.xhly.corelib.Const
10 10
 import com.xhly.corelib.eventbus.UIEvent
11
+import com.xhly.corelib.utils.LogShow
11 12
 
12 13
 class BLEStateReceiver : BroadcastReceiver() {
13 14
     override fun onReceive(context: Context, intent: Intent) {
@@ -24,7 +25,7 @@ class BLEStateReceiver : BroadcastReceiver() {
24 25
     @Synchronized
25 26
     private fun checkBLEState(context: Context, intent: Intent) {
26 27
         val BLEState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, 0)
27
-        Log.i("执行监听", "--------蓝牙监听$BLEState")
28
+        LogShow("执行监听--------蓝牙监听$BLEState")
28 29
         when (BLEState) {
29 30
             BluetoothAdapter.STATE_ON ->                 // 蓝牙已经打开
30 31
             {

Načítá se…
Zrušit
Uložit