dom/mobilemessage/src/android/SmsService.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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 "SmsMessage.h"
     7 #include "SmsService.h"
     8 #include "SmsSegmentInfo.h"
     9 #include "AndroidBridge.h"
    11 namespace mozilla {
    12 namespace dom {
    13 namespace mobilemessage {
    15 NS_IMPL_ISUPPORTS(SmsService, nsISmsService)
    17 NS_IMETHODIMP
    18 SmsService::GetSmsDefaultServiceId(uint32_t* aServiceId)
    19 {
    20   // Android has no official DSDS support.
    21   *aServiceId = 0;
    22   return NS_OK;
    23 }
    25 NS_IMETHODIMP
    26 SmsService::GetSegmentInfoForText(const nsAString& aText,
    27                                   nsIMobileMessageCallback* aRequest)
    28 {
    29   if (!AndroidBridge::Bridge()) {
    30     return NS_ERROR_FAILURE;
    31   }
    33   nsresult rv = AndroidBridge::Bridge()->GetSegmentInfoForText(aText, aRequest);
    34   NS_ENSURE_SUCCESS(rv, rv);
    36   return NS_OK;
    37 }
    39 NS_IMETHODIMP
    40 SmsService::Send(uint32_t aServiceId,
    41                  const nsAString& aNumber,
    42                  const nsAString& aMessage,
    43                  bool aSilent,
    44                  nsIMobileMessageCallback* aRequest)
    45 {
    46   if (!AndroidBridge::Bridge()) {
    47     return NS_OK;
    48   }
    50   AndroidBridge::Bridge()->SendMessage(aNumber, aMessage, aRequest);
    51   return NS_OK;
    52 }
    54 NS_IMETHODIMP
    55 SmsService::IsSilentNumber(const nsAString& aNumber,
    56                            bool*            aIsSilent)
    57 {
    58   NS_NOTYETIMPLEMENTED("Implement me!");
    59   return NS_ERROR_NOT_IMPLEMENTED;
    60 }
    62 NS_IMETHODIMP
    63 SmsService::AddSilentNumber(const nsAString& aNumber)
    64 {
    65   NS_NOTYETIMPLEMENTED("Implement me!");
    66   return NS_ERROR_NOT_IMPLEMENTED;
    67 }
    69 NS_IMETHODIMP
    70 SmsService::RemoveSilentNumber(const nsAString& aNumber)
    71 {
    72   NS_NOTYETIMPLEMENTED("Implement me!");
    73   return NS_ERROR_NOT_IMPLEMENTED;
    74 }
    76 NS_IMETHODIMP
    77 SmsService::GetSmscAddress(uint32_t aServiceId,
    78                            nsIMobileMessageCallback *aRequest)
    79 {
    80   // TODO: bug 878016 - Android backend: implement getSMSCAddress/setSMSCAddress
    81   return NS_OK;
    82 }
    84 } // namespace mobilemessage
    85 } // namespace dom
    86 } // namespace mozilla

mercurial