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

Commit 78467480 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "[SP19] Reduce log when set limit and request stats update" into rvc-dev am: 689f5334

Change-Id: I837b6852789e4a75e2d90ef086162ce950ca6e41
parents c526774f 689f5334
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -288,10 +288,18 @@ public class OffloadController {

        @Override
        public void setLimit(String iface, long quotaBytes) {
            mLog.i("setLimit: " + iface + "," + quotaBytes);
            // Listen for all iface is necessary since upstream might be changed after limit
            // is set.
            mHandler.post(() -> {
                final Long curIfaceQuota = mInterfaceQuotas.get(iface);

                // If the quota is set to unlimited, the value set to HAL is Long.MAX_VALUE,
                // which is ~8.4 x 10^6 TiB, no one can actually reach it. Thus, it is not
                // useful to set it multiple times.
                // Otherwise, the quota needs to be updated to tell HAL to re-count from now even
                // if the quota is the same as the existing one.
                if (null == curIfaceQuota && QUOTA_UNLIMITED == quotaBytes) return;

                if (quotaBytes == QUOTA_UNLIMITED) {
                    mInterfaceQuotas.remove(iface);
                } else {
@@ -323,7 +331,6 @@ public class OffloadController {

        @Override
        public void requestStatsUpdate(int token) {
            mLog.i("requestStatsUpdate: " + token);
            // Do not attempt to update stats by querying the offload HAL
            // synchronously from a different thread than the Handler thread. http://b/64771555.
            mHandler.post(() -> {