Merge auto-rotate comment/style fixes from tm-dev that couldn't be cherry picked into master

Test: none

Bug: 230378938
Change-Id: Ia0e9e5bf25d005aa6b8ccaa07a1901779b88588c
This commit is contained in:
Abel Tesfaye
2022-04-25 23:13:20 +00:00
parent 79463db83b
commit 939e0e0d9d
2 changed files with 3 additions and 13 deletions

View File

@@ -17,13 +17,11 @@
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/accelerometer_title" > android:title="@string/accelerometer_title" >
<com.android.settingslib.widget.TopIntroPreference <com.android.settingslib.widget.TopIntroPreference
android:title="@string/auto_rotate_screen_summary" android:title="@string/auto_rotate_screen_summary"/>
app:allowDividerAbove="false"/>
<com.android.settingslib.widget.MainSwitchPreference <com.android.settingslib.widget.MainSwitchPreference
android:key="auto_rotate_main_switch" android:key="auto_rotate_main_switch"
@@ -58,10 +56,9 @@
settings:controller="com.android.settings.display.SmartAutoRotateController" /> settings:controller="com.android.settings.display.SmartAutoRotateController" />
<com.android.settingslib.widget.FooterPreference <com.android.settingslib.widget.FooterPreference
android:order="100"
android:key="auto_rotate_footer_preference" android:key="auto_rotate_footer_preference"
android:title="@string/smart_rotate_text_headline" android:title="@string/smart_rotate_text_headline"
android:selectable="true" android:selectable="false"
settings:searchable="false"/> settings:searchable="false"/>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -70,13 +70,6 @@ public class SmartAutoRotatePreferenceFragment extends DashboardFragment {
); );
} }
@Override
public void onStart() {
super.onStart();
setupFooter();
}
@Override @Override
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) { protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return DeviceStateAutoRotationHelper.createPreferenceControllers(context); return DeviceStateAutoRotationHelper.createPreferenceControllers(context);
@@ -91,6 +84,7 @@ public class SmartAutoRotatePreferenceFragment extends DashboardFragment {
final Preference footerPreference = findPreference(KEY_FOOTER_PREFERENCE); final Preference footerPreference = findPreference(KEY_FOOTER_PREFERENCE);
if (footerPreference != null) { if (footerPreference != null) {
footerPreference.setVisible(isRotationResolverServiceAvailable(activity)); footerPreference.setVisible(isRotationResolverServiceAvailable(activity));
setupFooter();
} }
return view; return view;
} }
@@ -135,7 +129,6 @@ public class SmartAutoRotatePreferenceFragment extends DashboardFragment {
void addHelpLink() { void addHelpLink() {
final FooterPreference pref = findPreference(KEY_FOOTER_PREFERENCE); final FooterPreference pref = findPreference(KEY_FOOTER_PREFERENCE);
if (pref != null) { if (pref != null) {
pref.setSelectable(false);
pref.setLearnMoreAction(v -> { pref.setLearnMoreAction(v -> {
startActivityForResult(HelpUtils.getHelpIntent(getContext(), startActivityForResult(HelpUtils.getHelpIntent(getContext(),
getString(getHelpResource()), getString(getHelpResource()),