Disable the control of draw over permission for SystemUI

Bug: 31077838
Test: make SettingsTests && adb install -r \
${OUT}/data/app/SettingsTests/SettingsTests.apk \
&& adb shell am instrument -w  \
'com.android.settings.tests/android.support.test.runner.AndroidJUnitRunner'

Change-Id: I760590f5558f2d686ffbfe78234a8b08e13883fd
This commit is contained in:
jackqdyulei
2016-09-19 10:00:49 -07:00
parent ad7023a406
commit 0162daa651
3 changed files with 74 additions and 1 deletions

View File

@@ -144,7 +144,7 @@ public class DrawOverlayDetails extends AppInfoWithHeader implements OnPreferenc
boolean isAllowed = mOverlayState.isPermissible();
mSwitchPref.setChecked(isAllowed);
// you cannot ask a user to grant you a permission you did not have!
mSwitchPref.setEnabled(mOverlayState.permissionDeclared);
mSwitchPref.setEnabled(mOverlayState.permissionDeclared && mOverlayState.controlEnabled);
mOverlayPrefs.setEnabled(isAllowed);
getPreferenceScreen().removePreference(mOverlayPrefs);