Loading android/app/src/com/android/bluetooth/Utils.java +1 −1 Original line number Diff line number Diff line Loading @@ -349,7 +349,7 @@ public final class Utils { // Use the Bluetooth process identity when making call to get parent user final long ident = Binder.clearCallingIdentity(); try { UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE); UserManager um = mContext.getSystemService(UserManager.class); UserHandle uh = um.getProfileParent(callingUser); int parentUser = (uh != null) ? uh.getIdentifier() : UserHandle.USER_NULL; Loading android/app/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ class A2dpCodecConfig { mA2dpNativeInterface = a2dpNativeInterface; mCodecConfigPriorities = assignCodecConfigPriorities(); AudioManager audioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE); AudioManager audioManager = mContext.getSystemService(AudioManager.class); if (audioManager == null) { Log.w(TAG, "Can't obtain the codec offloading prefernece from null AudioManager"); return; Loading android/app/src/com/android/bluetooth/a2dp/A2dpService.java +1 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class A2dpService extends ProfileService { "A2dpNativeInterface cannot be null when A2dpService starts"); mDatabaseManager = Objects.requireNonNull(mAdapterService.getDatabase(), "DatabaseManager cannot be null when A2dpService starts"); mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); mAudioManager = getSystemService(AudioManager.class); Objects.requireNonNull(mAudioManager, "AudioManager cannot be null when A2dpService starts"); Loading android/app/src/com/android/bluetooth/a2dpsink/A2dpSinkStreamHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,7 @@ public class A2dpSinkStreamHandler extends Handler { public A2dpSinkStreamHandler(A2dpSinkService a2dpSinkService, Context context) { mA2dpSinkService = a2dpSinkService; mContext = context; mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); mAudioManager = context.getSystemService(AudioManager.class); } /** Loading android/app/src/com/android/bluetooth/audio_util/MediaPlayerList.java +2 −3 Original line number Diff line number Diff line Loading @@ -136,11 +136,10 @@ public class MediaPlayerList { pkgFilter.addDataScheme(PACKAGE_SCHEME); context.registerReceiver(mPackageChangedBroadcastReceiver, pkgFilter); mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); mAudioManager = context.getSystemService(AudioManager.class); mAudioManager.registerAudioPlaybackCallback(mAudioPlaybackCallback, new Handler(mLooper)); mMediaSessionManager = (MediaSessionManager) context.getSystemService(Context.MEDIA_SESSION_SERVICE); mMediaSessionManager = context.getSystemService(MediaSessionManager.class); mMediaSessionManager.addOnActiveSessionsChangedListener( mActiveSessionsChangedListener, null, new Handler(looper)); mMediaSessionManager.addOnMediaKeyEventSessionChangedListener( Loading Loading
android/app/src/com/android/bluetooth/Utils.java +1 −1 Original line number Diff line number Diff line Loading @@ -349,7 +349,7 @@ public final class Utils { // Use the Bluetooth process identity when making call to get parent user final long ident = Binder.clearCallingIdentity(); try { UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE); UserManager um = mContext.getSystemService(UserManager.class); UserHandle uh = um.getProfileParent(callingUser); int parentUser = (uh != null) ? uh.getIdentifier() : UserHandle.USER_NULL; Loading
android/app/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ class A2dpCodecConfig { mA2dpNativeInterface = a2dpNativeInterface; mCodecConfigPriorities = assignCodecConfigPriorities(); AudioManager audioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE); AudioManager audioManager = mContext.getSystemService(AudioManager.class); if (audioManager == null) { Log.w(TAG, "Can't obtain the codec offloading prefernece from null AudioManager"); return; Loading
android/app/src/com/android/bluetooth/a2dp/A2dpService.java +1 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class A2dpService extends ProfileService { "A2dpNativeInterface cannot be null when A2dpService starts"); mDatabaseManager = Objects.requireNonNull(mAdapterService.getDatabase(), "DatabaseManager cannot be null when A2dpService starts"); mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); mAudioManager = getSystemService(AudioManager.class); Objects.requireNonNull(mAudioManager, "AudioManager cannot be null when A2dpService starts"); Loading
android/app/src/com/android/bluetooth/a2dpsink/A2dpSinkStreamHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,7 @@ public class A2dpSinkStreamHandler extends Handler { public A2dpSinkStreamHandler(A2dpSinkService a2dpSinkService, Context context) { mA2dpSinkService = a2dpSinkService; mContext = context; mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); mAudioManager = context.getSystemService(AudioManager.class); } /** Loading
android/app/src/com/android/bluetooth/audio_util/MediaPlayerList.java +2 −3 Original line number Diff line number Diff line Loading @@ -136,11 +136,10 @@ public class MediaPlayerList { pkgFilter.addDataScheme(PACKAGE_SCHEME); context.registerReceiver(mPackageChangedBroadcastReceiver, pkgFilter); mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); mAudioManager = context.getSystemService(AudioManager.class); mAudioManager.registerAudioPlaybackCallback(mAudioPlaybackCallback, new Handler(mLooper)); mMediaSessionManager = (MediaSessionManager) context.getSystemService(Context.MEDIA_SESSION_SERVICE); mMediaSessionManager = context.getSystemService(MediaSessionManager.class); mMediaSessionManager.addOnActiveSessionsChangedListener( mActiveSessionsChangedListener, null, new Handler(looper)); mMediaSessionManager.addOnMediaKeyEventSessionChangedListener( Loading