Support monitoring tethered interface

This would be useful to be used in together with Instant Tethering + Turn off hotspot automatically.

Refine #26, #53.
This commit is contained in:
Mygod
2019-02-06 01:26:06 +08:00
parent 6d6418b8e0
commit cbc65f989c
14 changed files with 174 additions and 61 deletions

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#FF000000"
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
</vector>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/monitor"
android:icon="@drawable/ic_image_remove_red_eye"
android:title="@string/tethering_monitor"
app:showAsAction="always">
<menu/>
</item>
</menu>

View File

@@ -39,6 +39,9 @@
<string name="tethering_temp_hotspot_failure_incompatible_mode">模式不兼容</string>
<string name="tethering_temp_hotspot_failure_tethering_disallowed">共享被禁用</string>
<string name="tethering_monitor">监视…</string>
<string name="tethering_state_monitored">%s监视</string>
<string name="tethering_manage">管理系统共享…</string>
<string name="tethering_manage_offload_enabled">若 VPN 共享无法使用,请尝试禁用“开发者选项”中的“网络共享硬件加速”。</string>
<!--
@@ -122,6 +125,7 @@
<plurals name="notification_interfaces">
<item quantity="other">%d 个接口</item>
</plurals>
<string name="notification_interfaces_inactive">不活跃:</string>
<string name="failure_reason_unknown">未知 #%d</string>
<string name="exception_interface_not_found">错误:未找到下游接口</string>

View File

@@ -49,6 +49,9 @@
<string name="tethering_temp_hotspot_failure_incompatible_mode">incompatible mode</string>
<string name="tethering_temp_hotspot_failure_tethering_disallowed">tethering disallowed</string>
<string name="tethering_monitor">Monitor…</string>
<string name="tethering_state_monitored">%s (monitored)</string>
<string name="tethering_manage">Manage system tethering…</string>
<string name="tethering_manage_offload_enabled">Please disable Tethering hardware acceleration in Developer options
if VPN tethering does not work.</string>
@@ -131,6 +134,7 @@
<item quantity="one">%d interface</item>
<item quantity="other">%d interfaces</item>
</plurals>
<string name="notification_interfaces_inactive">"Inactive: "</string>
<string name="failure_reason_unknown">unknown #%d</string>
<string name="exception_interface_not_found">Fatal: Downstream interface not found</string>