Skip to content

Commit 006c5a2

Browse files
committed
【ID868776255】App数据隐私合规整改--关于我们处添加个人信息收集清单和三方清单入口,添加通知权限开关。
http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192868776255 Change-Id: Ia90113382ef306a0514d81129cd39e781df4cece
1 parent 1363e8b commit 006c5a2

File tree

8 files changed

+149
-2
lines changed

8 files changed

+149
-2
lines changed

app/src/main/java/com/tencent/iot/explorer/link/App.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ class App : Application(), Application.ActivityLifecycleCallbacks, PayloadMessag
150150
lang = lang.substring(0,2)
151151
WeatherUtils.defaultLang = lang
152152
BleConfigService.get().context = this
153+
154+
loadLastCountryInfo();
153155
}
154156

155157
/**
@@ -482,6 +484,17 @@ class App : Application(), Application.ActivityLifecycleCallbacks, PayloadMessag
482484
IoTAuth.registerActivePush(data.rtcDeviceIdList!!, null)
483485
}
484486
}
487+
488+
private fun loadLastCountryInfo() {
489+
var countryInfo = Utils.getStringValueFromXml(T.getContext(), CommonField.COUNTRY_INFO, CommonField.COUNTRY_INFO)
490+
if (TextUtils.isEmpty(countryInfo)) return
491+
492+
countryInfo!!.split("+").let {
493+
val regionId = it[1]
494+
App.data.regionId = regionId
495+
App.data.region = it[3]
496+
}
497+
}
485498
}
486499

487500
interface AppLifeCircleListener {

app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/AboutUsActivity.kt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class AboutUsActivity : BaseActivity() {
5959
iv_back.setOnClickListener { finish() }
6060
tv_title_privacy_policy.setOnClickListener(listener)
6161
tv_title_user_agreement.setOnClickListener(listener)
62+
tv_title_third_party_information.setOnClickListener(listener)
63+
tv_title_collected_personal_information.setOnClickListener(listener)
6264
tv_about_app_version.setOnClickListener(listener)
6365
tv_title_opensource.setOnClickListener(listener)
6466
}
@@ -118,6 +120,26 @@ class AboutUsActivity : BaseActivity() {
118120
}
119121
}
120122

123+
tv_title_third_party_information -> {
124+
var url = ""
125+
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
126+
url = CommonField.THIRD_SDK_URL_US_ZH
127+
} else {
128+
url = CommonField.THIRD_SDK_URL_US_EN
129+
}
130+
OpensourceLicenseActivity.startWebWithExtra(this@AboutUsActivity, getString(R.string.rule_content_list), url)
131+
}
132+
133+
tv_title_collected_personal_information -> {
134+
var url = ""
135+
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
136+
url = CommonField.PERSONAL_INFO_URL_US_ZH
137+
} else {
138+
url = CommonField.PERSONAL_INFO_URL_US_EN
139+
}
140+
OpensourceLicenseActivity.startWebWithExtra(this@AboutUsActivity, getString(R.string.personal_information_list), url)
141+
}
142+
121143
tv_title_opensource -> {
122144
var url = ""
123145
if (Utils.getLang().contains(CommonField.ZH_TAG)) {

app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/ControlPermissionActivity.kt

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import android.net.Uri
77
import android.provider.Settings
88
import android.util.Log
99
import androidx.core.app.ActivityCompat
10+
import androidx.core.app.NotificationManagerCompat
1011
import androidx.recyclerview.widget.LinearLayoutManager
1112
import com.tencent.iot.explorer.link.R
1213
import com.tencent.iot.explorer.link.kitlink.adapter.PermissionsAdapter
@@ -43,7 +44,9 @@ class ControlPermissionActivity : BaseActivity() {
4344
super.onResume()
4445
// 刷新当前的权限列表,避免用户手动进入到后台,调整权限的情况
4546
if (permissionsData.isEmpty()) return
46-
for (i in permissionsData.indices) {
47+
val notificationManager: NotificationManagerCompat = NotificationManagerCompat.from(this@ControlPermissionActivity);
48+
permissionsData[0].permissionAccessed = notificationManager.areNotificationsEnabled()
49+
for (i in 1 until permissionsData.size) {
4750
permissionsData[i].permissionAccessed =
4851
ActivityCompat.checkSelfPermission(this, permissionsData[i].permission) == PackageManager.PERMISSION_GRANTED
4952
}
@@ -68,6 +71,33 @@ class ControlPermissionActivity : BaseActivity() {
6871

6972
private var onItemClicked = object: PermissionsAdapter.OnItemActionListener {
7073
override fun onItemSwitched(pos: Int, permissionAccessInfo: PermissionAccessInfo) {
74+
if (pos == 0) { //通知
75+
val intent: Intent = Intent()
76+
try {
77+
intent.action = Settings.ACTION_APP_NOTIFICATION_SETTINGS
78+
79+
//8.0及以后版本使用这两个extra. >=API 26
80+
intent.putExtra(Settings.EXTRA_APP_PACKAGE, packageName)
81+
intent.putExtra(Settings.EXTRA_CHANNEL_ID, applicationInfo.uid)
82+
83+
//5.0-7.1 使用这两个extra. <= API 25, >=API 21
84+
intent.putExtra("app_package", packageName)
85+
intent.putExtra("app_uid", applicationInfo.uid)
86+
87+
startActivity(intent)
88+
} catch (e: Exception) {
89+
e.printStackTrace()
90+
91+
//其他低版本或者异常情况,走该节点。进入APP设置界面
92+
intent.action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
93+
intent.putExtra("package", packageName)
94+
95+
//val uri = Uri.fromParts("package", packageName, null)
96+
//intent.data = uri
97+
startActivity(intent)
98+
}
99+
return
100+
}
71101
if (!permissionAccessInfo.permissionAccessed) { // 没有对应的权限,尝试开启权限
72102
ActivityCompat.requestPermissions(this@ControlPermissionActivity, arrayOf(permissionAccessInfo.permission), REQUEST_CODE)
73103
return
@@ -79,6 +109,7 @@ class ControlPermissionActivity : BaseActivity() {
79109
}
80110

81111
private fun checkPermissionsInfo(permissions: Array<String>) {
112+
permissionsData.add(checkNotificationPermissions())
82113
val pm = this@ControlPermissionActivity.packageManager
83114
for (permission in permissions) {
84115
var accessInfo = PermissionAccessInfo()
@@ -97,4 +128,12 @@ class ControlPermissionActivity : BaseActivity() {
97128
}
98129
}
99130

131+
private fun checkNotificationPermissions() : PermissionAccessInfo {
132+
var accessInfo = PermissionAccessInfo()
133+
val notificationManager: NotificationManagerCompat = NotificationManagerCompat.from(this@ControlPermissionActivity);
134+
accessInfo.permissionAccessed = notificationManager.areNotificationsEnabled()
135+
accessInfo.permissionName = "通知管理"
136+
return accessInfo
137+
}
138+
100139
}

app/src/main/java/com/tencent/iot/explorer/link/kitlink/consts/CommonField.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ object CommonField {
132132
const val DELET_ACCOUNT_POLICY_EN = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config6.js"
133133
const val THIRD_SDK_URL_US_ZH = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config12.js"
134134
const val THIRD_SDK_URL_US_EN = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config13.js"
135+
const val PERSONAL_INFO_URL_US_ZH = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config14.js"
136+
const val PERSONAL_INFO_URL_US_EN = "http://qzonestyle.gtimg.cn/qzone/qzactStatics/qcloud/data/42/config15.js"
135137

136138
/************返回结果通用字段*************/
137139
const val RESPONSE = "Response"

