Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf5f5a45 authored by The Android Automerger's avatar The Android Automerger
Browse files

Merge branch 'froyo' into froyo-release

parents c0be76ff 11a7ba36
Loading
Loading
Loading
Loading
+533 −795

File changed.

Preview size limit exceeded, changes collapsed.

+21 −6
Original line number Diff line number Diff line
@@ -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());
@@ -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");
        }
@@ -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);
+11 −55
Original line number Diff line number Diff line
@@ -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 {
@@ -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)
@@ -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) {
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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";
+17 −3
Original line number Diff line number Diff line
@@ -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.
     *
@@ -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