Merge "Skip SystemUI check in BluetoothServiceManager if noHome." am: fc3b50e9b6
am: 65d0549fde
Change-Id: Ia42f33a0d7becd5a4f3f3f81fc077d13863f94ed
This commit is contained in:
@@ -60,6 +60,7 @@ import android.provider.Settings;
|
|||||||
import android.provider.Settings.SettingNotFoundException;
|
import android.provider.Settings.SettingNotFoundException;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
|
|
||||||
|
import com.android.internal.R;
|
||||||
import com.android.internal.util.DumpUtils;
|
import com.android.internal.util.DumpUtils;
|
||||||
import com.android.server.pm.UserRestrictionsUtils;
|
import com.android.server.pm.UserRestrictionsUtils;
|
||||||
|
|
||||||
@@ -415,9 +416,14 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
|
|||||||
|
|
||||||
int systemUiUid = -1;
|
int systemUiUid = -1;
|
||||||
try {
|
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()
|
systemUiUid = mContext.getPackageManager()
|
||||||
.getPackageUidAsUser("com.android.systemui", PackageManager.MATCH_SYSTEM_ONLY,
|
.getPackageUidAsUser("com.android.systemui", PackageManager.MATCH_SYSTEM_ONLY,
|
||||||
UserHandle.USER_SYSTEM);
|
UserHandle.USER_SYSTEM);
|
||||||
|
}
|
||||||
|
Slog.d(TAG, "Detected SystemUiUid: " + Integer.toString(systemUiUid));
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
// Some platforms, such as wearables do not have a system ui.
|
// Some platforms, such as wearables do not have a system ui.
|
||||||
Slog.w(TAG, "Unable to resolve SystemUI's UID.", e);
|
Slog.w(TAG, "Unable to resolve SystemUI's UID.", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user