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

Commit 39c015a1 authored by Robin Lee's avatar Robin Lee
Browse files

Don't worry about mWmInternal being null

It's not an optional service like DevicePolicyManager so
it's OK to requireNonNull and skip null checks.

Change-Id: I15dbd67e9698cb2f03304a35f8f6a97f1109ce8f
parent db7264ed
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -181,7 +181,8 @@ public class VoiceInteractionManagerService extends SystemService {
                LocalServices.getService(ActivityManagerInternal.class));
        mAtmInternal = Objects.requireNonNull(
                LocalServices.getService(ActivityTaskManagerInternal.class));
        mWmInternal = LocalServices.getService(WindowManagerInternal.class);
        mWmInternal = Objects.requireNonNull(
                LocalServices.getService(WindowManagerInternal.class));
        mDpmInternal = LocalServices.getService(DevicePolicyManagerInternal.class);
        LegacyPermissionManagerInternal permissionManagerInternal = LocalServices.getService(
                LegacyPermissionManagerInternal.class);
@@ -2753,12 +2754,8 @@ public class VoiceInteractionManagerService extends SystemService {
                    isManagedProfileVisible = true;
                }
            }
            final ScreenCapture.ScreenshotHardwareBuffer shb;
            if (mWmInternal != null) {
                shb = mWmInternal.takeAssistScreenshot();
            } else {
                shb = null;
            }
            final ScreenCapture.ScreenshotHardwareBuffer shb =
                    mWmInternal.takeAssistScreenshot();
            final Bitmap bm = shb != null ? shb.asBitmap() : null;
            // Now that everything is fetched, putting it in the launchIntent.
            if (bm != null) {