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

Commit 661cd52e authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Add progress dialog for booting after an upgrade.

This introduces a new facility for code during the boot process
to display messages to the user through a progress dialog.  This
is only for use when performing longer-than-usual post-upgrade
operations such as running dexopt on applications or upgrading
databases.

Change-Id: I0e78439ccec3850fb67872c22f235bf12a158dae
parent 5e82bc03
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7205,6 +7205,7 @@ package android.database.sqlite {
    ctor public SQLiteOpenHelper(android.content.Context, java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int);
    ctor public SQLiteOpenHelper(android.content.Context, java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int, android.database.DatabaseErrorHandler);
    method public synchronized void close();
    method public java.lang.String getDatabaseName();
    method public synchronized android.database.sqlite.SQLiteDatabase getReadableDatabase();
    method public synchronized android.database.sqlite.SQLiteDatabase getWritableDatabase();
    method public abstract void onCreate(android.database.sqlite.SQLiteDatabase);
@@ -23503,6 +23504,7 @@ package android.view {
    method public abstract void setContentView(android.view.View);
    method public abstract void setContentView(android.view.View, android.view.ViewGroup.LayoutParams);
    method protected void setDefaultWindowFormat(int);
    method public void setDimAmount(float);
    method public abstract void setFeatureDrawable(int, android.graphics.drawable.Drawable);
    method public abstract void setFeatureDrawableAlpha(int, int);
    method public abstract void setFeatureDrawableResource(int, int);
+21 −0
Original line number Diff line number Diff line
@@ -1541,6 +1541,15 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
            return true;
        }

        case SHOW_BOOT_MESSAGE_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
            boolean always = data.readInt() != 0;
            showBootMessage(msg, always);
            reply.writeNoException();
            return true;
        }

        }

        return super.onTransact(code, data, reply, flags);
@@ -3483,5 +3492,17 @@ class ActivityManagerProxy implements IActivityManager
        return res;
    }

    public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        TextUtils.writeToParcel(msg, data, 0);
        data.writeInt(always ? 1 : 0);
        mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
        reply.readException();
        data.recycle();
        reply.recycle();
    }

    private IBinder mRemote;
}
+3 −0
Original line number Diff line number Diff line
@@ -370,6 +370,8 @@ public interface IActivityManager extends IInterface {

    public long[] getProcessPss(int[] pids) throws RemoteException;

    public void showBootMessage(CharSequence msg, boolean always) throws RemoteException;

    /*
     * Private non-Binder interfaces
     */
@@ -599,4 +601,5 @@ public interface IActivityManager extends IInterface {
    int IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+134;
    int UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+135;
    int GET_PROCESS_PSS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+136;
    int SHOW_BOOT_MESSAGE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+137;
}
+7 −1
Original line number Diff line number Diff line
@@ -321,6 +321,12 @@ interface IPackageManager {
    void systemReady();
    boolean hasSystemUidErrors();

    /**
     * Ask the package manager to perform boot-time dex-opt of all
     * existing packages.
     */
    void performBootDexOpt();

    /**
     * Ask the package manager to perform dex-opt (if needed) on the given
     * package, if it already hasn't done mode.  Only does this if running
+8 −0
Original line number Diff line number Diff line
@@ -99,6 +99,14 @@ public abstract class SQLiteOpenHelper {
        mErrorHandler = errorHandler;
    }

    /**
     * Return the name of the SQLite database being opened, as given tp
     * the constructor.
     */
    public String getDatabaseName() {
        return mName;
    }

    /**
     * Create and/or open a database that will be used for reading and writing.
     * The first time this is called, the database will be opened and
Loading