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

Commit 13f378e7 authored by Roshan Pius's avatar Roshan Pius
Browse files

Modify the wake reasons data structure(2/2)

Changes in the android framework to use the modifed HAL API to
fetch the host wakeup reasons from the driver.

BUG: 26902794

Change-Id: I4df53c00b6b4ffd9f9ddb45577f6bccf150c43e4
parent 0d0f0c7f
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@

package android.net.wifi;

import android.os.Parcelable;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * A class representing wifi wake reason accounting.
@@ -52,6 +52,8 @@ public class WifiWakeReasonAndCounts implements Parcelable {
    public int ipv4RxMulticast;
    public int ipv6Multicast;
    public int otherRxMulticast;
    public int[] cmdEventWakeCntArray;
    public int[] driverFWLocalWakeCntArray;

    /* {@hide} */
    public WifiWakeReasonAndCounts () {
@@ -78,6 +80,13 @@ public class WifiWakeReasonAndCounts implements Parcelable {
        sb.append(" ipv4RxMulticast ").append(ipv4RxMulticast);
        sb.append(" ipv6Multicast ").append(ipv6Multicast);
        sb.append(" otherRxMulticast ").append(otherRxMulticast);
        for (int i = 0; i < cmdEventWakeCntArray.length; i++) {
            sb.append(" cmdEventWakeCntArray[" + i + "] " + cmdEventWakeCntArray[i]);
        }
        for (int i = 0; i < driverFWLocalWakeCntArray.length; i++) {
            sb.append(" driverFWLocalWakeCntArray[" + i + "] " + driverFWLocalWakeCntArray[i]);
        }

        return sb.toString();
    }

@@ -111,6 +120,8 @@ public class WifiWakeReasonAndCounts implements Parcelable {
        dest.writeInt(ipv4RxMulticast);
        dest.writeInt(ipv6Multicast);
        dest.writeInt(otherRxMulticast);
        dest.writeIntArray(cmdEventWakeCntArray);
        dest.writeIntArray(driverFWLocalWakeCntArray);
    }

    /* Implement the Parcelable interface
@@ -137,6 +148,8 @@ public class WifiWakeReasonAndCounts implements Parcelable {
                counts.ipv4RxMulticast = in.readInt();
                counts.ipv6Multicast = in.readInt();
                counts.otherRxMulticast = in.readInt();
                in.readIntArray(counts.cmdEventWakeCntArray);
                in.readIntArray(counts.driverFWLocalWakeCntArray);
                return counts;
            }
            /* Implement the Parcelable interface