Merge "Clean up BackupSettingsHelper.getSummary()" into main

This commit is contained in:
Chaohui Wang
2023-12-05 06:42:54 +00:00
committed by Android (Google) Code Review
3 changed files with 0 additions and 60 deletions

View File

@@ -24,7 +24,6 @@ import android.content.Intent;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.UserManager;
import android.text.TextUtils;
import android.util.Log;
@@ -50,24 +49,6 @@ public class BackupSettingsHelper {
mContext = context;
}
/**
* If there is only one profile, show whether the backup is on or off.
* Otherwise, show nothing.
*/
public String getSummary() {
UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
if (userManager.getUserProfiles().size() == 1) {
try {
int resId = mBackupManager.isBackupEnabled()
? R.string.backup_summary_state_on : R.string.backup_summary_state_off;
return mContext.getText(resId).toString();
} catch (RemoteException e) {
Log.e(TAG, "Error getting isBackupEnabled", e);
}
}
return null;
}
/**
* Returns an intent to launch backup settings from backup transport if the intent was provided
* by the transport. Otherwise returns the intent to launch the default backup settings screen.