Bug 838467 (follow-up): fix fennec build bustage. a=leo+
authorVicamo Yang <vyang@mozilla.com>
Thu, 18 Apr 2013 09:09:39 +0800
changeset 119096 585bc5156688d95d17f1f4a1bda61d63f6057d57
parent 119095 28446a795700e64bf5ed7b8c1bb6e08e68eba30b
child 119097 d303c877d3a0da8f018190d8f6300a36cf0fab87
push id680
push uservyang@mozilla.com
push dateThu, 18 Apr 2013 01:11:41 +0000
reviewersleo
bugs838467
milestone18.0
Bug 838467 (follow-up): fix fennec build bustage. a=leo+
embedding/android/GeckoAppShell.java
embedding/android/GeckoSmsManager.java
mobile/android/base/GeckoAppShell.java
mobile/android/base/GeckoSmsManager.java
mozglue/android/APKOpen.cpp
widget/android/AndroidBridge.cpp
widget/android/AndroidBridge.h
widget/android/AndroidJNI.cpp
--- a/embedding/android/GeckoAppShell.java
+++ b/embedding/android/GeckoAppShell.java
@@ -92,16 +92,17 @@ public class GeckoAppShell
     public static native void notifySmsReceived(String aSender, String aBody, int aMessageClass, long aTimestamp);
     public static native void notifySmsSent(int aId, String aReceiver, String aBody, long aTimestamp, int aRequestId);
     public static native void notifySmsDelivery(int aId, int aDeliveryStatus, String aReceiver, String aBody, long aTimestamp);
     public static native void notifySmsSendFailed(int aError, int aRequestId);
     public static native void notifyGetSms(int aId, int aDeliveryStatus, String aReceiver, String aSender, String aBody, long aTimestamp, int aRequestId);
     public static native void notifyGetSmsFailed(int aError, int aRequestId);
     public static native void notifySmsDeleted(boolean aDeleted, int aRequestId);
     public static native void notifySmsDeleteFailed(int aError, int aRequestId);
+    // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
     public static native void notifyNoMessageInList(int aRequestId);
     public static native void notifyListCreated(int aListId, int aMessageId, int aDeliveryStatus, String aReceiver, String aSender, String aBody, long aTimestamp, int aRequestId);
     public static native void notifyGotNextMessage(int aMessageId, int aDeliveryStatus, String aReceiver, String aSender, String aBody, long aTimestamp, int aRequestId);
     public static native void notifyReadingMessageListFailed(int aError, int aRequestId);
     public static native void onSurfaceTextureFrameAvailable(Object surfaceTexture, int id);
 
     // A looper thread, accessed by GeckoAppShell.getHandler
     private static class LooperThread extends Thread {
--- a/embedding/android/GeckoSmsManager.java
+++ b/embedding/android/GeckoSmsManager.java
@@ -765,16 +765,17 @@ public class GeckoSmsManager
     }
 
     if (!SmsIOThread.getInstance().execute(new DeleteMessageRunnable(aMessageId, aRequestId))) {
       Log.e("GeckoSmsManager", "Failed to add GetMessageRunnable to the SmsIOThread");
       GeckoAppShell.notifySmsDeleteFailed(kUnknownError, aRequestId);
     }
   }
 
+  // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
   public void createMessageList(long aStartDate, long aEndDate, String[] aNumbers, int aNumbersCount, int aDeliveryState, boolean aReverse, int aRequestId) {
     class CreateMessageListRunnable implements Runnable {
       private long     mStartDate;
       private long     mEndDate;
       private String[] mNumbers;
       private int      mNumbersCount;
       private int      mDeliveryState;
       private boolean  mReverse;
@@ -890,16 +891,17 @@ public class GeckoSmsManager
     }
 
     if (!SmsIOThread.getInstance().execute(new CreateMessageListRunnable(aStartDate, aEndDate, aNumbers, aNumbersCount, aDeliveryState, aReverse, aRequestId))) {
       Log.e("GeckoSmsManager", "Failed to add CreateMessageListRunnable to the SmsIOThread");
       GeckoAppShell.notifyReadingMessageListFailed(kUnknownError, aRequestId);
     }
   }
 
