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

Commit 9486b6a8 authored by Linux4's avatar Linux4 Committed by Bruno Martins
Browse files

SystemUI: Add powershare QS tile

Author: Linux4 <tim@linux4.de>
Date:   Mon Apr 20 17:57:43 2020 +0200

    base: SystemUI: add qs powershare tile

    Change-Id: Ibcf5cc3e766d971d9dca9242bf2770093d4d3099

Author: Linux4 <tim@linux4.de>
Date:   Sat May 2 12:54:49 2020 +0200

    base: SystemUI: fix NPE in PowerShareTile

    Change-Id: If69846f3e3d4f3a12c0f78f47b5adc1008888de1

Author: LuK1337 <priv.luk@gmail.com>
Date:   Tue Jul 7 13:27:12 2020 +0200

    SystemUI: Call setOnlyAlertOnce(true) for PowerShare notification

    * Otherwise we end up getting notification sound
      every 20 seconds when using it...

    Change-Id: Ia56b01f332860b64f0d2c532884e6bcaa2acfb17

Change-Id: Ia09a674745adb433f3aaeebfeb79899906350793
parent 2ffafb75
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ android_library {
        "dagger2-2.19",
        "jsr330",
        "org.lineageos.platform.internal",
        "vendor.lineage.powershare-V1.0-java",
    ],
    manifest: "AndroidManifest.xml",
    additional_manifests: ["LineageManifest.xml"],
@@ -144,6 +145,7 @@ android_library {
        "dagger2-2.19",
        "jsr330",
        "org.lineageos.platform.internal",
        "vendor.lineage.powershare-V1.0-java",
    ],
    libs: [
        "android.test.runner",
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
       Copyright (C) 2020 The LineageOS 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">

    <path
        android:fillColor="#ffffff"
        android:pathData="M19.77,7.23l0.01,-0.01 -3.72,-3.72L15,4.56l2.11,2.11c-0.94,0.36 -1.61,1.26 -1.61,2.33 0,1.38 1.12,2.5 2.5,2.5 0.36,0 0.69,-0.08 1,-0.21v7.21c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1V14c0,-1.1 -0.9,-2 -2,-2h-1V5c0,-1.1 -0.9,-2 -2,-2H6c-1.1,0 -2,0.9 -2,2v16h10v-7.5h1.5v5c0,1.38 1.12,2.5 2.5,2.5s2.5,-1.12 2.5,-2.5V9c0,-0.69 -0.28,-1.32 -0.73,-1.77zM18,10c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1 1,0.45 1,1 -0.45,1 -1,1zM8,18v-4.5H6L10,6v5h2l-4,7z" />

</vector>
+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,12 @@
    <string name="accessibility_quick_settings_heads_up_changed_off">Heads up turned off.</string>
    <string name="accessibility_quick_settings_heads_up_changed_on">Heads up turned on.</string>

    <!-- PowerShare QS tile -->
    <string name="quick_settings_powershare_label">Wireless PowerShare</string>
    <string name="quick_settings_powershare_off_powersave_label">Wireless PowerShare off\nBattery saver</string>
    <string name="quick_settings_powershare_off_low_battery_label">Wireless PowerShare off\nBattery too low</string>
    <string name="quick_settings_powershare_enabled_label">Wireless PowerShare is enabled</string>

    <!-- Reader mode QS tile -->
    <string name="quick_settings_reading_mode">Reading mode</string>
    <string name="accessibility_quick_settings_reading_mode_on">Reading mode on.</string>
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@

    <!-- Tiles native to System UI. Order should match "quick_settings_tiles_default" -->
    <string name="quick_settings_tiles_stock" translatable="false">
        wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,nfc,location,hotspot,inversion,saver,dark,work,cast,night,screenrecord,reverse,ambient_display,aod,caffeine,heads_up,livedisplay,reading_mode,sync,usb_tether,volume_panel,vpn
        wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,nfc,location,hotspot,inversion,saver,dark,work,cast,night,screenrecord,reverse,ambient_display,aod,caffeine,heads_up,livedisplay,powershare,reading_mode,sync,usb_tether,volume_panel,vpn
    </string>

    <!-- The tiles to display in QuickSettings -->
+6 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import com.android.systemui.qs.tiles.LocationTile;
import com.android.systemui.qs.tiles.LiveDisplayTile;
import com.android.systemui.qs.tiles.NfcTile;
import com.android.systemui.qs.tiles.NightDisplayTile;
import com.android.systemui.qs.tiles.PowerShareTile;
import com.android.systemui.qs.tiles.ReadingModeTile;
import com.android.systemui.qs.tiles.RotationLockTile;
import com.android.systemui.qs.tiles.ScreenRecordTile;
@@ -94,6 +95,7 @@ public class QSFactoryImpl implements QSFactory {
    private final Provider<CaffeineTile> mCaffeineTileProvider;
    private final Provider<HeadsUpTile> mHeadsUpTileProvider;
    private final Provider<LiveDisplayTile> mLiveDisplayTileProvider;
    private final Provider<PowerShareTile> mPowerShareTileProvider;
    private final Provider<ReadingModeTile> mReadingModeTileProvider;
    private final Provider<SyncTile> mSyncTileProvider;
    private final Provider<UsbTetherTile> mUsbTetherTileProvider;
@@ -129,6 +131,7 @@ public class QSFactoryImpl implements QSFactory {
            Provider<CaffeineTile> caffeineTileProvider,
            Provider<HeadsUpTile> headsUpTileProvider,
            Provider<LiveDisplayTile> liveDisplayTileProvider,
            Provider<PowerShareTile> powerShareTileProvider,
            Provider<ReadingModeTile> readingModeTileProvider,
            Provider<SyncTile> syncTileProvider,
            Provider<UsbTetherTile> usbTetherTileProvider,
@@ -160,6 +163,7 @@ public class QSFactoryImpl implements QSFactory {
        mCaffeineTileProvider = caffeineTileProvider;
        mHeadsUpTileProvider = headsUpTileProvider;
        mLiveDisplayTileProvider = liveDisplayTileProvider;
        mPowerShareTileProvider = powerShareTileProvider;
        mReadingModeTileProvider = readingModeTileProvider;
        mSyncTileProvider = syncTileProvider;
        mUsbTetherTileProvider = usbTetherTileProvider;
@@ -227,6 +231,8 @@ public class QSFactoryImpl implements QSFactory {
                return mHeadsUpTileProvider.get();
            case "livedisplay":
                return mLiveDisplayTileProvider.get();
            case "powershare":
                return mPowerShareTileProvider.get();
            case "reading_mode":
                return mReadingModeTileProvider.get();
            case "sync":
Loading