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

Commit 81abfcf6 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7678438 from 33af17ff to sc-qpr1-release

Change-Id: I24d3da43da4b4fac71278d077d230a507d678032
parents 7138dd4b 33af17ff
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -40,12 +40,14 @@
        android:contentDescription="@string/battery_usage_chart"
        android:textAppearance="?android:attr/textAppearanceSmall"
        settings:textColor="?android:attr/textColorSecondary" />
    <!-- Use non-scalable text size from text_size_small_material -->
    <TextView
        android:id="@+id/companion_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="?android:attr/textColorSecondary"/>
        android:textColor="?android:attr/textColorSecondary"
        android:textSize="14dp" />

</LinearLayout>
+1 −1
Original line number Diff line number Diff line
@@ -437,7 +437,7 @@
    <dimen name="chartview_text_padding">6dp</dimen>
    <dimen name="chartview_divider_width">1dp</dimen>
    <dimen name="chartview_divider_height">4dp</dimen>
    <dimen name="chartview_trapezoid_radius">3dp</dimen>
    <dimen name="chartview_trapezoid_radius">5dp</dimen>
    <dimen name="chartview_trapezoid_margin_start">1dp</dimen>
    <dimen name="chartview_trapezoid_margin_bottom">2dp</dimen>
</resources>
+0 −6
Original line number Diff line number Diff line
@@ -6614,10 +6614,6 @@
    <string name="battery_system_usage_for">System usage for <xliff:g id="slot">%s</xliff:g></string>
    <!-- [CHAR_LIMIT=NONE] Battery app usage section header -->
    <string name="battery_app_usage_for">App usage for <xliff:g id="slot">%s</xliff:g></string>
    <!-- [CHAR_LIMIT=NONE] Battery usage section header for a specific time slot -->
    <string name="battery_usage_time_am">am</string>
    <!-- [CHAR_LIMIT=NONE] Battery usage section header for a specific time slot -->
    <string name="battery_usage_time_pm">pm</string>
    <!-- [CHAR_LIMIT=NONE] Battery usage item for total usage time less than a minute -->
    <string name="battery_usage_total_less_than_one_minute">Total: less than a min</string>
    <!-- [CHAR_LIMIT=NONE] Battery usage item for total background time less than a minute -->
@@ -13332,8 +13328,6 @@
    <string name="calls_sms_no_sim">No SIM</string>
    <!-- Network & internet preferences title [CHAR LIMIT=NONE] -->
    <string name="network_and_internet_preferences_title">Network preferences</string>
    <!-- Network & internet preferences summary [CHAR LIMIT=NONE] -->
    <string name="network_and_internet_preferences_summary">Connect to public networks</string>
    <!-- Search keywords for "Internet" settings [CHAR_LIMIT=NONE] -->
    <string name="keywords_internet">network connection, internet, wireless, data, wifi, wi-fi, wi fi, cellular, mobile, cell carrier, 4g, 3g, 2g, lte</string>
    <!-- Slice title text for turning on the Wi-Fi networks. [CHAR LIMIT=40] -->
+0 −1
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@
    <Preference
        android:key="configure_wifi_settings"
        android:title="@string/network_and_internet_preferences_title"
        android:summary="@string/network_and_internet_preferences_summary"
        settings:allowDividerAbove="true"
        android:fragment="com.android.settings.wifi.ConfigureWifiSettings"/>

+14 −9
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ public class BatteryChartView extends AppCompatImageView implements View.OnClick
        Arrays.asList("SwitchAccessService", "TalkBackService", "JustSpeakService");

    private static final int DEFAULT_TRAPEZOID_COUNT = 12;
    private static final int DEFAULT_TIMESTAMP_COUNT = 5;
    private static final int DEFAULT_TIMESTAMP_COUNT = 4;
    private static final int TIMESTAMP_GAPS_COUNT = DEFAULT_TIMESTAMP_COUNT - 1;
    private static final int DIVIDER_COLOR = Color.parseColor("#CDCCC5");
    private static final long UPDATE_STATE_DELAYED_TIME = 500L;

@@ -91,7 +92,7 @@ public class BatteryChartView extends AppCompatImageView implements View.OnClick
        new Rect[] {new Rect(), new Rect(), new Rect()};
    // For drawing the timestamp information.
    private final Rect[] mTimestampsBounds =
        new Rect[] {new Rect(), new Rect(), new Rect(), new Rect(), new Rect()};
        new Rect[] {new Rect(), new Rect(), new Rect(), new Rect()};

    @VisibleForTesting
    Handler mHandler = new Handler();
@@ -198,13 +199,14 @@ public class BatteryChartView extends AppCompatImageView implements View.OnClick
        if (mTimestamps == null) {
            mTimestamps = new String[DEFAULT_TIMESTAMP_COUNT];
        }
        final long timeSlotOffset = DateUtils.HOUR_IN_MILLIS * 6;
        final long timeSlotOffset =
            DateUtils.HOUR_IN_MILLIS * (/*total 24 hours*/ 24 / TIMESTAMP_GAPS_COUNT);
        final boolean is24HourFormat = DateFormat.is24HourFormat(getContext());
        for (int index = 0; index < DEFAULT_TIMESTAMP_COUNT; index++) {
            mTimestamps[index] =
                ConvertUtils.utcToLocalTimeHour(
                    getContext(),
                    latestTimestamp - (4 - index) * timeSlotOffset,
                    latestTimestamp - (TIMESTAMP_GAPS_COUNT - index) * timeSlotOffset,
                    is24HourFormat);
        }
        requestLayout();
@@ -426,8 +428,9 @@ public class BatteryChartView extends AppCompatImageView implements View.OnClick
            final float[] xOffsets = new float[DEFAULT_TIMESTAMP_COUNT];
            final float baselineX = mDividerWidth * .5f;
            final float offsetX = mDividerWidth + unitWidth;
            final int slotBarOffset = (/*total 12 bars*/ 12) / TIMESTAMP_GAPS_COUNT;
            for (int index = 0; index < DEFAULT_TIMESTAMP_COUNT; index++) {
                xOffsets[index] = baselineX + index * offsetX * 3;
                xOffsets[index] = baselineX + index * offsetX * slotBarOffset;
            }
            drawTimestamp(canvas, xOffsets);
        }
@@ -439,13 +442,15 @@ public class BatteryChartView extends AppCompatImageView implements View.OnClick
            mTimestamps[0],
            xOffsets[0] - mTimestampsBounds[0].left,
            getTimestampY(0), mTextPaint);
        final int latestIndex = DEFAULT_TIMESTAMP_COUNT - 1;
        // Draws the last timestamp info.
        canvas.drawText(
            mTimestamps[4],
            xOffsets[4] - mTimestampsBounds[4].width() - mTimestampsBounds[4].left,
            getTimestampY(4), mTextPaint);
            mTimestamps[latestIndex],
            xOffsets[latestIndex] - mTimestampsBounds[latestIndex].width()
                    - mTimestampsBounds[latestIndex].left,
            getTimestampY(latestIndex), mTextPaint);
        // Draws the rest of timestamp info since it is located in the center.
        for (int index = 1; index <= 3; index++) {
        for (int index = 1; index <= DEFAULT_TIMESTAMP_COUNT - 2; index++) {
            canvas.drawText(
                mTimestamps[index],
                xOffsets[index] -
Loading