Bug 1293585 - Remove more unused members in AndroidBridge after bug 1255628. r=snorp
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 09 Aug 2016 17:18:02 +0900
changeset 400817 18afb91eaac8c7b73db0407bcd90a3afe88f14ab
parent 400816 adb44576fbe4936fca68eaa91b30c25858b68c00
child 400818 cec1738be04c0e2ec1dfa0b5f174cf8dbf3b8ac3
push id26289
push userbmo:npancholi@mozilla.com
push dateMon, 15 Aug 2016 22:10:02 +0000
reviewerssnorp
bugs1293585, 1255628
milestone51.0a1
Bug 1293585 - Remove more unused members in AndroidBridge after bug 1255628. r=snorp MozReview-Commit-ID: C8W4dnY2his
widget/android/AndroidBridge.cpp
widget/android/AndroidBridge.h
--- a/widget/android/AndroidBridge.cpp
+++ b/widget/android/AndroidBridge.cpp
@@ -201,45 +201,29 @@ AndroidBridge::AndroidBridge()
             jEnv, jEnv->GetObjectClass(mMessageQueue.Get()));
     // mMessageQueueNext must not be null
     mMessageQueueNext = GetMethodID(
             jEnv, msgQueueClass.Get(), "next", "()Landroid/os/Message;");
     // mMessageQueueMessages may be null (e.g. due to proguard optimization)
     mMessageQueueMessages = jEnv->GetFieldID(
             msgQueueClass.Get(), "mMessages", "Landroid/os/Message;");
 
-    mOpenedGraphicsLibraries = false;
-    mHasNativeBitmapAccess = false;
-    mHasNativeWindowAccess = false;
-    mHasNativeWindowFallback = false;
-
 #ifdef MOZ_WEBSMS_BACKEND
     AutoJNIClass smsMessage(jEnv, "android/telephony/SmsMessage");
     mAndroidSmsMessageClass = smsMessage.getGlobalRef();
     jCalculateLength = smsMessage.getStaticMethod("calculateLength", "(Ljava/lang/CharSequence;Z)[I");
 #endif
 
     AutoJNIClass string(jEnv, "java/lang/String");
     jStringClass = string.getGlobalRef();
 
     if (!GetStaticIntField("android/os/Build$VERSION", "SDK_INT", &mAPIVersion, jEnv)) {
         ALOG_BRIDGE("Failed to find API version");
     }
 
-    AutoJNIClass surface(jEnv, "android/view/Surface");
-    jSurfaceClass = surface.getGlobalRef();
-    if (mAPIVersion <= 8 /* Froyo */) {
-        jSurfacePointerField = surface.getField("mSurface", "I");
-    } else if (mAPIVersion > 8 && mAPIVersion < 19 /* KitKat */) {
-        jSurfacePointerField = surface.getField("mNativeSurface", "I");
-    } else {
-        // We don't know how to get this, just set it to 0
-        jSurfacePointerField = 0;
-    }
-
     AutoJNIClass channels(jEnv, "java/nio/channels/Channels");
     jChannels = channels.getGlobalRef();
     jChannelCreate = channels.getStaticMethod("newChannel", "(Ljava/io/InputStream;)Ljava/nio/channels/ReadableByteChannel;");
 
     AutoJNIClass readableByteChannel(jEnv, "java/nio/channels/ReadableByteChannel");
     jReadableByteChannel = readableByteChannel.getGlobalRef();
     jByteBufferRead = readableByteChannel.getMethod("read", "(Ljava/nio/ByteBuffer;)I");
 
@@ -638,24 +622,16 @@ AndroidBridge::GetStaticStringField(cons
     jstring jstr = (jstring) jEnv->GetStaticObjectField(cls.getRawRef(), field);
     if (!jstr)
         return false;
 
     result.Assign(nsJNIString(jstr, jEnv));
     return true;
 }
 
-void*
-AndroidBridge::GetNativeSurface(JNIEnv* env, jobject surface) {
-    if (!env || !mHasNativeWindowFallback || !jSurfacePointerField)
-        return nullptr;
-
-    return (void*)env->GetIntField(surface, jSurfacePointerField);
-}
-
 namespace mozilla {
     class TracerRunnable : public Runnable{
     public:
         TracerRunnable() {
             mTracerLock = new Mutex("TracerRunnable");
             mTracerCondVar = new CondVar(*mTracerLock, "TracerRunnable");
             mMainThread = do_GetMainThread();
 
--- a/widget/android/AndroidBridge.h
+++ b/widget/android/AndroidBridge.h
@@ -253,17 +253,16 @@ public:
     // These methods don't use a ScreenOrientation because it's an
     // enum and that would require including the header which requires
     // include IPC headers which requires including basictypes.h which
     // requires a lot of changes...
     uint32_t GetScreenOrientation();
     uint16_t GetScreenAngle();
 
     int GetAPIVersion() { return mAPIVersion; }
-    bool IsHoneycomb() { return mAPIVersion >= 11 && mAPIVersion <= 13; }
 
     void InvalidateAndScheduleComposite();
 
     nsresult GetProxyForURI(const nsACString & aSpec,
                             const nsACString & aScheme,
                             const nsACString & aHost,
                             const int32_t      aPort,
                             nsACString & aResult);
@@ -306,54 +305,33 @@ protected:
     java::GeckoLayerClient::GlobalRef mLayerClient;
 
     // the android.telephony.SmsMessage class
     jclass mAndroidSmsMessageClass;
 
     AndroidBridge();
     ~AndroidBridge();
 
-    bool mOpenedGraphicsLibraries;
-    void OpenGraphicsLibraries();
-    void* GetNativeSurface(JNIEnv* env, jobject surface);
-
-    bool mHasNativeBitmapAccess;
-    bool mHasNativeWindowAccess;
-    bool mHasNativeWindowFallback;
-
     int mAPIVersion;
 
     bool QueueSmsRequest(nsIMobileMessageCallback* aRequest, uint32_t* aRequestIdOut);
     bool QueueSmsCursorRequest(nsIMobileMessageCursorCallback* aRequest, uint32_t* aRequestIdOut);
 
     // intput stream
     jclass jReadableByteChannel;
     jclass jChannels;
     jmethodID jChannelCreate;
     jmethodID jByteBufferRead;
 
     jclass jInputStream;
     jmethodID jClose;
     jmethodID jAvailable;
 
-    // other things
-    jmethodID jNotifyAppShellReady;
-    jmethodID jGetOutstandingDrawEvents;
-    jmethodID jPostToJavaThread;
-    jmethodID jCreateSurface;
-    jmethodID jShowSurface;
-    jmethodID jHideSurface;
-    jmethodID jDestroySurface;
-
     jmethodID jCalculateLength;
 
-    // For native surface stuff
-    jclass jSurfaceClass;
-    jfieldID jSurfacePointerField;
-
     // some convinient types to have around
     jclass jStringClass;
 
     jni::Object::GlobalRef mClassLoader;
     jmethodID mClassLoaderLoadClass;
 
     jni::Object::GlobalRef mMessageQueue;
     jfieldID mMessageQueueMessages;