Loading core/java/android/app/backup/IBackupManager.aidl +12 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,18 @@ interface IBackupManager { */ String getDestinationString(String transport); /** * Get the manage-data UI intent, if any, from the given transport. Callers must * hold the android.permission.BACKUP permission in order to use this method. */ Intent getDataManagementIntent(String transport); /** * Get the manage-data menu label, if any, from the given transport. Callers must * hold the android.permission.BACKUP permission in order to use this method. */ String getDataManagementLabel(String transport); /** * Begin a restore session. Either or both of packageName and transportID * may be null. If packageName is non-null, then only the given package will be Loading services/backup/java/com/android/server/backup/BackupManagerService.java +44 −0 Original line number Diff line number Diff line Loading @@ -8441,6 +8441,50 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF return null; } // Supply the manage-data intent for the given transport. public Intent getDataManagementIntent(String transportName) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "getDataManagementIntent"); synchronized (mTransports) { final IBackupTransport transport = mTransports.get(transportName); if (transport != null) { try { final Intent intent = transport.dataManagementIntent(); if (MORE_DEBUG) Slog.d(TAG, "getDataManagementIntent() returning intent " + intent); return intent; } catch (RemoteException e) { /* fall through to return null */ } } } return null; } // Supply the menu label for affordances that fire the manage-data intent // for the given transport. public String getDataManagementLabel(String transportName) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "getDataManagementLabel"); synchronized (mTransports) { final IBackupTransport transport = mTransports.get(transportName); if (transport != null) { try { final String text = transport.dataManagementLabel(); if (MORE_DEBUG) Slog.d(TAG, "getDataManagementLabel() returning " + text); return text; } catch (RemoteException e) { /* fall through to return null */ } } } return null; } // Callback: a requested backup agent has been instantiated. This should only // be called from the Activity Manager. public void agentConnected(String packageName, IBinder agentBinder) { Loading Loading
core/java/android/app/backup/IBackupManager.aidl +12 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,18 @@ interface IBackupManager { */ String getDestinationString(String transport); /** * Get the manage-data UI intent, if any, from the given transport. Callers must * hold the android.permission.BACKUP permission in order to use this method. */ Intent getDataManagementIntent(String transport); /** * Get the manage-data menu label, if any, from the given transport. Callers must * hold the android.permission.BACKUP permission in order to use this method. */ String getDataManagementLabel(String transport); /** * Begin a restore session. Either or both of packageName and transportID * may be null. If packageName is non-null, then only the given package will be Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +44 −0 Original line number Diff line number Diff line Loading @@ -8441,6 +8441,50 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF return null; } // Supply the manage-data intent for the given transport. public Intent getDataManagementIntent(String transportName) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "getDataManagementIntent"); synchronized (mTransports) { final IBackupTransport transport = mTransports.get(transportName); if (transport != null) { try { final Intent intent = transport.dataManagementIntent(); if (MORE_DEBUG) Slog.d(TAG, "getDataManagementIntent() returning intent " + intent); return intent; } catch (RemoteException e) { /* fall through to return null */ } } } return null; } // Supply the menu label for affordances that fire the manage-data intent // for the given transport. public String getDataManagementLabel(String transportName) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "getDataManagementLabel"); synchronized (mTransports) { final IBackupTransport transport = mTransports.get(transportName); if (transport != null) { try { final String text = transport.dataManagementLabel(); if (MORE_DEBUG) Slog.d(TAG, "getDataManagementLabel() returning " + text); return text; } catch (RemoteException e) { /* fall through to return null */ } } } return null; } // Callback: a requested backup agent has been instantiated. This should only // be called from the Activity Manager. public void agentConnected(String packageName, IBinder agentBinder) { Loading