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

Commit 0ca0f6b3 authored by jackqdyulei's avatar jackqdyulei
Browse files

Polish on mobile network settings

Update some strings:
In settings it has the same resId for this title so I skipped migration
for it. Actually it should be "Access Point Names" instead of "APNs".
Also since "roaming" is used nowhere so we can update the string
directly.

Also remove unused files

Bug: 114749736
Test: Manual
Change-Id: Ia2f8a352865b9577e0385045f1ad2604ab2bb6af
parent a923a411
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -678,7 +678,7 @@
    <!-- check box to allow data usage when roaming [CHAR LIMIT=41] -->
    <string name="allow_data_usage_title">Allow data usage when roaming</string>
    <!-- mobile network settings screen, setting check box title -->
    <string name="roaming">Data roaming</string>
    <string name="roaming">Roaming</string>
    <!-- mobile network settings screen, setting option summary text when check box is selected -->
    <string name="roaming_enable">Connect to data services when roaming</string>
    <!-- mobile network settings screen, setting option summary text when check box is clear -->
@@ -10258,6 +10258,8 @@
    <string name="mobile_data_usage_title">App data usage</string>
    <!-- Summary to show the current network mode is invalid. [CHAR LIMIT=NONE]-->
    <string name="mobile_network_mode_error">Invalid Network Mode <xliff:g id="networkModeId" example="0">%1$d</xliff:g>. Ignore.</string>
    <!-- Title for Apn settings in mobile network settings [CHAR LIMIT=60] -->
    <string name="mobile_network_apn_title">Access Point Names</string>
    <!-- Available networks screen, summary when button disallowed due to permanent automatic mode [CHAR LIMIT=NONE] -->
    <string name="manual_mode_disallowed_summary">Unavailable when connected to <xliff:g id="carrier" example="verizon">%1$s</xliff:g></string>

res/xml/gsm_umts_options.xml

deleted100644 → 0
+0 −37
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2008 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.
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
    <!--We want separate APN setting from reset of settings because-->
    <!--we want user to change it with caution.-->
    <PreferenceCategory
        android:key="category_gsm_apn_key"
        android:layout="@layout/preference_category_no_label">

        <com.android.settingslib.RestrictedPreference
            android:key="button_gsm_apn_key"
            android:title="@string/apn_settings"
            android:persistent="false" />
    </PreferenceCategory>

    <PreferenceScreen
        android:key="carrier_settings_key"
        android:title="@string/carrier_settings_title">
        <!-- b/114749736, create a preference controller to build intent -->
    </PreferenceScreen>

</PreferenceScreen>
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@
    <com.android.settingslib.RestrictedPreference
        android:key="telephony_apn_key"
        android:persistent="false"
        android:title="@string/apn_settings"
        android:title="@string/mobile_network_apn_title"
        settings:allowDividerAbove="true"
        settings:controller="com.android.settings.network.telephony.ApnPreferenceController"/>

+0 −57
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.
 */

package com.android.settings.network.telephony;

import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceScreen;

import com.android.settings.R;

/**
 * List of Phone-specific settings screens.
 */
public class CdmaOptions {
    private static final String LOG_TAG = "CdmaOptions";

    private static final String BUTTON_CDMA_SYSTEM_SELECT_KEY = "cdma_system_select_key";
    private static final String BUTTON_CDMA_SUBSCRIPTION_KEY = "cdma_subscription_key";

    private PreferenceFragmentCompat mPrefFragment;

    public CdmaOptions(PreferenceFragmentCompat prefFragment, PreferenceScreen prefScreen,
            int subId) {
        mPrefFragment = prefFragment;
    }

    public boolean preferenceTreeClick(Preference preference) {
        //TODO(b/114749736): handle it in preferenceController and remove this file
        if (preference.getKey().equals(BUTTON_CDMA_SYSTEM_SELECT_KEY)) {
            log("preferenceTreeClick: return BUTTON_CDMA_ROAMING_KEY true");
            return true;
        }
        if (preference.getKey().equals(BUTTON_CDMA_SUBSCRIPTION_KEY)) {
            log("preferenceTreeClick: return CDMA_SUBSCRIPTION_KEY true");
            return true;
        }
        return false;
    }

    protected void log(String s) {
        android.util.Log.d(LOG_TAG, s);
    }
}