Remove advanced category if no preference am: 392850a825 am: 34ebed2bba

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Messaging/+/1351522

Change-Id: I40e97e119cfefaf90e14efad2760e9e31a46a9b8
diff --git a/src/com/android/messaging/ui/appsettings/PerSubscriptionSettingsActivity.java b/src/com/android/messaging/ui/appsettings/PerSubscriptionSettingsActivity.java
index 18a3f47..c2fd473 100644
--- a/src/com/android/messaging/ui/appsettings/PerSubscriptionSettingsActivity.java
+++ b/src/com/android/messaging/ui/appsettings/PerSubscriptionSettingsActivity.java
@@ -190,6 +190,10 @@
                     deliveryReportsPreference.setEnabled(false);
                 }
             }
+
+            if (advancedCategory.getPreferenceCount() == 0) {
+                getPreferenceScreen().removePreference(advancedCategory);
+            }
         }
 
         private boolean isCellBroadcastAppLinkEnabled() {