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

Commit 58ff0217 authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Increment BatteryStatsImpl's VERSION.

That'll make it stop trying to interpret older records with the new format.
Also applied other comments involving name changes to remove un-needed 'Wifi' labels in WifiManager API, etc.
parent 65ff54c4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public final class BatteryStatsImpl extends BatteryStats {
    private static final int MAGIC = 0xBA757475; // 'BATSTATS' 

    // Current on-disk Parcel version
    private static final int VERSION = 34;
    private static final int VERSION = 35;

    private final File mFile;
    private final File mBackupFile;
+14 −14
Original line number Diff line number Diff line
@@ -96,8 +96,8 @@ public class WifiService extends IWifiManager.Stub {
    private int mScanLocksAcquired;
    private int mScanLocksReleased;

    private final List<WifiMulticaster> mMulticasters =
            new ArrayList<WifiMulticaster>();
    private final List<Multicaster> mMulticasters =
            new ArrayList<Multicaster>();
    private int mMulticastEnabled;
    private int mMulticastDisabled;

@@ -1744,7 +1744,7 @@ public class WifiService extends IWifiManager.Stub {
        }
    }

    private class WifiLock extends WifiDeathRecipient {
    private class WifiLock extends DeathRecipient {
        WifiLock(int lockMode, String tag, IBinder binder) {
            super(lockMode, tag, binder);
        }
@@ -1887,13 +1887,13 @@ public class WifiService extends IWifiManager.Stub {
        return hadLock;
    }

    private abstract class WifiDeathRecipient
    private abstract class DeathRecipient
            implements IBinder.DeathRecipient {
        String mTag;
        int mMode;
        IBinder mBinder;

        WifiDeathRecipient(int mode, String tag, IBinder binder) {
        DeathRecipient(int mode, String tag, IBinder binder) {
            super();
            mTag = tag;
            mMode = mode;
@@ -1906,13 +1906,13 @@ public class WifiService extends IWifiManager.Stub {
        }
    }

    private class WifiMulticaster extends WifiDeathRecipient {
        WifiMulticaster(String tag, IBinder binder) {
    private class Multicaster extends DeathRecipient {
        Multicaster(String tag, IBinder binder) {
            super(Binder.getCallingUid(), tag, binder);
        }

        public void binderDied() {
            Log.e(TAG, "WifiMulticaster binderDied");
            Log.e(TAG, "Multicaster binderDied");
            synchronized (mMulticasters) {
                int i = mMulticasters.indexOf(this);
                if (i != -1) {
@@ -1922,7 +1922,7 @@ public class WifiService extends IWifiManager.Stub {
        }

        public String toString() {
            return "WifiMulticaster{" + mTag + " binder=" + mBinder + "}";
            return "Multicaster{" + mTag + " binder=" + mBinder + "}";
        }

        public int getUid() {
@@ -1930,12 +1930,12 @@ public class WifiService extends IWifiManager.Stub {
        }
    }

    public void enableWifiMulticast(IBinder binder, String tag) {
    public void enableMulticast(IBinder binder, String tag) {
        enforceChangePermission();

        synchronized (mMulticasters) {
            mMulticastEnabled++;
            mMulticasters.add(new WifiMulticaster(tag, binder));
            mMulticasters.add(new Multicaster(tag, binder));
            // Note that we could call stopPacketFiltering only when
            // our new size == 1 (first call), but this function won't
            // be called often and by making the stopPacket call each
@@ -1953,7 +1953,7 @@ public class WifiService extends IWifiManager.Stub {
        }
    }

    public void disableWifiMulticast() {
    public void disableMulticast() {
        enforceChangePermission();

        int uid = Binder.getCallingUid();
@@ -1961,7 +1961,7 @@ public class WifiService extends IWifiManager.Stub {
            mMulticastDisabled++;
            int size = mMulticasters.size();
            for (int i = size - 1; i >= 0; i--) {
                WifiMulticaster m = mMulticasters.get(i);
                Multicaster m = mMulticasters.get(i);
                if ((m != null) && (m.getUid() == uid)) {
                    removeMulticasterLocked(i, uid);
                }
@@ -1985,7 +1985,7 @@ public class WifiService extends IWifiManager.Stub {
        }
    }

    public boolean isWifiMulticastEnabled() {
    public boolean isMulticastEnabled() {
        enforceAccessPermission();

        synchronized (mMulticasters) {
+3 −3
Original line number Diff line number Diff line
@@ -70,10 +70,10 @@ interface IWifiManager

    boolean releaseWifiLock(IBinder lock);

    boolean isWifiMulticastEnabled();
    boolean isMulticastEnabled();

    void enableWifiMulticast(IBinder binder, String tag);
    void enableMulticast(IBinder binder, String tag);

    void disableWifiMulticast();
    void disableMulticast();
}
+8 −8
Original line number Diff line number Diff line
@@ -831,9 +831,9 @@ public class WifiManager {
     *
     * @hide pending API council approval
     */
    public boolean isWifiMulticastEnabled() {
    public boolean isMulticastEnabled() {
        try {
            return mService.isWifiMulticastEnabled();
            return mService.isMulticastEnabled();
        } catch (RemoteException e) {
            return false;
        }
@@ -851,13 +851,13 @@ public class WifiManager {
     *
     * @return true on success
     *
     * @see #disableWifiMulticast
     * @see #disableMulticast
     *
     * @hide pending API council approval
     */
    public boolean enableWifiMulticast(String tag) {
    public boolean enableMulticast(String tag) {
        try {
            mService.enableWifiMulticast(new Binder(), tag);
            mService.enableMulticast(new Binder(), tag);
            return true;
        } catch (RemoteException e) {
            return false;
@@ -872,13 +872,13 @@ public class WifiManager {
     *
     * @return true on success
     *
     * @see #enableWifiMulticast
     * @see #enableMulticast
     *
     * @hide pending API council approval
     */
    public boolean disableWifiMulticast() {
    public boolean disableMulticast() {
        try {
            mService.disableWifiMulticast();
            mService.disableMulticast();
            return true;
        } catch (RemoteException e) {
            return false;
+2 −2
Original line number Diff line number Diff line
@@ -747,8 +747,8 @@ public class WifiStateTracker extends NetworkStateTracker {
                 * first and then off.. if nobody else wants it on it'll be
                 * off then and it's all synchronized within the API.
                 */
                mWM.enableWifiMulticast("WifiStateTracker");
                mWM.disableWifiMulticast();
                mWM.enableMulticast("WifiStateTracker");
                mWM.disableMulticast();

                if (mBluetoothA2dp == null) {
                    mBluetoothA2dp = new BluetoothA2dp(mContext);