Merge "Throw exceptions if obtain ActivityStarter before system ready"

This commit is contained in:
Louis Chang
2020-12-24 07:57:55 +00:00
committed by Android (Google) Code Review
2 changed files with 19 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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;