Make sure FLAG_SECURE is set on all activities when activated
This commit is contained in:
parent
a09b1ecb58
commit
0922953bca
@ -127,9 +127,7 @@ public class FDroidApp extends Application {
|
||||
|
||||
public void applyTheme(Activity activity) {
|
||||
activity.setTheme(getCurThemeResId());
|
||||
if (Preferences.get().preventScreenshots()) {
|
||||
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
setSecureWindow(activity);
|
||||
}
|
||||
|
||||
public static int getCurThemeResId() {
|
||||
@ -147,6 +145,13 @@ public class FDroidApp extends Application {
|
||||
|
||||
public void applyDialogTheme(Activity activity) {
|
||||
activity.setTheme(getCurDialogThemeResId());
|
||||
setSecureWindow(activity);
|
||||
}
|
||||
|
||||
public void setSecureWindow(Activity activity) {
|
||||
if (Preferences.get().preventScreenshots()) {
|
||||
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
}
|
||||
|
||||
private static int getCurDialogThemeResId() {
|
||||
|
@ -163,6 +163,7 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
((FDroidApp) getApplication()).setSecureWindow(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// The server should not be doing anything or occupying any (noticeable) resources
|
||||
|
Loading…
x
Reference in New Issue
Block a user