Add Tapjacking Protection for SettingsHomepageActivity

Add/remove the SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS flag into/from
SettingsHomepageActivity and SettingsPanelActivity with lifecycle.

Bug: 138442483
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.homepage
      make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.panel
      manual test
Change-Id: I72f9a947f57f74a8c09127d6c39173594c248ddc
This commit is contained in:
Sunny Shao
2019-07-31 13:19:23 +08:00
parent 5939f73740
commit 647e49e7cf
4 changed files with 132 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ import androidx.fragment.app.FragmentManager;
import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.core.HideNonSystemOverlayMixin;
/**
* Dialog Activity to host Settings Slices.
@@ -62,6 +63,7 @@ public class SettingsPanelActivity extends FragmentActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
createOrUpdatePanel(true /* shouldForceCreation */);
getLifecycle().addObserver(new HideNonSystemOverlayMixin(this));
}
@Override