Remove silky flag from System for official release
Remove the silky condition and clean up redundant files. Bug: 183670633 Test: robotests & visual Change-Id: I2743a65869c4fe2ea684e259373ddc309dea59c3
This commit is contained in:
@@ -18,16 +18,14 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:key="system_dashboard_screen"
|
||||
android:title="@string/header_category_system"
|
||||
settings:initialExpandedChildrenCount="4">
|
||||
android:title="@string/header_category_system">
|
||||
|
||||
<Preference
|
||||
android:key="language_input_settings"
|
||||
android:title="@string/language_settings"
|
||||
android:icon="@drawable/ic_settings_language"
|
||||
android:order="-260"
|
||||
android:fragment="com.android.settings.language.LanguageAndInputSettings"
|
||||
settings:controller="com.android.settings.language.LanguageAndInputPreferenceController"/>
|
||||
android:fragment="com.android.settings.language.LanguageAndInputSettings"/>
|
||||
|
||||
<Preference
|
||||
android:key="gesture_settings"
|
||||
@@ -45,35 +43,33 @@
|
||||
android:fragment="com.android.settings.datetime.DateTimeSettings"
|
||||
settings:controller="com.android.settings.datetime.DateTimePreferenceController"/>
|
||||
|
||||
<Preference
|
||||
android:key="reset_dashboard"
|
||||
android:title="@string/reset_dashboard_title"
|
||||
android:summary="@string/reset_dashboard_summary"
|
||||
android:icon="@drawable/ic_restore"
|
||||
android:order="-50"
|
||||
android:fragment="com.android.settings.system.ResetDashboardFragment"
|
||||
settings:controller="com.android.settings.system.ResetPreferenceController"/>
|
||||
|
||||
<!-- System updates -->
|
||||
<Preference
|
||||
android:key="system_update_settings"
|
||||
android:title="@string/system_update_settings_list_item_title"
|
||||
android:summary="@string/summary_placeholder"
|
||||
android:icon="@drawable/ic_system_update"
|
||||
android:order="-30"
|
||||
settings:keywords="@string/keywords_system_update_settings"
|
||||
settings:controller="com.android.settings.system.SystemUpdatePreferenceController">
|
||||
<intent android:action="android.settings.SYSTEM_UPDATE_SETTINGS"/>
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:key="additional_system_update_settings"
|
||||
android:title="@string/additional_system_update_settings_list_item_title"
|
||||
android:order="-31"
|
||||
android:order="-59"
|
||||
settings:controller="com.android.settings.system.AdditionalSystemUpdatePreferenceController">
|
||||
<intent android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="@string/additional_system_update"
|
||||
android:targetClass="@string/additional_system_update_menu"/>
|
||||
</Preference>
|
||||
|
||||
</PreferenceScreen>
|
||||
<Preference
|
||||
android:key="system_update_settings"
|
||||
android:title="@string/system_update_settings_list_item_title"
|
||||
android:summary="@string/summary_placeholder"
|
||||
android:icon="@drawable/ic_system_update"
|
||||
android:order="-58"
|
||||
settings:keywords="@string/keywords_system_update_settings"
|
||||
settings:controller="com.android.settings.system.SystemUpdatePreferenceController">
|
||||
<intent android:action="android.settings.SYSTEM_UPDATE_SETTINGS"/>
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:key="reset_dashboard"
|
||||
android:title="@string/reset_dashboard_title"
|
||||
android:icon="@drawable/ic_restore"
|
||||
android:order="-30"
|
||||
android:fragment="com.android.settings.system.ResetDashboardFragment"
|
||||
settings:controller="com.android.settings.system.ResetPreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
|
@@ -1,75 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2021 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-auto"
|
||||
android:key="system_dashboard_screen"
|
||||
android:title="@string/header_category_system">
|
||||
|
||||
<Preference
|
||||
android:key="language_input_settings"
|
||||
android:title="@string/language_settings"
|
||||
android:icon="@drawable/ic_settings_language"
|
||||
android:order="-260"
|
||||
android:fragment="com.android.settings.language.LanguageAndInputSettings"/>
|
||||
|
||||
<Preference
|
||||
android:key="gesture_settings"
|
||||
android:title="@string/gesture_preference_title"
|
||||
android:icon="@drawable/ic_settings_gestures"
|
||||
android:order="-250"
|
||||
android:fragment="com.android.settings.gestures.GestureSettings"
|
||||
settings:controller="com.android.settings.gestures.GesturesSettingPreferenceController"/>
|
||||
|
||||
<Preference
|
||||
android:key="date_time_settings"
|
||||
android:title="@string/date_and_time"
|
||||
android:icon="@drawable/ic_settings_date_time"
|
||||
android:order="-240"
|
||||
android:fragment="com.android.settings.datetime.DateTimeSettings"
|
||||
settings:controller="com.android.settings.datetime.DateTimePreferenceController"/>
|
||||
|
||||
<!-- System updates -->
|
||||
<Preference
|
||||
android:key="system_update_settings"
|
||||
android:title="@string/system_update_settings_list_item_title"
|
||||
android:summary="@string/summary_placeholder"
|
||||
android:icon="@drawable/ic_system_update"
|
||||
android:order="-58"
|
||||
settings:keywords="@string/keywords_system_update_settings"
|
||||
settings:controller="com.android.settings.system.SystemUpdatePreferenceController">
|
||||
<intent android:action="android.settings.SYSTEM_UPDATE_SETTINGS"/>
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:key="additional_system_update_settings"
|
||||
android:title="@string/additional_system_update_settings_list_item_title"
|
||||
android:order="-59"
|
||||
settings:controller="com.android.settings.system.AdditionalSystemUpdatePreferenceController">
|
||||
<intent android:action="android.intent.action.MAIN"
|
||||
android:targetPackage="@string/additional_system_update"
|
||||
android:targetClass="@string/additional_system_update_menu"/>
|
||||
</Preference>
|
||||
|
||||
<Preference
|
||||
android:key="reset_dashboard"
|
||||
android:title="@string/reset_dashboard_title"
|
||||
android:icon="@drawable/ic_restore"
|
||||
android:order="-30"
|
||||
android:fragment="com.android.settings.system.ResetDashboardFragment"
|
||||
settings:controller="com.android.settings.system.ResetPreferenceController"/>
|
||||
</PreferenceScreen>
|
@@ -16,19 +16,13 @@
|
||||
|
||||
package com.android.settings.gestures;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.hardware.display.AmbientDisplayConfiguration;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.aware.AwareFeatureProvider;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
|
||||
@@ -85,37 +79,4 @@ public class GesturesSettingPreferenceController extends BasePreferenceControlle
|
||||
controllers.add(new PreventRingingParentPreferenceController(context, FAKE_PREF_KEY));
|
||||
return controllers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
if (FeatureFlagUtils.isEnabled(mContext, FeatureFlags.SILKY_HOME)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!mFeatureProvider.isSensorAvailable(mContext)) {
|
||||
return "";
|
||||
}
|
||||
final ContentResolver contentResolver = mContext.getContentResolver();
|
||||
final boolean assistGestureEnabled = Settings.Secure.getInt(
|
||||
contentResolver, Settings.Secure.ASSIST_GESTURE_ENABLED, 1) != 0;
|
||||
final boolean assistGestureSilenceEnabled = Settings.Secure.getInt(
|
||||
contentResolver, Settings.Secure.ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, 1) != 0;
|
||||
final boolean sensorSupported = mFeatureProvider.isSupported(mContext);
|
||||
|
||||
final CharSequence awareSummary = mAwareFeatureProvider.getGestureSummary(mContext,
|
||||
sensorSupported, assistGestureEnabled, assistGestureSilenceEnabled);
|
||||
if (!TextUtils.isEmpty(awareSummary)) {
|
||||
return awareSummary;
|
||||
}
|
||||
|
||||
if (sensorSupported && assistGestureEnabled) {
|
||||
return mContext.getText(
|
||||
R.string.language_input_gesture_summary_on_with_assist);
|
||||
}
|
||||
if (assistGestureSilenceEnabled) {
|
||||
return mContext.getText(
|
||||
R.string.language_input_gesture_summary_on_non_assist);
|
||||
}
|
||||
return mContext.getText(R.string.language_input_gesture_summary_off);
|
||||
}
|
||||
}
|
||||
|
@@ -17,11 +17,9 @@ package com.android.settings.system;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.UserManager;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.network.NetworkResetPreferenceController;
|
||||
|
||||
public class ResetPreferenceController extends BasePreferenceController {
|
||||
@@ -42,17 +40,4 @@ public class ResetPreferenceController extends BasePreferenceController {
|
||||
return mContext.getResources().getBoolean(R.bool.config_show_reset_dashboard)
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
if (FeatureFlagUtils.isEnabled(mContext, FeatureFlags.SILKY_HOME)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!mNetworkReset.isAvailable() && !mFactpruReset.isAvailable()) {
|
||||
return mContext.getText(R.string.reset_dashboard_summary_onlyApps);
|
||||
}
|
||||
|
||||
return mContext.getText(R.string.reset_dashboard_summary);
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@ import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.Preference;
|
||||
@@ -27,7 +26,6 @@ import androidx.preference.PreferenceGroup;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.dashboard.DashboardFragment;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
@@ -77,9 +75,6 @@ public class SystemDashboardFragment extends DashboardFragment {
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)) {
|
||||
return R.xml.system_dashboard_fragment_v2;
|
||||
}
|
||||
return R.xml.system_dashboard_fragment;
|
||||
}
|
||||
|
||||
@@ -110,8 +105,7 @@ public class SystemDashboardFragment extends DashboardFragment {
|
||||
public List<SearchIndexableResource> getXmlResourcesToIndex(
|
||||
Context context, boolean enabled) {
|
||||
final SearchIndexableResource sir = new SearchIndexableResource(context);
|
||||
sir.xmlResId = FeatureFlagUtils.isEnabled(context, FeatureFlags.SILKY_HOME)
|
||||
? R.xml.system_dashboard_fragment_v2 : R.xml.system_dashboard_fragment;
|
||||
sir.xmlResId = R.xml.system_dashboard_fragment;
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
};
|
||||
|
@@ -20,22 +20,9 @@ import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.provider.Settings;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settings.testutils.shadow.ShadowSecureSettings;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -46,7 +33,6 @@ import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Config;
|
||||
import org.robolectric.util.ReflectionHelpers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -57,8 +43,6 @@ public class GesturesSettingsPreferenceControllerTest {
|
||||
|
||||
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
||||
private Activity mActivity;
|
||||
@Mock
|
||||
private Preference mPreference;
|
||||
|
||||
private GesturesSettingPreferenceController mController;
|
||||
|
||||
@@ -67,7 +51,6 @@ public class GesturesSettingsPreferenceControllerTest {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
FakeFeatureFactory.setupForTest();
|
||||
mController = new GesturesSettingPreferenceController(mActivity);
|
||||
FeatureFlagUtils.setEnabled(RuntimeEnvironment.application, FeatureFlags.SILKY_HOME, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -96,43 +79,4 @@ public class GesturesSettingsPreferenceControllerTest {
|
||||
|
||||
assertThat(mController.isAvailable()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(shadows = ShadowSecureSettings.class)
|
||||
public void updateState_assistSupported_shouldSetToAssistGestureStatus() {
|
||||
final FakeFeatureFactory featureFactory =
|
||||
(FakeFeatureFactory) FakeFeatureFactory.getFactory(mActivity);
|
||||
when(featureFactory.assistGestureFeatureProvider.isSupported(any(Context.class)))
|
||||
.thenReturn(true);
|
||||
when(featureFactory.assistGestureFeatureProvider.isSensorAvailable(any(Context.class)))
|
||||
.thenReturn(true);
|
||||
|
||||
final ContentResolver cr = mActivity.getContentResolver();
|
||||
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_ENABLED, 0);
|
||||
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, 0);
|
||||
mController.updateState(mPreference);
|
||||
verify(mActivity).getText(R.string.language_input_gesture_summary_off);
|
||||
|
||||
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_ENABLED, 1);
|
||||
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, 0);
|
||||
mController.updateState(mPreference);
|
||||
verify(mActivity).getText(R.string.language_input_gesture_summary_on_with_assist);
|
||||
|
||||
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_ENABLED, 0);
|
||||
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, 1);
|
||||
mController.updateState(mPreference);
|
||||
verify(mActivity).getText(R.string.language_input_gesture_summary_on_non_assist);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(shadows = ShadowSecureSettings.class)
|
||||
public void updateState_sensorNotAvailable_shouldSetToEmptyStatus() {
|
||||
final FakeFeatureFactory featureFactory =
|
||||
(FakeFeatureFactory) FakeFeatureFactory.getFactory(mActivity);
|
||||
when(featureFactory.assistGestureFeatureProvider.isSensorAvailable(any(Context.class)))
|
||||
.thenReturn(false);
|
||||
|
||||
mController.updateState(mPreference);
|
||||
verify(mPreference).setSummary("");
|
||||
}
|
||||
}
|
||||
|
@@ -18,14 +18,6 @@ package com.android.settings.system;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.UserInfo;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.Settings;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.testutils.shadow.ShadowUserManager;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -35,11 +27,9 @@ import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@Config(shadows = ShadowUserManager.class)
|
||||
public class ResetPreferenceControllerTest {
|
||||
|
||||
private static final String KEY_RESET_DASHBOARD = "reset_dashboard";
|
||||
private ShadowUserManager mShadowUserManager;
|
||||
|
||||
private Context mContext;
|
||||
private ResetPreferenceController mController;
|
||||
@@ -48,8 +38,6 @@ public class ResetPreferenceControllerTest {
|
||||
public void setUp() {
|
||||
mContext = RuntimeEnvironment.application;
|
||||
mController = new ResetPreferenceController(mContext, KEY_RESET_DASHBOARD);
|
||||
mShadowUserManager = ShadowUserManager.getShadow();
|
||||
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.SILKY_HOME, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -62,35 +50,4 @@ public class ResetPreferenceControllerTest {
|
||||
public void isAvailable_ifNotVisible_false() {
|
||||
assertThat(mController.isAvailable()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSummary_systemUser_shouldReturnFullSummary() {
|
||||
mShadowUserManager.setIsAdminUser(true);
|
||||
|
||||
assertThat(mController.getSummary()).isEqualTo(
|
||||
mContext.getString(R.string.reset_dashboard_summary));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSummary_nonSystemUser_shouldReturnAppsSummary() {
|
||||
mShadowUserManager.setIsAdminUser(false);
|
||||
mShadowUserManager.setIsDemoUser(false);
|
||||
|
||||
assertThat(mController.getSummary()).isEqualTo(
|
||||
mContext.getString(R.string.reset_dashboard_summary_onlyApps));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSummary_demoUser_shouldReturnFullSummary() {
|
||||
mShadowUserManager.setIsAdminUser(false);
|
||||
|
||||
// Place the device in demo mode.
|
||||
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.DEVICE_DEMO_MODE, 1);
|
||||
|
||||
// Indicate the user is a demo user.
|
||||
mShadowUserManager.addUser(UserHandle.myUserId(), "test", UserInfo.FLAG_DEMO);
|
||||
|
||||
assertThat(mController.getSummary()).isEqualTo(
|
||||
mContext.getString(R.string.reset_dashboard_summary));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user