OSDN Git Service

Polish on mobile network settings
authorjackqdyulei <jackqdyulei@google.com>
Thu, 8 Nov 2018 22:32:05 +0000 (14:32 -0800)
committerjackqdyulei <jackqdyulei@google.com>
Thu, 8 Nov 2018 23:04:35 +0000 (15:04 -0800)
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

res/values/strings.xml
res/xml/gsm_umts_options.xml [deleted file]
res/xml/mobile_network_settings.xml
src/com/android/settings/network/telephony/CdmaOptions.java [deleted file]

index 0f3b18d..4ccb395 100644 (file)
     <!-- 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 -->
     <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>
diff --git a/res/xml/gsm_umts_options.xml b/res/xml/gsm_umts_options.xml
deleted file mode 100644 (file)
index cf56595..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?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>
index 0478664..cc914ad 100644 (file)
     <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"/>
 
diff --git a/src/com/android/settings/network/telephony/CdmaOptions.java b/src/com/android/settings/network/telephony/CdmaOptions.java
deleted file mode 100644 (file)
index c573128..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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);
-    }
-}