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

Commit 73866ec8 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Automerger Merge Worker
Browse files

Merge changes from topic "presubmit-am-a395a5903d8543a59f4dad431ebc68c5" into...

Merge changes from topic "presubmit-am-a395a5903d8543a59f4dad431ebc68c5" into tm-mainline-prod am: 59728eb2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17696091



Change-Id: I41f4af6a7ce888bc199db6f04b0a1e2fd531692b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 20a6956f 59728eb2
Loading
Loading
Loading
Loading
+22 −2
Original line number Diff line number Diff line
@@ -49,6 +49,12 @@ import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
import static android.content.pm.PackageManager.MATCH_SYSTEM_ONLY;
import static android.content.pm.PackageManager.MATCH_UNINSTALLED_PACKAGES;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.net.ConnectivityManager.BLOCKED_METERED_REASON_DATA_SAVER;
import static android.net.ConnectivityManager.BLOCKED_METERED_REASON_USER_RESTRICTED;
import static android.net.ConnectivityManager.BLOCKED_REASON_APP_STANDBY;
import static android.net.ConnectivityManager.BLOCKED_REASON_BATTERY_SAVER;
import static android.net.ConnectivityManager.BLOCKED_REASON_DOZE;
import static android.net.ConnectivityManager.BLOCKED_REASON_LOW_POWER_STANDBY;
import static android.net.ConnectivityManager.BLOCKED_REASON_NONE;
import static android.os.FactoryTest.FACTORY_TEST_OFF;
import static android.os.IServiceManager.DUMP_FLAG_PRIORITY_CRITICAL;
@@ -17306,8 +17312,22 @@ public class ActivityManagerService extends IActivityManager.Stub
                // TODO: We can reuse this data in
                // ProcessList#incrementProcStateSeqAndNotifyAppsLOSP instead of calling into
                // NetworkManagementService.
                return mUidNetworkBlockedReasons.get(uid, BLOCKED_REASON_NONE)
                        != BLOCKED_REASON_NONE;
                final int uidBlockedReasons = mUidNetworkBlockedReasons.get(
                        uid, BLOCKED_REASON_NONE);
                if (uidBlockedReasons == BLOCKED_REASON_NONE) {
                    return false;
                }
                final int topExemptedBlockedReasons = BLOCKED_REASON_BATTERY_SAVER
                        | BLOCKED_REASON_DOZE
                        | BLOCKED_REASON_APP_STANDBY
                        | BLOCKED_REASON_LOW_POWER_STANDBY
                        | BLOCKED_METERED_REASON_DATA_SAVER
                        | BLOCKED_METERED_REASON_USER_RESTRICTED;
                final int effectiveBlockedReasons =
                        uidBlockedReasons & ~topExemptedBlockedReasons;
                // Only consider it as blocked if it is not blocked by a reason
                // that is not exempted by app being in the top state.
                return effectiveBlockedReasons == BLOCKED_REASON_NONE;
            }
        }