1549 } |
1545 } |
1550 |
1546 |
1551 /** @publishedPartner */ |
1547 /** @publishedPartner */ |
1552 EXPORT_C void RApaLsSession::RegisterNonNativeApplicationTypeL(TUid aApplicationType, const TDesC& aNativeExecutable) |
1548 EXPORT_C void RApaLsSession::RegisterNonNativeApplicationTypeL(TUid aApplicationType, const TDesC& aNativeExecutable) |
1553 { |
1549 { |
1554 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
1555 User::LeaveIfError(SendReceiveWithReconnect(EAppListServRegisterNonNativeApplicationType, TIpcArgs(aApplicationType.iUid, &aNativeExecutable))); |
1550 User::LeaveIfError(SendReceiveWithReconnect(EAppListServRegisterNonNativeApplicationType, TIpcArgs(aApplicationType.iUid, &aNativeExecutable))); |
1556 #else |
|
1557 (void)aApplicationType; //to make compiler happy |
|
1558 (void)aNativeExecutable; |
|
1559 User::Leave(KErrNotSupported); |
|
1560 #endif |
|
1561 } //lint !e1762 Suppress member function could be made const |
1551 } //lint !e1762 Suppress member function could be made const |
1562 |
1552 |
1563 /** @publishedPartner */ |
1553 /** @publishedPartner */ |
1564 EXPORT_C void RApaLsSession::DeregisterNonNativeApplicationTypeL(TUid aApplicationType) |
1554 EXPORT_C void RApaLsSession::DeregisterNonNativeApplicationTypeL(TUid aApplicationType) |
1565 { |
1555 { |
1566 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
1567 User::LeaveIfError(SendReceiveWithReconnect(EAppListServDeregisterNonNativeApplicationType, TIpcArgs(aApplicationType.iUid))); |
1556 User::LeaveIfError(SendReceiveWithReconnect(EAppListServDeregisterNonNativeApplicationType, TIpcArgs(aApplicationType.iUid))); |
1568 #else |
|
1569 (void)aApplicationType; //to make compiler happy |
|
1570 User::Leave(KErrNotSupported); |
|
1571 #endif |
|
1572 } //lint !e1762 Suppress member function could be made const |
1557 } //lint !e1762 Suppress member function could be made const |
1573 |
1558 |
1574 /** @publishedPartner */ |
1559 /** @publishedPartner */ |
1575 EXPORT_C void RApaLsSession::PrepareNonNativeApplicationsUpdatesL() |
1560 EXPORT_C void RApaLsSession::PrepareNonNativeApplicationsUpdatesL() |
1576 { |
1561 { |
1577 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
1578 TIpcArgs ipcArgs(0, 0, 0, 0); |
1562 TIpcArgs ipcArgs(0, 0, 0, 0); |
1579 User::LeaveIfError(SendReceiveWithReconnect(EAppListServPrepareNonNativeApplicationsUpdates, ipcArgs)); |
1563 User::LeaveIfError(SendReceiveWithReconnect(EAppListServPrepareNonNativeApplicationsUpdates, ipcArgs)); |
1580 #else |
|
1581 User::Leave(KErrNotSupported); |
|
1582 #endif |
|
1583 } //lint !e1762 Suppress member function could be made const |
1564 } //lint !e1762 Suppress member function could be made const |
1584 |
1565 |
1585 /** @publishedPartner */ |
1566 /** @publishedPartner */ |
1586 EXPORT_C void RApaLsSession::RegisterNonNativeApplicationL(TUid aApplicationType, const TDriveUnit& aDrive, CApaRegistrationResourceFileWriter& aRegistrationResourceFile, CApaLocalisableResourceFileWriter* aLocalisableResourceFile, const RFile* aIconFile) |
1567 EXPORT_C void RApaLsSession::RegisterNonNativeApplicationL(TUid aApplicationType, const TDriveUnit& aDrive, CApaRegistrationResourceFileWriter& aRegistrationResourceFile, CApaLocalisableResourceFileWriter* aLocalisableResourceFile, const RFile* aIconFile) |
1587 { |
1568 { |
1588 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
1589 TIpcArgs ipcArgs(0, 0, 0, 0); |
1569 TIpcArgs ipcArgs(0, 0, 0, 0); |
1590 RBuf8 ipcParameter0; |
1570 RBuf8 ipcParameter0; |
1591 CleanupClosePushL(ipcParameter0); |
1571 CleanupClosePushL(ipcParameter0); |
1592 RBuf8 ipcParameter1; |
1572 RBuf8 ipcParameter1; |
1593 CleanupClosePushL(ipcParameter1); |
1573 CleanupClosePushL(ipcParameter1); |
1634 const TDesC8& ipcParameter0_asConst=ipcParameter0; |
1614 const TDesC8& ipcParameter0_asConst=ipcParameter0; |
1635 ipcArgs.Set(0, &ipcParameter0_asConst); |
1615 ipcArgs.Set(0, &ipcParameter0_asConst); |
1636 |
1616 |
1637 User::LeaveIfError(SendReceiveWithReconnect(EAppListServRegisterNonNativeApplication, ipcArgs)); |
1617 User::LeaveIfError(SendReceiveWithReconnect(EAppListServRegisterNonNativeApplication, ipcArgs)); |
1638 CleanupStack::PopAndDestroy(2, &ipcParameter0); |
1618 CleanupStack::PopAndDestroy(2, &ipcParameter0); |
1639 #else |
|
1640 (void) aApplicationType; //to make compiler happy |
|
1641 (void) aDrive; |
|
1642 (void) aRegistrationResourceFile; |
|
1643 (void) aRegistrationResourceFile; |
|
1644 (void) aLocalisableResourceFile; |
|
1645 (void) aIconFile; |
|
1646 User::Leave(KErrNotSupported); |
|
1647 #endif |
|
1648 } //lint !e1762 Suppress member function could be made const |
1619 } //lint !e1762 Suppress member function could be made const |
1649 |
1620 |
1650 /** @publishedPartner */ |
1621 /** @publishedPartner */ |
1651 EXPORT_C void RApaLsSession::DeregisterNonNativeApplicationL(TUid aApplication) |
1622 EXPORT_C void RApaLsSession::DeregisterNonNativeApplicationL(TUid aApplication) |
1652 { |
1623 { |
1653 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
1654 User::LeaveIfError(SendReceiveWithReconnect(EAppListServDeregisterNonNativeApplication, TIpcArgs(aApplication.iUid))); |
1624 User::LeaveIfError(SendReceiveWithReconnect(EAppListServDeregisterNonNativeApplication, TIpcArgs(aApplication.iUid))); |
1655 #else |
|
1656 (void) aApplication; |
|
1657 User::Leave(KErrNotSupported); |
|
1658 #endif |
|
1659 } //lint !e1762 Suppress member function could be made const |
1625 } //lint !e1762 Suppress member function could be made const |
1660 |
1626 |
1661 /** |
1627 /** |
1662 Commits the non-native application updates. This is a synchronous method which waits |
1628 Commits the non-native application updates. This is a synchronous method which waits |
1663 until the application list is updated. |
1629 until the application list is updated. |
1922 writeStream.CommitL(); |
1871 writeStream.CommitL(); |
1923 CleanupStack::PopAndDestroy(&writeStream); |
1872 CleanupStack::PopAndDestroy(&writeStream); |
1924 CleanupStack::Pop(buffer); |
1873 CleanupStack::Pop(buffer); |
1925 return buffer; |
1874 return buffer; |
1926 } |
1875 } |
1927 #endif |
|
1928 |
|
1929 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
1930 |
|
1931 /* This function is only for use by Installers. |
|
1932 |
|
1933 Installers can provide the information about installed, uninstaleld and upgraded applications using this function. |
|
1934 The function takes list of TApaAppUpdateInfo objects. TApaAppUpdateInfo object contains the application uid and |
|
1935 corresponding action done on that application like installed, uninstalled and upgraded. |
|
1936 |
|
1937 Apparc updates the application list based on the information provided in the list. |
|
1938 |
|
1939 UpdateAppListL initiates applist update. It will not wait till the applist update completed. |
|
1940 |
|
1941 @param aAppUpdateInfo List of TApaAppUpdateInfo objects, which contains application uid and corresponding action information |
|
1942 like installed, uninstalled and changed. |
|
1943 @return A standard error code. |
|
1944 @publishedAll |
|
1945 @released |
|
1946 */ |
|
1947 |
|
1948 EXPORT_C TInt RApaLsSession::UpdateAppListL(RArray<TApaAppUpdateInfo>& aAppUpdateInfo) |
|
1949 { |
|
1950 //Create a buffer with the application UID and corresponding action information. |
|
1951 CBufFlat* buffer = 0; |
|
1952 TRAPD(err, buffer = CreateAppUpdateInfoBufferL(aAppUpdateInfo)); |
|
1953 if (err) |
|
1954 return err; |
|
1955 |
|
1956 TPtr8 ptr = buffer->Ptr(0); |
|
1957 const TInt returnValue=SendReceiveWithReconnect(EAppListServUpdateAppList,TIpcArgs(&ptr)); |
|
1958 delete buffer; |
|
1959 return returnValue; |
|
1960 } |
|
1961 |
|
1962 |
|
1963 /** |
|
1964 This function is only for use by Software Install. |
|
1965 |
|
1966 ForceRegistration allows Software Install to provide a list of application information that need to be |
|
1967 included in apparc's application list even if they have not been marked as installed in the SISRegistry. |
|
1968 The force registered applications will be removed from application list once Software Install notifies |
|
1969 the end of the installation by calling UpdateApplist. |
|
1970 |
|
1971 |
|
1972 @param aAppsData The list of application information needs to be added to application list. Apparc don't take the |
|
1973 ownership of this array. |
|
1974 @return A standard error code. |
|
1975 @publishedAll |
|
1976 @released |
|
1977 */ |
|
1978 |
|
1979 EXPORT_C TInt RApaLsSession::ForceRegistration(const RPointerArray<Usif::CApplicationRegistrationData>& aForceRegAppsInfo) |
|
1980 { |
|
1981 //If there are no applications to update, just return. |
|
1982 if(aForceRegAppsInfo.Count()==0) |
|
1983 return(KErrNone); |
|
1984 |
|
1985 //Create a buffer with the application uid and corresponding action information. |
|
1986 CBufFlat* buffer = 0; |
|
1987 TRAPD(err, buffer = CreateForceRegAppInfoBufferL(aForceRegAppsInfo)); |
|
1988 if (err) |
|
1989 return err; |
|
1990 |
|
1991 TPtr8 ptr = buffer->Ptr(0); |
|
1992 const TInt returnValue=SendReceiveWithReconnect(EAppListServForceRegistration,TIpcArgs(&ptr)); |
|
1993 delete buffer; |
|
1994 return returnValue; |
|
1995 } |
|
1996 |
|
1997 |
|
1998 /* |
|
1999 * Creates a buffer for applications uids and action information. |
|
2000 */ |
|
2001 CBufFlat* RApaLsSession::CreateAppUpdateInfoBufferL(RArray<TApaAppUpdateInfo>& aAppUpdateInfo) |
|
2002 { |
|
2003 TInt count=aAppUpdateInfo.Count(); |
|
2004 TInt requiredBufferSize=sizeof(TInt32)+(count*sizeof(TApaAppUpdateInfo)); //Size of count + size of TApaAppUpdateInfo objects |
|
2005 |
|
2006 CBufFlat* const buffer = CBufFlat::NewL(requiredBufferSize); |
|
2007 CleanupStack::PushL(buffer); |
|
2008 buffer->ExpandL(0,requiredBufferSize); |
|
2009 RBufWriteStream writeStream; |
|
2010 writeStream.Open(*buffer); |
|
2011 CleanupClosePushL(writeStream); |
|
2012 |
|
2013 //Write number of TApaAppUpdateInfo objects to stream. |
|
2014 writeStream.WriteUint32L(count); |
|
2015 |
|
2016 for(TInt index=0;index<count;index++) |
|
2017 { |
|
2018 //Write one application information at a time |
|
2019 writeStream<<aAppUpdateInfo[index]; |
|
2020 } |
|
2021 |
|
2022 writeStream.CommitL(); |
|
2023 CleanupStack::PopAndDestroy(&writeStream); |
|
2024 CleanupStack::Pop(buffer); |
|
2025 |
|
2026 return buffer; |
|
2027 } |
|
2028 |
|
2029 |
|
2030 /* Creates buffer for force registered application information array*/ |
|
2031 |
|
2032 CBufFlat* RApaLsSession::CreateForceRegAppInfoBufferL(const RPointerArray<Usif::CApplicationRegistrationData>& aForceRegAppsInfo) |
|
2033 { |
|
2034 TInt count=aForceRegAppsInfo.Count(); |
|
2035 TInt requiredBufferSize=sizeof(TInt32); //For count |
|
2036 |
|
2037 for(TInt index=0; index<count; index++) |
|
2038 { |
|
2039 //Get each application information size and add it to required size. |
|
2040 requiredBufferSize += GetObjectSizeL(aForceRegAppsInfo[index]); |
|
2041 } |
|
2042 |
|
2043 CBufFlat* const buffer = CBufFlat::NewL(requiredBufferSize); |
|
2044 CleanupStack::PushL(buffer); |
|
2045 buffer->ExpandL(0,requiredBufferSize); |
|
2046 |
|
2047 RBufWriteStream writeStream; |
|
2048 writeStream.Open(*buffer); |
|
2049 CleanupClosePushL(writeStream); |
|
2050 |
|
2051 //Write count to stream. |
|
2052 writeStream.WriteUint32L(count); |
|
2053 |
|
2054 for(TInt index=0;index<count;index++) |
|
2055 { |
|
2056 //Write one applciation information at a time to stream. |
|
2057 writeStream<<*aForceRegAppsInfo[index]; |
|
2058 } |
|
2059 |
|
2060 writeStream.CommitL(); |
|
2061 CleanupStack::PopAndDestroy(&writeStream); |
|
2062 CleanupStack::Pop(buffer); |
|
2063 |
|
2064 return buffer; |
|
2065 } |
|
2066 |
|
2067 |
|
2068 |
|
2069 /* |
|
2070 Provides updated application information after apparc notifies application list change. It provides list of TApaAppUpdateInfo |
|
2071 objects which contains the information about updated application UID and the action, i.e installed, uninstalled and changed. |
|
2072 |
|
2073 The function returns empty list if the application list is changed due to initial application list creation or because of phone |
|
2074 language change. During that time the list of changed applications can be large. |
|
2075 |
|
2076 This function should be called only after the client receives the applist notification from AppArc registered through SetNotify(). Otherwise the |
|
2077 return values are unpredictable. |
|
2078 |
|
2079 @param aUpdatedAppsInfo On return, provides the list of TApaAppUpdateInfo objects, which contains changed application uids and |
|
2080 corresponding action information like installed, uninstalled and changed. If this list is empty, then |
|
2081 the applist is updated because of initial applist creation or because of phone language change. In that |
|
2082 case use GetAllApps and GetNextApp APIs to retrieve the complete applist information. |
|
2083 |
|
2084 @return A standard error code. |
|
2085 @publishedAll |
|
2086 @released |
|
2087 */ |
|
2088 |
|
2089 EXPORT_C TInt RApaLsSession::UpdatedAppsInfoL(RArray<TApaAppUpdateInfo>& aUpdatedAppsInfo) |
|
2090 { |
|
2091 const TInt KDefaultUpdateAppEntries=10; |
|
2092 |
|
2093 //Create a buffer with default size |
|
2094 TInt sizeRequired=(KDefaultUpdateAppEntries * sizeof(TApaAppUpdateInfo)) + 2; |
|
2095 CBufFlat* buffer=CBufFlat::NewL(sizeRequired); |
|
2096 CleanupStack::PushL(buffer); |
|
2097 buffer->ExpandL(0, sizeRequired); |
|
2098 TPtr8 ptr = buffer->Ptr(0); |
|
2099 |
|
2100 TPckgBuf<TInt> pckg(sizeRequired); |
|
2101 |
|
2102 //pass the buffer and size of the buffer. |
|
2103 TInt returnValue=SendReceiveWithReconnect(EAppListUpdatedAppsInfo,TIpcArgs(&ptr, &pckg)); |
|
2104 |
|
2105 //If the size of the buffer is not enough expand it to required size and pass it again. |
|
2106 if(returnValue==KErrOverflow) |
|
2107 { |
|
2108 buffer->ExpandL(0, sizeRequired); |
|
2109 returnValue=SendReceiveWithReconnect(EAppListUpdatedAppsInfo,TIpcArgs(&ptr, &pckg)); |
|
2110 } |
|
2111 |
|
2112 if(returnValue==KErrNone) |
|
2113 { |
|
2114 RBufReadStream readStream; |
|
2115 readStream.Open(*buffer); |
|
2116 |
|
2117 //Read count from the stream |
|
2118 TInt count=readStream.ReadUint32L(); |
|
2119 |
|
2120 //Read updated applications information and add it to array |
|
2121 for(TInt index=0; index<count; index++) |
|
2122 { |
|
2123 TApaAppUpdateInfo appUpdateInfo; |
|
2124 readStream>>appUpdateInfo; |
|
2125 aUpdatedAppsInfo.AppendL(appUpdateInfo); |
|
2126 } |
|
2127 } |
|
2128 |
|
2129 CleanupStack::PopAndDestroy(buffer); |
|
2130 return returnValue; |
|
2131 } |
|
2132 |
|
2133 #endif |
|
2134 |
|