If backup service is not available, remove Settings->Backup and Backup->"Backup is disabled by
admin" from search results.

"Backup -> Backup" still appears due to the PrivacySettingsActivity. On clicking that,
we get "Backup is disabled by admin" which is OK

Bug: 129743816

Test: 1. atest -v UserBackupSettingsActivityTest
2. atest -v BackupInactivePreferenceControllerTest
3. Create and switch to secondary user. Type "backup" in settings search. Note that only
"Backup->Backup" is shown and on clicking it, we get "Backup is disabled by admin"

Change-Id: Ic13e2d745c9511cbebe27aa4c6f5cd89b277fc37
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index d34dfeb..8077ee3 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -639,12 +639,7 @@
                 showDev, isAdmin)
                 || somethingChanged;
 
-        // For profiles, we want them to be included in the profile select dialog even if
-        // backup is not activated.
-        // For other users, enable/disable backup settings depending on whether backup is activated
-        // for the user.
-        boolean enableBackupTile = um.isManagedProfile()
-                || new BackupSettingsHelper(this).isBackupServiceActive();
+        boolean enableBackupTile = new BackupSettingsHelper(this).showBackupSettingsForUser();
         somethingChanged = setTileEnabled(changedList, new ComponentName(packageName,
                 UserBackupSettingsActivity.class.getName()), enableBackupTile, isAdmin)
                 || somethingChanged;