Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43ded696 authored by Neil Fuller's avatar Neil Fuller
Browse files

UI changes to support time feedback

The feature is behind a release flag. It is also behind an experiment
flag so it can be trialed with Googlers before general release even
after being enabled in a release.

The feedback button only shows up if there is an intent URI configured,
which should be handled via an overlay. The design means that the intent
is potentially dependent on the manufacturer (good!), though I expect we
will suggest a standard one for GMS devices so we get feedback from a
variety of devices with different form factors / capabilities.
In this default, GMS core (Google Play Services) will handle the intent
and take the user through a feedback UI flow.

Testing:

To enable the button you need to build with one of release variants that
supports dynamic flags, e.g. trunk_food.

Then release flag:
$ adb shell device_config put location com.android.settings.flags.datetime_feedback true

It still won't work without the experiment flag:
$ adb shell device_config put settings_ui time_help_and_feedback_feature_supported true

Finally, the settings entry will launch an intent when pressed which has
to have a receiver. The receiver will be in GMS core but will be subject
to its own review / launch process. Until then, this feature will remain
quiet, biding its time.

Bug: 283239837
Test: Manual (see above)
Test: atest SettingsRoboTests:com.android.settings.datetime
Change-Id: I68798798fc0a47ae4c6755174ce509fbaee24142
parent 958d17bb
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
package: "com.android.settings.flags"
container: "system"

flag {
    name: "datetime_feedback"
    # "location" is used by the Android System Time team for feature flags.
    namespace: "location"
    description: "Enable the time feedback feature, a button to launch feedback in Date & Time Settings"
    bug: "283239837"
}
+3 −0
Original line number Diff line number Diff line
@@ -812,4 +812,7 @@
    <!-- Array of carrier id that uses reusable activation code-->
    <integer-array name="config_carrier_use_rac" translatable="false">
    </integer-array>

    <!-- The Activity intent to trigger to launch time-related feedback. -->
    <string name="config_time_feedback_intent_uri" translatable="false" />
</resources>
+9 −0
Original line number Diff line number Diff line
@@ -611,6 +611,15 @@
    <!-- The menu item to switch to selecting a time zone with a fixed offset (such as UTC or GMT+0200) [CHAR LIMIT=30] -->
    <string name="zone_menu_by_offset">Select by UTC offset</string>
    <!-- The settings category title containing the feedback button [CHAR LIMIT=30] -->
    <string name="time_feedback_category_title">Feedback</string>
    <!-- Search keywords for the feedback category / section in Date & Time settings. [CHAR_LIMIT=NONE] -->
    <string name="keywords_time_feedback_category">feedback, bug, time, zone, timezone</string>
    <!-- The menu item to start the feedback process [CHAR LIMIT=30] -->
    <string name="time_feedback_title">Send feedback about time</string>
    <!-- Search keywords for the feedback option in Date & Time settings. [CHAR_LIMIT=NONE] -->
    <string name="keywords_time_feedback">feedback, bug, time, zone, timezone</string>
    <!-- Security Settings --><skip />
    <!-- Security settings screen, setting option name to change screen timeout -->
+15 −0
Original line number Diff line number Diff line
@@ -73,6 +73,21 @@

    </PreferenceCategory>

    <!-- An optional preference category for feedback. Only displayed up if enabled via flags and config. -->
    <PreferenceCategory
            android:key="time_feedback_preference_category"
            android:title="@string/time_feedback_category_title"
            settings:keywords="@string/keywords_time_feedback_category"
            settings:controller="com.android.settings.datetime.TimeFeedbackPreferenceCategoryController">

        <Preference
                android:key="time_feedback"
                android:title="@string/time_feedback_title"
                settings:keywords="@string/keywords_time_feedback"
                settings:controller="com.android.settings.datetime.TimeFeedbackPreferenceController" />

    </PreferenceCategory>

    <PreferenceCategory
        android:key="time_format_preference_category"
        android:title="@string/time_format_category_title"
+6 −0
Original line number Diff line number Diff line
@@ -68,6 +68,12 @@ public class DateTimeSettings extends DashboardFragment implements
                .setTimeAndDateCallback(this)
                .setFromSUW(isFromSUW);

        // All the elements in the category are optional, so we must ensure the category is only
        // available if any of the elements are available.
        TimeFeedbackPreferenceCategoryController helpAndFeedbackCategoryController =
                use(TimeFeedbackPreferenceCategoryController.class);
        use(TimeFeedbackPreferenceController.class)
                .registerWithOptionalCategoryController(helpAndFeedbackCategoryController);
    }

    @Override
Loading