diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 37f5034..35e2810 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -144,12 +144,6 @@
     <!-- Per-app data restrictions -->
     <string name="data_usage_app_restrict_all">Allow network access</string>
     <string name="data_usage_app_restrict_all_summary">Enable network usage</string>
-    <string name="data_usage_app_restrict_mobile">Mobile data</string>
-    <string name="data_usage_app_restrict_mobile_summary">Enable usage of mobile data</string>
-    <string name="data_usage_app_restrict_vpn">VPN data</string>
-    <string name="data_usage_app_restrict_vpn_summary">Enable usage of VPN data</string>
-    <string name="data_usage_app_restrict_wifi">Wi\u2011Fi data</string>
-    <string name="data_usage_app_restrict_wifi_summary">Enable usage of Wi\u2011Fi data</string>
 
     <!-- PIN scramble -->
     <string name="unlock_scramble_pin_layout_title">Scramble layout</string>
diff --git a/res/xml/app_data_usage.xml b/res/xml/app_data_usage.xml
index 9b98391..aacc1f6 100644
--- a/res/xml/app_data_usage.xml
+++ b/res/xml/app_data_usage.xml
@@ -51,6 +51,7 @@
 
     <PreferenceCategory
         android:key="app_data_usage_settings_category"
+        settings:isPreferenceVisible="@bool/config_show_sim_info"
         android:layout="@layout/preference_category_no_label">
 
         <Preference
@@ -58,39 +59,16 @@
             android:title="@string/data_usage_app_settings" />
 
         <com.android.settingslib.RestrictedSwitchPreference
-            android:key="restrict_all"
-            android:title="@string/data_usage_app_restrict_all"
-            android:summary="@string/data_usage_app_restrict_all_summary" />
-
-        <com.android.settingslib.RestrictedSwitchPreference
-            android:key="restrict_wifi"
-            android:title="@string/data_usage_app_restrict_wifi"
-            android:summary="@string/data_usage_app_restrict_wifi_summary" />
-
-        <com.android.settingslib.RestrictedSwitchPreference
-            android:key="restrict_cellular"
-            android:title="@string/data_usage_app_restrict_mobile"
-            android:summary="@string/data_usage_app_restrict_mobile_summary"
-            settings:isPreferenceVisible="@bool/config_show_sim_info" />
-
-        <com.android.settingslib.RestrictedSwitchPreference
             android:key="restrict_background"
             android:title="@string/data_usage_app_restrict_background"
             android:summary="@string/data_usage_app_restrict_background_summary"
-            settings:isPreferenceVisible="@bool/config_show_sim_info"
             settings:useAdditionalSummary="true"
             settings:restrictedSwitchSummary="@string/disabled_by_admin" />
 
         <com.android.settingslib.RestrictedSwitchPreference
-            android:key="restrict_vpn"
-            android:title="@string/data_usage_app_restrict_vpn"
-            android:summary="@string/data_usage_app_restrict_vpn_summary" />
-
-        <com.android.settingslib.RestrictedSwitchPreference
             android:key="unrestricted_data_saver"
             android:title="@string/unrestricted_app_title"
             android:summary="@string/unrestricted_app_summary"
-            settings:isPreferenceVisible="@bool/config_show_sim_info"
             settings:useAdditionalSummary="true"
             settings:restrictedSwitchSummary="@string/disabled_by_admin" />
 
diff --git a/src/com/android/settings/datausage/AppDataUsage.java b/src/com/android/settings/datausage/AppDataUsage.java
index 574ed1b..e15cead 100644
--- a/src/com/android/settings/datausage/AppDataUsage.java
+++ b/src/com/android/settings/datausage/AppDataUsage.java
@@ -15,12 +15,7 @@
 package com.android.settings.datausage;
 
 import static android.net.NetworkPolicyManager.POLICY_REJECT_METERED_BACKGROUND;
