Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "SmsFilter.h"
7 #include "MobileMessageDatabaseService.h"
8 #include "AndroidBridge.h"
10 namespace mozilla {
11 namespace dom {
12 namespace mobilemessage {
14 NS_IMPL_ISUPPORTS(MobileMessageDatabaseService, nsIMobileMessageDatabaseService)
16 NS_IMETHODIMP
17 MobileMessageDatabaseService::GetMessageMoz(int32_t aMessageId,
18 nsIMobileMessageCallback* aRequest)
19 {
20 if (!AndroidBridge::Bridge()) {
21 return NS_OK;
22 }
24 AndroidBridge::Bridge()->GetMessage(aMessageId, aRequest);
25 return NS_OK;
26 }
28 NS_IMETHODIMP
29 MobileMessageDatabaseService::DeleteMessage(int32_t *aMessageIds,
30 uint32_t aLength,
31 nsIMobileMessageCallback* aRequest)
32 {
33 if (!AndroidBridge::Bridge()) {
34 return NS_OK;
35 }
37 if (!aMessageIds) {
38 return NS_OK;
39 }
41 if (aLength != 1) {
42 return NS_ERROR_FAILURE;
43 }
45 AndroidBridge::Bridge()->DeleteMessage(aMessageIds[0], aRequest);
46 return NS_OK;
47 }
49 NS_IMETHODIMP
50 MobileMessageDatabaseService::CreateMessageCursor(nsIDOMMozSmsFilter* aFilter,
51 bool aReverse,
52 nsIMobileMessageCursorCallback* aCallback,
53 nsICursorContinueCallback** aResult)
54 {
55 return NS_ERROR_NOT_IMPLEMENTED;
56 }
58 NS_IMETHODIMP
59 MobileMessageDatabaseService::MarkMessageRead(int32_t aMessageId,
60 bool aValue,
61 bool aSendReadReport,
62 nsIMobileMessageCallback* aRequest)
63 {
64 // TODO: This would need to be implemented as part of Bug 748391
65 return NS_OK;
66 }
68 NS_IMETHODIMP
69 MobileMessageDatabaseService::CreateThreadCursor(nsIMobileMessageCursorCallback* aCallback,
70 nsICursorContinueCallback** aResult)
71 {
72 NS_NOTYETIMPLEMENTED("Implement me!");
73 return NS_ERROR_NOT_IMPLEMENTED;
74 }
76 } // namespace mobilemessage
77 } // namespace dom
78 } // namespace mozilla