Add advanced button to security & location page
Change-Id: I45977105d6ddabef8f2d9bdc7b46959af9cbbf0f Fixes: 36657221 Test: visual
This commit is contained in:
25
res/xml/security_settings_advanced_button.xml
Normal file
25
res/xml/security_settings_advanced_button.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2017 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<PreferenceScreen
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
|
||||||
|
android:key="security_dashboard_page"
|
||||||
|
android:title="@string/security_settings_title"
|
||||||
|
settings:initialExpandedChildrenCount="9">
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
@@ -59,6 +59,7 @@ import com.android.internal.widget.LockPatternUtils;
|
|||||||
import com.android.settings.TrustAgentUtils.TrustAgentComponentInfo;
|
import com.android.settings.TrustAgentUtils.TrustAgentComponentInfo;
|
||||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||||
import com.android.settings.dashboard.DashboardFeatureProvider;
|
import com.android.settings.dashboard.DashboardFeatureProvider;
|
||||||
|
import com.android.settings.dashboard.ProgressiveDisclosureMixin;
|
||||||
import com.android.settings.dashboard.SummaryLoader;
|
import com.android.settings.dashboard.SummaryLoader;
|
||||||
import com.android.settings.enterprise.EnterprisePrivacyPreferenceController;
|
import com.android.settings.enterprise.EnterprisePrivacyPreferenceController;
|
||||||
import com.android.settings.enterprise.ManageDeviceAdminPreferenceController;
|
import com.android.settings.enterprise.ManageDeviceAdminPreferenceController;
|
||||||
@@ -275,7 +276,11 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
if (root != null) {
|
if (root != null) {
|
||||||
root.removeAll();
|
root.removeAll();
|
||||||
}
|
}
|
||||||
addPreferencesFromResource(R.xml.security_settings);
|
if (ProgressiveDisclosureMixin.isV2Enabled()) {
|
||||||
|
addPreferencesFromResource(R.xml.security_settings);
|
||||||
|
} else {
|
||||||
|
addPreferencesFromResource(R.xml.security_settings_advanced_button);
|
||||||
|
}
|
||||||
root = getPreferenceScreen();
|
root = getPreferenceScreen();
|
||||||
|
|
||||||
// Add category for security status
|
// Add category for security status
|
||||||
|
@@ -106,7 +106,11 @@ public class ProgressiveDisclosureMixin implements Preference.OnPreferenceClickL
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return !FeatureFlagUtils.isEnabled(FEATURE_FLAG_NEW_ADVANCE_BUTTON);
|
return !isV2Enabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isV2Enabled() {
|
||||||
|
return FeatureFlagUtils.isEnabled(FEATURE_FLAG_NEW_ADVANCE_BUTTON);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user