Use new dataManagementLabel AIDL in Backup Settings
1) Uses new AIDL method getDataManagementLabelForUser 2) Changes data management label type from String to CharSequence Bug: 113856654 Test: atest $(find \ packages/apps/Settings/tests/robotests/src/com/android/settings/backup \ -name '*Test.java') Change-Id: I2325527c67878467b96fb93de50faafe153fdb21
This commit is contained in:
@@ -25,6 +25,7 @@ import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
@@ -91,9 +92,9 @@ public class BackupSettingsHelper {
|
||||
*
|
||||
* @return Label for the backup settings item.
|
||||
*/
|
||||
public String getLabelForBackupSettings() {
|
||||
String label = getLabelFromBackupTransport();
|
||||
if (label == null || label.isEmpty()) {
|
||||
public CharSequence getLabelForBackupSettings() {
|
||||
CharSequence label = getLabelFromBackupTransport();
|
||||
if (TextUtils.isEmpty(label)) {
|
||||
label = mContext.getString(R.string.privacy_settings_title);
|
||||
}
|
||||
return label;
|
||||
@@ -222,10 +223,11 @@ public class BackupSettingsHelper {
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
String getLabelFromBackupTransport() {
|
||||
CharSequence getLabelFromBackupTransport() {
|
||||
try {
|
||||
String label =
|
||||
mBackupManager.getDataManagementLabel(mBackupManager.getCurrentTransport());
|
||||
CharSequence label =
|
||||
mBackupManager.getDataManagementLabelForUser(
|
||||
UserHandle.myUserId(), mBackupManager.getCurrentTransport());
|
||||
if (Log.isLoggable(TAG, Log.DEBUG)) {
|
||||
Log.d(TAG, "Received the backup settings label from backup transport: " + label);
|
||||
}
|
||||
|
Reference in New Issue
Block a user