app/src/main/res/layout/activity_about_us.xml

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,74 @@
138138
app:layout_constraintTop_toBottomOf="@+id/tv_title_user_agreement"
139139
android:background="@color/gray_E7E8EB" />
140140

141+
<TextView
142+
android:id="@+id/tv_title_third_party_information"
143+
android:layout_width="match_parent"
144+
android:layout_height="48dp"
145+
android:background="@color/white"
146+
android:gravity="center_vertical"
147+
android:layout_marginTop="1dp"
148+
android:paddingStart="20dp"
149+
android:paddingEnd="20dp"
150+
android:text="@string/rule_content_list"
151+
android:textColor="@color/black_15161A"
152+
android:textSize="@dimen/ts_14"
153+
app:layout_constraintTop_toBottomOf="@+id/tv_title_user_agreement" />
154+
155+
<ImageView
156+
android:id="@+id/iv_third_party_information"
157+
android:layout_width="18dp"
158+
android:layout_height="18dp"
159+
android:layout_marginEnd="20dp"
160+
android:src="@mipmap/icon_arrow"
161+
android:rotation="180"
162+
app:layout_constraintBottom_toBottomOf="@+id/tv_title_third_party_information"
163+
app:layout_constraintRight_toRightOf="parent"
164+
app:layout_constraintTop_toTopOf="@+id/tv_title_third_party_information" />
165+
166+
<View
167+
android:id="@+id/line_third_party_information"
168+
android:layout_width="match_parent"
169+
android:layout_height="1dp"
170+
android:layout_marginStart="20dp"
171+
android:layout_marginEnd="20dp"
172+
app:layout_constraintTop_toBottomOf="@+id/tv_title_third_party_information"
173+
android:background="@color/gray_E7E8EB" />
174+
175+
<TextView
176+
android:id="@+id/tv_title_collected_personal_information"
177+
android:layout_width="match_parent"
178+
android:layout_height="48dp"
179+
android:background="@color/white"
180+
android:gravity="center_vertical"
181+
android:layout_marginTop="1dp"
182+
android:paddingStart="20dp"
183+
android:paddingEnd="20dp"
184+
android:text="@string/personal_information_list"
185+
android:textColor="@color/black_15161A"
186+
android:textSize="@dimen/ts_14"
187+
app:layout_constraintTop_toBottomOf="@+id/tv_title_third_party_information" />
188+
189+
<ImageView
190+
android:id="@+id/iv_collected_personal_information"
191+
android:layout_width="18dp"
192+
android:layout_height="18dp"
193+
android:layout_marginEnd="20dp"
194+
android:src="@mipmap/icon_arrow"
195+
android:rotation="180"
196+
app:layout_constraintBottom_toBottomOf="@+id/tv_title_collected_personal_information"
197+
app:layout_constraintRight_toRightOf="parent"
198+
app:layout_constraintTop_toTopOf="@+id/tv_title_collected_personal_information" />
199+
200+
<View
201+
android:id="@+id/line_collected_personal_information"
202+
android:layout_width="match_parent"
203+
android:layout_height="1dp"
204+
android:layout_marginStart="20dp"
205+
android:layout_marginEnd="20dp"
206+
app:layout_constraintTop_toBottomOf="@+id/tv_title_collected_personal_information"
207+
android:background="@color/gray_E7E8EB" />
208+
141209
<TextView
142210
android:id="@+id/tv_title_opensource"
143211
android:layout_width="match_parent"
@@ -150,7 +218,7 @@
150218
android:text="@string/register_agree_5"
151219
android:textColor="@color/black_15161A"
152220
android:textSize="@dimen/ts_14"
153-
app:layout_constraintTop_toBottomOf="@+id/line_user_agreement" />
221+
app:layout_constraintTop_toBottomOf="@+id/tv_title_collected_personal_information" />
154222

