Skip to content

Commit

Permalink
【ID868776255】App数据隐私合规整改--关于我们处添加个人信息收集清单和三方清单入口,添加通知权限开关。
Browse files Browse the repository at this point in the history
http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192868776255

Change-Id: Ia90113382ef306a0514d81129cd39e781df4cece
  • Loading branch information
SundoggyNew committed Oct 28, 2021
1 parent 1363e8b commit 006c5a2
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 2 deletions.
13 changes: 13 additions & 0 deletions app/src/main/java/com/tencent/iot/explorer/link/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class App : Application(), Application.ActivityLifecycleCallbacks, PayloadMessag
lang = lang.substring(0,2)
WeatherUtils.defaultLang = lang
BleConfigService.get().context = this

loadLastCountryInfo();
}

/**
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand All @@ -79,6 +109,7 @@ class ControlPermissionActivity : BaseActivity() {
}

private fun checkPermissionsInfo(permissions: Array<String>) {
permissionsData.add(checkNotificationPermissions())
val pm = this@ControlPermissionActivity.packageManager
for (permission in permissions) {
var accessInfo = PermissionAccessInfo()
Expand All @@ -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
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
70 changes: 69 additions & 1 deletion app/src/main/res/layout/activity_about_us.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,74 @@
app:layout_constraintTop_toBottomOf="@+id/tv_title_user_agreement"
android:background="@color/gray_E7E8EB" />

<TextView
android:id="@+id/tv_title_third_party_information"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/white"
android:gravity="center_vertical"
android:layout_marginTop="1dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="@string/rule_content_list"
android:textColor="@color/black_15161A"
android:textSize="@dimen/ts_14"
app:layout_constraintTop_toBottomOf="@+id/tv_title_user_agreement" />

<ImageView
android:id="@+id/iv_third_party_information"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginEnd="20dp"
android:src="@mipmap/icon_arrow"
android:rotation="180"
app:layout_constraintBottom_toBottomOf="@+id/tv_title_third_party_information"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_title_third_party_information" />

<View
android:id="@+id/line_third_party_information"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
app:layout_constraintTop_toBottomOf="@+id/tv_title_third_party_information"
android:background="@color/gray_E7E8EB" />

<TextView
android:id="@+id/tv_title_collected_personal_information"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/white"
android:gravity="center_vertical"
android:layout_marginTop="1dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="@string/personal_information_list"
android:textColor="@color/black_15161A"
android:textSize="@dimen/ts_14"
app:layout_constraintTop_toBottomOf="@+id/tv_title_third_party_information" />

<ImageView
android:id="@+id/iv_collected_personal_information"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginEnd="20dp"
android:src="@mipmap/icon_arrow"
android:rotation="180"
app:layout_constraintBottom_toBottomOf="@+id/tv_title_collected_personal_information"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_title_collected_personal_information" />

<View
android:id="@+id/line_collected_personal_information"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
app:layout_constraintTop_toBottomOf="@+id/tv_title_collected_personal_information"
android:background="@color/gray_E7E8EB" />

<TextView
android:id="@+id/tv_title_opensource"
android:layout_width="match_parent"
Expand All @@ -150,7 +218,7 @@
android:text="@string/register_agree_5"
android:textColor="@color/black_15161A"
android:textSize="@dimen/ts_14"
app:layout_constraintTop_toBottomOf="@+id/line_user_agreement" />
app:layout_constraintTop_toBottomOf="@+id/tv_title_collected_personal_information" />

<ImageView
android:id="@+id/iv_opensource_arrow"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-en-rUS/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@
<string name="rule_title_and">and</string>
<string name="rule_title_private_protect">Privacy protection</string>
<string name="rule_content_list">Third-party information sharing checklist</string>
<string name="personal_information_list">Collection of personal information list</string>
<string name="rule_content_prefix">In order to protect your personal rights and interests, before you use our products, please be sure to carefully read Tencent LLink</string>
<string name="rule_content_middle">,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</string>
<string name="rule_content_suffix">. \nIf you have any questions about the above agreement, you can send the question to the official email [email protected] 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!</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@
<string name="rule_title_and">与</string>
<string name="rule_title_private_protect">隐私保护</string>
<string name="rule_content_list">第三方信息共享清单</string>
<string name="personal_information_list">收集个人信息明示清单</string>
<string name="rule_content_prefix">为了更好地保障您的个人权益,在您使用我们的产品前,请务必谨慎阅读腾讯连连</string>
<string name="rule_content_middle">,以帮助您了解我们对您的个人信息的收集/保存/使用/对外提供/保护等情况以及您享有的权利。\n我们不会主动共享或转让您的个人信息至第三方,如存在其他共享或转让您的个人信息或您需要我们将您的个人信息共享或转让至第三方情形时,我们会直接或确认第三方征得您对上述行为的明示同意。我们的产品中需要与第三方服务商共享的个人信息,请您查阅</string>
<string name="rule_content_suffix">。\n如您对以上协议有任何疑问,您可将问题发送至腾讯连连官方邮箱[email protected]或寄给我们设立的个人信息保护专职部门。邮寄地址为:中国广东省深圳市南山区科技中一路腾讯大厦 法务部 数据及隐私保护中心(收)\n如您同意以上协议内容,请点击“同意”开始接受我们的产品服务!</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@
<string name="rule_title_and">与</string>
<string name="rule_title_private_protect">隐私保护</string>
<string name="rule_content_list">第三方信息共享清单</string>
<string name="personal_information_list">收集个人信息明示清单</string>
<string name="rule_content_prefix">为了更好地保障您的个人权益,在您使用我们的产品前,请务必谨慎阅读腾讯连连</string>
<string name="rule_content_middle">,以帮助您了解我们对您的个人信息的收集/保存/使用/对外提供/保护等情况以及您享有的权利。\n我们不会主动共享或转让您的个人信息至第三方,如存在其他共享或转让您的个人信息或您需要我们将您的个人信息共享或转让至第三方情形时,我们会直接或确认第三方征得您对上述行为的明示同意。我们的产品中需要与第三方服务商共享的个人信息,请您查阅</string>
<string name="rule_content_suffix">。\n如您对以上协议有任何疑问,您可将问题发送至腾讯连连官方邮箱[email protected]或寄给我们设立的个人信息保护专职部门。邮寄地址为:中国广东省深圳市南山区科技中一路腾讯大厦 法务部 数据及隐私保护中心(收)\n如您同意以上协议内容,请点击“同意”开始接受我们的产品服务!</string>
Expand Down

0 comments on commit 006c5a2

Please sign in to comment.