Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
FUCKIT: Just disable audio devices enumeration
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Dec 27, 2016
1 parent 94c9c31 commit 972797d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
9 changes: 5 additions & 4 deletions tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,11 @@ public class Main extends NativeActivity implements Choreographer.FrameCallback
mSettingsContentObserver = new XBMCSettingsContentObserver(this, handler);
getApplicationContext().getContentResolver().registerContentObserver(android.provider.Settings.System.CONTENT_URI, true, mSettingsContentObserver );

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
AudioManager audioManager = (AudioManager)getSystemService(AUDIO_SERVICE);
audioManager.registerAudioDeviceCallback(new MyAudioDeviceCallback(), handler);
}
// Crashes on SATV as of FW 3.3
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// AudioManager audioManager = (AudioManager)getSystemService(AUDIO_SERVICE);
// audioManager.registerAudioDeviceCallback(new MyAudioDeviceCallback(), handler);
// }
mJsonRPC = new XBMCJsonRPC();

// Delayed Intent
Expand Down
13 changes: 7 additions & 6 deletions xbmc/android/activity/XBMCApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,13 @@ void CXBMCApp::onResume()
g_application.WakeUpScreenSaverAndDPMS();

m_audiodevices.clear();
if (CJNIAudioManager::GetSDKVersion() >= 23)
{
CJNIAudioManager audioManager(getSystemService("audio"));
m_audiodevices = audioManager.getDevices(CJNIAudioManager::GET_DEVICES_OUTPUTS);
LogAudoDevices("OnResume", m_audiodevices);
}
// Crashes on SATV as of FW 3.3
// if (CJNIAudioManager::GetSDKVersion() >= 23)
// {
// CJNIAudioManager audioManager(getSystemService("audio"));
// m_audiodevices = audioManager.getDevices(CJNIAudioManager::GET_DEVICES_OUTPUTS);
// LogAudoDevices("OnResume", m_audiodevices);
// }
CheckHeadsetPlugged();

unregisterMediaButtonEventReceiver();
Expand Down

0 comments on commit 972797d

Please sign in to comment.