Some items shouldn’t be present on WLAN SKU

Issue:
"

Actual Results: Some items are present on WLAN SKU

Expected Results: Some items shouldn’t be present on WLAN SKU

Reproduction Steps:

  1. Test on WLAN SKU
  2. Settings->About phone->Android version, Baseband version==>Problem1
  3. Settings->Sound & vibration, Ring & notification volume/ Phone ringtone==>Problem2
  4. Connect to PC, Settings->Connected devices->USB, USB tethering==>Problem3
  5. Settings->Safety & emergency, Wireless emergency alerts==>Problem4
  6. Settings->Apps->All apps, Wireless emergency alerts==>Problem5
  7. Settings->About phone->SW Components, WWAN==>Problem6
  8. Settings->Apps->Special app access, Premium SMS access==>Problem7
  9. Launch Settings, search “Data saver”, it can be searched==>Problem8
  10. Settings->Accessibility->System controls, Power button ends call==>Problem9
  11. Settings->System->Multiple users, enable “Allow multiple users”, Add user->OK->OK, Turn on phone calls & SMS==>Problem10
  12. Scroll down the notification window from the top, Edit, Location tile exist==>Problem11
  13. Long press the blank area of home screen->Widgets->Contacts, Direct dial and direct message==>Problem12
  14. Settings->Safety & emergency, OPEN EMERGENCY INFORMATION/Emergency information==>Problem13
  15. Launch Settings, search “Mobile”, "Reset Mobile Network Settings" can be searched==>Problem14

"
Solution:
"

Solution:
1. Fixed: Scroll down the notification window from the top, Edit, Location tile exist
2. Fixed: Settings->Safety & emergency, Wireless emergency alerts
3. Fixed: Settings->Apps->All apps, Wireless emergency alerts

Solution:
1. Fixed: Connect to PC, Settings->Connected devices->USB, USB tethering
2. Fixed: Launch Settings, search “Data saver”, it can be searched
3. Fixed: Launch Settings, search “Mobile”, "Reset Mobile Network Settings" can be searched
4. Fixed: Settings->Apps->Special app access, Premium SMS access
5. Fixed: Settings->Sound & vibration, Ring & notification volume/ Phone ringtone

Solution:
1. Fixed: Long press the blank area of home screen->Widgets->Contacts, Direct dial and direct message

"
具体的patch如下:
1.
a.frameworks/base/packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java
b.frameworks/base/services/core/java/com/android/server/pm/InstallPackageHelper.java
 

diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java b/packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java
index d9f4484..f04ef47 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2023 XXX Technologies Corporation and/or its affiliates. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,6 +54,8 @@
 
 import javax.inject.Inject;
 
