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

Commit 6884fed0 authored by Adam He's avatar Adam He
Browse files

Added null checks for NPE on mSystemServerInterface

Bug: 119254124
Change-Id: Iebec84b414b2e156b9cdada05d66bfeb7f6caf05
Test: atest CtsContentCaptureServiceTestCases
parent d59bfa45
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -193,6 +193,8 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
        final int flags = 0; // TODO(b/111276913): get proper flags

        try {
            if (mSystemServerInterface == null) return;

            mSystemServerInterface.startSession(mContext.getUserId(), mApplicationToken,
                    componentName, mId, flags, new IResultReceiver.Stub() {
                        @Override
@@ -375,6 +377,8 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
        }

        try {
            if (mSystemServerInterface == null) return;

            mSystemServerInterface.finishSession(mContext.getUserId(), mId);
        } catch (RemoteException e) {
            Log.e(TAG, "Error destroying system-service session " + mId + " for "