00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "CCallBarringStatus.h"
00017
00025 CCallBarringStatus* CCallBarringStatus::NewL(MExecAsync* aController)
00026 {
00027 CCallBarringStatus* self = new(ELeave) CCallBarringStatus(aController);
00028 CleanupStack::PushL(self);
00029 self->ConstructL();
00030 CleanupStack::Pop(self);
00031 return self;
00032 }
00033
00038 CCallBarringStatus::~CCallBarringStatus()
00039 {
00040 Cancel();
00041 }
00042
00047 void CCallBarringStatus::DoStartRequestL()
00048 {
00049 _LIT( KNotifyPanic, "CCallBarringStatus Get Method" );
00050 __ASSERT_ALWAYS( !IsActive(), User::Panic( KNotifyPanic, 1 ));
00051 iRequestNotify = EFalse;
00052 CTelephony::TCallBarringCondition condition = CTelephony::EBarAllIncoming;
00053
00054
00055 iTelephony->GetCallBarringStatus( iStatus,
00056 condition,
00057 iCallBarringStatusV1Pckg);
00058 SetActive();
00059 }
00060
00067 CCallBarringStatus::CCallBarringStatus(MExecAsync* aController)
00068 : CISVAPIAsync(aController, KCallBarringStatus)
00069 , iCallBarringStatusV1Pckg(iCallBarringStatusV1)
00070 {
00071
00072 }
00073
00077 void CCallBarringStatus::ConstructL()
00078 {
00079
00080 }
00081
00086 void CCallBarringStatus::RunL()
00087 {
00088 if(iStatus != KErrNone)
00089 {
00090 iConsole->Printf(KError);
00091
00092
00093 iConsole->Printf(_L("%d\n"), iStatus.Int());
00094 }
00095 else
00096 {
00097
00098 iConsole->Printf(KCallBarringStatusMsg);
00099 switch(iCallBarringStatusV1.iCallBarring)
00100 {
00101 case CTelephony::EStatusActive:
00102
00103
00104
00105 iConsole->Printf(_L("Call Barring Restricts incoming calls!\n"));
00106 iConsole->Printf(_L("Recify this to remove this delay\n"));
00107 User::After(5000000);
00108 ExampleComplete();
00109 break;
00110 case CTelephony::ENotActive:
00111 case CTelephony::ENotProvisioned:
00112 case CTelephony::ENotAvailable:
00113 case CTelephony::EUnknown:
00114 ExampleComplete();
00115 break;
00116 }
00117 }
00118 }
00119
00123 void CCallBarringStatus::DoCancel()
00124 {
00125
00126 iTelephony->CancelAsync(CTelephony::EGetCallBarringStatusCancel);
00127 }