From 59350eaf491df7cac496a38443e9d3fb8b715137 Mon Sep 17 00:00:00 2001 From: Alexander Martinz Date: Thu, 28 Jul 2016 13:57:44 +0200 Subject: [2/2] base: cm custom boot dexopt UI * Pass app info and number of installed packages to boot message UI * Ui by Asher and Joey, based on Alexander's previous work Change-Id: I9ec9d0cb0e20a9bac73e126f6b6f3965400f05e7 --- core/java/android/app/ActivityManagerNative.java | 19 +++++++++++++------ core/java/android/app/IActivityManager.java | 10 ++++++++-- core/java/android/view/WindowManagerPolicy.java | 6 ++++-- 3 files changed, 25 insertions(+), 10 deletions(-) (limited to 'core') diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index bfd6b5a..544331f 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -2097,11 +2097,14 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } - case SHOW_BOOT_MESSAGE_TRANSACTION: { + case UPDATE_BOOT_PROGRESS_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); - CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); + int stage = data.readInt(); + ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); + int current = data.readInt(); + int total = data.readInt(); boolean always = data.readInt() != 0; - showBootMessage(msg, always); + updateBootProgress(stage, info, current, total, always); reply.writeNoException(); return true; } @@ -5285,13 +5288,17 @@ class ActivityManagerProxy implements IActivityManager return res; } - public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { + public void updateBootProgress(int stage, ApplicationInfo optimizedApp, + int currentAppPos, int totalAppCount, boolean always) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); - TextUtils.writeToParcel(msg, data, 0); + data.writeInt(stage); + optimizedApp.writeToParcel(data, 0); + data.writeInt(currentAppPos); + data.writeInt(totalAppCount); data.writeInt(always ? 1 : 0); - mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); + mRemote.transact(UPDATE_BOOT_PROGRESS_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java index 7221e47..75951cf 100644 --- a/core/java/android/app/IActivityManager.java +++ b/core/java/android/app/IActivityManager.java @@ -408,7 +408,8 @@ public interface IActivityManager extends IInterface { public long[] getProcessPss(int[] pids) throws RemoteException; - public void showBootMessage(CharSequence msg, boolean always) throws RemoteException; + public void updateBootProgress(int stage, ApplicationInfo optimizedApp, + int currentAppPos, int totalAppCount, boolean always) throws RemoteException; public void keyguardWaitingForActivityDrawn() throws RemoteException; @@ -622,6 +623,11 @@ public interface IActivityManager extends IInterface { } } + public static final int BOOT_STAGE_STARTING_APPS = 1; + public static final int BOOT_STAGE_FSTRIM = 2; + public static final int BOOT_STAGE_PREPARING_APPS = 3; + public static final int BOOT_STAGE_COMPLETE = 4; + String descriptor = "android.app.IActivityManager"; // Please keep these transaction codes the same -- they are also @@ -757,7 +763,7 @@ 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; + int UPDATE_BOOT_PROGRESS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+137; int KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+139; int GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+140; int REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+141; diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index d19096b..9d7c741 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -20,6 +20,7 @@ import android.annotation.IntDef; import android.annotation.SystemApi; import android.content.Context; import android.content.pm.ActivityInfo; +import android.content.pm.ApplicationInfo; import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.graphics.Rect; @@ -1171,9 +1172,10 @@ public interface WindowManagerPolicy { public void systemBooted(); /** - * Show boot time message to the user. + * Update UI for boot-up progress. */ - public void showBootMessage(final CharSequence msg, final boolean always); + public void updateBootProgress(final int stage, final ApplicationInfo optimizedApp, + final int currentAppPos, final int totalAppCount); /** * Hide the UI for showing boot messages, never to be displayed again. -- cgit v1.1