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

Commit d7065ba1 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

BatteryService: Restore the original parcel order

Append the dock extensions to the end of the parcel to preserve
compatibility with the original parcel format.

Change-Id: Ib4fa8473fcab9882d41bd9f9617af163154290ab
parent 4eaaf29a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ enum {

struct BatteryProperties {
    bool chargerAcOnline;
    bool chargerDockAcOnline;
    bool chargerUsbOnline;
    bool chargerWirelessOnline;

@@ -59,6 +58,7 @@ struct BatteryProperties {
    int batteryTemperature;
    String8 batteryTechnology;

    bool chargerDockAcOnline;
    bool dockBatterySupported;
    int dockBatteryStatus;
    int dockBatteryHealth;
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ namespace android {

status_t BatteryProperties::readFromParcel(Parcel* p) {
    chargerAcOnline = p->readInt32() == 1 ? true : false;
    chargerDockAcOnline = p->readInt32() == 1 ? true : false;
    chargerUsbOnline = p->readInt32() == 1 ? true : false;
    chargerWirelessOnline = p->readInt32() == 1 ? true : false;

@@ -45,6 +44,7 @@ status_t BatteryProperties::readFromParcel(Parcel* p) {
    batteryTemperature = p->readInt32();
    batteryTechnology = String8((p->readString16()).string());

    chargerDockAcOnline = p->readInt32() == 1 ? true : false;
    dockBatterySupported = p->readInt32() == 1 ? true : false;
    dockBatteryStatus = p->readInt32();
    dockBatteryHealth = p->readInt32();
@@ -61,7 +61,6 @@ status_t BatteryProperties::readFromParcel(Parcel* p) {

status_t BatteryProperties::writeToParcel(Parcel* p) const {
    p->writeInt32(chargerAcOnline ? 1 : 0);
    p->writeInt32(chargerDockAcOnline ? 1 : 0);
    p->writeInt32(chargerUsbOnline ? 1 : 0);
    p->writeInt32(chargerWirelessOnline ? 1 : 0);

@@ -75,6 +74,7 @@ status_t BatteryProperties::writeToParcel(Parcel* p) const {
    p->writeInt32(batteryTemperature);
    p->writeString16(String16(batteryTechnology));

    p->writeInt32(chargerDockAcOnline ? 1 : 0);
    p->writeInt32(dockBatterySupported ? 1 : 0);
    p->writeInt32(dockBatteryStatus);
    p->writeInt32(dockBatteryHealth);