Skip to content

Commit

Permalink
【ID869532311】App数据隐私合规检测风险问题修复--注册登录页面添加查看用户协议,隐私政策入口。修改弹出权限样式,启动页添加询…
Browse files Browse the repository at this point in the history
…问隐私政策用户协议的弹窗。

http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192869532311

Change-Id: Iec36cda2a429728c638edc48810a8a634844655c
  • Loading branch information
SundoggyNew committed Nov 23, 2021
1 parent 926c10b commit c9dcdce
Show file tree
Hide file tree
Showing 49 changed files with 1,095 additions and 487 deletions.
416 changes: 207 additions & 209 deletions app/src/main/AndroidManifest.xml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion app/src/main/java/com/tencent/iot/explorer/link/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ class App : Application(), Application.ActivityLifecycleCallbacks, PayloadMessag
// App enters foreground
data.isForeground = true
L.e("App foreground")
requestDeviceList()
if (!TextUtils.isEmpty(data.getToken())) {
requestDeviceList()
}
if (activity is AppLifeCircleListener) {
activity.onAppGoforeground()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,41 @@

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.constraintlayout.widget.ConstraintLayout;

import com.tencent.iot.explorer.link.R;
import com.tencent.iot.explorer.link.customview.dialog.entity.UpgradeInfo;

public class PermissionDialog extends IosCenterStyleDialog implements View.OnClickListener {
public class PermissionDialog extends IosCenterStyleDialog {

private ImageView logo;
private TextView detail;
private TextView detailLips;
private TextView btnRefuse;
private TextView btnOK;
private TextView title;
private ConstraintLayout outLayout;
private String detailString;
private String detailLipsString;
private String titleString;
private int logoResId;

public PermissionDialog(Context context, String detail, String detailLips) {
super(context, R.layout.popup_permission_layout);
public PermissionDialog(Context context, int logoResId, String detail, String title) {
super(context, R.layout.popup_permission_layout, false);
this.logoResId = logoResId;
this.detailString = detail;
this.detailLipsString = detailLips;
this.titleString = title;
}

@Override
public void initView() {
outLayout = view.findViewById(R.id.permission_dialog_layout);
detail = view.findViewById(R.id.tv_detail);
detailLips = view.findViewById(R.id.tv_detail_lips);
btnRefuse = view.findViewById(R.id.tv_refuse);
btnOK = view.findViewById(R.id.tv_ok);

btnRefuse.setOnClickListener(this);
btnOK.setOnClickListener(this);
title = view.findViewById(R.id.tv_title);
logo = view.findViewById(R.id.iv_logo);

detail.setText(detailString);
detailLips.setText(detailLipsString);
title.setText(titleString);
logo.setImageResource(logoResId);
outLayout.setBackgroundColor(getContext().getResources().getColor(R.color.dialog_background));
}

@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.tv_refuse:
dismiss();
if (onDismisListener != null) {
onDismisListener.OnClickRefuse();
}
break;
case R.id.tv_ok:
dismiss();
if (onDismisListener != null) {
onDismisListener.OnClickOK();
}
break;
default:
break;
}
}

private volatile OnDismisListener onDismisListener;

public interface OnDismisListener {
void OnClickRefuse();
void OnClickOK();
}

public void setOnDismisListener(OnDismisListener onDismisListener) {
this.onDismisListener = onDismisListener;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import com.tencent.iot.explorer.link.T
import com.tencent.iot.explorer.link.core.auth.callback.MyCallback
import com.tencent.iot.explorer.link.core.auth.response.BaseResponse
import com.tencent.iot.explorer.link.core.utils.Utils
import com.tencent.iot.explorer.link.customview.dialog.PermissionDialog
import kotlinx.android.synthetic.main.activity_account_and_safety.*
import kotlinx.android.synthetic.main.menu_back_layout.*

Expand Down Expand Up @@ -73,18 +72,7 @@ class AccountAndSafetyActivity : PActivity(), AccountAndSafetyView, View.OnClick
if (App.data.userInfo.HasWxOpenID == "1") {
T.show(getString(R.string.wechat_bind_already)) //微信已经绑定过了, 请勿重复绑定
} else {
var dlg = PermissionDialog(this@AccountAndSafetyActivity, getString(R.string.permission_of_wechat), getString(R.string.permission_of_wechat_lips))
dlg.show()
dlg.setOnDismisListener(object : PermissionDialog.OnDismisListener {
override fun OnClickRefuse() {

}

override fun OnClickOK() {
WeChatLogin.getInstance().login(this@AccountAndSafetyActivity, this@AccountAndSafetyActivity)
}

})
WeChatLogin.getInstance().login(this, this)
}
}
tv_modify_passwd -> {// 修改密码
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ChooseCountryActivity : PActivity(), ChooseCountryView, View.OnClickListen
override fun initView() {
tv_title.text = getString(R.string.country_or_place)
presenter = ChooseCountryPresenter(this)
loadLastCountryInfo()
// loadLastCountryInfo()
}

override fun setListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import android.view.animation.LinearInterpolator
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.GridLayoutManager
import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.JSONObject
import com.example.qrcode.Constant
import com.example.qrcode.ScannerActivity
import com.tencent.iot.explorer.link.App
Expand Down Expand Up @@ -66,9 +67,9 @@ class DeviceCategoryActivity : PActivity(), MyCallback, CRecyclerView.RecyclerI
Manifest.permission.CAMERA,
Manifest.permission.ACCESS_WIFI_STATE,
Manifest.permission.CHANGE_WIFI_STATE,
Manifest.permission.CHANGE_WIFI_MULTICAST_STATE,
Manifest.permission.ACCESS_FINE_LOCATION
Manifest.permission.CHANGE_WIFI_MULTICAST_STATE
)
private var permissionDialog: PermissionDialog? = null

private var blueToothPermissions = arrayOf(
Manifest.permission.ACCESS_COARSE_LOCATION,
Expand Down Expand Up @@ -308,10 +309,13 @@ class DeviceCategoryActivity : PActivity(), MyCallback, CRecyclerView.RecyclerI
var intent = Intent(Intent(this, ScannerActivity::class.java))
intent.putExtra(Constant.EXTRA_IS_ENABLE_SCAN_FROM_PIC,true)
startActivityForResult(intent, CommonField.QR_CODE_REQUEST_CODE)
permissionDialog?.dismiss()
permissionDialog = null
}

override fun permissionDenied(permission: String) {
// requestPermission(arrayOf(permission))
permissionDialog?.dismiss()
permissionDialog = null
}

override fun onClick(v: View?) {
Expand All @@ -322,18 +326,23 @@ class DeviceCategoryActivity : PActivity(), MyCallback, CRecyclerView.RecyclerI
intent.putExtra(Constant.EXTRA_IS_ENABLE_SCAN_FROM_PIC,true)
startActivityForResult(intent, CommonField.QR_CODE_REQUEST_CODE)
} else {
var dlg = PermissionDialog(this@DeviceCategoryActivity, getString(R.string.permission_of_wifi), getString(R.string.permission_of_wifi_lips))
dlg.show()
dlg.setOnDismisListener(object : PermissionDialog.OnDismisListener {
override fun OnClickRefuse() {

}
// 查看请求camera权限的时间是否大于48小时
var cameraJsonString = Utils.getStringValueFromXml(T.getContext(), CommonField.PERMISSION_CAMERA, CommonField.PERMISSION_CAMERA)
var cameraJson: JSONObject? = JSONObject.parse(cameraJsonString) as JSONObject?
val lasttime = cameraJson?.getLong(CommonField.PERMISSION_CAMERA)
if (lasttime != null && lasttime > 0 && System.currentTimeMillis() / 1000 - lasttime < 48*60*60) {
T.show(getString(R.string.permission_of_camera_scan_refuse))
return
}
requestPermission(permissions)
permissionDialog = PermissionDialog(App.activity, R.mipmap.permission_camera ,getString(R.string.permission_camera_lips), getString(R.string.permission_camera))
permissionDialog!!.show()

override fun OnClickOK() {
requestPermission(permissions)
}
// 记录请求camera权限的时间
var json = JSONObject()
json.put(CommonField.PERMISSION_CAMERA, System.currentTimeMillis() / 1000)
Utils.setXmlStringValue(T.getContext(), CommonField.PERMISSION_CAMERA, CommonField.PERMISSION_CAMERA, json.toJSONString())

})
}
}
// iv_question -> {
Expand Down Expand Up @@ -489,18 +498,6 @@ class DeviceCategoryActivity : PActivity(), MyCallback, CRecyclerView.RecyclerI

private fun beginScanning() {
if (!checkPermissions(blueToothPermissions)) {
var dlg = PermissionDialog(this@DeviceCategoryActivity, getString(R.string.permission_of_wifi), getString(R.string.permission_of_wifi_lips))
dlg.show()
dlg.setOnDismisListener(object : PermissionDialog.OnDismisListener {
override fun OnClickRefuse() {

}

override fun OnClickOK() {
requestPermission(blueToothPermissions)
}

})
return
}

Expand Down
Loading

0 comments on commit c9dcdce

Please sign in to comment.