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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "SmsMessage.h" |
michael@0 | 7 | #include "SmsService.h" |
michael@0 | 8 | #include "SmsSegmentInfo.h" |
michael@0 | 9 | #include "AndroidBridge.h" |
michael@0 | 10 | |
michael@0 | 11 | namespace mozilla { |
michael@0 | 12 | namespace dom { |
michael@0 | 13 | namespace mobilemessage { |
michael@0 | 14 | |
michael@0 | 15 | NS_IMPL_ISUPPORTS(SmsService, nsISmsService) |
michael@0 | 16 | |
michael@0 | 17 | NS_IMETHODIMP |
michael@0 | 18 | SmsService::GetSmsDefaultServiceId(uint32_t* aServiceId) |
michael@0 | 19 | { |
michael@0 | 20 | // Android has no official DSDS support. |
michael@0 | 21 | *aServiceId = 0; |
michael@0 | 22 | return NS_OK; |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | NS_IMETHODIMP |
michael@0 | 26 | SmsService::GetSegmentInfoForText(const nsAString& aText, |
michael@0 | 27 | nsIMobileMessageCallback* aRequest) |
michael@0 | 28 | { |
michael@0 | 29 | if (!AndroidBridge::Bridge()) { |
michael@0 | 30 | return NS_ERROR_FAILURE; |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | nsresult rv = AndroidBridge::Bridge()->GetSegmentInfoForText(aText, aRequest); |
michael@0 | 34 | NS_ENSURE_SUCCESS(rv, rv); |
michael@0 | 35 | |
michael@0 | 36 | return NS_OK; |
michael@0 | 37 | } |
michael@0 | 38 | |
michael@0 | 39 | NS_IMETHODIMP |
michael@0 | 40 | SmsService::Send(uint32_t aServiceId, |
michael@0 | 41 | const nsAString& aNumber, |
michael@0 | 42 | const nsAString& aMessage, |
michael@0 | 43 | bool aSilent, |
michael@0 | 44 | nsIMobileMessageCallback* aRequest) |
michael@0 | 45 | { |
michael@0 | 46 | if (!AndroidBridge::Bridge()) { |
michael@0 | 47 | return NS_OK; |
michael@0 | 48 | } |
michael@0 | 49 | |
michael@0 | 50 | AndroidBridge::Bridge()->SendMessage(aNumber, aMessage, aRequest); |
michael@0 | 51 | return NS_OK; |
michael@0 | 52 | } |
michael@0 | 53 | |
michael@0 | 54 | NS_IMETHODIMP |
michael@0 | 55 | SmsService::IsSilentNumber(const nsAString& aNumber, |
michael@0 | 56 | bool* aIsSilent) |
michael@0 | 57 | { |
michael@0 | 58 | NS_NOTYETIMPLEMENTED("Implement me!"); |
michael@0 | 59 | return NS_ERROR_NOT_IMPLEMENTED; |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | NS_IMETHODIMP |
michael@0 | 63 | SmsService::AddSilentNumber(const nsAString& aNumber) |
michael@0 | 64 | { |
michael@0 | 65 | NS_NOTYETIMPLEMENTED("Implement me!"); |
michael@0 | 66 | return NS_ERROR_NOT_IMPLEMENTED; |
michael@0 | 67 | } |
michael@0 | 68 | |
michael@0 | 69 | NS_IMETHODIMP |
michael@0 | 70 | SmsService::RemoveSilentNumber(const nsAString& aNumber) |
michael@0 | 71 | { |
michael@0 | 72 | NS_NOTYETIMPLEMENTED("Implement me!"); |
michael@0 | 73 | return NS_ERROR_NOT_IMPLEMENTED; |
michael@0 | 74 | } |
michael@0 | 75 | |
michael@0 | 76 | NS_IMETHODIMP |
michael@0 | 77 | SmsService::GetSmscAddress(uint32_t aServiceId, |
michael@0 | 78 | nsIMobileMessageCallback *aRequest) |
michael@0 | 79 | { |
michael@0 | 80 | // TODO: bug 878016 - Android backend: implement getSMSCAddress/setSMSCAddress |
michael@0 | 81 | return NS_OK; |
michael@0 | 82 | } |
michael@0 | 83 | |
michael@0 | 84 | } // namespace mobilemessage |
michael@0 | 85 | } // namespace dom |
michael@0 | 86 | } // namespace mozilla |