Merge "Fix gap issue between animation and app list in recycler view while scrolling."
diff --git a/src/com/android/settings/datausage/BillingCycleSettings.java b/src/com/android/settings/datausage/BillingCycleSettings.java
index 1e38ad1..395d1c7 100644
--- a/src/com/android/settings/datausage/BillingCycleSettings.java
+++ b/src/com/android/settings/datausage/BillingCycleSettings.java
@@ -46,6 +46,7 @@
 import com.android.settings.R;
 import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
 import com.android.settings.network.SubscriptionUtil;
+import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settingslib.NetworkPolicyEditor;
 import com.android.settingslib.net.DataUsageController;
@@ -517,7 +518,8 @@
 
                 @Override
                 protected boolean isPageSearchEnabled(Context context) {
-                    return SubscriptionUtil.isSimHardwareVisible(context)
+                    return (!MobileNetworkUtils.isMobileNetworkUserRestricted(context))
+                            && SubscriptionUtil.isSimHardwareVisible(context)
                             && DataUsageUtils.hasMobileData(context);
                 }
             };
diff --git a/src/com/android/settings/network/telephony/MobileNetworkUtils.java b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
index 423ba2f..ff9ef39 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkUtils.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
@@ -49,6 +49,7 @@
 import android.os.PersistableBundle;
 import android.os.SystemClock;
 import android.os.SystemProperties;
+import android.os.UserManager;
 import android.provider.Settings;
 import android.telecom.PhoneAccountHandle;
 import android.telecom.TelecomManager;
@@ -115,6 +116,23 @@
     public static final Drawable EMPTY_DRAWABLE = new ColorDrawable(Color.TRANSPARENT);
 
     /**
+     * Return true if current user limited by UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS.
+     *
+     * Note: Guest user should have this restriction through
+     *       GuestTelephonyPreferenceController.java.
+     *       However, it's not help with those devices upgraded their software.
+     */
+    public static boolean isMobileNetworkUserRestricted(Context context) {
+        UserManager um = context.getSystemService(UserManager.class);
+        boolean disallow = false;
+        if (um != null) {
+            disallow = um.isGuestUser() || um.hasUserRestriction(
+                    UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
+        }
+        return disallow;
+    }
+
+    /**
      * Returns if DPC APNs are enforced.
      */
     public static boolean isDpcApnEnforced(Context context) {