+  // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
   public void getNextMessageInList(int aListId, int aRequestId) {
     class GetNextMessageInListRunnable implements Runnable {
       private int mListId;
       private int mRequestId;
 
       GetNextMessageInListRunnable(int aListId, int aRequestId) {
         mListId = aListId;
         mRequestId = aRequestId;
@@ -951,16 +953,17 @@ public class GeckoSmsManager
     }
 
     if (!SmsIOThread.getInstance().execute(new GetNextMessageInListRunnable(aListId, aRequestId))) {
       Log.e("GeckoSmsManager", "Failed to add GetNextMessageInListRunnable to the SmsIOThread");
       GeckoAppShell.notifyReadingMessageListFailed(kUnknownError, aRequestId);
     }
   }
 
+  // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
   public void clearMessageList(int aListId) {
     MessagesListManager.getInstance().remove(aListId);
   }
 
   public void stop() {
     GeckoApp.mAppContext.unregisterReceiver(this);
   }
 
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -235,16 +235,17 @@ public class GeckoAppShell
     public static native void notifySmsReceived(String aSender, String aBody, int aMessageClass, long aTimestamp);
     public static native void notifySmsSent(int aId, String aReceiver, String aBody, long aTimestamp, int aRequestId);
     public static native void notifySmsDelivery(int aId, int aDeliveryStatus, String aReceiver, String aBody, long aTimestamp);
     public static native void notifySmsSendFailed(int aError, int aRequestId);
     public static native void notifyGetSms(int aId, int aDeliveryStatus, String aReceiver, String aSender, String aBody, long aTimestamp, int aRequestId);
     public static native void notifyGetSmsFailed(int aError, int aRequestId);
     public static native void notifySmsDeleted(boolean aDeleted, int aRequestId);
     public static native void notifySmsDeleteFailed(int aError, int aRequestId);
+    // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
     public static native void notifyNoMessageInList(int aRequestId);
     public static native void notifyListCreated(int aListId, int aMessageId, int aDeliveryStatus, String aReceiver, String aSender, String aBody, long aTimestamp, int aRequestId);
     public static native void notifyGotNextMessage(int aMessageId, int aDeliveryStatus, String aReceiver, String aSender, String aBody, long aTimestamp, int aRequestId);
     public static native void notifyReadingMessageListFailed(int aError, int aRequestId);
 
     public static native void scheduleComposite();
     public static native void schedulePauseComposition();
     public static native void scheduleResumeComposition(int width, int height);
--- a/mobile/android/base/GeckoSmsManager.java
+++ b/mobile/android/base/GeckoSmsManager.java
@@ -758,16 +758,17 @@ public class GeckoSmsManager
     }
 
     if (!SmsIOThread.getInstance().execute(new DeleteMessageRunnable(aMessageId, aRequestId,))) {
       Log.e("GeckoSmsManager", "Failed to add GetMessageRunnable to the SmsIOThread");
       GeckoAppShell.notifySmsDeleteFailed(kUnknownError, aRequestId);
     }
   }
 
+  // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
   public void createMessageList(long aStartDate, long aEndDate, String[] aNumbers, int aNumbersCount, int aDeliveryState, boolean aReverse, int aRequestId) {
     class CreateMessageListRunnable implements Runnable {
       private long     mStartDate;
       private long     mEndDate;
       private String[] mNumbers;
       private int      mNumbersCount;
       private int      mDeliveryState;
       private boolean  mReverse;
@@ -883,16 +884,17 @@ public class GeckoSmsManager
     }
 
     if (!SmsIOThread.getInstance().execute(new CreateMessageListRunnable(aStartDate, aEndDate, aNumbers, aNumbersCount, aDeliveryState, aReverse, aRequestId))) {
       Log.e("GeckoSmsManager", "Failed to add CreateMessageListRunnable to the SmsIOThread");
       GeckoAppShell.notifyReadingMessageListFailed(kUnknownError, aRequestId);
     }
   }
 
