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

Commit 152d353e authored by Rom Lemarchand's avatar Rom Lemarchand Committed by android-build-merger
Browse files

Merge changes I4e45e5bb,Ibeba97eb,I8e8b892b into mnc-dr2-dev

am: 5032e49f

* commit '5032e49f':
  resolved conflicts for 7de7e0b0 to stage-aosp-master
  BatteryService: Add Max charging voltage
  Stop setting swappiness.
parents e1cbe99e 5032e49f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -108,6 +108,13 @@ public class BatteryManager {
     */
    public static final String EXTRA_MAX_CHARGING_CURRENT = "max_charging_current";

    /**
     * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}:
     * Int value set to the maximum charging voltage supported by the charger in micro volts.
     * {@hide}
     */
    public static final String EXTRA_MAX_CHARGING_VOLTAGE = "max_charging_voltage";

    // values for "status" field in the ACTION_BATTERY_CHANGED Intent
    public static final int BATTERY_STATUS_UNKNOWN = 1;
    public static final int BATTERY_STATUS_CHARGING = 2;
+4 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ public class BatteryProperties implements Parcelable {
    public boolean chargerUsbOnline;
    public boolean chargerWirelessOnline;
    public int maxChargingCurrent;
    public int maxChargingVoltage;
    public int batteryStatus;
    public int batteryHealth;
    public boolean batteryPresent;
@@ -39,6 +40,7 @@ public class BatteryProperties implements Parcelable {
        chargerUsbOnline = other.chargerUsbOnline;
        chargerWirelessOnline = other.chargerWirelessOnline;
        maxChargingCurrent = other.maxChargingCurrent;
        maxChargingVoltage = other.maxChargingVoltage;
        batteryStatus = other.batteryStatus;
        batteryHealth = other.batteryHealth;
        batteryPresent = other.batteryPresent;
@@ -58,6 +60,7 @@ public class BatteryProperties implements Parcelable {
        chargerUsbOnline = p.readInt() == 1 ? true : false;
        chargerWirelessOnline = p.readInt() == 1 ? true : false;
        maxChargingCurrent = p.readInt();
        maxChargingVoltage = p.readInt();
        batteryStatus = p.readInt();
        batteryHealth = p.readInt();
        batteryPresent = p.readInt() == 1 ? true : false;
@@ -72,6 +75,7 @@ public class BatteryProperties implements Parcelable {
        p.writeInt(chargerUsbOnline ? 1 : 0);
        p.writeInt(chargerWirelessOnline ? 1 : 0);
        p.writeInt(maxChargingCurrent);
        p.writeInt(maxChargingVoltage);
        p.writeInt(batteryStatus);
        p.writeInt(batteryHealth);
        p.writeInt(batteryPresent ? 1 : 0);
+9 −11
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.net.LocalSocket;
import android.net.LocalSocketAddress;
import android.os.SystemClock;
import android.util.Slog;

import libcore.io.IoUtils;
import libcore.io.Streams;

@@ -91,32 +92,29 @@ public class InstallerConnection {
        }
    }

    public int dexopt(String apkPath, int uid, boolean isPublic,
            String instructionSet, int dexoptNeeded, boolean bootComplete) {
        return dexopt(apkPath, uid, isPublic, "*", instructionSet, dexoptNeeded,
                false, false, null, bootComplete);
    public int dexopt(String apkPath, int uid, String instructionSet,
            int dexoptNeeded, int dexFlags) {
        return dexopt(apkPath, uid, "*", instructionSet, dexoptNeeded,
                null /*outputPath*/, dexFlags);
    }

    public int dexopt(String apkPath, int uid, boolean isPublic, String pkgName,
            String instructionSet, int dexoptNeeded, boolean vmSafeMode,
            boolean debuggable, String outputPath, boolean bootComplete) {
    public int dexopt(String apkPath, int uid, String pkgName, String instructionSet,
            int dexoptNeeded, String outputPath, int dexFlags) {
        StringBuilder builder = new StringBuilder("dexopt");
        builder.append(' ');
        builder.append(apkPath);
        builder.append(' ');
        builder.append(uid);
        builder.append(isPublic ? " 1" : " 0");
        builder.append(' ');
        builder.append(pkgName);
        builder.append(' ');
        builder.append(instructionSet);
        builder.append(' ');
        builder.append(dexoptNeeded);
        builder.append(vmSafeMode ? " 1" : " 0");
        builder.append(debuggable ? " 1" : " 0");
        builder.append(' ');
        builder.append(outputPath != null ? outputPath : "!");
        builder.append(bootComplete ? " 1" : " 0");
        builder.append(' ');
        builder.append(dexFlags);
        return execute(builder.toString());
    }

+2 −2
Original line number Diff line number Diff line
@@ -476,8 +476,8 @@ public class ZygoteInit {
                final int dexoptNeeded = DexFile.getDexOptNeeded(
                        classPathElement, "*", instructionSet, false /* defer */);
                if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                    installer.dexopt(classPathElement, Process.SYSTEM_UID, false,
                            instructionSet, dexoptNeeded, false /* boot complete */);
                    installer.dexopt(classPathElement, Process.SYSTEM_UID, instructionSet,
                            dexoptNeeded, 0 /*dexFlags*/);
                }
            }
        } catch (IOException ioe) {
+8 −2
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ public final class BatteryService extends SystemService {
    private int mLastBatteryTemperature;
    private boolean mLastBatteryLevelCritical;
    private int mLastMaxChargingCurrent;
    private int mLastMaxChargingVoltage;

    private int mInvalidCharger;
    private int mLastInvalidCharger;
@@ -325,6 +326,7 @@ public final class BatteryService extends SystemService {
                    + ", chargerUsbOnline=" + mBatteryProps.chargerUsbOnline
                    + ", chargerWirelessOnline=" + mBatteryProps.chargerWirelessOnline
                    + ", maxChargingCurrent" + mBatteryProps.maxChargingCurrent
                    + ", maxChargingVoltage" + mBatteryProps.maxChargingVoltage
                    + ", batteryStatus=" + mBatteryProps.batteryStatus
                    + ", batteryHealth=" + mBatteryProps.batteryHealth
                    + ", batteryPresent=" + mBatteryProps.batteryPresent
@@ -356,6 +358,7 @@ public final class BatteryService extends SystemService {
                mBatteryProps.batteryVoltage != mLastBatteryVoltage ||
                mBatteryProps.batteryTemperature != mLastBatteryTemperature ||
                mBatteryProps.maxChargingCurrent != mLastMaxChargingCurrent ||
                mBatteryProps.maxChargingVoltage != mLastMaxChargingVoltage ||
                mInvalidCharger != mLastInvalidCharger)) {

            if (mPlugType != mLastPlugType) {
@@ -483,6 +486,7 @@ public final class BatteryService extends SystemService {
            mLastBatteryVoltage = mBatteryProps.batteryVoltage;
            mLastBatteryTemperature = mBatteryProps.batteryTemperature;
            mLastMaxChargingCurrent = mBatteryProps.maxChargingCurrent;
            mLastMaxChargingVoltage = mBatteryProps.maxChargingVoltage;
            mLastBatteryLevelCritical = mBatteryLevelCritical;
            mLastInvalidCharger = mInvalidCharger;
        }
@@ -508,7 +512,7 @@ public final class BatteryService extends SystemService {
        intent.putExtra(BatteryManager.EXTRA_TECHNOLOGY, mBatteryProps.batteryTechnology);
        intent.putExtra(BatteryManager.EXTRA_INVALID_CHARGER, mInvalidCharger);
        intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_CURRENT, mBatteryProps.maxChargingCurrent);

        intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE, mBatteryProps.maxChargingVoltage);
        if (DEBUG) {
            Slog.d(TAG, "Sending ACTION_BATTERY_CHANGED.  level:" + mBatteryProps.batteryLevel +
                    ", scale:" + BATTERY_SCALE + ", status:" + mBatteryProps.batteryStatus +
@@ -521,7 +525,8 @@ public final class BatteryService extends SystemService {
                    ", USB powered:" + mBatteryProps.chargerUsbOnline +
                    ", Wireless powered:" + mBatteryProps.chargerWirelessOnline +
                    ", icon:" + icon  + ", invalid charger:" + mInvalidCharger +
                    ", maxChargingCurrent:" + mBatteryProps.maxChargingCurrent);
                    ", maxChargingCurrent:" + mBatteryProps.maxChargingCurrent +
                    ", maxChargingVoltage:" + mBatteryProps.maxChargingVoltage);
        }

        mHandler.post(new Runnable() {
@@ -627,6 +632,7 @@ public final class BatteryService extends SystemService {
                pw.println("  USB powered: " + mBatteryProps.chargerUsbOnline);
                pw.println("  Wireless powered: " + mBatteryProps.chargerWirelessOnline);
                pw.println("  Max charging current: " + mBatteryProps.maxChargingCurrent);
                pw.println("  Max charging voltage: " + mBatteryProps.maxChargingVoltage);
                pw.println("  status: " + mBatteryProps.batteryStatus);
                pw.println("  health: " + mBatteryProps.batteryHealth);
                pw.println("  present: " + mBatteryProps.batteryPresent);
Loading