当前位置: 首页>>代码示例>>C++>>正文


C++ CJNIIntentFilter类代码示例

本文整理汇总了C++中CJNIIntentFilter的典型用法代码示例。如果您正苦于以下问题:C++ CJNIIntentFilter类的具体用法?C++ CJNIIntentFilter怎么用?C++ CJNIIntentFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CJNIIntentFilter类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: android_printf

void CXBMCApp::onResume()
{
  android_printf("%s: ", __PRETTY_FUNCTION__);
  CJNIIntentFilter batteryFilter;
  batteryFilter.addAction("android.intent.action.BATTERY_CHANGED");
  registerReceiver(*this, batteryFilter);
}
开发者ID:IljaFedorow,项目名称:xbmc,代码行数:7,代码来源:XBMCApp.cpp

示例2: android_printf

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();
  }
}
开发者ID:AchimTuran,项目名称:xbmc,代码行数:27,代码来源:XBMCApp.cpp

示例3: android_printf

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());
  }
}
开发者ID:HitcherUK,项目名称:xbmc,代码行数:27,代码来源:XBMCApp.cpp

示例4: android_printf

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();
  }
}
开发者ID:sandalsoft,项目名称:mrmc,代码行数:20,代码来源:XBMCApp.cpp

示例5: android_printf

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();
  }
}
开发者ID:helinb,项目名称:xbmc,代码行数:25,代码来源:XBMCApp.cpp

示例6: registerReceiver

CJNIIntent CJNIContext::registerReceiver(const CJNIIntentFilter &filter)
{
  return call_method<jhobject>(m_context,
    "registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;",
    (jobject)NULL, filter.get_raw());
}
开发者ID:AchimTuran,项目名称:xbmc,代码行数:6,代码来源:Context.cpp


注:本文中的CJNIIntentFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。