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

Commit b212650a authored by Linux4's avatar Linux4 Committed by Łukasz Patron
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 a958ddb7
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -96,6 +96,7 @@ android_library {
        "jsr330",
        "jsr330",
        "lottie",
        "lottie",
        "org.lineageos.platform.internal",
        "org.lineageos.platform.internal",
        "vendor.lineage.powershare-V1.0-java",
    ],
    ],
    manifest: "AndroidManifest.xml",
    manifest: "AndroidManifest.xml",
    additional_manifests: ["LineageManifest.xml"],
    additional_manifests: ["LineageManifest.xml"],
@@ -185,6 +186,7 @@ android_library {
        "jsr330",
        "jsr330",
        "WindowManager-Shell",
        "WindowManager-Shell",
        "org.lineageos.platform.internal",
        "org.lineageos.platform.internal",
        "vendor.lineage.powershare-V1.0-java",
    ],
    ],
    libs: [
    libs: [
        "android.test.runner",
        "android.test.runner",
+26 −0
Original line number Original line Diff line number Diff line
<!--
    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 Original line Diff line number Diff line
@@ -46,6 +46,12 @@
    <string name="accessibility_quick_settings_heads_up_changed_off">Heads up turned off.</string>
    <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>
    <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>

    <!-- Sync QS tile -->
    <!-- Sync QS tile -->
    <string name="quick_settings_sync_label">Sync</string>
    <string name="quick_settings_sync_label">Sync</string>
    <string name="accessibility_quick_settings_sync_off">Sync off.</string>
    <string name="accessibility_quick_settings_sync_off">Sync off.</string>
+1 −1
Original line number Original line Diff line number Diff line
@@ -107,7 +107,7 @@


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


    <!-- The tiles to display in QuickSettings -->
    <!-- The tiles to display in QuickSettings -->
+6 −0
Original line number Original line Diff line number Diff line
@@ -48,6 +48,7 @@ import com.android.systemui.qs.tiles.LocationTile;
import com.android.systemui.qs.tiles.MicrophoneToggleTile;
import com.android.systemui.qs.tiles.MicrophoneToggleTile;
import com.android.systemui.qs.tiles.NfcTile;
import com.android.systemui.qs.tiles.NfcTile;
import com.android.systemui.qs.tiles.NightDisplayTile;
import com.android.systemui.qs.tiles.NightDisplayTile;
import com.android.systemui.qs.tiles.PowerShareTile;
import com.android.systemui.qs.tiles.QuickAccessWalletTile;
import com.android.systemui.qs.tiles.QuickAccessWalletTile;
import com.android.systemui.qs.tiles.ReduceBrightColorsTile;
import com.android.systemui.qs.tiles.ReduceBrightColorsTile;
import com.android.systemui.qs.tiles.RotationLockTile;
import com.android.systemui.qs.tiles.RotationLockTile;
@@ -102,6 +103,7 @@ public class QSFactoryImpl implements QSFactory {
    private final Provider<CaffeineTile> mCaffeineTileProvider;
    private final Provider<CaffeineTile> mCaffeineTileProvider;
    private final Provider<HeadsUpTile> mHeadsUpTileProvider;
    private final Provider<HeadsUpTile> mHeadsUpTileProvider;
    private final Provider<SyncTile> mSyncTileProvider;
    private final Provider<SyncTile> mSyncTileProvider;
    private final Provider<PowerShareTile> mPowerShareTileProvider;
    private final Provider<UsbTetherTile> mUsbTetherTileProvider;
    private final Provider<UsbTetherTile> mUsbTetherTileProvider;


    private final Lazy<QSHost> mQsHostLazy;
    private final Lazy<QSHost> mQsHostLazy;
@@ -142,6 +144,7 @@ public class QSFactoryImpl implements QSFactory {
            Provider<AODTile> aodTileProvider,
            Provider<AODTile> aodTileProvider,
            Provider<CaffeineTile> caffeineTileProvider,
            Provider<CaffeineTile> caffeineTileProvider,
            Provider<HeadsUpTile> headsUpTileProvider,
            Provider<HeadsUpTile> headsUpTileProvider,
            Provider<PowerShareTile> powerShareTileProvider,
            Provider<SyncTile> syncTileProvider,
            Provider<SyncTile> syncTileProvider,
            Provider<UsbTetherTile> usbTetherTileProvider) {
            Provider<UsbTetherTile> usbTetherTileProvider) {
        mQsHostLazy = qsHostLazy;
        mQsHostLazy = qsHostLazy;
@@ -179,6 +182,7 @@ public class QSFactoryImpl implements QSFactory {
        mCaffeineTileProvider = caffeineTileProvider;
        mCaffeineTileProvider = caffeineTileProvider;
        mHeadsUpTileProvider = headsUpTileProvider;
        mHeadsUpTileProvider = headsUpTileProvider;
        mSyncTileProvider = syncTileProvider;
        mSyncTileProvider = syncTileProvider;
        mPowerShareTileProvider = powerShareTileProvider;
        mUsbTetherTileProvider = usbTetherTileProvider;
        mUsbTetherTileProvider = usbTetherTileProvider;
    }
    }


@@ -257,6 +261,8 @@ public class QSFactoryImpl implements QSFactory {
                return mHeadsUpTileProvider.get();
                return mHeadsUpTileProvider.get();
            case "sync":
            case "sync":
                return mSyncTileProvider.get();
                return mSyncTileProvider.get();
            case "powershare":
                return mPowerShareTileProvider.get();
            case "usb_tether":
            case "usb_tether":
                return mUsbTetherTileProvider.get();
                return mUsbTetherTileProvider.get();
        }
        }
Loading