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

Commit 24053587 authored by Arthur Hsu's avatar Arthur Hsu Committed by android-build-merger
Browse files

Merge "Skip SystemUI check in BluetoothServiceManager if noHome." am: 1602f3f1 am: ac34ee5a

am: 1c4d4b2f

Change-Id: Ifa668bfd7d1381c2072e21feeaed383e9fbaaa87
parents 16447d2a 1c4d4b2f
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.util.Slog;

import com.android.internal.R;
import com.android.internal.util.DumpUtils;
import com.android.server.pm.UserRestrictionsUtils;

@@ -415,9 +416,14 @@ class BluetoothManagerService extends IBluetoothManager.Stub {

        int systemUiUid = -1;
        try {
            // Check if device is configured with no home screen, which implies no SystemUI.
            boolean noHome = mContext.getResources().getBoolean(R.bool.config_noHomeScreen);
            if (!noHome) {
                systemUiUid = mContext.getPackageManager()
                        .getPackageUidAsUser("com.android.systemui", PackageManager.MATCH_SYSTEM_ONLY,
                                UserHandle.USER_SYSTEM);
            }
            Slog.d(TAG, "Detected SystemUiUid: " + Integer.toString(systemUiUid));
        } catch (PackageManager.NameNotFoundException e) {
            // Some platforms, such as wearables do not have a system ui.
            Slog.w(TAG, "Unable to resolve SystemUI's UID.", e);