Loading api/current.xml +533 −795 File changed.Preview size limit exceeded, changes collapsed. Show changes cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +21 −6 Original line number Diff line number Diff line Loading @@ -254,11 +254,13 @@ public final class Bmgr { private void doListRestoreSets() { try { RestoreSet[] sets = mRestore.getAvailableRestoreSets(); if (sets == null || sets.length == 0) { System.out.println("No restore sets available"); RestoreObserver observer = new RestoreObserver(); int err = mRestore.getAvailableRestoreSets(observer); if (err != 0) { System.out.println("Unable to request restore sets"); } else { printRestoreSets(sets); observer.waitForCompletion(); printRestoreSets(observer.sets); } } catch (RemoteException e) { System.err.println(e.toString()); Loading @@ -274,6 +276,16 @@ public final class Bmgr { class RestoreObserver extends IRestoreObserver.Stub { boolean done; RestoreSet[] sets = null; public void restoreSetsAvailable(RestoreSet[] result) { synchronized (this) { sets = result; done = true; this.notify(); } } public void restoreStarting(int numPackages) { System.out.println("restoreStarting: " + numPackages + " packages"); } Loading Loading @@ -359,8 +371,11 @@ public final class Bmgr { System.err.println(BMGR_NOT_RUNNING_ERR); return; } RestoreSet[] sets = mRestore.getAvailableRestoreSets(); if (sets != null) { RestoreSet[] sets = null; int err = mRestore.getAvailableRestoreSets(observer); if (err != 0) { observer.waitForCompletion(); sets = observer.sets; for (RestoreSet s : sets) { if (s.token == token) { System.out.println("Scheduling restore: " + s.name); Loading core/java/android/app/ContextImpl.java +11 −55 Original line number Diff line number Diff line Loading @@ -1852,6 +1852,15 @@ class ContextImpl extends Context { } } @Override public boolean addPermissionAsync(PermissionInfo info) { try { return mPM.addPermissionAsync(info); } catch (RemoteException e) { throw new RuntimeException("Package manager has died", e); } } @Override public void removePermission(String name) { try { Loading Loading @@ -2139,31 +2148,7 @@ class ContextImpl extends Context { } @Override public Drawable getApplicationIcon(ApplicationInfo info) { final int icon = info.icon; if (icon != 0) { ResourceName name = new ResourceName(info, icon); Drawable dr = getCachedIcon(name); if (dr != null) { return dr; } try { Resources r = getResourcesForApplication(info); dr = r.getDrawable(icon); if (DEBUG_ICONS) Log.v(TAG, "Getting drawable 0x" + Integer.toHexString(icon) + " from " + r + ": " + dr); putCachedIcon(name, dr); return dr; } catch (NameNotFoundException e) { Log.w("PackageManager", "Failure retrieving resources for" + info.packageName); } catch (RuntimeException e) { // If an exception was thrown, fall through to return // default icon. Log.w("PackageManager", "Failure retrieving app icon", e); } } return getDefaultActivityIcon(); return info.loadIcon(this); } @Override public Drawable getApplicationIcon(String packageName) Loading Loading @@ -2404,25 +2389,6 @@ class ContextImpl extends Context { } } private CharSequence getLabel(ResourceName name, ApplicationInfo app, int id) { CharSequence cs = getCachedString(name); if (cs != null) { return cs; } try { Resources r = getResourcesForApplication(app); cs = r.getText(id); putCachedString(name, cs); } catch (NameNotFoundException e) { Log.w("PackageManager", "Failure retrieving resources for" + app.packageName); } catch (RuntimeException e) { // If an exception was thrown, fall through to return null Log.w("ApplicationInfo", "Failure retrieving activity name", e); } return cs; } @Override public CharSequence getText(String packageName, int resid, ApplicationInfo appInfo) { Loading Loading @@ -2484,17 +2450,7 @@ class ContextImpl extends Context { @Override public CharSequence getApplicationLabel(ApplicationInfo info) { if (info.nonLocalizedLabel != null) { return info.nonLocalizedLabel; } final int id = info.labelRes; if (id != 0) { CharSequence cs = getLabel(new ResourceName(info, id), info, id); if (cs != null) { return cs; } } return info.packageName; return info.loadLabel(this); } @Override Loading core/java/android/app/backup/AbsoluteFileBackupHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ import java.io.File; * Like FileBackupHelper, but takes absolute paths for the files instead of * subpaths of getFilesDir() * * STOPSHIP: document! * @hide */ public class AbsoluteFileBackupHelper extends FileBackupHelperBase implements BackupHelper { private static final String TAG = "AbsoluteFileBackupHelper"; Loading core/java/android/app/backup/IRestoreObserver.aidl +17 −3 Original line number Diff line number Diff line Loading @@ -16,12 +16,26 @@ package android.app.backup; import android.app.backup.RestoreSet; /** * Callback class for receiving progress reports during a restore operation. * * @hide */ interface IRestoreObserver { oneway interface IRestoreObserver { /** * Supply a list of the restore datasets available from the current transport. This * method is invoked as a callback following the application's use of the * {@link android.app.backup.IRestoreSession.getAvailableRestoreSets} method. * * @param result An array of {@link android.app.backup.RestoreSet RestoreSet} objects * describing all of the available datasets that are candidates for restoring to * the current device. If no applicable datasets exist, {@code result} will be * {@code null}. */ void restoreSetsAvailable(in RestoreSet[] result); /** * The restore operation has begun. * Loading @@ -32,8 +46,8 @@ interface IRestoreObserver { /** * An indication of which package is being restored currently, out of the * total number provided in the restoreStarting() callback. This method * is not guaranteed to be called. * total number provided in the {@link #restoreStarting(int numPackages)} callback. * This method is not guaranteed to be called. * * @param nowBeingRestored The index, between 1 and the numPackages parameter * to the restoreStarting() callback, of the package now being restored. Loading Loading
cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +21 −6 Original line number Diff line number Diff line Loading @@ -254,11 +254,13 @@ public final class Bmgr { private void doListRestoreSets() { try { RestoreSet[] sets = mRestore.getAvailableRestoreSets(); if (sets == null || sets.length == 0) { System.out.println("No restore sets available"); RestoreObserver observer = new RestoreObserver(); int err = mRestore.getAvailableRestoreSets(observer); if (err != 0) { System.out.println("Unable to request restore sets"); } else { printRestoreSets(sets); observer.waitForCompletion(); printRestoreSets(observer.sets); } } catch (RemoteException e) { System.err.println(e.toString()); Loading @@ -274,6 +276,16 @@ public final class Bmgr { class RestoreObserver extends IRestoreObserver.Stub { boolean done; RestoreSet[] sets = null; public void restoreSetsAvailable(RestoreSet[] result) { synchronized (this) { sets = result; done = true; this.notify(); } } public void restoreStarting(int numPackages) { System.out.println("restoreStarting: " + numPackages + " packages"); } Loading Loading @@ -359,8 +371,11 @@ public final class Bmgr { System.err.println(BMGR_NOT_RUNNING_ERR); return; } RestoreSet[] sets = mRestore.getAvailableRestoreSets(); if (sets != null) { RestoreSet[] sets = null; int err = mRestore.getAvailableRestoreSets(observer); if (err != 0) { observer.waitForCompletion(); sets = observer.sets; for (RestoreSet s : sets) { if (s.token == token) { System.out.println("Scheduling restore: " + s.name); Loading
core/java/android/app/ContextImpl.java +11 −55 Original line number Diff line number Diff line Loading @@ -1852,6 +1852,15 @@ class ContextImpl extends Context { } } @Override public boolean addPermissionAsync(PermissionInfo info) { try { return mPM.addPermissionAsync(info); } catch (RemoteException e) { throw new RuntimeException("Package manager has died", e); } } @Override public void removePermission(String name) { try { Loading Loading @@ -2139,31 +2148,7 @@ class ContextImpl extends Context { } @Override public Drawable getApplicationIcon(ApplicationInfo info) { final int icon = info.icon; if (icon != 0) { ResourceName name = new ResourceName(info, icon); Drawable dr = getCachedIcon(name); if (dr != null) { return dr; } try { Resources r = getResourcesForApplication(info); dr = r.getDrawable(icon); if (DEBUG_ICONS) Log.v(TAG, "Getting drawable 0x" + Integer.toHexString(icon) + " from " + r + ": " + dr); putCachedIcon(name, dr); return dr; } catch (NameNotFoundException e) { Log.w("PackageManager", "Failure retrieving resources for" + info.packageName); } catch (RuntimeException e) { // If an exception was thrown, fall through to return // default icon. Log.w("PackageManager", "Failure retrieving app icon", e); } } return getDefaultActivityIcon(); return info.loadIcon(this); } @Override public Drawable getApplicationIcon(String packageName) Loading Loading @@ -2404,25 +2389,6 @@ class ContextImpl extends Context { } } private CharSequence getLabel(ResourceName name, ApplicationInfo app, int id) { CharSequence cs = getCachedString(name); if (cs != null) { return cs; } try { Resources r = getResourcesForApplication(app); cs = r.getText(id); putCachedString(name, cs); } catch (NameNotFoundException e) { Log.w("PackageManager", "Failure retrieving resources for" + app.packageName); } catch (RuntimeException e) { // If an exception was thrown, fall through to return null Log.w("ApplicationInfo", "Failure retrieving activity name", e); } return cs; } @Override public CharSequence getText(String packageName, int resid, ApplicationInfo appInfo) { Loading Loading @@ -2484,17 +2450,7 @@ class ContextImpl extends Context { @Override public CharSequence getApplicationLabel(ApplicationInfo info) { if (info.nonLocalizedLabel != null) { return info.nonLocalizedLabel; } final int id = info.labelRes; if (id != 0) { CharSequence cs = getLabel(new ResourceName(info, id), info, id); if (cs != null) { return cs; } } return info.packageName; return info.loadLabel(this); } @Override Loading
core/java/android/app/backup/AbsoluteFileBackupHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ import java.io.File; * Like FileBackupHelper, but takes absolute paths for the files instead of * subpaths of getFilesDir() * * STOPSHIP: document! * @hide */ public class AbsoluteFileBackupHelper extends FileBackupHelperBase implements BackupHelper { private static final String TAG = "AbsoluteFileBackupHelper"; Loading
core/java/android/app/backup/IRestoreObserver.aidl +17 −3 Original line number Diff line number Diff line Loading @@ -16,12 +16,26 @@ package android.app.backup; import android.app.backup.RestoreSet; /** * Callback class for receiving progress reports during a restore operation. * * @hide */ interface IRestoreObserver { oneway interface IRestoreObserver { /** * Supply a list of the restore datasets available from the current transport. This * method is invoked as a callback following the application's use of the * {@link android.app.backup.IRestoreSession.getAvailableRestoreSets} method. * * @param result An array of {@link android.app.backup.RestoreSet RestoreSet} objects * describing all of the available datasets that are candidates for restoring to * the current device. If no applicable datasets exist, {@code result} will be * {@code null}. */ void restoreSetsAvailable(in RestoreSet[] result); /** * The restore operation has begun. * Loading @@ -32,8 +46,8 @@ interface IRestoreObserver { /** * An indication of which package is being restored currently, out of the * total number provided in the restoreStarting() callback. This method * is not guaranteed to be called. * total number provided in the {@link #restoreStarting(int numPackages)} callback. * This method is not guaranteed to be called. * * @param nowBeingRestored The index, between 1 and the numPackages parameter * to the restoreStarting() callback, of the package now being restored. Loading