本文整理汇总了C++中CJNIIntentFilter::addAction方法的典型用法代码示例。如果您正苦于以下问题:C++ CJNIIntentFilter::addAction方法的具体用法?C++ CJNIIntentFilter::addAction怎么用?C++ CJNIIntentFilter::addAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJNIIntentFilter
的用法示例。
在下文中一共展示了CJNIIntentFilter::addAction方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onResume
void CXBMCApp::onResume()
{
android_printf("%s: ", __PRETTY_FUNCTION__);
// Some intent filters MUST be registered in code rather than through the manifest
CJNIIntentFilter intentFilter;
intentFilter.addAction("android.intent.action.BATTERY_CHANGED");
intentFilter.addAction("android.intent.action.SCREEN_ON");
intentFilter.addAction("android.intent.action.HEADSET_PLUG");
registerReceiver(*this, intentFilter);
if (!g_application.IsInScreenSaver())
EnableWakeLock(true);
else
g_application.WakeUpScreenSaverAndDPMS();
CJNIAudioManager audioManager(getSystemService("audio"));
m_headsetPlugged = audioManager.isWiredHeadsetOn() || audioManager.isBluetoothA2dpOn();
unregisterMediaButtonEventReceiver();
// Clear the applications cache. We could have installed/deinstalled apps
{
CSingleLock lock(m_applicationsMutex);
m_applications.clear();
}
}
示例2: onResume
void CXBMCApp::onResume()
{
android_printf("%s: ", __PRETTY_FUNCTION__);
CJNIIntentFilter intentFilter;
intentFilter.addAction("android.intent.action.BATTERY_CHANGED");
intentFilter.addAction("android.intent.action.DREAMING_STOPPED");
intentFilter.addAction("android.intent.action.SCREEN_ON");
intentFilter.addAction("android.intent.action.HEADSET_PLUG");
intentFilter.addAction("android.bluetooth.a2dp.profile.action.CONNECTION_STATE_CHANGED");
registerReceiver(*this, intentFilter);
if (!g_application.IsInScreenSaver())
EnableWakeLock(true);
else
g_application.WakeUpScreenSaverAndDPMS();
CJNIAudioManager audioManager(getSystemService("audio"));
m_headsetPlugged = audioManager.isWiredHeadsetOn() || audioManager.isBluetoothA2dpOn();
// Clear the applications cache. We could have installed/deinstalled apps
{
CSingleLock lock(m_applicationsMutex);
m_applications.clear();
}
}
示例3: onResume
void CXBMCApp::onResume()
{
android_printf("%s: ", __PRETTY_FUNCTION__);
CJNIIntentFilter batteryFilter;
batteryFilter.addAction("android.intent.action.BATTERY_CHANGED");
registerReceiver(*this, batteryFilter);
}
示例4: onResume
void CXBMCApp::onResume()
{
android_printf("%s: ", __PRETTY_FUNCTION__);
CJNIIntentFilter intentFilter;
intentFilter.addAction("android.intent.action.BATTERY_CHANGED");
intentFilter.addAction("android.intent.action.DREAMING_STOPPED");
intentFilter.addAction("android.intent.action.SCREEN_ON");
registerReceiver(*this, intentFilter);
if (!g_application.IsInScreenSaver())
EnableWakeLock(true);
else
g_application.WakeUpScreenSaverAndDPMS();
// Clear the applications cache. We could have installed/deinstalled apps
{
CSingleLock lock(m_applicationsMutex);
m_applications.clear();
}
}
示例5: onStart
void CXBMCApp::onStart()
{
android_printf("%s: ", __PRETTY_FUNCTION__);
if (m_firstrun)
{
// Register sink
AE::CAESinkFactory::ClearSinks();
CAESinkAUDIOTRACK::Register();
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
pthread_create(&m_thread, &attr, thread_run<CXBMCApp, &CXBMCApp::run>, this);
pthread_attr_destroy(&attr);
// Some intent filters MUST be registered in code rather than through the manifest
CJNIIntentFilter intentFilter;
intentFilter.addAction("android.intent.action.BATTERY_CHANGED");
intentFilter.addAction("android.intent.action.SCREEN_ON");
intentFilter.addAction("android.intent.action.HEADSET_PLUG");
intentFilter.addAction("android.media.action.HDMI_AUDIO_PLUG");
intentFilter.addAction("android.intent.action.SCREEN_OFF");
intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
registerReceiver(*this, intentFilter);
m_mediaSession.reset(new CJNIXBMCMediaSession());
}
}