CB-11694 Android: Set hadwareBackButton value according option in cordova.InAppBrowser.open

HadwareBackButton value persists across usages. By default hardwareBack value is null. In this case we should set hadwareBackButton  to default value.

 This closes #188
This commit is contained in:
Nikita Matrosov
2016-09-20 10:23:37 +03:00
committed by Vladimir Kotikov
parent c81a64a21c
commit 2df0e72c36
2 changed files with 22 additions and 2 deletions
+4 -1
View File
@@ -87,6 +87,7 @@ public class InAppBrowser extends CordovaPlugin {
private static final String HARDWARE_BACK_BUTTON = "hardwareback";
private static final String MEDIA_PLAYBACK_REQUIRES_USER_ACTION = "mediaPlaybackRequiresUserAction";
private static final String SHOULD_PAUSE = "shouldPauseOnSuspend";
private static final Boolean DEFAULT_HARDWARE_BACK = true;
private InAppBrowserDialog dialog;
private WebView inAppWebView;
@@ -521,7 +522,9 @@ public class InAppBrowser extends CordovaPlugin {
Boolean hardwareBack = features.get(HARDWARE_BACK_BUTTON);
if (hardwareBack != null) {
hadwareBackButton = hardwareBack.booleanValue();
}
} else {
hadwareBackButton = DEFAULT_HARDWARE_BACK;
}
Boolean mediaPlayback = features.get(MEDIA_PLAYBACK_REQUIRES_USER_ACTION);
if (mediaPlayback != null) {
mediaPlaybackRequiresUserGesture = mediaPlayback.booleanValue();