Bug 786419 - Part 12: Add getAppOfflineState to nsIIOService r=jduell

This commit is contained in:
Valentin Gosu 2014-10-07 17:08:07 +03:00
parent ba5dac5ccb
commit cbaaddfa84
2 changed files with 21 additions and 0 deletions

View File

@ -106,6 +106,11 @@ interface nsIIOService : nsISupports
*/
boolean isAppOffline(in uint32_t appId);
/**
* Returns the state of the app with the given appId.
* returns nsIAppOfflineInfo::{ONLINE,OFFLINE,WIFI_ONLY}
*/
long getAppOfflineState(in uint32_t appId);
/**
* Checks if a port number is banned. This involves consulting a list of

View File

@ -1505,6 +1505,22 @@ nsIOService::SetAppOfflineInternal(uint32_t aAppId, int32_t aState)
}
NS_IMETHODIMP
nsIOService::GetAppOfflineState(uint32_t aAppId, int32_t *aResult)
{
NS_ENSURE_ARG(aResult);
if (aAppId == NECKO_NO_APP_ID ||
aAppId == NECKO_UNKNOWN_APP_ID) {
return NS_ERROR_NOT_AVAILABLE;
}
*aResult = nsIAppOfflineInfo::ONLINE;
mAppsOfflineStatus.Get(aAppId, aResult);
return NS_OK;
}
NS_IMETHODIMP
nsIOService::IsAppOffline(uint32_t aAppId, bool* aResult)
{