언어 설정

Menu
Sites
Language
Getting null string while calling simInfo.GetPhoneNumber() method.

Hi,

I am getting null string while calling a method GetPhoneNumber().

Here is my code:

GetSimInfo(void){

        result r;
         int mnc;
         int mcc;
        bool isAvailable;
        String spn;
        String iccId;
       String operatorName;
        String phoneNumber;
         SimType simType;

         SimStateManager* pSimStateManager = new (std::nothrow) SimStateManager();
         SimInfo simInfo;
         SimState simState = SIM_STATE_UNKNOWN;

        r = pSimStateManager->Construct();
        r = pSimStateManager->SetSimEventListener(this);
        r = pSimStateManager->GetSimInfo(simInfo);
       simState = pSimStateManager->GetSimState();
         AppLog("Sim State = %d",simState);
         mnc = simInfo.GetMnc();
         r = GetLastResult();
         if(r == E_SUCCESS)
             AppLog("MNC = %d", mnc);

         mcc = simInfo.GetMcc();
         r = GetLastResult();
         if(r == E_SUCCESS)
                AppLog("MCC = %d", mcc);

         spn = simInfo.GetSpn();
         r = GetLastResult();
         if(r == E_SUCCESS)
                AppLog("SPN = %S", spn.GetPointer());

         iccId = simInfo.GetIccId();
         r = GetLastResult();
         if(r == E_SUCCESS)
                AppLog("ICC Id = %S", iccId.GetPointer());

         operatorName = simInfo.GetOperatorName();
         r = GetLastResult();
         if(r == E_SUCCESS)
                AppLog("OperatorName = %S", operatorName.GetPointer());

         isAvailable = simInfo.IsAvailable();
         AppLog("isAvailable = %d", isAvailable);

         simType = simInfo.GetSimType();
         r = GetLastResult();
         if(r == E_SUCCESS)
              AppLog("Upendra--simType = %d", simType);

         phoneNumber = simInfo.GetPhoneNumber();
         r = GetLastResult();
         if(r == E_SUCCESS)
                AppLog("PhoneNumber = %S", phoneNumber.GetPointer());

}

 

Output for "OperatorName" and "PhoneNumber " is null rest all are working fine.

isAvailable = 1 and simState =3, SIM is available and state is also ready.But i do not know why OperatorName and PhoneNumber is null string. please guide me.

Thanks

Upendra

Responses

6 댓글
Alex Ashirov

Hi,

Did you add http://tizen.org/privilege/telephony privileges?
 

Upendra Kumar

Hi,

Yes, I have added http://tizen.org/privilege/telephony privileges.

Pushpa G

Are you able to make a call using that sim?

Upendra Kumar

Yes, i am able to call and sms from this sim. same behaviour with other sim.

Pushpa G

And is this issue happening only for this sim or with other sims also?

Upendra Kumar

with other sim also same problem.