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

Commit e0cee245 authored by Zoey Chen's avatar Zoey Chen
Browse files

[ProviderModel] Add InternetDialogController for internet dialog

    - Use OnSubscriptionsChangedListener for mobile data
    - Ues WifiPickerTrackerFactory for wifi list
    - Add InternetDialogControllerTest for unit test

Bug: 187779230
Test: atest InternetDialogControllerTest
Change-Id: I37a423f31ae80963147758160ac0234ae17469f9
parent 7d43f225
Loading
Loading
Loading
Loading
+34 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2020 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.0"
    android:viewportHeight="24.0"
    android:tint="?android:attr/colorControlNormal">
    <path
        android:fillColor="#FF000000"
        android:pathData="M2,22l16,0l0,-2l-11,0l13,-13l0,1l2,0l0,-6z"
        android:strokeAlpha="0.3"
        android:fillAlpha="0.3"/>
    <path
        android:fillColor="#FF000000"
        android:pathData="M20,10h2v8h-2z"/>
    <path
        android:fillColor="#FF000000"
        android:pathData="M20,20h2v2h-2z"/>
</vector>
 No newline at end of file
+3 −0
Original line number Original line Diff line number Diff line
@@ -1559,4 +1559,7 @@
    <!-- The padding between the icon and the text. -->
    <!-- The padding between the icon and the text. -->
    <dimen name="ongoing_call_chip_icon_text_padding">4dp</dimen>
    <dimen name="ongoing_call_chip_icon_text_padding">4dp</dimen>
    <dimen name="ongoing_call_chip_corner_radius">28dp</dimen>
    <dimen name="ongoing_call_chip_corner_radius">28dp</dimen>

    <!-- Signal icon in internet dialog -->
    <dimen name="signal_strength_icon_size">24dp</dimen>
</resources>
</resources>
+33 −0
Original line number Original line Diff line number Diff line
@@ -2978,4 +2978,37 @@


    <!-- Content description for a chip in the status bar showing that the user is currently on a phone call. [CHAR LIMIT=NONE] -->
    <!-- Content description for a chip in the status bar showing that the user is currently on a phone call. [CHAR LIMIT=NONE] -->
    <string name="ongoing_phone_call_content_description">Ongoing phone call</string>
    <string name="ongoing_phone_call_content_description">Ongoing phone call</string>

    <!-- Provider Model: Title of the airplane mode in the internet dialog. [CHAR LIMIT=50] -->
    <string name="airplane_mode">Airplane mode</string>
    <!-- Provider Model: Default title of the mobile network in the mobile layout. [CHAR LIMIT=50] -->
    <string name="mobile_data_settings_title">Mobile data</string>
    <!-- Provider Model: Summary text separator for preferences including a short description
         (eg. "Connected / 5G"). [CHAR LIMIT=50] -->
    <string name="preference_summary_default_combination"><xliff:g id="state" example="Connected">%1$s</xliff:g> / <xliff:g id="networkMode" example="LTE">%2$s</xliff:g></string>
    <!-- Provider Model:
         Summary indicating that a SIM has an active mobile data connection [CHAR LIMIT=50] -->
    <string name="mobile_data_connection_active">Connected</string>
    <!-- Provider Model:
     Summary indicating that a SIM has no mobile data connection [CHAR LIMIT=50] -->
    <string name="mobile_data_off_summary">Internet won\u0027t auto\u2011connect</string>
    <!-- Provider Model:
     Summary indicating that a active SIM and no network available [CHAR LIMIT=50] -->
    <string name="mobile_data_no_connection">No connection</string>
    <!-- Provider Model: Summary indicating that no other networks available [CHAR LIMIT=50] -->
    <string name="non_carrier_network_unavailable">No other networks available</string>
    <!-- Provider Model: Summary indicating that no networks available [CHAR LIMIT=50] -->
    <string name="all_network_unavailable">No networks available</string>
    <!-- Provider Model: Panel title text for turning on the Wi-Fi networks. [CHAR LIMIT=40] -->
    <string name="turn_on_wifi">Wi\u2011Fi</string>
    <!-- Provider Model: Title for detail page of wifi network [CHAR LIMIT=30] -->
    <string name="pref_title_network_details" msgid="7329759534269363308">"Network details"</string>
    <!-- Provider Model: Panel subtitle for tapping a network to connect to internet. [CHAR LIMIT=60] -->
    <string name="tap_a_network_to_connect">Tap a network to connect</string>
    <!-- Provider Model: Wi-Fi settings. text displayed when Wi-Fi is on and network list is empty [CHAR LIMIT=50]-->
    <string name="wifi_empty_list_wifi_on">Searching for networks\u2026</string>
    <!-- Provider Model: Failure notification for connect -->
    <string name="wifi_failed_connect_message">Failed to connect to network</string>
    <!-- Provider Model: Title to see all the networks [CHAR LIMIT=50] -->
    <string name="see_all_networks">See all</string>
</resources>
</resources>
+851 −0

File added.

Preview size limit exceeded, changes collapsed.

+14 −0
Original line number Original line Diff line number Diff line
package com.android.systemui.qs.tiles.dialog;

import android.content.Context;
import android.util.FeatureFlagUtils;

public class InternetDialogUtil {

    public static boolean isProviderModelEnabled(Context context) {
        if (context == null) {
            return false;
        }
        return FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL);
    }
}
Loading