michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "SmsMessage.h" michael@0: #include "SmsService.h" michael@0: #include "SmsSegmentInfo.h" michael@0: #include "AndroidBridge.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: namespace mobilemessage { michael@0: michael@0: NS_IMPL_ISUPPORTS(SmsService, nsISmsService) michael@0: michael@0: NS_IMETHODIMP michael@0: SmsService::GetSmsDefaultServiceId(uint32_t* aServiceId) michael@0: { michael@0: // Android has no official DSDS support. michael@0: *aServiceId = 0; michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: SmsService::GetSegmentInfoForText(const nsAString& aText, michael@0: nsIMobileMessageCallback* aRequest) michael@0: { michael@0: if (!AndroidBridge::Bridge()) { michael@0: return NS_ERROR_FAILURE; michael@0: } michael@0: michael@0: nsresult rv = AndroidBridge::Bridge()->GetSegmentInfoForText(aText, aRequest); michael@0: NS_ENSURE_SUCCESS(rv, rv); michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: SmsService::Send(uint32_t aServiceId, michael@0: const nsAString& aNumber, michael@0: const nsAString& aMessage, michael@0: bool aSilent, michael@0: nsIMobileMessageCallback* aRequest) michael@0: { michael@0: if (!AndroidBridge::Bridge()) { michael@0: return NS_OK; michael@0: } michael@0: michael@0: AndroidBridge::Bridge()->SendMessage(aNumber, aMessage, aRequest); michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: SmsService::IsSilentNumber(const nsAString& aNumber, michael@0: bool* aIsSilent) michael@0: { michael@0: NS_NOTYETIMPLEMENTED("Implement me!"); michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: SmsService::AddSilentNumber(const nsAString& aNumber) michael@0: { michael@0: NS_NOTYETIMPLEMENTED("Implement me!"); michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: SmsService::RemoveSilentNumber(const nsAString& aNumber) michael@0: { michael@0: NS_NOTYETIMPLEMENTED("Implement me!"); michael@0: return NS_ERROR_NOT_IMPLEMENTED; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: SmsService::GetSmscAddress(uint32_t aServiceId, michael@0: nsIMobileMessageCallback *aRequest) michael@0: { michael@0: // TODO: bug 878016 - Android backend: implement getSMSCAddress/setSMSCAddress michael@0: return NS_OK; michael@0: } michael@0: michael@0: } // namespace mobilemessage michael@0: } // namespace dom michael@0: } // namespace mozilla