Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -484,6 +484,7 @@ package android.app.backup { method public long getAvailableRestoreToken(java.lang.String); method public android.content.Intent getConfigurationIntent(java.lang.String); method public java.lang.String getCurrentTransport(); method public android.content.ComponentName getCurrentTransportComponent(); method public android.content.Intent getDataManagementIntent(java.lang.String); method public java.lang.String getDataManagementLabel(java.lang.String); method public java.lang.String getDestinationString(java.lang.String); Loading core/java/android/app/backup/BackupManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -442,6 +442,27 @@ public class BackupManager { return null; } /** * Returns the {@link ComponentName} of the host service of the selected transport or {@code * null} if no transport selected or if the transport selected is not registered. * * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.BACKUP) @Nullable public ComponentName getCurrentTransportComponent() { checkServiceBinder(); if (sService != null) { try { return sService.getCurrentTransportComponent(); } catch (RemoteException e) { Log.e(TAG, "getCurrentTransportComponent() couldn't connect"); } } return null; } /** * Request a list of all available backup transports' names. * Loading core/java/android/app/backup/IBackupManager.aidl +7 −5 Original line number Diff line number Diff line Loading @@ -244,8 +244,6 @@ interface IBackupManager { * {@code null} and MUST NOT be {@code null} when dataManagementIntent is not {@code null}. * @throws SecurityException If the UID of the calling process differs from the package UID of * {@code transportComponent} or if the caller does NOT have BACKUP permission. * * @hide */ void updateTransportAttributes(in ComponentName transportComponent, in String name, in Intent configurationIntent, in String currentDestinationString, Loading @@ -257,6 +255,13 @@ interface IBackupManager { */ String getCurrentTransport(); /** * Returns the {@link ComponentName} of the host service of the selected transport or {@code * null} if no transport selected or if the transport selected is not registered. Callers must * hold the android.permission.BACKUP permission to use this method. */ ComponentName getCurrentTransportComponent(); /** * Request a list of all available backup transports' names. Callers must * hold the android.permission.BACKUP permission to use this method. Loading Loading @@ -296,8 +301,6 @@ interface IBackupManager { * the transport's name that is returned by {@link BackupTransport#name()}. * @param listener A listener object to get a callback on the transport being selected. It may * be {@code null}. * * @hide */ void selectBackupTransportAsync(in ComponentName transport, ISelectBackupTransportCallback listener); Loading Loading @@ -364,7 +367,6 @@ interface IBackupManager { * @param result In the case of a full backup measure operation, the estimated * total file size that would result from the operation. Unused in all other * cases. * {@hide} */ void opComplete(int token, long result); Loading services/backup/java/com/android/server/backup/BackupManagerService.java +19 −0 Original line number Diff line number Diff line Loading @@ -2901,6 +2901,25 @@ public class BackupManagerService implements BackupManagerServiceInterface { return currentTransport; } /** * Returns the {@link ComponentName} of the host service of the selected transport or {@code * null} if no transport selected or if the transport selected is not registered. */ @Override @Nullable public ComponentName getCurrentTransportComponent() { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.BACKUP, "getCurrentTransportComponent"); long oldId = Binder.clearCallingIdentity(); try { return mTransportManager.getCurrentTransportComponent(); } catch (TransportNotRegisteredException e) { return null; } finally { Binder.restoreCallingIdentity(oldId); } } // Report all known, available backup transports @Override public String[] listAllTransports() { Loading services/backup/java/com/android/server/backup/BackupManagerServiceInterface.java +5 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.backup; import android.annotation.Nullable; import android.app.IBackupAgent; import android.app.backup.IBackupManager; import android.app.backup.IBackupManagerMonitor; Loading Loading @@ -132,6 +133,10 @@ public interface BackupManagerServiceInterface { // Report the name of the currently active transport String getCurrentTransport(); // Report the component name of the host service of the currently active transport @Nullable ComponentName getCurrentTransportComponent(); // Report all known, available backup transports String[] listAllTransports(); Loading Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -484,6 +484,7 @@ package android.app.backup { method public long getAvailableRestoreToken(java.lang.String); method public android.content.Intent getConfigurationIntent(java.lang.String); method public java.lang.String getCurrentTransport(); method public android.content.ComponentName getCurrentTransportComponent(); method public android.content.Intent getDataManagementIntent(java.lang.String); method public java.lang.String getDataManagementLabel(java.lang.String); method public java.lang.String getDestinationString(java.lang.String); Loading
core/java/android/app/backup/BackupManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -442,6 +442,27 @@ public class BackupManager { return null; } /** * Returns the {@link ComponentName} of the host service of the selected transport or {@code * null} if no transport selected or if the transport selected is not registered. * * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.BACKUP) @Nullable public ComponentName getCurrentTransportComponent() { checkServiceBinder(); if (sService != null) { try { return sService.getCurrentTransportComponent(); } catch (RemoteException e) { Log.e(TAG, "getCurrentTransportComponent() couldn't connect"); } } return null; } /** * Request a list of all available backup transports' names. * Loading
core/java/android/app/backup/IBackupManager.aidl +7 −5 Original line number Diff line number Diff line Loading @@ -244,8 +244,6 @@ interface IBackupManager { * {@code null} and MUST NOT be {@code null} when dataManagementIntent is not {@code null}. * @throws SecurityException If the UID of the calling process differs from the package UID of * {@code transportComponent} or if the caller does NOT have BACKUP permission. * * @hide */ void updateTransportAttributes(in ComponentName transportComponent, in String name, in Intent configurationIntent, in String currentDestinationString, Loading @@ -257,6 +255,13 @@ interface IBackupManager { */ String getCurrentTransport(); /** * Returns the {@link ComponentName} of the host service of the selected transport or {@code * null} if no transport selected or if the transport selected is not registered. Callers must * hold the android.permission.BACKUP permission to use this method. */ ComponentName getCurrentTransportComponent(); /** * Request a list of all available backup transports' names. Callers must * hold the android.permission.BACKUP permission to use this method. Loading Loading @@ -296,8 +301,6 @@ interface IBackupManager { * the transport's name that is returned by {@link BackupTransport#name()}. * @param listener A listener object to get a callback on the transport being selected. It may * be {@code null}. * * @hide */ void selectBackupTransportAsync(in ComponentName transport, ISelectBackupTransportCallback listener); Loading Loading @@ -364,7 +367,6 @@ interface IBackupManager { * @param result In the case of a full backup measure operation, the estimated * total file size that would result from the operation. Unused in all other * cases. * {@hide} */ void opComplete(int token, long result); Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +19 −0 Original line number Diff line number Diff line Loading @@ -2901,6 +2901,25 @@ public class BackupManagerService implements BackupManagerServiceInterface { return currentTransport; } /** * Returns the {@link ComponentName} of the host service of the selected transport or {@code * null} if no transport selected or if the transport selected is not registered. */ @Override @Nullable public ComponentName getCurrentTransportComponent() { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.BACKUP, "getCurrentTransportComponent"); long oldId = Binder.clearCallingIdentity(); try { return mTransportManager.getCurrentTransportComponent(); } catch (TransportNotRegisteredException e) { return null; } finally { Binder.restoreCallingIdentity(oldId); } } // Report all known, available backup transports @Override public String[] listAllTransports() { Loading
services/backup/java/com/android/server/backup/BackupManagerServiceInterface.java +5 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.backup; import android.annotation.Nullable; import android.app.IBackupAgent; import android.app.backup.IBackupManager; import android.app.backup.IBackupManagerMonitor; Loading Loading @@ -132,6 +133,10 @@ public interface BackupManagerServiceInterface { // Report the name of the currently active transport String getCurrentTransport(); // Report the component name of the host service of the currently active transport @Nullable ComponentName getCurrentTransportComponent(); // Report all known, available backup transports String[] listAllTransports(); Loading