Ask to disable tethering hardware acceleration on Android 8.1+

This commit is contained in:
Mygod
2018-08-26 15:22:27 +08:00
parent a76fcf8cf7
commit 1c5d7c1109
7 changed files with 79 additions and 28 deletions

View File

@@ -1,29 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:padding="16dp">
<ImageView
android:layout_width="wrap_content"
<layout
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="android.view.View"/>
<variable
name="data"
type="be.mygod.vpnhotspot.manage.ManageBar.Data"/>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_content_add"
android:tint="@color/colorSecondary"/>
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:padding="16dp">
<Space
android:layout_width="16dp"
android:layout_height="0dp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_content_add"
android:tint="@color/colorSecondary"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:text="@string/tethering_manage"/>
<Space
android:layout_width="16dp"
android:layout_height="0dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:text="@string/tethering_manage"/>
<TextView
android:id="@+id/offloadEnabled"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="@{data.offloadEnabled ? View.VISIBLE : View.GONE}"
android:text="@string/tethering_manage_offload_enabled"/>
</LinearLayout>
</LinearLayout>
</layout>

View File

@@ -38,6 +38,7 @@
<string name="tethering_temp_hotspot_failure_tethering_disallowed">共享被禁用</string>
<string name="tethering_manage">管理系统共享…</string>
<string name="tethering_manage_offload_enabled">若 VPN 共享无法使用,请尝试禁用“开发者选项”中的“网络共享硬件加速”。</string>
<!--
Values copied from:
* https://android.googlesource.com/platform/packages/apps/Settings/+/7686ef8/res/xml/tether_prefs.xml

View File

@@ -49,6 +49,8 @@
<string name="tethering_temp_hotspot_failure_tethering_disallowed">tethering disallowed</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>
<string name="tethering_manage_usb">USB tethering</string>
<string name="tethering_manage_wifi">Wi\u2011Fi hotspot</string>
<string name="tethering_manage_wifi_legacy">Wi\u2011Fi hotspot (legacy)</string>