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

Commit b7844e5b authored by Louis Chang's avatar Louis Chang
Browse files

Throw exceptions if obtain ActivityStarter before system ready

RWC was null while starting home activity during system boot up.
Throw exceptions now if that happens again.

Also add warning logs if any unknown failures during ATM#onTransact.

Bug: 174713714
Bug: 173221781
Test: build and run
Change-Id: I5f3414d98198144af7bc0a07c7dbfafd529790e8
parent e295da00
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -279,6 +279,9 @@ class ActivityStarter {
            ActivityStarter starter = mStarterPool.acquire();

            if (starter == null) {
                if (mService.mRootWindowContainer == null) {
                    throw new IllegalStateException("Too early to start activity.");
                }
                starter = new ActivityStarter(mController, mService, mSupervisor, mInterceptor);
            }

+16 −0
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ import android.os.IUserManager;
import android.os.LocaleList;
import android.os.Looper;
import android.os.Message;
import android.os.Parcel;
import android.os.PowerManager;
import android.os.PowerManagerInternal;
import android.os.Process;
@@ -4938,6 +4939,21 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
        return allUids.contains(uid);
    }

    @Override
    public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
            throws RemoteException {
        try {
            return super.onTransact(code, data, reply, flags);
        } catch (RuntimeException e) {
            if (!(e instanceof SecurityException)) {
                Slog.w(TAG, "Activity Task Manager onTransact aborts "
                        + " UID:" + Binder.getCallingUid()
                        + " PID:" + Binder.getCallingPid(), e);
            }
            throw e;
        }
    }

    final class H extends Handler {
        static final int REPORT_TIME_TRACKER_MSG = 1;