-import static android.net.NetworkPolicyManager.POLICY_REJECT_ALL;
-import static android.net.NetworkPolicyManager.POLICY_REJECT_CELLULAR;
-import static android.net.NetworkPolicyManager.POLICY_REJECT_VPN;
-import static android.net.NetworkPolicyManager.POLICY_REJECT_WIFI;
 
-import android.Manifest;
 import android.app.Activity;
 import android.app.settings.SettingsEnums;
 import android.content.Context;
@@ -28,7 +23,6 @@
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.graphics.drawable.Drawable;
-import android.net.NetworkPolicyManager;
 import android.net.NetworkTemplate;
 import android.os.Bundle;
 import android.os.Process;
@@ -64,7 +58,6 @@
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Set;
 
 public class AppDataUsage extends DataUsageBaseFragment implements OnPreferenceChangeListener,
         DataSaverBackend.Listener {
@@ -80,11 +73,7 @@
     private static final String KEY_FOREGROUND_USAGE = "foreground_usage";
     private static final String KEY_BACKGROUND_USAGE = "background_usage";
     private static final String KEY_APP_SETTINGS = "app_settings";
-    private static final String KEY_RESTRICT_ALL = "restrict_all";
     private static final String KEY_RESTRICT_BACKGROUND = "restrict_background";
-    private static final String KEY_RESTRICT_CELLULAR = "restrict_cellular";
-    private static final String KEY_RESTRICT_VPN = "restrict_vpn";
-    private static final String KEY_RESTRICT_WIFI = "restrict_wifi";
     private static final String KEY_APP_LIST = "app_list";
     private static final String KEY_CYCLE = "cycle";
     private static final String KEY_UNRESTRICTED_DATA = "unrestricted_data_saver";
@@ -98,11 +87,7 @@
     private Preference mForegroundUsage;
     private Preference mBackgroundUsage;
     private Preference mAppSettings;
-    private RestrictedSwitchPreference mRestrictAll;
     private RestrictedSwitchPreference mRestrictBackground;
-    private RestrictedSwitchPreference mRestrictCellular;
-    private RestrictedSwitchPreference mRestrictVpn;
-    private RestrictedSwitchPreference mRestrictWifi;
     private PreferenceCategory mAppList;
 
     private Drawable mIcon;
@@ -125,6 +110,10 @@
     private long mSelectedCycle;
     private boolean mIsLoading;
 
+    public boolean isSimHardwareVisible(Context context) {
+        return SubscriptionUtil.isSimHardwareVisible(context);
+    }
+
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
@@ -177,16 +166,12 @@
         final UidDetailProvider uidDetailProvider = getUidDetailProvider();
 
         if (mAppItem.key > 0) {
-            if (!UserHandle.isApp(mAppItem.key)) {
+            if ((!isSimHardwareVisible(mContext)) || !UserHandle.isApp(mAppItem.key)) {
                 final UidDetail uidDetail = uidDetailProvider.getUidDetail(mAppItem.key, true);
                 mIcon = uidDetail.icon;
                 mLabel = uidDetail.label;
                 removePreference(KEY_UNRESTRICTED_DATA);
-                removePreference(KEY_RESTRICT_ALL);
                 removePreference(KEY_RESTRICT_BACKGROUND);
-                removePreference(KEY_RESTRICT_CELLULAR);
-                removePreference(KEY_RESTRICT_VPN);
-                removePreference(KEY_RESTRICT_WIFI);
             } else {
                 if (mPackages.size() != 0) {
                     try {
@@ -198,16 +183,8 @@
                     } catch (PackageManager.NameNotFoundException e) {
                     }
                 }
-                mRestrictAll = findPreference(KEY_RESTRICT_ALL);
-                mRestrictAll.setOnPreferenceChangeListener(this);
                 mRestrictBackground = findPreference(KEY_RESTRICT_BACKGROUND);
                 mRestrictBackground.setOnPreferenceChangeListener(this);
-                mRestrictCellular = findPreference(KEY_RESTRICT_CELLULAR);
-                mRestrictCellular.setOnPreferenceChangeListener(this);
-                mRestrictVpn = findPreference(KEY_RESTRICT_VPN);
-                mRestrictVpn.setOnPreferenceChangeListener(this);
-                mRestrictWifi = findPreference(KEY_RESTRICT_WIFI);
-                mRestrictWifi.setOnPreferenceChangeListener(this);
                 mUnrestrictedData = findPreference(KEY_UNRESTRICTED_DATA);
                 mUnrestrictedData.setOnPreferenceChangeListener(this);
             }
@@ -247,11 +224,7 @@
 
             removePreference(KEY_UNRESTRICTED_DATA);
             removePreference(KEY_APP_SETTINGS);
-            removePreference(KEY_RESTRICT_ALL);
             removePreference(KEY_RESTRICT_BACKGROUND);
-            removePreference(KEY_RESTRICT_CELLULAR);
-            removePreference(KEY_RESTRICT_VPN);
-            removePreference(KEY_RESTRICT_WIFI);
             removePreference(KEY_APP_LIST);
         }
 
@@ -293,22 +266,6 @@
             mDataSaverBackend.setIsDenylisted(mAppItem.key, mPackageName, !(Boolean) newValue);
             updatePrefs();
             return true;
-        } else if (preference == mRestrictAll) {
-            setAppRestrictAll(!(Boolean) newValue);
-            updatePrefs();
-            return true;
-        } else if (preference == mRestrictCellular) {
-            setAppRestrictCellular(!(Boolean) newValue);
-            updatePrefs();
-            return true;
-        } else if (preference == mRestrictVpn) {
-            setAppRestrictVpn(!(Boolean) newValue);
-            updatePrefs();
-            return true;
-        } else if (preference == mRestrictWifi) {
-            setAppRestrictWifi(!(Boolean) newValue);
-            updatePrefs();
-            return true;
         } else if (preference == mUnrestrictedData) {
             mDataSaverBackend.setIsAllowlisted(mAppItem.key, mPackageName, (Boolean) newValue);
             return true;
@@ -339,9 +296,7 @@
 
     @VisibleForTesting
     void updatePrefs() {
-        updatePrefs(getAppRestrictBackground(), getUnrestrictData(), getAppRestrictAll(),
-                getAppRestrictCellular(), getAppRestrictVpn(), getAppRestrictWifi(),
-                hasInternetPermission());
+        updatePrefs(getAppRestrictBackground(), getUnrestrictData());
     }
 
     @VisibleForTesting
@@ -377,43 +332,25 @@
         }
     }
 
