Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d24f2895 authored by YUKAI HUNG's avatar YUKAI HUNG Committed by Android (Google) Code Review
Browse files

Merge "[Security] resolve overlay attack on RequestIgnoreBatteryOptimizations" into sc-v2-dev

parents 93f6df76 a8a2075f
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ public class RequestIgnoreBatteryOptimizations extends AlertActivity implements
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().addSystemFlags(android.view.WindowManager.LayoutParams
                .SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);

        mPowerWhitelistManager = getSystemService(PowerWhitelistManager.class);

@@ -98,13 +100,6 @@ public class RequestIgnoreBatteryOptimizations extends AlertActivity implements
        setupAlert();
    }

    @Override
    protected void onStart() {
        super.onStart();
        getWindow().addSystemFlags(android.view.WindowManager.LayoutParams
                .SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
    }

    @Override
    public void onClick(DialogInterface dialog, int which) {
        switch (which) {