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

Commit 7f8742db authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Deprecate unused methods in QSTileImpl

* Deprecate getMetricsCategory, as UiEvents just use a string for each
tile.
* Remove all a11y announcements methods. These were not used, as we've
been using stateDescription

Test: atest SystemUITests
Bug: no bug

Change-Id: Id7a53abe59bc2b265f3049e844d9e8d9c4ef1f83
parent f8660097
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -357,10 +357,12 @@ Following are methods that need to be implemented when creating a new SystemUI t
  Updates the `State` of the Tile based on the state of the device as provided by the respective controller. It will be called every time the Tile becomes visible, is interacted with or `QSTileImpl#refreshState` is called. After this is done, the updated state will be reflected in the UI.

* ```java
  @Deprecated
  public int getMetricsCategory()
  ```

  Identifier for this Tile, as defined in [proto/src/metrics_constants/metrics_constants.proto](/proto/src/metrics_constants/metrics_constants.proto). This is used to log events related to this Tile.
  ~~Identifier for this Tile, as defined in [proto/src/metrics_constants/metrics_constants.proto](/proto/src/metrics_constants/metrics_constants.proto). This is used to log events related to this Tile.~~
  This is now deprecated in favor of `UiEvent` that use the tile spec.

* ```java
  public boolean isAvailable()
+7 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ import java.util.function.Supplier;
@DependsOn(target = Icon.class)
@DependsOn(target = State.class)
public interface QSTile {
    int VERSION = 1;
    int VERSION = 2;

    DetailAdapter getDetailAdapter();
    String getTileSpec();
@@ -79,6 +79,12 @@ public interface QSTile {
    void longClick(@Nullable View view);

    void userSwitch(int currentUser);

    /**
     * @deprecated not needed as {@link com.android.internal.logging.UiEvent} will use
     * {@link #getMetricsSpec}
     */
    @Deprecated
    int getMetricsCategory();

    void setListening(Object client, boolean listening);
@@ -117,7 +123,6 @@ public interface QSTile {
        void onShowDetail(boolean show);
        void onToggleStateChanged(boolean state);
        void onScanStateChanged(boolean state);
        void onAnnouncementRequested(CharSequence announcement);
    }

    @ProvidesInterface(version = Icon.VERSION)
+0 −36
Original line number Diff line number Diff line
@@ -425,60 +425,24 @@
    <!-- Content description for the close button in the zen mode panel introduction message. [CHAR LIMIT=NONE] -->
    <string name="accessibility_desc_close">Close</string>

    <!-- Announcement made when the wifi is turned off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_wifi_changed_off">Wifi turned off.</string>
    <!-- Announcement made when the wifi is turned on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_wifi_changed_on">Wifi turned on.</string>
    <!-- Announcement made when the airplane mode changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_airplane_changed_off">Airplane mode turned off.</string>
    <!-- Announcement made when the airplane mode changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_airplane_changed_on">Airplane mode turned on.</string>
    <!-- Content description of the do not disturb tile in quick settings when on in none (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_dnd_none_on">total silence</string>
    <!-- Content description of the do not disturb tile in quick settings when on in alarms only (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_dnd_alarms_on">alarms only</string>
     <!-- Content description of the do not disturb tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_dnd">Do Not Disturb.</string>
    <!-- Announcement made when do not disturb changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_dnd_changed_off">Do Not Disturb turned off.</string>
    <!-- Announcement made when do not disturb changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_dnd_changed_on">Do Not Disturb turned on.</string>
    <!-- Content description of the bluetooth tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_bluetooth">Bluetooth.</string>
    <!-- Content description of the bluetooth tile in quick settings when on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_bluetooth_on">Bluetooth on.</string>
    <!-- Announcement made when the bluetooth is turned off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_bluetooth_changed_off">Bluetooth turned off.</string>
    <!-- Announcement made when the bluetooth is turned on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_bluetooth_changed_on">Bluetooth turned on.</string>
    <!-- Announcement made when the location tile changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_location_changed_off">Location reporting turned off.</string>
    <!-- Announcement made when the location tile changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_location_changed_on">Location reporting turned on.</string>
    <!-- Content description of the alarm tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_alarm">Alarm set for <xliff:g id="time" example="Wed 3:30 PM">%s</xliff:g>.</string>
    <!-- Content description of zen mode time condition plus button (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_more_time">More time.</string>
    <!-- Content description of zen mode time condition minus button (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_less_time">Less time.</string>
    <!-- Announcement made when the flashlight state changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_flashlight_changed_off">Flashlight turned off.</string>
    <!-- Announcement made when the flashlight state changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_flashlight_changed_on">Flashlight turned on.</string>
    <!-- Announcement made when the hotspot state changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_hotspot_changed_off">Mobile hotspot turned off.</string>
    <!-- Announcement made when the hotspot state changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_hotspot_changed_on">Mobile hotspot turned on.</string>
    <!-- Announcement made when the screen stopped casting (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_casting_turned_off">Screen casting stopped.</string>
    <!-- Announcement made when the work mode changes to off (not shown on the screen). Paused is used as a verb. [CHAR LIMIT=NONE] -->
    <!-- Announcement made when the work mode changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <!-- Announcement made when the Data Saver changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_data_saver_changed_off">Data Saver turned off.</string>
    <!-- Announcement made when the Data Saver changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_data_saver_changed_on">Data Saver turned on.</string>
    <!-- Announcement made when the Sensor Privacy changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <!-- Announcement made when the Sensor Privacy changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->

    <!-- Content description of the display brightness slider (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_brightness">Display brightness</string>
+0 −8
Original line number Diff line number Diff line
@@ -558,14 +558,6 @@ public class QSPanel extends LinearLayout implements Tunable {
                    fireScanStateChanged(tileRecord.scanState);
                }
            }

            @Override
            public void onAnnouncementRequested(CharSequence announcement) {
                if (announcement != null) {
                    mHandler.obtainMessage(H.ANNOUNCE_FOR_ACCESSIBILITY, announcement)
                            .sendToTarget();
                }
            }
        };

        tileRecord.tile.addCallback(callback);
+0 −3
Original line number Diff line number Diff line
@@ -212,9 +212,6 @@ public class TileQueryHelper {

        @Override
        public void onScanStateChanged(boolean state) {}

        @Override
        public void onAnnouncementRequested(CharSequence announcement) {}
    }

    private void addPackageTiles(final QSTileHost host) {
Loading