Commit 19cedfa2 authored by Ryan Landay's avatar Ryan Landay Committed by Commit Bot

Add ApiCompatibilityUtils#isInMultiWindowMode()

Based on MultiWindowUtils#isInMultiWindowMode() (which is in
org.chromium.chrome code, and therefore can't be used in the content layer),
but with simpler implementation.

We should probably update callers of MultiWindowUtils#isInMultiWindowMode() at
some point to use this method instead and then remove that method.

Bug: 
Change-Id: Ibb20fccf706368dd054541ce769855e1e24266ba
Reviewed-on: https://chromium-review.googlesource.com/578390Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Commit-Queue: Ryan Landay <rlanday@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488007}
parent 0820394a
...@@ -671,6 +671,17 @@ public class ApiCompatibilityUtils { ...@@ -671,6 +671,17 @@ public class ApiCompatibilityUtils {
} }
} }
/**
* @param activity The {@link Activity} to check.
* @return Whether or not {@code activity} is currently in Android N+ multi-window mode.
*/
public static boolean isInMultiWindowMode(Activity activity) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
return false;
}
return activity.isInMultiWindowMode();
}
/** /**
* Null-safe equivalent of {@code a.equals(b)}. * Null-safe equivalent of {@code a.equals(b)}.
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment