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

Commit 7d7e98a2 authored by jeffreyhuang's avatar jeffreyhuang
Browse files

Popup a dialog to display sim status information

 - Create layout files for the dialog
 - Create a new controller to launch the dialog activity
 - Create a new controller to update the contents of the dialog
 - Deprecate old files that are no longer used in about phone v2

Bug: 36458278
Test: make RunSettingsRoboTests -j40
Change-Id: Iaf4f5e53c83b27f148acb076f38bfeabff41087e
parent ef7eb162
Loading
Loading
Loading
Loading
+132 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2017 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.
  -->

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="@dimen/sim_content_padding">

        <TextView
            style="@style/device_info_dialog_label"
            android:id="@+id/operator_name_label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/status_operator"/>
        <TextView
            style="@style/device_info_dialog_value"
            android:id="@+id/operator_name_value"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/device_info_not_available"/>

        <TextView
            style="@style/device_info_dialog_label"
            android:id="@+id/number_label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/status_number_sim_status"/>
        <TextView
            style="@style/device_info_dialog_value"
            android:id="@+id/number_value"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/device_info_not_available"/>

        <TextView
            style="@style/device_info_dialog_label"
            android:id="@+id/data_state_label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/status_data_state"/>
        <TextView
            style="@style/device_info_dialog_value"
            android:id="@+id/data_state_value"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/device_info_not_available"/>

        <TextView
            style="@style/device_info_dialog_label"
            android:id="@+id/latest_area_info_label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/status_latest_area_info"/>
        <TextView
            style="@style/device_info_dialog_value"
            android:id="@+id/latest_area_info_value"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/device_info_not_available"/>

        <TextView
            style="@style/device_info_dialog_label"
            android:id="@+id/service_state_label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/status_service_state"/>
        <TextView
            style="@style/device_info_dialog_value"
            android:id="@+id/service_state_value"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/device_info_not_available"/>

        <TextView
            style="@style/device_info_dialog_label"
            android:id="@+id/signal_strength_label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/status_signal_strength"/>
        <TextView
            style="@style/device_info_dialog_value"
            android:id="@+id/signal_strength_value"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/device_info_not_available"/>

        <TextView
            style="@style/device_info_dialog_label"
            android:id="@+id/network_type_label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/status_network_type"/>
        <TextView
            style="@style/device_info_dialog_value"
            android:id="@+id/network_type_value"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/device_info_not_available"/>

        <TextView
            style="@style/device_info_dialog_label"
            android:id="@+id/roaming_state_label"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/status_roaming"/>
        <TextView
            style="@style/device_info_dialog_value"
            android:id="@+id/roaming_state_value"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/device_info_not_available"/>
    </LinearLayout>
</ScrollView>
+8 −0
Original line number Diff line number Diff line
@@ -2671,6 +2671,10 @@
    <string name="status_number" product="tablet">MDN</string>
    <!-- About phone, status item title.  The phone number of the current device [CHAR LIMIT=30] -->
    <string name="status_number" product="default">Phone number</string>
    <!-- About tablet, status item title.  The Mobile Directory Number [CHAR LIMIT=30] -->
    <string name="status_number_sim_status" product="tablet">MDN on SIM</string>
    <!-- About phone, status item title.  The phone number of the current device [CHAR LIMIT=30] -->
    <string name="status_number_sim_status" product="default">Phone number on SIM</string>
    <!-- About phone, status item title.  The phone MIN number of the current device.-->
    <string name="status_min_number">MIN</string>
    <!-- About phone, status item title.  The phone MSID number of the current device.-->
@@ -6430,6 +6434,10 @@
    <string name="sim_no_inserted_msg">No SIM cards inserted</string>
    <!-- SIM status title  [CHAR LIMIT=40] -->
    <string name="sim_status_title">SIM status</string>
    <!-- SIM status title  [CHAR LIMIT=40] -->
    <string name="sim_status_title_sim_slot_1">SIM status (sim slot 1)</string>
    <!-- SIM status title  [CHAR LIMIT=40] -->
    <string name="sim_status_title_sim_slot_2">SIM status (sim slot 2)</string>
    <!-- Title for call back. [CHAR LIMIT=60] -->
    <string name="sim_call_back_title">Call back from default SIM</string>
    <!-- Title for outgoing back. [CHAR LIMIT=60] -->
+10 −0
Original line number Diff line number Diff line
@@ -478,4 +478,14 @@
        <item name="android:textSize">@dimen/search_bar_text_size</item>
    </style>

    <style name="device_info_dialog_label">
        <item name="android:textAppearance">@android:style/TextAppearance.Material.Body1</item>
        <item name="android:textColor">?android:attr/textColorSecondary</item>
    </style>

    <style name="device_info_dialog_value">
        <item name="android:textAppearance">@android:style/TextAppearance.Material.Body2</item>
        <item name="android:paddingBottom">24dp</item>
    </style>

</resources>
+9 −2
Original line number Diff line number Diff line
@@ -28,12 +28,19 @@
        android:title="@string/status_number"
        android:summary="@string/summary_placeholder"/>

    <!-- SIM status -->
    <!-- SIM status Sim Slot 1 -->
    <Preference
        android:key="sim_status"
        android:key="sim_status_sim_1"
        android:title="@string/sim_status_title"
        android:summary="@string/summary_placeholder"/>

    <!-- SIM status Sim Slot 2-->
    <Preference
        android:key="sim_status_sim_2"
        android:title="@string/sim_status_title_sim_slot_2"
        android:summary="@string/summary_placeholder"/>


    <!-- Model & hardware -->
    <Preference
        android:key="device_model"
+5 −1
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ import com.android.settings.deviceinfo.ManualPreferenceController;
import com.android.settings.deviceinfo.RegulatoryInfoPreferenceController;
import com.android.settings.deviceinfo.SafetyInfoPreferenceController;
import com.android.settings.deviceinfo.SecurityPatchPreferenceController;
import com.android.settings.deviceinfo.simstatus.SimStatusDualSimPreferenceController;
import com.android.settings.deviceinfo.simstatus.SimStatusPreferenceControllerV2;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -125,7 +127,9 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {

            // Phone number

            // SIM status
            controllers.add(new SimStatusPreferenceControllerV2(context, fragment));

            controllers.add(new SimStatusDualSimPreferenceController(context, fragment));

            controllers.add(new DeviceModelPreferenceController(context, fragment));

Loading