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

Commit 55f1e9b5 authored by Kweku Adams's avatar Kweku Adams Committed by Automerger Merge Worker
Browse files

Merge "Fix NPE." into udc-dev am: 7f958bd4

parents 1a81e5fa 7f958bd4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16353,6 +16353,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    // TODO(b/111541062): This method is only used for updating OOM adjustments. We need to update
    // the logic there and in mBatteryStatsService to make them aware of multiple resumed activities
    @Nullable
    ProcessRecord getTopApp() {
        final WindowProcessController wpc = mAtmInternal != null ? mAtmInternal.getTopApp() : null;
        final ProcessRecord r = wpc != null ? (ProcessRecord) wpc.mOwner : null;
+8 −3
Original line number Diff line number Diff line
@@ -3531,10 +3531,15 @@ final class ActivityManagerShellCommand extends ShellCommand {
            if (foregroundActivities) {
                try {
                    int prcState = mIam.getUidProcessState(uid, "android");
                    int topPid = mInternal.getTopApp().getPid();
                    ProcessRecord topApp = mInternal.getTopApp();
                    if (topApp == null) {
                        mPw.println("No top app found");
                    } else {
                        int topPid = topApp.getPid();
                        if (prcState == ProcessStateEnum.TOP && topPid == pid) {
                            mPw.println("New foreground process: " + pid);
                        }
                    }
                    mPw.flush();
                } catch (RemoteException e) {
                    mPw.println("Error occurred in binder call");