155223
<ImageView
156224
android:id="@+id/iv_opensource_arrow"

app/src/main/res/values-en-rUS/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@
686686
<string name="rule_title_and">and</string>
687687
<string name="rule_title_private_protect">Privacy protection</string>
688688
<string name="rule_content_list">Third-party information sharing checklist</string>
689+
<string name="personal_information_list">Collection of personal information list</string>
689690
<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>
690691
<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>
691692
<string name="rule_content_suffix">. \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!</string>

app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@
686686
<string name="rule_title_and">与</string>
687687
<string name="rule_title_private_protect">隐私保护</string>
688688
<string name="rule_content_list">第三方信息共享清单</string>
689+
<string name="personal_information_list">收集个人信息明示清单</string>
689690
<string name="rule_content_prefix">为了更好地保障您的个人权益,在您使用我们的产品前,请务必谨慎阅读腾讯连连</string>
690691
<string name="rule_content_middle">,以帮助您了解我们对您的个人信息的收集/保存/使用/对外提供/保护等情况以及您享有的权利。\n我们不会主动共享或转让您的个人信息至第三方,如存在其他共享或转让您的个人信息或您需要我们将您的个人信息共享或转让至第三方情形时,我们会直接或确认第三方征得您对上述行为的明示同意。我们的产品中需要与第三方服务商共享的个人信息,请您查阅</string>
691692
<string name="rule_content_suffix">。\n如您对以上协议有任何疑问,您可将问题发送至腾讯连连官方邮箱fanyi@tencent.com或寄给我们设立的个人信息保护专职部门。邮寄地址为:中国广东省深圳市南山区科技中一路腾讯大厦 法务部 数据及隐私保护中心(收)\n如您同意以上协议内容,请点击“同意”开始接受我们的产品服务!</string>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@
686686
<string name="rule_title_and">与</string>
687687
<string name="rule_title_private_protect">隐私保护</string>
688688
<string name="rule_content_list">第三方信息共享清单</string>
689+
<string name="personal_information_list">收集个人信息明示清单</string>
689690
<string name="rule_content_prefix">为了更好地保障您的个人权益,在您使用我们的产品前,请务必谨慎阅读腾讯连连</string>
690691
<string name="rule_content_middle">,以帮助您了解我们对您的个人信息的收集/保存/使用/对外提供/保护等情况以及您享有的权利。\n我们不会主动共享或转让您的个人信息至第三方,如存在其他共享或转让您的个人信息或您需要我们将您的个人信息共享或转让至第三方情形时,我们会直接或确认第三方征得您对上述行为的明示同意。我们的产品中需要与第三方服务商共享的个人信息,请您查阅</string>
691692
<string name="rule_content_suffix">。\n如您对以上协议有任何疑问,您可将问题发送至腾讯连连官方邮箱fanyi@tencent.com或寄给我们设立的个人信息保护专职部门。邮寄地址为:中国广东省深圳市南山区科技中一路腾讯大厦 法务部 数据及隐私保护中心(收)\n如您同意以上协议内容,请点击“同意”开始接受我们的产品服务!</string>

0 commit comments

Comments
 (0)