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

Commit b369d268 authored by Omair Kamil's avatar Omair Kamil Committed by Gerrit Code Review
Browse files

Merge "Calculate the foreground status for uid based on the highest importance...

Merge "Calculate the foreground status for uid based on the highest importance for any app running with the uid." into main
parents 7a70f98f 3b0835c6
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.view.Display;
import com.android.bluetooth.Utils;
import com.android.bluetooth.btservice.AdapterService;
import com.android.bluetooth.btservice.BluetoothAdapterProxy;
import com.android.bluetooth.flags.Flags;
import com.android.bluetooth.gatt.FilterParams;
import com.android.bluetooth.gatt.GattObjectsFactory;
import com.android.bluetooth.gatt.GattServiceConfig;
@@ -719,7 +720,16 @@ public class ScanManager {
            if (packages == null || packages.length == 0) {
                return;
            }
            int importance = mActivityManager.getPackageImportance(packages[0]);
            int importance = ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED;
            if (Flags.leScanUseUidForImportance()) {
                for (String packageName : packages) {
                    importance =
                            Math.min(
                                    importance, mActivityManager.getPackageImportance(packageName));
                }
            } else {
                importance = mActivityManager.getPackageImportance(packages[0]);
            }
            boolean isForeground =
                    importance
                            <= ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE;