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

Commit 65e7ce0e authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

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

parents 5deeb3bf e3951996
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ import static lineageos.health.HealthInterface.MODE_MANUAL;
import static org.lineageos.platform.internal.health.Util.msToString;

import android.content.Context;
import android.os.RemoteException;
import android.util.Log;

import vendor.lineage.health.ChargingControlSupportedMode;
@@ -41,14 +40,9 @@ public class Deadline extends ChargingControlProvider {
        try {
            mChargingControl.setChargingDeadline(deadline);
            mSavedTargetTime = targetTime;
        } catch (RemoteException e) {
        } catch (Exception e) {
            Log.e(TAG, "Failed to set charging deadline", e);
            return false;
        } catch (IllegalStateException e) {
            // This is possible when the device is just plugged in and the sysfs node is not ready
            // to be written to
            Log.e(TAG, "Failed to set charging deadline, will retry on next battery change");
            return false;
        }

        return true;
@@ -70,7 +64,7 @@ public class Deadline extends ChargingControlProvider {

        try {
            mChargingControl.setChargingDeadline(-1);
        } catch (RemoteException e) {
        } catch (Exception e) {
            Log.e(TAG, "Failed to reset charging deadline", e);
        }
    }
+2 −3
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ import android.content.IntentFilter;
import android.os.BatteryManager;
import android.os.BatteryStatsManager;
import android.os.BatteryUsageStats;
import android.os.RemoteException;
import android.util.Log;

import org.lineageos.platform.internal.R;
@@ -205,7 +204,7 @@ public class Toggle extends ChargingControlProvider {
                mChargingControl.setChargingEnabled(enabled);
            }
            return true;
        } catch (RemoteException e) {
        } catch (Exception e) {
            Log.e(TAG, "Failed to set charging enabled", e);
            return false;
        }
@@ -229,7 +228,7 @@ public class Toggle extends ChargingControlProvider {
            mSavedTargetTime = 0;
            mEstimatedFullTime = 0;
            mStage = chgCtrlStage.STAGE_NONE;
        } catch (RemoteException e) {
        } catch (Exception e) {
            Log.e(TAG, "Failed to set charging enabled", e);
        }
    }