diff --git a/app/src/main/java/com/tencent/iot/explorer/link/App.kt b/app/src/main/java/com/tencent/iot/explorer/link/App.kt
index 81d37c8c6..b505eed05 100644
--- a/app/src/main/java/com/tencent/iot/explorer/link/App.kt
+++ b/app/src/main/java/com/tencent/iot/explorer/link/App.kt
@@ -150,6 +150,8 @@ class App : Application(), Application.ActivityLifecycleCallbacks, PayloadMessag
lang = lang.substring(0,2)
WeatherUtils.defaultLang = lang
BleConfigService.get().context = this
+
+ loadLastCountryInfo();
}
/**
@@ -482,6 +484,17 @@ class App : Application(), Application.ActivityLifecycleCallbacks, PayloadMessag
IoTAuth.registerActivePush(data.rtcDeviceIdList!!, null)
}
}
+
+ private fun loadLastCountryInfo() {
+ var countryInfo = Utils.getStringValueFromXml(T.getContext(), CommonField.COUNTRY_INFO, CommonField.COUNTRY_INFO)
+ if (TextUtils.isEmpty(countryInfo)) return
+
+ countryInfo!!.split("+").let {
+ val regionId = it[1]
+ App.data.regionId = regionId
+ App.data.region = it[3]
+ }
+ }
}
interface AppLifeCircleListener {
diff --git a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/AboutUsActivity.kt b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/AboutUsActivity.kt
index c7f7c8666..4f55d7e05 100644
--- a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/AboutUsActivity.kt
+++ b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/AboutUsActivity.kt
@@ -59,6 +59,8 @@ class AboutUsActivity : BaseActivity() {
iv_back.setOnClickListener { finish() }
tv_title_privacy_policy.setOnClickListener(listener)
tv_title_user_agreement.setOnClickListener(listener)
+ tv_title_third_party_information.setOnClickListener(listener)
+ tv_title_collected_personal_information.setOnClickListener(listener)
tv_about_app_version.setOnClickListener(listener)
tv_title_opensource.setOnClickListener(listener)
}
@@ -118,6 +120,26 @@ class AboutUsActivity : BaseActivity() {
}
}
+ tv_title_third_party_information -> {
+ var url = ""
+ if (Utils.getLang().contains(CommonField.ZH_TAG)) {
+ url = CommonField.THIRD_SDK_URL_US_ZH
+ } else {
+ url = CommonField.THIRD_SDK_URL_US_EN
+ }
+ OpensourceLicenseActivity.startWebWithExtra(this@AboutUsActivity, getString(R.string.rule_content_list), url)
+ }
+
+ tv_title_collected_personal_information -> {
+ var url = ""
+ if (Utils.getLang().contains(CommonField.ZH_TAG)) {
+ url = CommonField.PERSONAL_INFO_URL_US_ZH
+ } else {
+ url = CommonField.PERSONAL_INFO_URL_US_EN
+ }
+ OpensourceLicenseActivity.startWebWithExtra(this@AboutUsActivity, getString(R.string.personal_information_list), url)
+ }
+
tv_title_opensource -> {
var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
diff --git a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/ControlPermissionActivity.kt b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/ControlPermissionActivity.kt
index a2dcd5c65..77baabe35 100644
--- a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/ControlPermissionActivity.kt
+++ b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/ControlPermissionActivity.kt
@@ -7,6 +7,7 @@ import android.net.Uri
import android.provider.Settings
import android.util.Log
import androidx.core.app.ActivityCompat
+import androidx.core.app.NotificationManagerCompat
import androidx.recyclerview.widget.LinearLayoutManager
import com.tencent.iot.explorer.link.R
import com.tencent.iot.explorer.link.kitlink.adapter.PermissionsAdapter
@@ -43,7 +44,9 @@ class ControlPermissionActivity : BaseActivity() {
super.onResume()
// 刷新当前的权限列表,避免用户手动进入到后台,调整权限的情况
if (permissionsData.isEmpty()) return
- for (i in permissionsData.indices) {
+ val notificationManager: NotificationManagerCompat = NotificationManagerCompat.from(this@ControlPermissionActivity);
+ permissionsData[0].permissionAccessed = notificationManager.areNotificationsEnabled()
+ for (i in 1 until permissionsData.size) {
permissionsData[i].permissionAccessed =
ActivityCompat.checkSelfPermission(this, permissionsData[i].permission) == PackageManager.PERMISSION_GRANTED
}
@@ -68,6 +71,33 @@ class ControlPermissionActivity : BaseActivity() {
private var onItemClicked = object: PermissionsAdapter.OnItemActionListener {
override fun onItemSwitched(pos: Int, permissionAccessInfo: PermissionAccessInfo) {
+ if (pos == 0) { //通知
+ val intent: Intent = Intent()
+ try {
+ intent.action = Settings.ACTION_APP_NOTIFICATION_SETTINGS
+
+ //8.0及以后版本使用这两个extra. >=API 26
+ intent.putExtra(Settings.EXTRA_APP_PACKAGE, packageName)
+ intent.putExtra(Settings.EXTRA_CHANNEL_ID, applicationInfo.uid)
+
+ //5.0-7.1 使用这两个extra. <= API 25, >=API 21
+ intent.putExtra("app_package", packageName)
+ intent.putExtra("app_uid", applicationInfo.uid)
+
+ startActivity(intent)
+ } catch (e: Exception) {
+ e.printStackTrace()
+
+ //其他低版本或者异常情况,走该节点。进入APP设置界面
+ intent.action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
+ intent.putExtra("package", packageName)
+
+ //val uri = Uri.fromParts("package", packageName, null)
+ //intent.data = uri
+ startActivity(intent)
+ }
+ return
+ }
if (!permissionAccessInfo.permissionAccessed) { // 没有对应的权限,尝试开启权限
ActivityCompat.requestPermissions(this@ControlPermissionActivity, arrayOf(permissionAccessInfo.permission), REQUEST_CODE)
return
@@ -79,6 +109,7 @@ class ControlPermissionActivity : BaseActivity() {
}
private fun checkPermissionsInfo(permissions: Array) {
+ permissionsData.add(checkNotificationPermissions())
val pm = this@ControlPermissionActivity.packageManager
for (permission in permissions) {
var accessInfo = PermissionAccessInfo()
@@ -97,4 +128,12 @@ class ControlPermissionActivity : BaseActivity() {
}
}
+ private fun checkNotificationPermissions() : PermissionAccessInfo {
+ var accessInfo = PermissionAccessInfo()
+ val notificationManager: NotificationManagerCompat = NotificationManagerCompat.from(this@ControlPermissionActivity);
+ accessInfo.permissionAccessed = notificationManager.areNotificationsEnabled()
+ accessInfo.permissionName = "通知管理"
+ return accessInfo
+ }
+
}
\ No newline at end of file
diff --git a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/consts/CommonField.kt b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/consts/CommonField.kt
index 11c3b4c7c..8be8115c6 100644
--- a/app/src/main/java/com/tencent/iot/explorer/link/kitlink/consts/CommonField.kt
+++ b/app/src/main/java/com/tencent/iot/explorer/link/kitlink/consts/CommonField.kt
@@ -132,6 +132,8 @@ object CommonField {
const val DELET_ACCOUNT_POLICY_EN = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config6.js"
const val THIRD_SDK_URL_US_ZH = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config12.js"
const val THIRD_SDK_URL_US_EN = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config13.js"
+ const val PERSONAL_INFO_URL_US_ZH = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config14.js"
+ const val PERSONAL_INFO_URL_US_EN = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config15.js"
/************返回结果通用字段*************/
const val RESPONSE = "Response"
diff --git a/app/src/main/res/layout/activity_about_us.xml b/app/src/main/res/layout/activity_about_us.xml
index b66f2213e..4634fa874 100644
--- a/app/src/main/res/layout/activity_about_us.xml
+++ b/app/src/main/res/layout/activity_about_us.xml
@@ -138,6 +138,74 @@
app:layout_constraintTop_toBottomOf="@+id/tv_title_user_agreement"
android:background="@color/gray_E7E8EB" />
+
+
+
+
+
+
+
+
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@+id/tv_title_collected_personal_information" />
and
Privacy protection
Third-party information sharing checklist
+ Collection of personal information list
In order to protect your personal rights and interests, before you use our products, please be sure to carefully read Tencent LLink
,to help you understand our collection/storage/use/external provision/protection of your personal information and your rights. \nWe will not actively share or transfer your personal information to a third party. If there are other situations in which your personal information is shared or transferred or you need us to share or transfer that to a third party, we will confirm that the third party obtains your agreement to the above actions. For personal information that needs to be shared with third-party service providers in our products, please refer to
. \nIf you have any questions about the above agreement, you can send the question to the official email fanyi@tencent.com of Tencent LLink or to our dedicated department for personal information protection.The mailing address is:Tencent Building, Keji Zhong Road, Nanshan District, Shenzhen, Guangdong, China. Recipient:Legal Department,Data and Privacy Protection Center\n If you agree to the content of the above agreement, please click "Yes" to accept our product service!
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 942a218ad..9d3c7b9e5 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -686,6 +686,7 @@
与
隐私保护
第三方信息共享清单
+ 收集个人信息明示清单
为了更好地保障您的个人权益,在您使用我们的产品前,请务必谨慎阅读腾讯连连
,以帮助您了解我们对您的个人信息的收集/保存/使用/对外提供/保护等情况以及您享有的权利。\n我们不会主动共享或转让您的个人信息至第三方,如存在其他共享或转让您的个人信息或您需要我们将您的个人信息共享或转让至第三方情形时,我们会直接或确认第三方征得您对上述行为的明示同意。我们的产品中需要与第三方服务商共享的个人信息,请您查阅
。\n如您对以上协议有任何疑问,您可将问题发送至腾讯连连官方邮箱fanyi@tencent.com或寄给我们设立的个人信息保护专职部门。邮寄地址为:中国广东省深圳市南山区科技中一路腾讯大厦 法务部 数据及隐私保护中心(收)\n如您同意以上协议内容,请点击“同意”开始接受我们的产品服务!
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 942a218ad..9d3c7b9e5 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -686,6 +686,7 @@
与
隐私保护
第三方信息共享清单
+ 收集个人信息明示清单
为了更好地保障您的个人权益,在您使用我们的产品前,请务必谨慎阅读腾讯连连
,以帮助您了解我们对您的个人信息的收集/保存/使用/对外提供/保护等情况以及您享有的权利。\n我们不会主动共享或转让您的个人信息至第三方,如存在其他共享或转让您的个人信息或您需要我们将您的个人信息共享或转让至第三方情形时,我们会直接或确认第三方征得您对上述行为的明示同意。我们的产品中需要与第三方服务商共享的个人信息,请您查阅
。\n如您对以上协议有任何疑问,您可将问题发送至腾讯连连官方邮箱fanyi@tencent.com或寄给我们设立的个人信息保护专职部门。邮寄地址为:中国广东省深圳市南山区科技中一路腾讯大厦 法务部 数据及隐私保护中心(收)\n如您同意以上协议内容,请点击“同意”开始接受我们的产品服务!