Bug 1419581 - Part 2: Guard media Fennec JNI primitives with MOZ_NATIVE_DEVICES. r=jchen

MozReview-Commit-ID: 3NWZ6BL5Tlr

--HG--
extra : rebase_source : 7db66ec51c0a3337527c76d02109db71804d23f8
This commit is contained in:
Nick Alexander 2017-12-06 20:28:04 -08:00
parent a056b461cc
commit d61bdc9e40
5 changed files with 9 additions and 0 deletions

View File

@ -550,6 +550,7 @@ endif
# @BuildFlag annotation in Java). For example, add a "MOZ_FOO \" line to this
# list to support @BuildFlag(MOZ_FOO).
BINDING_BUILD_FLAGS = \
MOZ_NATIVE_DEVICES \
$(NULL)
# Preprocess a JNI binding file using the build flags defined above.

View File

@ -20,11 +20,13 @@ import android.view.WindowManager;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.annotation.BuildFlag;
import org.mozilla.gecko.annotation.WrapForJNI;
/**
* A MediaPlayerManager with API 17+ Presentation support.
*/
@BuildFlag("MOZ_NATIVE_DEVICES")
@TargetApi(17)
public class PresentationMediaPlayerManager extends MediaPlayerManager {

View File

@ -83,6 +83,7 @@ const JNINativeMethod MemoryMonitor::Natives<Impl>::methods[] = {
::template Wrap<&Impl::DispatchMemoryPressure>)
};
#ifdef MOZ_NATIVE_DEVICES
template<class Impl>
class PresentationMediaPlayerManager::Natives : public mozilla::jni::NativeImpl<PresentationMediaPlayerManager, Impl>
{
@ -106,6 +107,7 @@ const JNINativeMethod PresentationMediaPlayerManager::Natives<Impl>::methods[] =
::template Wrap<&Impl::RemovePresentationSurface>)
};
#endif // MOZ_NATIVE_DEVICES
template<class Impl>
class Telemetry::Natives : public mozilla::jni::NativeImpl<Telemetry, Impl>
{

View File

@ -174,6 +174,7 @@ const char MemoryMonitor::name[] =
constexpr char MemoryMonitor::DispatchMemoryPressure_t::name[];
constexpr char MemoryMonitor::DispatchMemoryPressure_t::signature[];
#ifdef MOZ_NATIVE_DEVICES
const char PresentationMediaPlayerManager::name[] =
"org/mozilla/gecko/PresentationMediaPlayerManager";
@ -186,6 +187,7 @@ constexpr char PresentationMediaPlayerManager::InvalidateAndScheduleComposite_t:
constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::name[];
constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::signature[];
#endif // MOZ_NATIVE_DEVICES
const char Telemetry::name[] =
"org/mozilla/gecko/Telemetry";

View File

@ -518,6 +518,7 @@ public:
template<class Impl> class Natives;
};
#ifdef MOZ_NATIVE_DEVICES
class PresentationMediaPlayerManager : public mozilla::jni::ObjectBase<PresentationMediaPlayerManager>
{
public:
@ -585,6 +586,7 @@ public:
template<class Impl> class Natives;
};
#endif // MOZ_NATIVE_DEVICES
class Telemetry : public mozilla::jni::ObjectBase<Telemetry>
{
public: