Skip to content

Commit 1d8f0cc

Browse files
author
ctj
committed
删除冗余日志
1 parent 563edfc commit 1d8f0cc

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

app/src/main/java/com/wave_chtj/example/allapp/AllAppAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public void onClick(View v) {
147147
if (isClearResult) {
148148
ToastUtils.success("启用成功,该应用可正常上网!");
149149
} else {
150-
ToastUtils.error("启用成功,请重试!");
150+
ToastUtils.error("启用失败,请重试!");
151151
}
152152
}
153153
});

app/src/main/java/com/wave_chtj/example/allapp/AllAppAty.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
import androidx.recyclerview.widget.LinearLayoutManager;
1212
import androidx.recyclerview.widget.RecyclerView;
1313

14+
import com.chtj.base_framework.FIPTablesTools;
1415
import com.chtj.base_framework.network.FNetworkTools;
1516
import com.face_chtj.base_iotutils.BaseIotUtils;
1617
import com.face_chtj.base_iotutils.KLog;
1718
import com.face_chtj.base_iotutils.display.AppsUtils;
19+
import com.face_chtj.base_iotutils.display.ToastUtils;
1820
import com.face_chtj.base_iotutils.entity.AppEntity;
1921
import com.wave_chtj.example.R;
2022
import com.wave_chtj.example.base.BaseActivity;
@@ -72,6 +74,18 @@ public void getDeskTopApp(View view) {
7274
newsAdapter.setList(appEntityList);
7375
}
7476

77+
/**
78+
* 启用全部应用的网络访问
79+
*/
80+
public void enableAllAppNetClick(View view){
81+
boolean isPass=FIPTablesTools.clearAllRule();
82+
if(isPass){
83+
ToastUtils.success("启用成功!");
84+
}else{
85+
ToastUtils.error("启用失败!");
86+
}
87+
}
88+
7589
/**
7690
* 查询可卸载应用
7791
*

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

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@
3030

3131
<LinearLayout
3232
android:layout_width="179pt"
33-
android:layout_height="wrap_content"
33+
android:layout_height="match_parent"
3434
android:orientation="vertical">
3535

3636
<Button
3737
android:layout_width="160pt"
38-
android:layout_height="90pt"
38+
android:layout_height="55pt"
39+
android:layout_weight="1"
3940
android:layout_gravity="center"
4041
android:layout_marginTop="25pt"
4142
android:background="@drawable/button_switch"
@@ -45,7 +46,8 @@
4546

4647
<Button
4748
android:layout_width="160pt"
48-
android:layout_height="90pt"
49+
android:layout_height="55pt"
50+
android:layout_weight="1"
4951
android:layout_gravity="center"
5052
android:layout_marginTop="25pt"
5153
android:background="@drawable/button_switch"
@@ -55,17 +57,29 @@
5557

5658
<Button
5759
android:layout_width="160pt"
58-
android:layout_height="90pt"
60+
android:layout_height="55pt"
5961
android:layout_gravity="center"
6062
android:layout_marginTop="25pt"
63+
android:layout_weight="1"
6164
android:background="@drawable/button_switch"
6265
android:onClick="getSystemApp"
6366
android:text="系统应用"
6467
android:textSize="20pt" />
68+
<Button
69+
android:layout_width="160pt"
70+
android:layout_weight="1"
71+
android:layout_height="55pt"
72+
android:layout_gravity="center"
73+
android:layout_marginTop="25pt"
74+
android:background="@drawable/button_switch"
75+
android:onClick="enableAllAppNetClick"
76+
android:text="启用全部网络"
77+
android:textSize="20pt" />
6578

6679
<TextView
6780
android:id="@+id/tvCount"
6881
android:layout_width="160pt"
82+
android:layout_weight="1"
6983
android:layout_height="90pt"
7084
android:layout_gravity="center"
7185
android:layout_marginTop="25pt"
@@ -75,6 +89,7 @@
7589

7690
<TextView
7791
android:id="@+id/tvTotal"
92+
android:layout_weight="1"
7893
android:layout_width="160pt"
7994
android:layout_height="90pt"
8095
android:layout_gravity="center"

base_iotutils/src/main/java/com/face_chtj/base_iotutils/network/NetUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public static boolean isConnected() {
271271
public static boolean checkNetWork(String[] dnsList, int count, int deadline) {
272272
for (String pingAddr : dnsList) {
273273
boolean isPing=NetUtils.ping(pingAddr, count, deadline);
274-
KLog.d("checkNetWork() isPing >> "+isPing);
274+
//KLog.d("checkNetWork() isPing >> "+isPing);
275275
if (isPing) {
276276
//If it is abnormal when entering the program network at the beginning, then only prompt once
277277
return true;

0 commit comments

Comments
 (0)