forked from github/cordova-android
Merge branch 'master' into 4.0.x (volume stream & setMediaPlaybackRequiresUserGesture)
Conflicts: framework/src/org/apache/cordova/CordovaActivity.java framework/src/org/apache/cordova/CordovaWebView.java
This commit is contained in:
commit
12bf07d560
@ -186,8 +186,12 @@ public class AndroidWebView extends WebView implements CordovaWebView {
|
|||||||
|
|
||||||
// Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist
|
// Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist
|
||||||
// while we do this
|
// while we do this
|
||||||
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
Level16Apis.enableUniversalAccess(settings);
|
Level16Apis.enableUniversalAccess(settings);
|
||||||
|
}
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||||
|
Level17Apis.setMediaPlaybackRequiresUserGesture(settings, false);
|
||||||
|
}
|
||||||
// Enable database
|
// Enable database
|
||||||
// We keep this disabled because we use or shim to get around DOM_EXCEPTION_ERROR_16
|
// We keep this disabled because we use or shim to get around DOM_EXCEPTION_ERROR_16
|
||||||
String databasePath = getContext().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
|
String databasePath = getContext().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
|
||||||
@ -642,6 +646,12 @@ public class AndroidWebView extends WebView implements CordovaWebView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(17)
|
||||||
|
private static final class Level17Apis {
|
||||||
|
static void setMediaPlaybackRequiresUserGesture(WebSettings settings, boolean value) {
|
||||||
|
settings.setMediaPlaybackRequiresUserGesture(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
public void printBackForwardList() {
|
public void printBackForwardList() {
|
||||||
WebBackForwardList currentList = this.copyBackForwardList();
|
WebBackForwardList currentList = this.copyBackForwardList();
|
||||||
int currentSize = currentList.getSize();
|
int currentSize = currentList.getSize();
|
||||||
|
@ -173,9 +173,11 @@ public class CordovaActivity extends Activity implements CordovaInterface {
|
|||||||
}
|
}
|
||||||
createViews();
|
createViews();
|
||||||
|
|
||||||
// TODO: Make this a preference (CB-6153)
|
// Wire the hardware volume controls to control media if desired.
|
||||||
// Setup the hardware volume controls to handle volume control
|
String volumePref = preferences.getString("DefaultVolumeStream", "");
|
||||||
setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
if ("media".equals(volumePref.toLowerCase(Locale.ENGLISH))) {
|
||||||
|
setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
|
Loading…
Reference in New Issue
Block a user