[Security] resolve overlay attack on RequestIgnoreBatteryOptimizations
we should put the addSystemFlags() after onCreate() method rather than the original onStart() method (refer the proposed solution in b/199167909) Bug: 199167909 Test: make SettingsRoboTests Change-Id: Ic7361443bfa2e1a6d8d962708c794fa0122a691c
This commit is contained in:
@@ -41,6 +41,8 @@ public class RequestIgnoreBatteryOptimizations extends AlertActivity implements
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
getWindow().addSystemFlags(android.view.WindowManager.LayoutParams
|
||||||
|
.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
|
||||||
|
|
||||||
mPowerWhitelistManager = getSystemService(PowerWhitelistManager.class);
|
mPowerWhitelistManager = getSystemService(PowerWhitelistManager.class);
|
||||||
|
|
||||||
@@ -94,13 +96,6 @@ public class RequestIgnoreBatteryOptimizations extends AlertActivity implements
|
|||||||
setupAlert();
|
setupAlert();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStart() {
|
|
||||||
super.onStart();
|
|
||||||
getWindow().addSystemFlags(android.view.WindowManager.LayoutParams
|
|
||||||
.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
switch (which) {
|
switch (which) {
|
||||||
|
Reference in New Issue
Block a user