Commit 804016a6 authored by jyx's avatar jyx

注释挂断电话模块

parent d80fbfe6
......@@ -177,6 +177,7 @@ public class MintsApplication extends BaseApp {
// TODO 这里可以初始化广告SDK
thirdConfig();
// 锁屏模块初始化
new ScreenLockerObserver(this).start(this);
CoreAdContext.Companion.setLockerResumeCallback(new Function1<Activity, Boolean>() {
......@@ -208,14 +209,14 @@ public class MintsApplication extends BaseApp {
});
// 监听电话状态
PhoneWatch.getInstance(this).begin(new PhoneWatch.PhoneStateListener() {
@Override
public void onIdle(String phoneNum, int time) {
if (WifiDataManager.INSTANCE.getTelephoneOff()) {
OutAppRouter.INSTANCE.showTriggerActivity(TriggerActivity.TRIGGER_TYPE_PHONE, phoneNum, time);
}
}
});
// PhoneWatch.getInstance(this).begin(new PhoneWatch.PhoneStateListener() {
// @Override
// public void onIdle(String phoneNum, int time) {
// if (WifiDataManager.INSTANCE.getTelephoneOff()) {
// OutAppRouter.INSTANCE.showTriggerActivity(TriggerActivity.TRIGGER_TYPE_PHONE, phoneNum, time);
// }
// }
// });
// 监听充电状态
BatteryWatch.getInstance(this).begin(new BatteryWatch.BatteryStateListener() {
......@@ -247,7 +248,6 @@ public class MintsApplication extends BaseApp {
public void onAdded(String pkgName) {
AntiAuditManager.Companion.getInstance().antiAudit();
if (WifiDataManager.INSTANCE.getInstallApk()) {
// AntiAuditManager.Companion.getInstance().updateInstallApkCount();
OutAppRouter.INSTANCE.showApkActivity(0, pkgName);
}
}
......
......@@ -6,10 +6,8 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.telephony.TelephonyManager;
import com.mints.flowbox.utils.LogUtil;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
//import java.util.concurrent.ExecutorService;
//import java.util.concurrent.Executors;
/**
* @author jyx
......@@ -64,19 +62,23 @@ public class PhoneWatch {
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
int state = tm.getCallState();
//获取电话号码
String phone = intent.getStringExtra("incoming_number");
String phone;
try {
phone = intent.getStringExtra("incoming_number");
if (phone == null) phone = "";
} catch (Exception e) {
e.printStackTrace();
phone = "";
}
switch (state) {
case TelephonyManager.CALL_STATE_RINGING: // 来电
LogUtil.d("AAA -> CALL_STATE_RINGING");
// isFinish = false;
// if (service.isShutdown()) {
// service = Executors.newSingleThreadExecutor();
// }
break;
case TelephonyManager.CALL_STATE_OFFHOOK: // 正在通话中
LogUtil.d("AAA -> CALL_STATE_OFFHOOK");
time = System.currentTimeMillis();
// isCalling = true;
......@@ -92,8 +94,6 @@ public class PhoneWatch {
// });
break;
case TelephonyManager.CALL_STATE_IDLE: // 通话结束
LogUtil.d("AAA -> CALL_STATE_IDLE");
time = System.currentTimeMillis() - time;
if (time != 0) {
time /= 1000;
......
......@@ -48,7 +48,10 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
}
tvAboutasVersion.setOnLongClickListener {
ToastUtil.showLong(MintsApplication.getContext(),"黑名单:true不弹,false弹"+WifiDataManager.isBlackOrClose())
ToastUtil.showLong(
MintsApplication.getContext(),
"黑名单:true不弹,false弹" + WifiDataManager.isBlackOrClose()
)
true
}
......
......@@ -82,12 +82,6 @@ class ApkActivity : BaseActivity() {
WifiDataManager.increaseCount(WifiDataManager.INSTALL_APK)
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.text = "测试 -> 当前应用安装剩余次数:" + sp.getInt(
WifiDataManager.INSTALL_APK,
0
) + "总次数:" + WifiDataManager.INSTALL_APK_TIMES
}
} else if (mApkState == 1) {
// 应用安装
val apkInfo2 = AppUtil.getApkInfo2(this, mApkPkgName)
......@@ -106,12 +100,7 @@ class ApkActivity : BaseActivity() {
WifiDataManager.increaseCount(WifiDataManager.UPDATE_APK)
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.text = "测试 -> 当前应用更新剩余次数:" + sp.getInt(
WifiDataManager.UPDATE_APK,
0
) + "总次数:" + WifiDataManager.UPDATE_APK_TIMES
}
} else if (mApkState == 2) {
// 应用卸载
tvTitle.text = "卸载残留提示"
......@@ -128,14 +117,6 @@ class ApkActivity : BaseActivity() {
ivIcon.visibility = View.GONE
WifiDataManager.increaseCount(WifiDataManager.UNINSTALL_APK)
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "测试 -> 当前应用卸载剩余次数:" + sp.getInt(
WifiDataManager.UNINSTALL_APK,
0
) + "总次数:" + WifiDataManager.UNINSTALL_APK_TIMES
}
}
btnClean.setOnClickListener {
......
......@@ -19,8 +19,6 @@ import com.mints.flowbox.utils.StatusBarUtil
import kotlinx.android.synthetic.main.activity_boost_fast.*
import kotlinx.android.synthetic.main.activity_boost_fast.fl_ad
import kotlinx.android.synthetic.main.activity_boost_fast.iv_close
import kotlinx.android.synthetic.main.activity_screen.*
import kotlinx.android.synthetic.main.activity_timing.*
import java.util.*
import kotlin.random.Random
......@@ -55,7 +53,6 @@ class BoostFastActivity : Activity() {
mType = it.getInt(TransparentActivity.TIMING_TYPE, 0)
}
initView()
startAnim()
......@@ -134,14 +131,6 @@ class BoostFastActivity : Activity() {
finish()
overridePendingTransition(0, 0)
}
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "测试 -> 当前 定时 弹出次数:" + sp.getInt(
WifiDataManager.TIMING,
0
) + "总次数:" + WifiDataManager.TIMING_TIMES
}
}
/**初始化信息iyc*/
......
......@@ -5,13 +5,11 @@ import android.os.Handler
import android.os.Looper
import android.view.View
import android.widget.FrameLayout
import com.mints.flowbox.BuildConfig
import com.mints.flowbox.R
import com.mints.flowbox.ad.AppOutScreenGroMoreCarrierExpressManager
import com.mints.flowbox.ad.ExpressAdCallback
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.manager.AppPreferencesManager
import com.mints.flowbox.manager.wifi.WifiDataManager
import com.mints.flowbox.ui.activitys.IncreasespeedActivity
import com.mints.flowbox.ui.activitys.base.OutAppActivity
......@@ -20,13 +18,10 @@ import com.mints.flowbox.utils.ToolUtil
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_screen.*
import kotlinx.android.synthetic.main.activity_screen.fl_ad
import kotlinx.android.synthetic.main.activity_timing.*
import java.util.*
class ScreenActivity : OutAppActivity(), View.OnClickListener {
private val sp by lazy { AppPreferencesManager.get() }
override fun initViewsAndEvents() {
Handler(Looper.getMainLooper()).postDelayed({
mHelper.swipeBackLayout.setEdgeSize(ToolUtil.getScreenWidth(this))
......@@ -62,13 +57,6 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
tvDate.text = TimeRender.getWeek() + " " + monthDay
tvTime.text = time
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvDate.text = "测试 -> 当前锁屏已弹出次数:" + sp.getInt(
WifiDataManager.LOCK_ON,
0
) + " 总次数:" + WifiDataManager.LOCK_TIMES
}
}
override fun onClick(v: View?) {
......
......@@ -6,7 +6,6 @@ import android.widget.FrameLayout
import androidx.core.content.ContextCompat
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.mints.flowbox.BuildConfig
import com.mints.flowbox.R
import com.mints.flowbox.ad.AppOutSimpleGroMoreCarrierExpressManager
import com.mints.flowbox.ad.ExpressAdCallback
......@@ -33,7 +32,6 @@ import kotlinx.android.synthetic.main.activity_timing.fl_ad
import kotlinx.android.synthetic.main.activity_timing.ivImg
import kotlinx.android.synthetic.main.activity_timing.iv_close
import kotlinx.android.synthetic.main.activity_timing.tvInfo
import kotlinx.android.synthetic.main.activity_timing.tvInfo2
import kotlin.random.Random
/**
......@@ -71,8 +69,6 @@ class TriggerActivity : BaseActivity() {
private var rope: YoYo.YoYoString? = null
private val sp by lazy { AppPreferencesManager.get() }
override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras)
extras?.let {
......@@ -107,14 +103,6 @@ class TriggerActivity : BaseActivity() {
btnClean.text = "立即提速"
WifiDataManager.increaseCount(WifiDataManager.WIFI_ON)
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "测试 -> 当前 连接WIFI 弹出次数:" + sp.getInt(
WifiDataManager.WIFI_ON,
0
) + "总次数:" + WifiDataManager.WIFI_ON_TIMES
}
}
TRIGGER_TYPE_WIFI_TEST -> { // wifi测速
GlideUtils.loadImageView(this, R.mipmap.ic_app_out_wifi_test, ivImg)
......@@ -128,13 +116,6 @@ class TriggerActivity : BaseActivity() {
WifiDataManager.increaseCount(WifiDataManager.WIFI_ON)
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "测试 -> 当前 连接WIFI 弹出次数:" + sp.getInt(
WifiDataManager.WIFI_ON,
0
) + "总次数:" + WifiDataManager.WIFI_ON_TIMES
}
}
TRIGGER_TYPE_WIFI_SAFE -> { // wifi安全检测
GlideUtils.loadImageView(this, R.mipmap.ic_app_out_wifi_safe, ivImg)
......@@ -148,13 +129,6 @@ class TriggerActivity : BaseActivity() {
WifiDataManager.increaseCount(WifiDataManager.WIFI_ON)
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "测试 -> 当前 连接WIFI 弹出次数:" + sp.getInt(
WifiDataManager.WIFI_ON,
0
) + "总次数:" + WifiDataManager.WIFI_ON_TIMES
}
}
TRIGGER_TYPE_WIFI_DISCONNECT_TEST -> { // wifi断开时测速
GlideUtils.loadImageView(this, R.mipmap.ic_app_out_wifi_test, ivImg)
......@@ -164,14 +138,6 @@ class TriggerActivity : BaseActivity() {
btnClean.text = "网络测速"
WifiDataManager.increaseCount(WifiDataManager.WIFI_OFF)
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "测试 -> 当前 断开WIFI 弹出次数:" + sp.getInt(
WifiDataManager.WIFI_OFF,
0
) + "总次数:" + WifiDataManager.WIFI_OFF_TIMES
}
}
TRIGGER_TYPE_WIFI_DISCONNECT_BOOST -> { // wifi断开时加速
GlideUtils.loadImageView(this, R.mipmap.ic_app_out_wifi_boost, ivImg)
......@@ -181,14 +147,6 @@ class TriggerActivity : BaseActivity() {
btnClean.text = "网络优化"
WifiDataManager.increaseCount(WifiDataManager.WIFI_OFF)
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "测试 -> 当前 断开WIFI 弹出次数:" + sp.getInt(
WifiDataManager.WIFI_OFF,
0
) + "总次数:" + WifiDataManager.WIFI_OFF_TIMES
}
}
TRIGGER_TYPE_BOOST -> { // 一键加速
val usedPercentValue = SystemUtils.getUsedPercentValue(mContext)
......@@ -201,7 +159,6 @@ class TriggerActivity : BaseActivity() {
.append("可大幅提示手机运行速度")
.create()
btnClean.text = "一键加速"
}
TRIGGER_TYPE_SAVE_ELE -> { // 省电
AppConfig.fakeSaveBatteryCount = 1 + Random.nextInt(8)
......@@ -219,13 +176,6 @@ class TriggerActivity : BaseActivity() {
WifiDataManager.increaseCount(WifiDataManager.BATTERY_OFF)
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "测试 -> 当前 拔电 弹出次数:" + sp.getInt(
WifiDataManager.BATTERY_OFF,
0
) + "总次数:" + WifiDataManager.BATTERY_OFF_TIMES
}
}
TRIGGER_TYPE_PHONE -> { // 电话挂断
......@@ -238,14 +188,6 @@ class TriggerActivity : BaseActivity() {
btnClean.visibility = View.GONE
WifiDataManager.increaseCount(WifiDataManager.TELEPHONE_OFF)
if (BuildConfig.DEBUG&&tvInfo2!=null) {
tvInfo2.visibility = View.VISIBLE
tvInfo2.text = "测试 -> 当前 电话挂断 弹出次数:" + sp.getInt(
WifiDataManager.TELEPHONE_OFF,
0
) + "总次数:" + WifiDataManager.PHONE_OFF_TIMES
}
}
else -> {
finish()
......
......@@ -111,9 +111,9 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
}
if (AntiAuditManager.instance.isBlack()) {
tv_home_moneytitle.visibility=View.INVISIBLE
}else{
tv_home_moneytitle.visibility=View.VISIBLE
tv_home_moneytitle.visibility = View.INVISIBLE
} else {
tv_home_moneytitle.visibility = View.VISIBLE
}
}
......@@ -171,9 +171,9 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
if (!AntiAuditManager.instance.isBlack()) {
homePresenter.getHotActivity()
homePresenter.getDownloadBottoms()
}else{
ll_home_root.visibility=View.GONE
recy_task.visibility=View.GONE
} else {
ll_home_root.visibility = View.GONE
recy_task.visibility = View.GONE
}
homePresenter.getBubbleMsg()
(requireActivity() as MainActivity).refreshHall()
......
......@@ -397,9 +397,7 @@ class MyFragment : BaseFragment(),
when (taskBean.otherConfig.status) {
0, 2 -> {
val activity: MainActivity? = activity as MainActivity?
activity?.let {
it.clickTab2Layout()
}
activity?.clickTab2Layout()
}
1 -> {
val bundle = Bundle()
......@@ -768,15 +766,19 @@ class MyFragment : BaseFragment(),
swipeRefreshLayout.setOnRefreshListener(this)
if (AntiAuditManager.instance.isBlack()) {
if(TextUtils.equals("xiaomi", CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"))){
btn_withdraw.visibility=View.INVISIBLE
if (TextUtils.equals(
"xiaomi",
CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
)
) {
cl_coin.visibility = View.GONE
}
tv_my_tasktitle.visibility=View.INVISIBLE
item_title_friends.visibility=View.INVISIBLE
}else{
btn_withdraw.visibility=View.VISIBLE
tv_my_tasktitle.visibility=View.VISIBLE
item_title_friends.visibility=View.VISIBLE
ll_task.visibility = View.INVISIBLE
item_title_friends.visibility = View.INVISIBLE
} else {
cl_coin.visibility = View.VISIBLE
tv_my_tasktitle.visibility = View.VISIBLE
item_title_friends.visibility = View.VISIBLE
}
}
......
......@@ -61,16 +61,6 @@
android:textColor="@color/color_40000000"
android:textSize="12sp" />
<TextView
android:id="@+id/tvInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:textSize="12sp"
android:visibility="gone" />
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="wrap_content"
......
......@@ -67,19 +67,6 @@
android:textColor="@color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/tvInfo2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:gravity="center"
android:text="-"
android:textColor="@color/black"
android:textSize="16sp"
android:visibility="gone" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/phoneContainer"
android:layout_width="match_parent"
......
......@@ -48,6 +48,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:id="@+id/ll_task"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment