Merge "Add advanced button to security & location page"

This commit is contained in:
TreeHugger Robot
2017-10-17 02:09:45 +00:00
committed by Android (Google) Code Review
3 changed files with 36 additions and 2 deletions

View 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>

View File

@@ -59,6 +59,7 @@ import com.android.internal.widget.LockPatternUtils;
import com.android.settings.TrustAgentUtils.TrustAgentComponentInfo;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.dashboard.DashboardFeatureProvider;
import com.android.settings.dashboard.ProgressiveDisclosureMixin;
import com.android.settings.dashboard.SummaryLoader;
import com.android.settings.enterprise.EnterprisePrivacyPreferenceController;
import com.android.settings.enterprise.ManageDeviceAdminPreferenceController;
@@ -275,7 +276,11 @@ public class SecuritySettings extends SettingsPreferenceFragment
if (root != null) {
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();
// Add category for security status

View File

@@ -106,7 +106,11 @@ public class ProgressiveDisclosureMixin implements Preference.OnPreferenceClickL
}
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);
}
/**