Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 598934d6 authored by Weng Su's avatar Weng Su
Browse files

[Provider Model] Add Fix connectivity toggle to Internet Settings

- Add Fix connectivity toggle in menu item

- Show "Resetting your internet..." when recovering

- Screenshot:
  https://screenshot.googleplex.com/BPyRADfNUoPE8Dc

Bug: 172297799
Test: manual test
- make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest

Change-Id: I27594d24659ca281e224f86accc20d49514d5001
parent 88ffca9a
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2021 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24"
        android:viewportHeight="24"
        android:tint="?android:attr/colorAccent">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M13,9v2h7V4h-2v2.74C16.53,5.07 14.4,4 12,4c-2.21,0 -4.21,0.9 -5.66,2.34S4,9.79 4,12c0,4.42 3.58,8 8,8 2.21,0 4.21,-0.9 5.66,-2.34l-1.42,-1.42C15.15,17.33 13.65,18 12,18c-3.31,0 -6,-2.69 -6,-6 0,-1.65 0.67,-3.15 1.76,-4.24C8.85,6.67 10.35,6 12,6c2.21,0 4.15,1.21 5.19,3H13z"/>
</vector>
+47 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/content_margin_left"
        android:layout_marginEnd="@dimen/content_margin_left"
        android:layout_marginTop="@dimen/description_margin_top"
        android:layout_marginBottom="@dimen/description_margin_top"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <ProgressBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/reset_internet_ring_progress_right_margin"
            style="?android:attr/progressBarStyleSmallTitle"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/resetting_internet_text"
            android:textAppearance="?android:attr/textAppearanceSmall"/>
    </LinearLayout>
</LinearLayout>
+1 −0
Original line number Diff line number Diff line
@@ -209,6 +209,7 @@

    <!-- Internet Preferences -->
    <dimen name="view_airplane_mode_networks_button_margin_vertical">24dp</dimen>
    <dimen name="reset_internet_ring_progress_right_margin">4dp</dimen>

    <!-- Color picker -->
    <dimen name="color_swatch_size">16dp</dimen>
+10 −0
Original line number Diff line number Diff line
@@ -12536,6 +12536,16 @@
    <string name="viewing_airplane_mode_networks">Viewing airplane mode networks</string>
    <!-- Label text to turn off airplane mode. [CHAR LIMIT=40] -->
    <string name="turn_off_airplane_mode">Turn off airplane mode</string>
    <!-- Title for interrupting the voice call alert. [CHAR_LIMIT=NONE] -->
    <string name="reset_your_internet_title">Reset your internet?</string>
    <!-- Description for interrupting the voice call alert. [CHAR_LIMIT=NONE] -->
    <string name="reset_internet_text" product="default">This will end your phone call</string>
    <!-- Description for interrupting the voice call alert. [CHAR_LIMIT=NONE] -->
    <string name="reset_internet_text" product="tablet">This will end your phone call</string>
    <!-- Description to wait device resetting internet networks. [CHAR_LIMIT=NONE] -->
    <string name="resetting_internet_text">Resetting your internet\u2026</string>
    <!-- Menu option for data connectivity recovery for all requested technologies. [CHAR_LIMIT=NONE] -->
    <string name="fix_connectivity">Fix connectivity</string>
    <!-- Summary text separator for preferences including a short description
         (eg. "Connected / 5G"). [CHAR LIMIT=50] -->
+8 −0
Original line number Diff line number Diff line
@@ -20,6 +20,14 @@
        android:title="@string/provider_internet_settings"
        settings:keywords="@string/keywords_wifi">

    <!-- Resetting your internet description -->
    <com.android.settingslib.widget.LayoutPreference
        android:key="resetting_your_internet"
        android:title="@string/resetting_internet_text"
        android:selectable="false"
        android:layout="@layout/resetting_internet"
        settings:allowDividerBelow="true"/>

    <!-- View airplane mode networks button -->
    <com.android.settingslib.widget.LayoutPreference
        android:key="view_airplane_mode_netwokrs_button"
Loading