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

Commit 7659a025 authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/lineage-22.2' into a15

parents 1072e9f1 9b41d790
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ public class PowerShareTile extends QSTileImpl<BooleanState>
        if (mBatteryController.isPowerSave()) {
            try {
                mPowerShare.setEnabled(false);
            } catch (RemoteException | ServiceSpecificException ex) {
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
@@ -135,14 +135,20 @@ public class PowerShareTile extends QSTileImpl<BooleanState>
            } else {
                mNotificationManager.cancel(NOTIFICATION_ID);
            }
        } catch (RemoteException | ServiceSpecificException ex) {
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    @Override
    public boolean isAvailable() {
        return mPowerShare != null;
        try {
            // Will throw NPE or some other exception if HAL is either missing or broken.
            mPowerShare.isEnabled();
            return true;
        } catch (Exception ex) {
            return false;
        }
    }

    @Override
@@ -157,7 +163,7 @@ public class PowerShareTile extends QSTileImpl<BooleanState>
        try {
            mPowerShare.setEnabled(!mPowerShare.isEnabled());
            refreshState();
        } catch (RemoteException | ServiceSpecificException ex) {
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
@@ -190,7 +196,7 @@ public class PowerShareTile extends QSTileImpl<BooleanState>
        state.hasLongClickEffect = false;
        try {
            state.value = mPowerShare.isEnabled();
        } catch (RemoteException | ServiceSpecificException ex) {
        } catch (Exception ex) {
            state.value = false;
            ex.printStackTrace();
        }
@@ -229,7 +235,7 @@ public class PowerShareTile extends QSTileImpl<BooleanState>
    private int getMinBatteryLevel() {
        try {
            return mPowerShare.getMinBattery();
        } catch (RemoteException | ServiceSpecificException ex) {
        } catch (Exception ex) {
            ex.printStackTrace();
        }