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

Commit b96f7c2a authored by jdragon.lee's avatar jdragon.lee Committed by Steve Kondik
Browse files

Remove unnecessary sleep in ActivityThread.

This attachApplication function is working when ActivityThread is created and it takes 30~40 milliseconds in G3.
At that time, ActivityThread goes to sleep even it is not necessary.
Parallel processing can be helpful in this case.
After merging this code, there is no sleep time during attachApplication function and
starting application time is reduced.

sleep time 30ms -> 0ms in G3.

Change-Id: Ia4babb97d15234ac430d148cfdcadfbc7689bb74
parent 1787ad70
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -5158,11 +5158,15 @@ public final class ActivityThread {
                                                    UserHandle.myUserId());
            RuntimeInit.setApplicationObject(mAppThread.asBinder());
            final IActivityManager mgr = ActivityManagerNative.getDefault();
            new Thread() {
                public void run() {
                    try {
                        mgr.attachApplication(mAppThread);
                    } catch (RemoteException ex) {
                        // Ignore
                    }
                }
            }.start();
            // Watch for getting close to heap limit.
            BinderInternal.addGcWatcher(new Runnable() {
                @Override public void run() {