mirror of
https://github.com/sdkcarlos/cordova-ourcodeworld-preventscreenshots.git
synced 2025-02-26 12:02:56 +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() {
|
||||
try{
|
||||
// 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, "");
|
||||
result.setKeepCallback(true);
|
||||
callbacks.sendPluginResult(result);
|
||||
@ -36,8 +38,10 @@ public class OurCodeWorldpreventscreenshots extends CordovaPlugin {
|
||||
public void run() {
|
||||
try{
|
||||
// Disable the creation of screenshots adding the FLAG_SECURE to the window
|
||||
cordova.getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
|
||||
WindowManager.LayoutParams.FLAG_SECURE);
|
||||
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
cordova.getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
|
||||
WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
|
||||
PluginResult result = new PluginResult(PluginResult.Status.OK, "");
|
||||
result.setKeepCallback(true);
|
||||
|
Loading…
Reference in New Issue
Block a user