javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/sms/SMSCRetriever.java
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 package com.nokia.mj.impl.sms;
       
    19 
       
    20 import java.io.IOException;
       
    21 import com.nokia.mj.impl.utils.Logger;
       
    22 import com.nokia.mj.impl.rt.support.Jvm;
       
    23 
       
    24 /**
       
    25  * Provides some utilities to: Retrieve Service Centre Number.
       
    26  * @author Nokia Corporation
       
    27  * @see
       
    28  */
       
    29 public final class SMSCRetriever
       
    30 {
       
    31 
       
    32     static
       
    33     {
       
    34         try
       
    35         {
       
    36             Jvm.loadSystemLibrary("javawma");
       
    37         }
       
    38         catch (Exception e)
       
    39         {
       
    40             Logger.LOG(Logger.EWMA, Logger.EInfo, e.toString());
       
    41         }
       
    42     }
       
    43 
       
    44     /**
       
    45      * Method to get service centre number from native side
       
    46      * @return service centre number
       
    47      */
       
    48     public static String getSmscNum()
       
    49     {
       
    50         String smscNum = null;
       
    51         smscNum = _getSmscNum();
       
    52         if ((smscNum == null) || (0 == smscNum.length()))
       
    53         {
       
    54             smscNum = null;
       
    55         }
       
    56         return smscNum;
       
    57     }
       
    58 
       
    59     /**
       
    60      * Private native method that gets the Service Centre Number.
       
    61      *
       
    62      * @param nativeHandle
       
    63      *            handle to native side objects
       
    64      * @return Service Centre Number as string
       
    65      * @see
       
    66      */
       
    67     private native static String _getSmscNum();
       
    68 }