mirror of
https://github.com/sdkcarlos/cordova-ourcodeworld-preventscreenshots.git
synced 2025-02-26 20:47:49 +08:00
Fix honeycomb
This commit is contained in:
parent
3084445737
commit
b21e75ad86
@ -19,8 +19,10 @@ public class OurCodeWorldpreventscreenshots extends CordovaPlugin {
|
|||||||
public void run() {
|
public void run() {
|
||||||
try{
|
try{
|
||||||
// Allow to make screenshots removing the FLAG_SECURE
|
// Allow to make screenshots removing the FLAG_SECURE
|
||||||
cordova.getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||||
|
cordova.getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||||
|
}
|
||||||
|
|
||||||
PluginResult result = new PluginResult(PluginResult.Status.OK, "");
|
PluginResult result = new PluginResult(PluginResult.Status.OK, "");
|
||||||
result.setKeepCallback(true);
|
result.setKeepCallback(true);
|
||||||
callbacks.sendPluginResult(result);
|
callbacks.sendPluginResult(result);
|
||||||
@ -36,8 +38,10 @@ public class OurCodeWorldpreventscreenshots extends CordovaPlugin {
|
|||||||
public void run() {
|
public void run() {
|
||||||
try{
|
try{
|
||||||
// Disable the creation of screenshots adding the FLAG_SECURE to the window
|
// Disable the creation of screenshots adding the FLAG_SECURE to the window
|
||||||
cordova.getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
|
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||||
WindowManager.LayoutParams.FLAG_SECURE);
|
cordova.getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
|
||||||
|
WindowManager.LayoutParams.FLAG_SECURE);
|
||||||
|
}
|
||||||
|
|
||||||
PluginResult result = new PluginResult(PluginResult.Status.OK, "");
|
PluginResult result = new PluginResult(PluginResult.Status.OK, "");
|
||||||
result.setKeepCallback(true);
|
result.setKeepCallback(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user