00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "CIdentityServiceStatus.h"
00018
00026 CIdentityServiceStatus* CIdentityServiceStatus::NewL(MExecAsync* aController)
00027 {
00028 CIdentityServiceStatus* self = new(ELeave) CIdentityServiceStatus(aController);
00029 CleanupStack::PushL(self);
00030 self->ConstructL();
00031 CleanupStack::Pop(self);
00032 return self;
00033 }
00034
00039 CIdentityServiceStatus::~CIdentityServiceStatus()
00040 {
00041 Cancel();
00042 }
00043
00048 void CIdentityServiceStatus::DoStartRequestL()
00049 {
00050 _LIT(KDummyAnswerPanic, "CIdentityServiceStatus Get Method");
00051 __ASSERT_ALWAYS(!IsActive(), User::Panic(KDummyAnswerPanic, 1));
00052 iRequestNotify = EFalse;
00053 CTelephony::TIdentityService condition = CTelephony::EIdServiceCallerPresentation;
00054
00055
00056 iTelephony->GetIdentityServiceStatus(iStatus,
00057 condition,
00058 iIdentityServiceStatusV1Pckg);
00059 SetActive();
00060 }
00061
00068 CIdentityServiceStatus::CIdentityServiceStatus(MExecAsync* aController)
00069 : CISVAPIAsync(aController, KIdentityServiceStatus),
00070 iIdentityServiceStatusV1Pckg(iIdentityServiceStatusV1)
00071 {
00072
00073 }
00074
00078 void CIdentityServiceStatus::ConstructL()
00079 {
00080
00081 }
00082
00087 void CIdentityServiceStatus::RunL()
00088 {
00089 if(iStatus != KErrNone)
00090 {
00091 iConsole->Printf(KError);
00092
00093
00094 iConsole->Printf(_L("%d\n"), iStatus.Int());
00095 }
00096 else
00097 {
00098
00099 iConsole->Printf(KIdentityServiceStatusMsg);
00100 switch(iIdentityServiceStatusV1.iIdentityStatus)
00101 {
00102 case CTelephony::EIdServiceActivePermanent:
00103 iConsole->Printf(_L("Provisioned and permanently active.\n"));
00104 break;
00105 case CTelephony::EIdServiceActiveDefaultRestricted:
00106 iConsole->Printf(_L("Provisioned and active. By default, the number is restricted unless overridden by the user.\n"));
00107 break;
00108 case CTelephony::EIdServiceActiveDefaultAllowed :
00109 iConsole->Printf(_L("Provisioned and active. By default, the number is displayed unless specifically restricted by the user.\n"));
00110 break;
00111 case CTelephony::EIdServiceNotProvisioned:
00112 iConsole->Printf(_L("Not provisioned.\n"));
00113 break;
00114 case CTelephony::EIdServiceUnknown:
00115 iConsole->Printf(_L("Unknown.\n"));
00116 break;
00117 }
00118 }
00119 ExampleComplete();
00120 }
00121
00125 void CIdentityServiceStatus::DoCancel()
00126 {
00127
00128 iTelephony->CancelAsync(CTelephony::EGetIdentityServiceStatusCancel);
00129 }
00130