equal
deleted
inserted
replaced
48 // FOTA |
48 // FOTA |
49 #include "NSmlDMGenericAlert.h" |
49 #include "NSmlDMGenericAlert.h" |
50 #include "NSmlPrivateAPI.h" |
50 #include "NSmlPrivateAPI.h" |
51 // FOTA end |
51 // FOTA end |
52 #include <featmgr.h> |
52 #include <featmgr.h> |
|
53 const TUid KUidNotifier = { 0x101F8769 }; |
53 const TInt KNotifierTimeout = 300000000; // 5 min timeout |
54 const TInt KNotifierTimeout = 300000000; // 5 min timeout |
54 _LIT8 ( KNSmlDMFotaNode, "FUMO" ); |
55 _LIT8 ( KNSmlDMFotaNode, "FUMO" ); |
55 |
56 |
56 // ================= MEMBER FUNCTIONS ======================= |
57 // ================= MEMBER FUNCTIONS ======================= |
57 |
58 |
205 aAlertCode == KNSmlDMAgentClientInitAlert || |
206 aAlertCode == KNSmlDMAgentClientInitAlert || |
206 aAlertCode == KNSmlDMAgentResultAlert || |
207 aAlertCode == KNSmlDMAgentResultAlert || |
207 aAlertCode == KNSmlDMAgentNextMessage || |
208 aAlertCode == KNSmlDMAgentNextMessage || |
208 aAlertCode == KNSmlDMAgentSessionAbortAlert || |
209 aAlertCode == KNSmlDMAgentSessionAbortAlert || |
209 aAlertCode == KNSmlDMAgentDisplayAlert || |
210 aAlertCode == KNSmlDMAgentDisplayAlert || |
210 aAlertCode == KNSmlDMAgentContinueOrAbortAlert ) |
211 aAlertCode == KNSmlDMAgentContinueOrAbortAlert |
|
212 || aAlertCode == KNSmlDMAgentUserInputAlert |
|
213 || aAlertCode == KNSmlDMAgentSingleChoiceAlert |
|
214 || aAlertCode == KNSmlDMAgentMultipleChoiceAlert ) |
211 { |
215 { |
212 return ETrue; |
216 return ETrue; |
213 } |
217 } |
214 return EFalse; |
218 return EFalse; |
215 } |
219 } |
1871 CNSmlAgentNotifierObserver::~CNSmlAgentNotifierObserver() |
1875 CNSmlAgentNotifierObserver::~CNSmlAgentNotifierObserver() |
1872 { |
1876 { |
1873 // StartNotifier called to avoid Notifier server panic, if |
1877 // StartNotifier called to avoid Notifier server panic, if |
1874 // notifier does not exist anymore. |
1878 // notifier does not exist anymore. |
1875 TBuf8<1> dummy; |
1879 TBuf8<1> dummy; |
1876 // iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also.. |
1880 iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also.. |
1877 // iNotifier.CancelNotifier( KUidNotifier ); |
1881 iNotifier.CancelNotifier( KUidNotifier ); |
1878 // iNotifier.Close(); |
1882 iNotifier.Close(); |
1879 iNotifierTimeOut.Cancel(); |
1883 iNotifierTimeOut.Cancel(); |
1880 Cancel(); |
1884 Cancel(); |
1881 } |
1885 } |
1882 |
1886 |
1883 // -------------------------------------------------------------------------- |
1887 // -------------------------------------------------------------------------- |
1893 if ( !IsActive() ) |
1897 if ( !IsActive() ) |
1894 { |
1898 { |
1895 SetActive(); |
1899 SetActive(); |
1896 } |
1900 } |
1897 |
1901 |
|
1902 //connect to repository |
|
1903 CRepository* rep = CRepository::NewLC( KCRUidPolicyManagementUtilInternalKeys ); |
|
1904 |
|
1905 //get parameters |
|
1906 TSyncMLAppLaunchNotifParams params; |
|
1907 TPckg<TSyncMLAppLaunchNotifParams> data( params ); |
|
1908 User::LeaveIfError( rep->Get( KSyncMLSessionParamsKey, data)); |
|
1909 |
|
1910 CleanupStack::PopAndDestroy( rep); |
|
1911 |
1898 iNotifierTimeOut.LaunchNotifierTimer( this ); |
1912 iNotifierTimeOut.LaunchNotifierTimer( this ); |
1899 // User::LeaveIfError( iNotifier.Connect() ); |
1913 User::LeaveIfError( iNotifier.Connect() ); |
1900 // iNotifier.StartNotifierAndGetResponse( iStatus, KUidNotifier, data, iResBuf ); |
1914 iNotifier.StartNotifierAndGetResponse( iStatus, KUidNotifier, data, iResBuf ); |
1901 } |
1915 } |
1902 |
1916 |
1903 // -------------------------------------------------------------------------- |
1917 // -------------------------------------------------------------------------- |
1904 // CNSmlNotifierObserver::NotifierTimeOut() |
1918 // CNSmlNotifierObserver::NotifierTimeOut() |
1905 // Starts notifier time out timer |
1919 // Starts notifier time out timer |
1909 { |
1923 { |
1910 iTimeOut = ETrue; |
1924 iTimeOut = ETrue; |
1911 // StartNotifier called to avoid Notifier server panic, if |
1925 // StartNotifier called to avoid Notifier server panic, if |
1912 // notifier does not exist anymore. |
1926 // notifier does not exist anymore. |
1913 TBuf8<1> dummy; |
1927 TBuf8<1> dummy; |
1914 // iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also.. |
1928 iNotifier.StartNotifier(KNullUid, dummy, dummy); // KNullUid should do also.. |
1915 |
1929 |
1916 // iNotifier.CancelNotifier( KUidNotifier ); |
1930 iNotifier.CancelNotifier( KUidNotifier ); |
1917 } |
1931 } |
1918 |
1932 |
1919 // -------------------------------------------------------------------------- |
1933 // -------------------------------------------------------------------------- |
1920 // CNSmlNotifierObserver::DoCancel() |
1934 // CNSmlNotifierObserver::DoCancel() |
1921 // From base class |
1935 // From base class |
1941 else |
1955 else |
1942 { |
1956 { |
1943 if ( ret == KErrNone ) |
1957 if ( ret == KErrNone ) |
1944 { |
1958 { |
1945 |
1959 |
|
1960 TInt sid = iResBuf().iSecureId.iUid; // read secure id from notifier. |
1946 |
1961 |
1947 // Check the response and error code. If there is a fail, dump the job. |
1962 // Check the response and error code. If there is a fail, dump the job. |
1948 // Also compare sid to creator id saved for current job to secure that listener owns the job. |
1963 // Also compare sid to creator id saved for current job to secure that listener owns the job. |
1949 /* if ( ret != KErrNone || sid != iThreadParams.iCurrentJob.CreatorId() ) |
1964 /* if ( ret != KErrNone || sid != iThreadParams.iCurrentJob.CreatorId() ) |
1950 { |
1965 { |