我要实现对短信的监测,是我要监测的号码信息就删除,现在问题是:
1.短信无法删除。
2.我想屏蔽他短信铃声,也无法实现。
case EMsvEntriesChanged:
{
TMsvId* EntryId = STATIC_CAST(TMsvId*,aArg2);
if( *EntryId != KMsvGlobalInBoxIndexEntryId )
{
break;
}
CMsvEntrySelection* NewEntryList = STATIC_CAST(CMsvEntrySelection* ,aArg1);
TInt i = 0;
for(; i<NewEntryList->Count();i++)
{
CMsvEntry* NewEntry = iSmsSession->GetEntryL(NewEntryList->At(i));
TMsvEntry Entry = NewEntry->Entry();
TPtrC Detail(Entry.iDetails);//发信人号码
TPtrC Description(Entry.iDescription);//短信内容
WriteLog(Detail);
WriteLog(Description);
if(Detail.Find(_L("13125436548")) != 0)
{
Entry.SetInPreparation(EFalse);
Entry.SetNew(EFalse);
Entry.SetUnread(EFalse);
Entry.SetVisible(EFalse);
NewEntry->ChangeL(Entry);
TMsvId myId = NewEntryList->At(i);
iSmsSession->RemoveEntry(myId);
//NewEntry->DeleteL(myId);
}
delete NewEntry;
}
delete NewEntryList;
break;
}

Reply With Quote


