|
@@ -1331,10 +1331,17 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|
* This method is called by SDL using JNI.
|
|
* This method is called by SDL using JNI.
|
|
*/
|
|
*/
|
|
public static boolean isChromebook() {
|
|
public static boolean isChromebook() {
|
|
- if (getContext() == null) {
|
|
|
|
- return false;
|
|
|
|
|
|
+ // https://stackoverflow.com/questions/39784415/how-to-detect-programmatically-if-android-app-is-running-in-chrome-book-or-in
|
|
|
|
+ if (getContext() != null) {
|
|
|
|
+ if (getContext().getPackageManager().hasSystemFeature("org.chromium.arc")
|
|
|
|
+ || getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management")) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- return getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
|
|
|
|
|
|
+
|
|
|
|
+ // Running on AVD emulator
|
|
|
|
+ boolean isChromebookEmulator = (Build.MODEL != null && Build.MODEL.startsWith("sdk_gpc_"));
|
|
|
|
+ return isChromebookEmulator;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -2117,7 +2124,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|
int requestCode;
|
|
int requestCode;
|
|
boolean multipleChoice;
|
|
boolean multipleChoice;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* This method is called by SDL using JNI.
|
|
* This method is called by SDL using JNI.
|
|
*/
|
|
*/
|