-    private void updatePrefs(boolean restrictBackground, boolean unrestrictData,
-            boolean restrictAll, boolean restrictCellular, boolean restrictVpn,
-            boolean restrictWifi, boolean hasInternetPermission) {
+    private void updatePrefs(boolean restrictBackground, boolean unrestrictData) {
+        if (!isSimHardwareVisible(mContext)) {
+            return;
+        }
         setBackPreferenceListAnimatorIfLoaded();
         final EnforcedAdmin admin = RestrictedLockUtilsInternal.checkIfMeteredDataRestricted(
                 mContext, mPackageName, UserHandle.getUserId(mAppItem.key));
-        if (mRestrictAll != null) {
-            mRestrictAll.setEnabled(hasInternetPermission);
-            mRestrictAll.setChecked(!restrictAll);
-        }
         if (mRestrictBackground != null) {
+            mRestrictBackground.setChecked(!restrictBackground);
             mRestrictBackground.setDisabledByAdmin(admin);
-            mRestrictBackground.setEnabled(hasInternetPermission &&
-                    !mRestrictBackground.isDisabledByAdmin() && !restrictAll &&
-                    !restrictCellular);
-            mRestrictBackground.setChecked(!restrictBackground && !restrictAll &&
-                    !restrictCellular);
-        }
-        if (mRestrictCellular != null) {
-            mRestrictCellular.setEnabled(hasInternetPermission && !restrictAll);
-            mRestrictCellular.setChecked(!restrictAll && !restrictCellular);
-        }
-        if (mRestrictVpn != null) {
-            mRestrictVpn.setEnabled(hasInternetPermission && !restrictAll);
-            mRestrictVpn.setChecked(!restrictAll && !restrictVpn);
-        }
-        if (mRestrictWifi != null) {
-            mRestrictWifi.setEnabled(hasInternetPermission && !restrictAll);
-            mRestrictWifi.setChecked(!restrictAll && !restrictWifi);
         }
         if (mUnrestrictedData != null) {
-            mUnrestrictedData.setDisabledByAdmin(admin);
-            mUnrestrictedData.setEnabled(hasInternetPermission &&
-                    !mUnrestrictedData.isDisabledByAdmin() && !restrictBackground && !restrictAll &&
-                    !restrictCellular);
-            mUnrestrictedData.setChecked(unrestrictData && !restrictBackground && !restrictAll &&
-                    !restrictCellular);
+            if (restrictBackground) {
+                mUnrestrictedData.setVisible(false);
+            } else {
+                mUnrestrictedData.setVisible(true);
+                mUnrestrictedData.setChecked(unrestrictData);
+                mUnrestrictedData.setDisabledByAdmin(admin);
+            }
         }
     }
 
@@ -450,23 +387,9 @@
     }
 
     private boolean getAppRestrictBackground() {
-        return getAppRestriction(POLICY_REJECT_METERED_BACKGROUND);
-    }
-
-    private boolean getAppRestrictCellular() {
-        return getAppRestriction(POLICY_REJECT_CELLULAR);
-    }
-
-    private boolean getAppRestrictVpn() {
-        return getAppRestriction(POLICY_REJECT_VPN);
-    }
-
-    private boolean getAppRestrictWifi() {
-        return getAppRestriction(POLICY_REJECT_WIFI);
-    }
-
-    private boolean getAppRestrictAll() {
-        return getAppRestriction(POLICY_REJECT_ALL);
+        final int uid = mAppItem.key;
+        final int uidPolicy = services.mPolicyManager.getUidPolicy(uid);
+        return (uidPolicy & POLICY_REJECT_METERED_BACKGROUND) != 0;
     }
 
     private boolean getUnrestrictData() {
@@ -476,42 +399,6 @@
         return false;
     }
 
-    private boolean getAppRestriction(int policy) {
-        final int uid = mAppItem.key;
-        final int uidPolicy = services.mPolicyManager.getUidPolicy(uid);
-        return (uidPolicy & policy) != 0;
-    }
-
-    private boolean hasInternetPermission() {
-        return mPackageManager.checkPermission(Manifest.permission.INTERNET, mPackageName)
-                == PackageManager.PERMISSION_GRANTED;
-    }
-
-    private void setAppRestrictAll(boolean restrict) {
-        setAppRestriction(POLICY_REJECT_ALL, restrict);
-    }
-
-    private void setAppRestrictCellular(boolean restrict) {
-        setAppRestriction(POLICY_REJECT_CELLULAR, restrict);
-    }
-
-    private void setAppRestrictVpn(boolean restrict) {
-        setAppRestriction(POLICY_REJECT_VPN, restrict);
-    }
-
-    private void setAppRestrictWifi(boolean restrict) {
-        setAppRestriction(POLICY_REJECT_WIFI, restrict);
-    }
-
-    private void setAppRestriction(int policy, boolean restrict) {
-        final int uid = mAppItem.key;
-        if (restrict) {
-            services.mPolicyManager.addUidPolicy(uid, policy);
-        } else {
-            services.mPolicyManager.removeUidPolicy(uid, policy);
-        }
-    }
-
     @VisibleForTesting
     void addEntityHeader() {
         String pkg = mPackages.size() != 0 ? mPackages.valueAt(0) : null;
@@ -638,18 +525,14 @@
     @Override
     public void onAllowlistStatusChanged(int uid, boolean isAllowlisted) {
         if (mAppItem.uids.get(uid, false)) {
-            updatePrefs(getAppRestrictBackground(), isAllowlisted, getAppRestrictAll(),
-                    getAppRestrictCellular(), getAppRestrictVpn(), getAppRestrictWifi(),
-                    hasInternetPermission());
+            updatePrefs(getAppRestrictBackground(), isAllowlisted);
         }
     }
 
     @Override
     public void onDenylistStatusChanged(int uid, boolean isDenylisted) {
         if (mAppItem.uids.get(uid, false)) {
-            updatePrefs(isDenylisted, getUnrestrictData(), getAppRestrictAll(),
-                    getAppRestrictCellular(), getAppRestrictVpn(), getAppRestrictWifi(),
-                    hasInternetPermission());
+            updatePrefs(isDenylisted, getUnrestrictData());
         }
     }
 }
