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

Commit 719b1a75 authored by Chris Li's avatar Chris Li
Browse files

Disable WM Extensions on Watch

Watch supports multi window, but doesn't need any WM Extensions
feature.

Bug: 306666082
Test: atest CtsWindowManagerJetpackTestCases:SdkAvailabilityTest
Change-Id: I076162c4c317a7cb4fa4558a9878bb5cb6b26ef6
parent e52b99f0
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ import android.content.ClipData;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.PixelFormat;
@@ -1490,7 +1491,13 @@ public interface WindowManager extends ViewManager {
        }

        try {
            return ActivityTaskManager.supportsMultiWindow(ActivityThread.currentApplication());
            final Context context = ActivityThread.currentApplication();
            if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) {
                // Watch supports multi-window to present essential system UI, but it doesn't need
                // WM Extensions.
                return false;
            }
            return ActivityTaskManager.supportsMultiWindow(context);
        } catch (Exception e) {
            // In case the PackageManager is not set up correctly in test.
            Log.e("WindowManager", "Unable to read if the device supports multi window", e);