Enable the filterTouchesWhenObscured in Special app access

- Enable the filterTouchesWhenObscured attribute on all toggle
  switches in all pages of the special app access

Fixes: 155288585
Test: make RunSettingsRoboTests
Change-Id: I011cfe4b7e4e624a8338332ac47a353f7f3ab661
This commit is contained in:
Sunny Shao
2020-05-27 17:21:24 +08:00
parent 1e0789355e
commit ee4ec4b33f
14 changed files with 157 additions and 33 deletions

View File

@@ -17,7 +17,9 @@
package com.android.settings.widget;
import android.content.Context;
import android.view.View;
import androidx.preference.PreferenceViewHolder;
import androidx.preference.SwitchPreference;
import com.android.settings.R;
@@ -28,4 +30,13 @@ public class AppSwitchPreference extends SwitchPreference {
super(context);
setLayoutResource(R.layout.preference_app);
}
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
final View switchView = holder.findViewById(android.R.id.switch_widget);
if (switchView != null) {
switchView.setFilterTouchesWhenObscured(true);
}
}
}