tongmengxiao il y a 4 mois
Parent
commit
33e2d4e31e

+ 3 - 0
app/src/main/AndroidManifest.xml

@@ -13,6 +13,9 @@
     <uses-permission android:name="android.permission.INTERNET"/>
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.CAMERA"/>
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA"/>
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
     <uses-permission android:name="android.permission.RECORD_AUDIO"/>
     <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

+ 1 - 0
baseswago/src/main/java/com/swago/baseswago/util/LogProducer.kt

@@ -65,6 +65,7 @@ object LogProducer {
         val jsonContentsObject =JSONObject()
         jsonContentsObject.put("type", type)
         jsonContentsObject.put("device_info", SwagoInfo.getDeviceInfo())
+        jsonContentsObject.put("android_os", SwagoInfo.getAndroidOS())
         jsonContentsObject.put("device_system", "android")
         jsonContentsObject.put("app_channel", SwagoInfo.getChannel())
         jsonContentsObject.put("app_version",SwagoInfo.getVersionCode())

+ 35 - 13
home/src/main/java/com/swago/home/HomeFragment.kt

@@ -5,6 +5,7 @@ import android.content.Context
 import android.content.Intent
 import android.graphics.Color
 import android.graphics.Typeface
+import android.os.Build
 import android.view.View
 import android.widget.Toast
 import androidx.fragment.app.activityViewModels
@@ -118,20 +119,41 @@ class HomeFragment : BaseXFragment<FragmentHomeBinding>() {
         binding.ivLive.setOnClickListener(object :NoDoubleClickListener(){
             override fun onClick() {
                 binding.ivLive.isEnabled = false
-                PermissionX.init(this@HomeFragment)
-                    .permissions(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO)
-                    .request { allGranted, grantedList, deniedList ->
-                        if (allGranted) {
-                            ARouter.getInstance().build(ARouteConstant.Room.anchor).navigation()
-                        } else {
-                            binding.ivLive.isEnabled = true
-                            Toast.makeText(
-                                AppContext.getContext(),
-                                AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
-                                Toast.LENGTH_LONG
-                            ).show()
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE){
+                    PermissionX.init(this@HomeFragment)
+                        .permissions(Manifest.permission.CAMERA,
+                            Manifest.permission.RECORD_AUDIO,
+                            Manifest.permission.FOREGROUND_SERVICE_CAMERA,
+                            Manifest.permission.FOREGROUND_SERVICE_MICROPHONE)
+                        .request { allGranted, grantedList, deniedList ->
+                            if (allGranted) {
+                                ARouter.getInstance().build(ARouteConstant.Room.anchor).navigation()
+                            } else {
+                                binding.ivLive.isEnabled = true
+                                Toast.makeText(
+                                    AppContext.getContext(),
+                                    AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
+                                    Toast.LENGTH_LONG
+                                ).show()
+                            }
                         }
-                    }
+                } else {
+                    PermissionX.init(this@HomeFragment)
+                        .permissions(Manifest.permission.CAMERA,
+                            Manifest.permission.RECORD_AUDIO)
+                        .request { allGranted, grantedList, deniedList ->
+                            if (allGranted) {
+                                ARouter.getInstance().build(ARouteConstant.Room.anchor).navigation()
+                            } else {
+                                binding.ivLive.isEnabled = true
+                                Toast.makeText(
+                                    AppContext.getContext(),
+                                    AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
+                                    Toast.LENGTH_LONG
+                                ).show()
+                            }
+                        }
+                }
             }
         })
 

+ 0 - 32
lib_country_picker/src/main/assets/code.json

@@ -327,14 +327,6 @@
     "locale": "CR",
     "tc": "哥斯達黎加"
   },
-  {
-    "sc": "古巴",
-    "code": 53,
-    "pinyin": "GUBA",
-    "en": "Cuba",
-    "locale": "CU",
-    "tc": "古巴"
-  },
   {
     "sc": "塞浦路斯",
     "code": 357,
@@ -599,14 +591,6 @@
     "locale": "ID",
     "tc": "印度尼西亞"
   },
-  {
-    "sc": "伊朗",
-    "code": 98,
-    "pinyin": "YILANG",
-    "en": "Iran",
-    "locale": "IR",
-    "tc": "伊朗"
-  },
   {
     "sc": "伊拉克",
     "code": 964,
@@ -999,14 +983,6 @@
     "locale": "NG",
     "tc": "尼日利亞"
   },
-  {
-    "sc": "朝鲜",
-    "code": 850,
-    "pinyin": "CHAOXIAN",
-    "en": "North Korea",
-    "locale": "KP",
-    "tc": "朝鮮"
-  },
   {
     "sc": "挪威",
     "code": 47,
@@ -1335,14 +1311,6 @@
     "locale": "CH",
     "tc": "瑞士"
   },
-  {
-    "sc": "叙利亚",
-    "code": 963,
-    "pinyin": "XULIYA",
-    "en": "Syria",
-    "locale": "SY",
-    "tc": "敘利亞"
-  },
   {
     "sc": "中国台湾",
     "code": 886,

+ 0 - 32
user/src/main/assets/code.json

@@ -327,14 +327,6 @@
     "locale": "CR",
     "tc": "哥斯達黎加"
   },
-  {
-    "sc": "古巴",
-    "code": 53,
-    "pinyin": "GUBA",
-    "en": "Cuba",
-    "locale": "CU",
-    "tc": "古巴"
-  },
   {
     "sc": "塞浦路斯",
     "code": 357,
@@ -599,14 +591,6 @@
     "locale": "ID",
     "tc": "印度尼西亞"
   },
-  {
-    "sc": "伊朗",
-    "code": 98,
-    "pinyin": "YILANG",
-    "en": "Iran",
-    "locale": "IR",
-    "tc": "伊朗"
-  },
   {
     "sc": "伊拉克",
     "code": 964,
@@ -999,14 +983,6 @@
     "locale": "NG",
     "tc": "尼日利亞"
   },
-  {
-    "sc": "朝鲜",
-    "code": 850,
-    "pinyin": "CHAOXIAN",
-    "en": "North Korea",
-    "locale": "KP",
-    "tc": "朝鮮"
-  },
   {
     "sc": "挪威",
     "code": 47,
@@ -1335,14 +1311,6 @@
     "locale": "CH",
     "tc": "瑞士"
   },
-  {
-    "sc": "叙利亚",
-    "code": 963,
-    "pinyin": "XULIYA",
-    "en": "Syria",
-    "locale": "SY",
-    "tc": "敘利亞"
-  },
   {
     "sc": "中国台湾",
     "code": 886,

+ 1 - 1
user/src/main/java/com/swago/user/SettingActivity.kt

@@ -32,7 +32,7 @@ class SettingActivity : BaseXActivity<ActivitySettingBinding>() {
         setBackView(binding.toolbar.ivBack)
         binding.toolbar.tvTitle.text = AppContext.getContext().resources.getString(R.string.setting)
 
-        binding.tvVersion.text = getVersionName()
+        binding.tvVersion.text = getVersionName() + "(1)"
 
         binding.tvUserAgreement.setOnClickListener(object : NoDoubleClickListener() {
             override fun onClick() {