+import com.xxx.util.XXXUtils;
+
 /** */
 @QSScope
 public class TileQueryHelper {
@@ -98,7 +101,12 @@
     }
 
     private void addCurrentAndStockTiles(QSHost host) {
-        String stock = mContext.getString(R.string.quick_settings_tiles_stock);
+        String stock;
+        if (XXXUtils.isXXX().orElse(false) && !XXXUtils.isDeviceWWAN().orElse(false)) {
+            stock = mContext.getString(R.string.quick_settings_tiles_wlan_stock);
+        } else {
+            stock = mContext.getString(R.string.quick_settings_tiles_stock);
+        }
         String current = Settings.Secure.getString(mContext.getContentResolver(),
                 Settings.Secure.QS_TILES);
         final ArrayList<String> possibleTiles = new ArrayList<>();
diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java
index afe9cd3..5229cf9 100644
--- a/services/core/java/com/android/server/pm/InstallPackageHelper.java
+++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java
@@ -3802,7 +3802,8 @@
                     if (file.getName().equals("AndroidAutoStub")
                         || file.getName().equals("EmergencyInfo")
                         || file.getName().equals("PersonalSafety")
-                        || file.getName().equals("Stk")) {
+                        || file.getName().equals("Stk")
+                        || file.getName().startsWith("CellBroadcastApp")) {
                         Slog.e(TAG, "remove app file.getName(): "+file.getName());
                         continue;
                     }

2.

diff --git a/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsController.java b/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsController.java
index 9c6ab8c..83e6521 100644
--- a/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsController.java
+++ b/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsController.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (c) 2023 XXX Technologies Corporation and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +22,8 @@
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
 
+import com.xxxx.util.XXXXUtils;
+
 public class PremiumSmsController extends BasePreferenceController {
 
     public PremiumSmsController(Context context, String key) {
@@ -29,7 +32,11 @@
 
     @AvailabilityStatus
     public int getAvailabilityStatus() {
-        return mContext.getResources().getBoolean(R.bool.config_show_premium_sms)
-                ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+        if (XXXXUtils.isXXX().orElse(false) && !XXXXUtils.isDeviceWWAN().orElse(false)) {
+            return UNSUPPORTED_ON_DEVICE;
+        } else {
+            return mContext.getResources().getBoolean(R.bool.config_show_premium_sms)
+                    ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+        }
     }
 }
diff --git a/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsScreenPreferenceController.java b/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsScreenPreferenceController.java
index 582e75e..bcc31b0 100644
--- a/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsScreenPreferenceController.java
+++ b/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsScreenPreferenceController.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (c) 2023 XXXX Technologies Corporation and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +22,8 @@
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
 
+import com.zebra.util.XXXXUtils;
+
 public class PremiumSmsScreenPreferenceController extends BasePreferenceController {
 
     public PremiumSmsScreenPreferenceController(Context context, String preferenceKey) {
@@ -29,8 +32,12 @@
 
     @AvailabilityStatus
     public int getAvailabilityStatus() {
-        return mContext.getResources().getBoolean(R.bool.config_show_premium_sms)
-                ? AVAILABLE
-                : UNSUPPORTED_ON_DEVICE;
+        if (XXXXUtils.isXXX().orElse(false) && !ZebraUtils.isDeviceWWAN().orElse(false)) {
+            return UNSUPPORTED_ON_DEVICE;
+        } else {
+            return mContext.getResources().getBoolean(R.bool.config_show_premium_sms)
+                    ? AVAILABLE
+                    : UNSUPPORTED_ON_DEVICE;
+        }
     }
 }
diff --git a/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java b/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java
index 88e20b6..bf26fcc 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2023 XXXX Technologies Corporation and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,6 +37,8 @@
 import java.util.LinkedHashMap;
 import java.util.Map;
 
+import com.xxx.util.XXXUtils;
+
 /**
  * This class controls the radio buttons for choosing between different USB functions.
  */
@@ -49,7 +52,9 @@
 
     static {
         FUNCTIONS_MAP.put(UsbManager.FUNCTION_MTP, R.string.usb_use_file_transfers);
-        FUNCTIONS_MAP.put(UsbManager.FUNCTION_RNDIS, R.string.usb_use_tethering);
+        if (!XXXUtils.isXXX().orElse(false) || XXXUtils.isDeviceWWAN().orElse(false)) {
+            FUNCTIONS_MAP.put(UsbManager.FUNCTION_RNDIS, R.string.usb_use_tethering);
+        }
         FUNCTIONS_MAP.put(UsbManager.FUNCTION_MIDI, R.string.usb_use_MIDI);
         FUNCTIONS_MAP.put(UsbManager.FUNCTION_PTP, R.string.usb_use_photo_transfers);
         FUNCTIONS_MAP.put(UsbManager.FUNCTION_UVC, R.string.usb_use_uvc_webcam);
diff --git a/src/com/android/settings/network/MobileNetworkListFragment.java b/src/com/android/settings/network/MobileNetworkListFragment.java
index a06c61a..7f9ef9b 100644
--- a/src/com/android/settings/network/MobileNetworkListFragment.java
+++ b/src/com/android/settings/network/MobileNetworkListFragment.java
@@ -39,6 +39,7 @@
 @SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
 public class MobileNetworkListFragment extends DashboardFragment {
     private static final String LOG_TAG = "NetworkListFragment";
+    private static final String KEY_MOBILE_NETWORK = "mobile_network_list_screen";
 
     static final String KEY_PREFERENCE_CATEGORY_SIM = "provider_model_sim_category";
     private static final String KEY_ADD_SIM = "add_sim";
@@ -108,6 +109,15 @@
                 }
 
                 @Override
+                public List<String> getNonIndexableKeys(Context context) {
+                    List<String> keys = super.getNonIndexableKeys(context);
+                    if (XXXUtils.isXXX().orElse(false) && !XXXUtils.isDeviceWWAN().orElse(false)) {
+                        keys.add(KEY_MOBILE_NETWORK);
+                    }
+                    return keys;
+                }
+
+                @Override
                 protected boolean isPageSearchEnabled(Context context) {
                     return SubscriptionUtil.isSimHardwareVisible(context) &&
                             context.getSystemService(UserManager.class).isAdminUser();
diff --git a/src/com/android/settings/network/NetworkDashboardFragment.java b/src/com/android/settings/network/NetworkDashboardFragment.java
index 2814998..08db59f 100644
--- a/src/com/android/settings/network/NetworkDashboardFragment.java
+++ b/src/com/android/settings/network/NetworkDashboardFragment.java
@@ -54,6 +54,7 @@
         MobilePlanPreferenceHost, OnActivityResultListener {
 
     private static final String TAG = "NetworkDashboardFrag";
+    private static final String DATA_SAVER_SUMMARY ="restrict_background_parent_entry";
 
     @Override
     public int getMetricsCategory() {
@@ -206,5 +207,15 @@
                             null /* metricsFeatureProvider */, null /* fragment */,
                             null /* mobilePlanHost */, null /* LifecycleOwner */);
                 }
+
+                @Override
+                public List<String> getNonIndexableKeys(Context context) {
+                    List<String> keys = super.getNonIndexableKeys(context);
+                    // Remove WWAN-ENG-TOOLS from search for WLAN Devices
+                    if (XXXUtils.isXXX().orElse(false) && !XXXUtils.isDeviceWWAN().orElse(false)) {
+                        keys.add(DATA_SAVER_SUMMARY);
+                    }
+                    return keys;
+                }
             };
 }
diff --git a/src/com/android/settings/network/NetworkProviderCallsSmsController.java b/src/com/android/settings/network/NetworkProviderCallsSmsController.java
index 5eec3d9..a8e64ab 100644
--- a/src/com/android/settings/network/NetworkProviderCallsSmsController.java
+++ b/src/com/android/settings/network/NetworkProviderCallsSmsController.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2020 The Android Open Source Project
+ * Copyright (c) 2023 XXX Technologies Corporation and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,6 +43,8 @@
 
 import java.util.List;
 
+import com.xxx.util.XXXUtils;
+
 public class NetworkProviderCallsSmsController extends AbstractPreferenceController implements
         LifecycleObserver, MobileNetworkRepository.MobileNetworkCallback,
         DefaultSubscriptionReceiver.DefaultSubscriptionListener {
@@ -197,8 +200,12 @@
 
     @Override
     public boolean isAvailable() {
-        return SubscriptionUtil.isSimHardwareVisible(mContext) &&
-                mUserManager.isAdminUser();
+        if (XXXUtils.isXXX().orElse(false) && !XXXUtils.isDeviceWWAN().orElse(false)) {
+            return false;
+        } else {
+            return SubscriptionUtil.isSimHardwareVisible(mContext) &&
+                    mUserManager.isAdminUser();
+        }
     }
 
     @Override
diff --git a/src/com/android/settings/network/TetherPreferenceController.java b/src/com/android/settings/network/TetherPreferenceController.java
index b003ce4..c61238a 100644
--- a/src/com/android/settings/network/TetherPreferenceController.java
+++ b/src/com/android/settings/network/TetherPreferenceController.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2023 XXX Technologies Corporation and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,6 +56,8 @@
 
 import java.util.concurrent.atomic.AtomicReference;
 
+import com.xxx.util.XXXUtils;
+
 public class TetherPreferenceController extends AbstractPreferenceController implements
         PreferenceControllerMixin, LifecycleObserver, OnCreate, OnResume, OnPause, OnDestroy {
 
@@ -122,8 +125,12 @@
 
     @Override
     public boolean isAvailable() {
-        return TetherUtil.isTetherAvailable(mContext)
-                && !FeatureFlagUtils.isEnabled(mContext, FeatureFlags.TETHER_ALL_IN_ONE);
+        if (XXXUtils.isXXX().orElse(false) && !XXXUtils.isDeviceWWAN().orElse(false)) {
+            return false;
+        } else {
+            return TetherUtil.isTetherAvailable(mContext)
+                    && !FeatureFlagUtils.isEnabled(mContext, FeatureFlags.TETHER_ALL_IN_ONE);
+        }
     }
 
     @Override
diff --git a/src/com/android/settings/network/tether/TetherSettings.java b/src/com/android/settings/network/tether/TetherSettings.java
index 6f6ba8e..1c1a89c 100755
--- a/src/com/android/settings/network/tether/TetherSettings.java
+++ b/src/com/android/settings/network/tether/TetherSettings.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2022 The Android Open Source Project
+ * Copyright (C) 2023 XXX Technologies Corporation and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -73,6 +74,8 @@
 import java.util.List;
 import java.util.concurrent.atomic.AtomicReference;
 
+import com.xxx.util.XXXUtils;
+
 /**
  * Displays preferences for Tethering.
  */
@@ -648,7 +651,8 @@
 
                     final boolean usbAvailable =
                             tm.getTetherableUsbRegexs().length != 0;
-                    if (!usbAvailable || Utils.isMonkeyRunning()) {
+                    if (!usbAvailable || Utils.isMonkeyRunning() ||
+                            (XXXUtils.isXXX().orElse(false) && !XXXUtils.isDeviceWWAN().orElse(false))) {
                         keys.add(KEY_USB_TETHER_SETTINGS);
                     }
 
diff --git a/src/com/android/settings/notification/CallVolumePreferenceController.java b/src/com/android/settings/notification/CallVolumePreferenceController.java
index d505227..fe70931 100644
--- a/src/com/android/settings/notification/CallVolumePreferenceController.java
+++ b/src/com/android/settings/notification/CallVolumePreferenceController.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (c) 2023 XXX Technologies Corporation and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,6 +23,8 @@
 
 import com.android.settings.R;
 
+import com.xxx.util.XXXUtils;
+
 
 public class CallVolumePreferenceController extends VolumeSeekBarPreferenceController {
 
@@ -34,8 +37,12 @@
 
     @Override
     public int getAvailabilityStatus() {
-        return mContext.getResources().getBoolean(R.bool.config_show_call_volume)
-                && !mHelper.isSingleVolume() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+        if (XXXUtils.isXXX().orElse(false) && !XXXUtils.isDeviceWWAN().orElse(false)) {
+            return UNSUPPORTED_ON_DEVICE;
+        } else {
+            return mContext.getResources().getBoolean(R.bool.config_show_call_volume)
+                    && !mHelper.isSingleVolume() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+        }
     }
 
     @Override
diff --git a/src/com/android/settings/notification/SeparateRingVolumePreferenceController.java b/src/com/android/settings/notification/SeparateRingVolumePreferenceController.java
index 91926e3..d5b94da 100644
--- a/src/com/android/settings/notification/SeparateRingVolumePreferenceController.java
+++ b/src/com/android/settings/notification/SeparateRingVolumePreferenceController.java
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2022 The Android Open Source Project
+ * Copyright (c) 2023 XXX Technologies Corporation and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,6 +33,8 @@
 import com.android.settings.R;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
+import com.xxx.util.XXXUtils;
+
 /**
  * This slider is used to represent ring volume when ring is separated from notification
  */
@@ -86,7 +89,11 @@
 
     @Override
     public int getAvailabilityStatus() {
-        return !mHelper.isSingleVolume() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+        if (XXXUtils.isZebra().orElse(false) && !XXXUtils.isDeviceWWAN().orElse(false)) {
+            return UNSUPPORTED_ON_DEVICE;
+        } else {
+            return !mHelper.isSingleVolume() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+        }
     }
 
     @Override
diff --git a/src/com/android/settings/system/ResetDashboardFragment.java b/src/com/android/settings/system/ResetDashboardFragment.java
index 6420280..5d6f8c4 100644
--- a/src/com/android/settings/system/ResetDashboardFragment.java
+++ b/src/com/android/settings/system/ResetDashboardFragment.java
@@ -34,6 +34,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import com.xxx.util.XXXUtils;
+
 /** Settings fragment containing reset options. */
 @SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
 public class ResetDashboardFragment extends DashboardFragment {
@@ -92,5 +94,15 @@
                         Context context) {
                     return buildPreferenceControllers(context, null /* lifecycle */);
                 }
+
+                @Override
+                public List<String> getNonIndexableKeys(Context context) {
+                    final List<String> keys = super.getNonIndexableKeys(context);
+
+                    if (XXXUtils.isXXX().orElse(false) && !XXXUtils.isDeviceWWAN().orElse(false)) {
+                        keys.add("network_reset_mobile_network_settings_pref");
+                    }
+                    return keys;
+                }
             };
 }

3. packages/apps/Launcher3/com/android/launcher3/model/WidgetsModel.java
 

diff --git a/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java b/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java
index 2f16065..b1017b4 100644
--- a/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java
+++ b/src_shortcuts_overrides/com/android/launcher3/model/WidgetsModel.java
@@ -1,4 +1,18 @@
-
+/*
+ * Copyright (C) 2023 XXX Technologies Corporation and/or its affiliates. All rights reserved
+ *
+ * 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.launcher3.model;
 
 import static android.appwidget.AppWidgetProviderInfo.WIDGET_FEATURE_HIDE_FROM_PICKER;
@@ -52,6 +66,8 @@
 import java.util.Set;
 import java.util.function.Predicate;
 
+import com.xxx.util.XXXUtils;
+
 /**
  * Widgets data model that is used by the adapters of the widget views and controllers.
  *
@@ -298,6 +314,17 @@
                 return false;
             }
 
+            if (XXXUtils.isXXX().orElse(false) && !XXXUtils.isDeviceWWAN().orElse(false)) {
+                if (((item.componentName.getPackageName()).contains("com.android.contacts")) &&
+                        ((item.componentName.getClassName()).contains("alias.DialShortcut"))) {
+                    return false;
+                }
+                if (((item.componentName.getPackageName()).contains("com.android.contacts")) &&
+                        ((item.componentName.getClassName()).contains("alias.MessageShortcut"))) {
+                    return false;
+                }
+            }
+
             return true;
         }
     }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值