mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 708772 - (1/3) Add IsTablet method to AndroidBridge [r=dougt]
This commit is contained in:
parent
6d41c00c3d
commit
5868041d51
@ -1695,4 +1695,17 @@ public class GeckoAppShell
|
||||
public static void sendMessage(String aNumber, String aMessage) {
|
||||
GeckoSmsManager.send(aNumber, aMessage);
|
||||
}
|
||||
|
||||
public static boolean isTablet() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
|
||||
Configuration config = GeckoApp.mAppContext.getResources().getConfiguration();
|
||||
// xlarge is defined by android as screens larger than 960dp x 720dp
|
||||
// and should include most devices ~7in and up.
|
||||
// http://developer.android.com/guide/practices/screens_support.html
|
||||
if ((config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -156,6 +156,7 @@ AndroidBridge::Init(JNIEnv *jEnv,
|
||||
jPostToJavaThread = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "postToJavaThread", "(Z)V");
|
||||
jInitCamera = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "initCamera", "(Ljava/lang/String;III)[I");
|
||||
jCloseCamera = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "closeCamera", "()V");
|
||||
jIsTablet = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "isTablet", "()Z");
|
||||
jEnableBatteryNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "enableBatteryNotifications", "()V");
|
||||
jDisableBatteryNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "disableBatteryNotifications", "()V");
|
||||
jGetCurrentBatteryInformation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getCurrentBatteryInformation", "()[D");
|
||||
@ -1463,6 +1464,12 @@ AndroidBridge::UnlockWindow(void* window)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
AndroidBridge::IsTablet()
|
||||
{
|
||||
return mJNIEnv->CallStaticBooleanMethod(mGeckoAppShellClass, jIsTablet);
|
||||
}
|
||||
|
||||
/* Implementation file */
|
||||
NS_IMPL_ISUPPORTS1(nsAndroidBridge, nsIAndroidBridge)
|
||||
|
||||
|
@ -336,6 +336,8 @@ public:
|
||||
PRUint16 GetNumberOfMessagesForText(const nsAString& aText);
|
||||
void SendMessage(const nsAString& aNumber, const nsAString& aText);
|
||||
|
||||
bool IsTablet();
|
||||
|
||||
protected:
|
||||
static AndroidBridge *sBridge;
|
||||
|
||||
@ -411,6 +413,7 @@ protected:
|
||||
jmethodID jPostToJavaThread;
|
||||
jmethodID jInitCamera;
|
||||
jmethodID jCloseCamera;
|
||||
jmethodID jIsTablet;
|
||||
jmethodID jEnableBatteryNotifications;
|
||||
jmethodID jDisableBatteryNotifications;
|
||||
jmethodID jGetCurrentBatteryInformation;
|
||||
|
Loading…
Reference in New Issue
Block a user