+  // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
   public void getNextMessageInList(int aListId, int aRequestId) {
     class GetNextMessageInListRunnable implements Runnable {
       private int mListId;
       private int mRequestId;
 
       GetNextMessageInListRunnable(int aListId, int aRequestId) {
         mListId = aListId;
         mRequestId = aRequestId;
@@ -944,16 +946,17 @@ public class GeckoSmsManager
     }
 
     if (!SmsIOThread.getInstance().execute(new GetNextMessageInListRunnable(aListId, aRequestId))) {
       Log.e("GeckoSmsManager", "Failed to add GetNextMessageInListRunnable to the SmsIOThread");
       GeckoAppShell.notifyReadingMessageListFailed(kUnknownError, aRequestId);
     }
   }
 
+  // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
   public void clearMessageList(int aListId) {
     MessagesListManager.getInstance().remove(aListId);
   }
 
   public void stop() {
     GeckoApp.mAppContext.unregisterReceiver(this);
   }
 
--- a/mozglue/android/APKOpen.cpp
+++ b/mozglue/android/APKOpen.cpp
@@ -327,16 +327,17 @@ SHELL_WRAPPER2(scheduleResumeComposition
 SHELL_WRAPPER3_WITH_RETURN(saveMessageInSentbox, jint, jstring, jstring, jlong)
 SHELL_WRAPPER5(notifySmsSent, jint, jstring, jstring, jlong, jint)
 SHELL_WRAPPER5(notifySmsDelivery, jint, jint, jstring, jstring, jlong)
 SHELL_WRAPPER2(notifySmsSendFailed, jint, jint)
 SHELL_WRAPPER7(notifyGetSms, jint, jint, jstring, jstring, jstring, jlong, jint)
 SHELL_WRAPPER2(notifyGetSmsFailed, jint, jint)
 SHELL_WRAPPER2(notifySmsDeleted, jboolean, jint)
 SHELL_WRAPPER2(notifySmsDeleteFailed, jint, jint)
+// TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
 SHELL_WRAPPER1(notifyNoMessageInList, jint)
 SHELL_WRAPPER8(notifyListCreated, jint, jint, jint, jstring, jstring, jstring, jlong, jint)
 SHELL_WRAPPER7(notifyGotNextMessage, jint, jint, jstring, jstring, jstring, jlong, jint)
 SHELL_WRAPPER2(notifyReadingMessageListFailed, jint, jint)
 SHELL_WRAPPER2(notifyFilePickerResult, jstring, jlong)
 SHELL_WRAPPER1_WITH_RETURN(getSurfaceBits, jobject, jobject)
 SHELL_WRAPPER1(onFullScreenPluginHidden, jobject)
 SHELL_WRAPPER1_WITH_RETURN(getNextMessageFromQueue, jobject, jobject)
--- a/widget/android/AndroidBridge.cpp
+++ b/widget/android/AndroidBridge.cpp
@@ -160,16 +160,17 @@ AndroidBridge::Init(JNIEnv *jEnv,
     jHandleGeckoMessage = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "handleGeckoMessage", "(Ljava/lang/String;)Ljava/lang/String;");
     jCheckUriVisited = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "checkUriVisited", "(Ljava/lang/String;)V");
     jMarkUriVisited = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "markUriVisited", "(Ljava/lang/String;)V");
 
     jCalculateLength = (jmethodID) jEnv->GetStaticMethodID(jAndroidSmsMessageClass, "calculateLength", "(Ljava/lang/CharSequence;Z)[I");
     jSendMessage = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "sendMessage", "(Ljava/lang/String;Ljava/lang/String;I)V");
     jGetMessage = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getMessage", "(II)V");
     jDeleteMessage = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "deleteMessage", "(II)V");
+    // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
     jCreateMessageList = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "createMessageList", "(JJ[Ljava/lang/String;IIZI)V");
     jGetNextMessageinList = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getNextMessageInList", "(II)V");
     jClearMessageList = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "clearMessageList", "(I)V");
 
     jGetCurrentNetworkInformation = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getCurrentNetworkInformation", "()[D");
     jEnableNetworkNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "enableNetworkNotifications", "()V");
     jDisableNetworkNotifications = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "disableNetworkNotifications", "()V");
 
@@ -1788,16 +1789,17 @@ AndroidBridge::DeleteMessage(int32_t aMe
     AutoLocalJNIFrame jniFrame(env, 0);
     env->CallStaticVoidMethod(mGeckoAppShellClass, jDeleteMessage, aMessageId, requestId);
 }
 
 void
 AndroidBridge::CreateMessageList(const dom::mobilemessage::SmsFilterData& aFilter, bool aReverse,
                                  nsIMobileMessageCallback* aRequest)
 {
+    // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
     ALOG_BRIDGE("AndroidBridge::CreateMessageList");
 
     JNIEnv *env = GetJNIEnv();
     if (!env)
         return;
 
     int32_t requestId = QueueSmsRequest(aRequest);
     NS_ENSURE_TRUE_VOID(requestId >= 0);
@@ -1818,32 +1820,34 @@ AndroidBridge::CreateMessageList(const d
                               aFilter.startDate(), aFilter.endDate(),
                               numbers, aFilter.numbers().Length(),
                               aFilter.delivery(), aReverse, requestId);
 }
 
 void
 AndroidBridge::GetNextMessageInList(int32_t aListId, nsIMobileMessageCallback* aRequest)
 {
+    // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
     ALOG_BRIDGE("AndroidBridge::GetNextMessageInList");
 
     JNIEnv *env = GetJNIEnv();
     if (!env)
         return;
 
     int32_t requestId = QueueSmsRequest(aRequest);
     NS_ENSURE_TRUE_VOID(requestId >= 0);
 
     AutoLocalJNIFrame jniFrame(env, 0);
     env->CallStaticVoidMethod(mGeckoAppShellClass, jGetNextMessageinList, aListId, requestId);
 }
 
 void
 AndroidBridge::ClearMessageList(int32_t aListId)
 {
+    // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
     ALOG_BRIDGE("AndroidBridge::ClearMessageList");
 
     JNIEnv *env = GetJNIEnv();
     if (!env)
         return;
 
     AutoLocalJNIFrame jniFrame(env, 0);
     env->CallStaticVoidMethod(mGeckoAppShellClass, jClearMessageList, aListId);
--- a/widget/android/AndroidBridge.h
+++ b/widget/android/AndroidBridge.h
@@ -323,16 +323,17 @@ public:
     void GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo);
 
     nsresult GetSegmentInfoForText(const nsAString& aText,
                                    dom::mobilemessage::SmsSegmentInfoData* aData);
     void SendMessage(const nsAString& aNumber, const nsAString& aText,
                      nsIMobileMessageCallback* aRequest);
     void GetMessage(int32_t aMessageId, nsIMobileMessageCallback* aRequest);
     void DeleteMessage(int32_t aMessageId, nsIMobileMessageCallback* aRequest);