diff --git a/src/com/android/settings/datausage/DataSaverBackend.java b/src/com/android/settings/datausage/DataSaverBackend.java
index 98d909f..e39e41a 100644
--- a/src/com/android/settings/datausage/DataSaverBackend.java
+++ b/src/com/android/settings/datausage/DataSaverBackend.java
@@ -80,15 +80,12 @@
 
     public void setIsAllowlisted(int uid, String packageName, boolean allowlisted) {
         final int policy = allowlisted ? POLICY_ALLOW_METERED_BACKGROUND : POLICY_NONE;
+        mPolicyManager.setUidPolicy(uid, policy);
         mUidPolicies.put(uid, policy);
         if (allowlisted) {
-            mPolicyManager.addUidPolicy(uid, POLICY_ALLOW_METERED_BACKGROUND);
             mMetricsFeatureProvider.action(
                     mContext, SettingsEnums.ACTION_DATA_SAVER_WHITELIST, packageName);
-        } else {
-            mPolicyManager.removeUidPolicy(uid, POLICY_ALLOW_METERED_BACKGROUND);
         }
-        mPolicyManager.removeUidPolicy(uid, POLICY_REJECT_METERED_BACKGROUND);
     }
 
     public boolean isAllowlisted(int uid) {
@@ -113,15 +110,12 @@
 
     public void setIsDenylisted(int uid, String packageName, boolean denylisted) {
         final int policy = denylisted ? POLICY_REJECT_METERED_BACKGROUND : POLICY_NONE;
+        mPolicyManager.setUidPolicy(uid, policy);
         mUidPolicies.put(uid, policy);
         if (denylisted) {
-            mPolicyManager.addUidPolicy(uid, POLICY_REJECT_METERED_BACKGROUND);
             mMetricsFeatureProvider.action(
                     mContext, SettingsEnums.ACTION_DATA_SAVER_BLACKLIST, packageName);
-        } else {
-            mPolicyManager.removeUidPolicy(uid, POLICY_REJECT_METERED_BACKGROUND);
         }
-        mPolicyManager.removeUidPolicy(uid, POLICY_ALLOW_METERED_BACKGROUND);
     }
 
     public boolean isDenylisted(int uid) {
@@ -161,9 +155,6 @@
         loadAllowlist();
         loadDenylist();
 
-        // We only care about allow/reject metered background policy here.
-        newPolicy &= POLICY_ALLOW_METERED_BACKGROUND | POLICY_REJECT_METERED_BACKGROUND;
-
         final int oldPolicy = mUidPolicies.get(uid, POLICY_NONE);
         if (newPolicy == POLICY_NONE) {
             mUidPolicies.delete(uid);