+    // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
     void CreateMessageList(const dom::mobilemessage::SmsFilterData& aFilter,
                            bool aReverse, nsIMobileMessageCallback* aRequest);
     void GetNextMessageInList(int32_t aListId, nsIMobileMessageCallback* aRequest);
     void ClearMessageList(int32_t aListId);
     already_AddRefed<nsIMobileMessageCallback> DequeueSmsRequest(int32_t aRequestId);
 
     bool IsTablet();
 
--- a/widget/android/AndroidJNI.cpp
+++ b/widget/android/AndroidJNI.cpp
@@ -506,21 +506,17 @@ Java_org_mozilla_gecko_GeckoAppShell_not
 {
     class NotifyNoMessageInListRunnable : public nsRunnable {
     public:
       NotifyNoMessageInListRunnable(int32_t aRequestId)
         : mRequestId(aRequestId)
       {}
 
       NS_IMETHODIMP Run() {
-        nsCOMPtr<nsIMobileMessageCallback> request =
-          AndroidBridge::Bridge()->DequeueSmsRequest(mRequestId);
-        NS_ENSURE_TRUE(request, NS_ERROR_FAILURE);
-
-        request->NotifyNoMessageInList();
+        // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
         return NS_OK;
       }
 
     private:
       int32_t               mRequestId;
     };
 
 
@@ -546,22 +542,17 @@ Java_org_mozilla_gecko_GeckoAppShell_not
                                       const SmsMessageData& aMessageData,
                                       int32_t aRequestId)
         : mListId(aListId)
         , mMessageData(aMessageData)
         , mRequestId(aRequestId)
       {}
 
       NS_IMETHODIMP Run() {
-        nsCOMPtr<nsIMobileMessageCallback> request =
-          AndroidBridge::Bridge()->DequeueSmsRequest(mRequestId);
-        NS_ENSURE_TRUE(request, NS_ERROR_FAILURE);
-
-        nsCOMPtr<nsIDOMMozSmsMessage> message = new SmsMessage(mMessageData);
-        request->NotifyMessageListCreated(mListId, message);
+        // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
         return NS_OK;
       }
 
     private:
       int32_t        mListId;
       SmsMessageData mMessageData;
       int32_t        mRequestId;
     };
@@ -599,22 +590,17 @@ Java_org_mozilla_gecko_GeckoAppShell_not
     public:
       NotifyGotNextMessageRunnable(const SmsMessageData& aMessageData,
                                    int32_t aRequestId)
         : mMessageData(aMessageData)
         , mRequestId(aRequestId)
       {}
 
       NS_IMETHODIMP Run() {
-        nsCOMPtr<nsIMobileMessageCallback> request =
-          AndroidBridge::Bridge()->DequeueSmsRequest(mRequestId);
-        NS_ENSURE_TRUE(request, NS_ERROR_FAILURE);
-
-        nsCOMPtr<nsIDOMMozSmsMessage> message = new SmsMessage(mMessageData);
-        request->NotifyNextMessageInListGot(message);
+        // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
         return NS_OK;
       }
 
     private:
       SmsMessageData mMessageData;
       int32_t        mRequestId;
     };
 
@@ -646,21 +632,17 @@ Java_org_mozilla_gecko_GeckoAppShell_not
     public:
       NotifyReadListFailedRunnable(int32_t aError,
                                    int32_t aRequestId)
         : mError(aError)
         , mRequestId(aRequestId)
       {}
 
       NS_IMETHODIMP Run() {
-        nsCOMPtr<nsIMobileMessageCallback> request =
-          AndroidBridge::Bridge()->DequeueSmsRequest(mRequestId);
-        NS_ENSURE_TRUE(request, NS_ERROR_FAILURE);
-
-        request->NotifyReadMessageListFailed(mError);
+        // TODO: Bug 862718 - WebSMS Android backend: use DOMCursor
         return NS_OK;
       }
 
     private:
       int32_t  mError;
       int32_t  mRequestId;
     };