Description
The IPlatformService interface is implemented by the Platform Service which supervises the operation of all components in the platform. All components must use this interface to tell the Platform Service they have initialized successfully. If a component cannot initialize successfully it should just exit, which is a condition the Platform Service will detect very rapidly and it will handle the situation appropriately.
- See also:
- IToiPlatformService
List of all members.
Public Member Functions |
| void | ReportComponent (in long serviceId, in string address) raises (TToiInvalidArgumentException) |
| void | UnloadDone (in long serviceId) raises (TToiInvalidArgumentException) |
| oneway void | ReportPing (in long serviceId) |
| void | IsInStandby (out boolean value) |
| void | GetStartupType (out TStartupType type) |
| oneway void | SetStartupType (in TStartupType startupType) |
| oneway void | RestartPlatformNow () |
| oneway void | ReportApplicationShutdownComplete () |
| void | RegisterFactoryResetHandler (in string storagePath, in string address, out long handlerId) raises (TToiInvalidArgumentException) |
| void | UnregisterFactoryResetHandler (in long handlerId) raises (TToiInvalidArgumentException) |
| oneway void | FactoryResetHandlerDone (in long handlerId) |
| void | CreatePowerControlInstanceInternal (in IToiPowerControl::TToiPowerProfileAccess access, in string serviceName, out string address) |
| void | RegisterStartupHandler (out long id) |
| void | ReportStartupStatus (in long id, in TStatusCode statusCode) |
| void | RegisterObserverInternal (in string address) raises (TToiInvalidArgumentException) |
| void | AddAppDataPathForRemoval (in IToiApplicationService::TToiApplicationId appId, in long flags, in string path) raises (TToiInvalidArgumentException, TToiPermissionDeniedException) |
| void | ClearFastbootFlag () raises (TToiNotEnoughResourcesException) |
| void | GetUpTime (out long time) |
Public Attributes |
|
const string | FLASH_APPLICATION_PATH = "/flash/applications" |
|
const string | FLASH_SERVICE_PATH = "/flash/services" |
Public Types |
| enum | TStartupType {
STARTUP_TYPE_POWER_ON,
STARTUP_TYPE_REBOOT,
STARTUP_TYPE_WAKE_UP,
STARTUP_TYPE_PLATFORM_FAILURE,
STARTUP_TYPE_PLATFORM_RESTART,
STARTUP_TYPE_RESET_LEVEL_0,
STARTUP_TYPE_RESET_LEVEL_1,
STARTUP_TYPE_RESET_LEVEL_2,
STARTUP_TYPE_RESET_LEVEL_3
} |
| enum | TStatusCode { STATUS_CODE_OK,
STATUS_CODE_PENDING,
STATUS_CODE_NO_NETWORK,
STATUS_CODE_NO_IP_ADDRESS
} |
Member Enumeration Documentation
The TStartupType enumerates the ways in which the platform can be starting up.
- Enumerator:
| STARTUP_TYPE_POWER_ON |
The platform is starting after a hard reset (Power On)
|
| STARTUP_TYPE_REBOOT |
The platform is rebooting due to a soft reset
|
| STARTUP_TYPE_WAKE_UP |
The platform is waking up from power save mode. This mode is not used yet.
|
| STARTUP_TYPE_PLATFORM_FAILURE |
The platform is restarting due to a failure in some platform component
|
| STARTUP_TYPE_PLATFORM_RESTART |
Platform was restarted in standby mode
|
| STARTUP_TYPE_RESET_LEVEL_0 |
The platform is restarting after a reset is requested, and few, if any, configuration settings are removed.
|
| STARTUP_TYPE_RESET_LEVEL_1 |
The platform was reset before receiving a fresh set of configuration settings from a headend. In preparation, many configuration settings were removed.
|
| STARTUP_TYPE_RESET_LEVEL_2 |
Most platform settings were erased on this type of reset.
|
| STARTUP_TYPE_RESET_LEVEL_3 |
Most platform settings were erased on this type of reset. In addition, all applications were removed as well.
|
- Enumerator:
| STATUS_CODE_OK |
It is now fine to call IPlatformComponent::OnLoad() from the perspective of the reporting service.
|
| STATUS_CODE_PENDING |
The previous error code is now invalid and the reporting service will soon report a new status. This is used to clear it's previous error message from boot splash.
|
| STATUS_CODE_NO_NETWORK |
No network available. Typically the network cable is not plugged in.
|
| STATUS_CODE_NO_IP_ADDRESS |
No IP address could be obtained from the DHCP server.
|
Member Function Documentation
| void IPlatformService::AddAppDataPathForRemoval |
( |
in IToiApplicationService::TToiApplicationId |
appId, |
|
|
in long |
flags, |
|
|
in string |
path |
|
) |
| raises (TToiInvalidArgumentException, TToiPermissionDeniedException) |
Add path that needs to be removed by platform service in factory reset.
- Parameters:
-
| appId | Application identifier. |
| flags | Flags indicating which parts to reset. |
- See also:
- TToiResetFlag.
- Parameters:
-
| path | Path to the file/directory. |
- Exceptions:
-
| TToiInvalidArgumentException | Raised if the specified path is invalid. |
| TToiPermissionDeniedException | Raised if lack of permission to remove the path. |
| void IPlatformService::ClearFastbootFlag |
( |
| ) |
raises (TToiNotEnoughResourcesException) |
Can be used by client to disable fast boot flag
- Exceptions:
-
| TToiNotEnoughResourcesException | Raised if dbl resource cannot be opened. |
| void IPlatformService::CreatePowerControlInstanceInternal |
( |
in IToiPowerControl::TToiPowerProfileAccess |
access, |
|
|
in string |
serviceName, |
|
|
out string |
address |
|
) |
| |
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
This method creates a power control instance that a service can use for power management purposes. Note that services are always expected to vote during power profile switches but not to initiate a switch. Consequently this call contains fewer parameters than the corresponding TOI method.
- Parameters:
-
| access | Determines if the registering service wants to be able to have access to initiate power profile switches. Note that usually a service should not have that access, you should have very good reasons for giving a service that access. |
| serviceName | The service name is only used for platform debugging purposes. |
- Return values:
-
| address | Address to an IToiPowerControl interface. |
| oneway void IPlatformService::FactoryResetHandlerDone |
( |
in long |
handlerId | ) |
|
A factory reset handler must call FactoryResetHandlerDone after having received an IFactoryResetHandler::PerformFactoryReset callback and completed the requested reset to report that it has done its part of the factory reset.
- Parameters:
-
| handlerId | The id returned from RegisterFactoryResetHandler. |
| void IPlatformService::GetStartupType |
( |
out TStartupType |
type | ) |
|
A platform component can call this method to get information about the current startup mode.
- Return values:
-
| type | the current startup mode |
| void IPlatformService::GetUpTime |
( |
out long |
time | ) |
|
This method returns the number of seconds since the last transition from low power mode to active mode.
- Parameters:
-
| time | returned time since start up. |
| void IPlatformService::IsInStandby |
( |
out boolean |
value | ) |
|
A platform component can call this IsInStandby to get information if we are in standby mode.
- Return values:
-
| value | true if we are in standby mode. |
| void IPlatformService::RegisterFactoryResetHandler |
( |
in string |
storagePath, |
|
|
in string |
address, |
|
|
out long |
handlerId |
|
) |
| raises (TToiInvalidArgumentException) |
Register an IFactoryResetHandler callback interface to do something when IToiPlatformService::FactoryReset is called.
The platform service will call all registered handlers, passing along the reset flags. The handler is expected to take action after examining the flags and call FactoryResetHandlerDone when done.
- Parameters:
-
| storagePath | A path that will be handled by the calling component on factory reset. If the empty string is provided as value, no path will be registered for the handler. |
| address | The address to the IFactoryResetHandler callback interface. |
- Return values:
-
| handlerId | A unique id that the handler must use in the FactoryResetHandlerDone callback. |
- Exceptions:
-
| TToiInvalidArgumentException | An invalid argument exception will be raised if the address parameter is invalid. |
| void IPlatformService::RegisterObserverInternal |
( |
in string |
address | ) |
raises (TToiInvalidArgumentException) |
Add an internal platform service observer.
- Parameters:
-
| address | IPC address to an observer that implements the IToiPlatformObserver interface. |
- Exceptions:
-
| TToiInvalidArgumentException | Raised if the specified address is not a legal IPC address. |
| void IPlatformService::RegisterStartupHandler |
( |
out long |
id | ) |
|
- Technical Preview:
- This method is a TECHNICAL PREVIEW, it may change.
This method should be called before ReportComponent() by the services that wants to give a positive or negative startup status code through ReportStartupStatus(). Not before all startup handlers has reported STATUS_CODE_OK the platform service calls IPlatformComponent::OnLoad(). This is used to print an error message at boot time if for example the net service fails to receive an IP address from the DHCP when an IP address is required to boot.
- Return values:
-
| oneway void IPlatformService::ReportApplicationShutdownComplete |
( |
| ) |
|
Used by appman to report that all applications have been shut down completely.
| void IPlatformService::ReportComponent |
( |
in long |
serviceId, |
|
|
in string |
address |
|
) |
| raises (TToiInvalidArgumentException) |
A platform component must call the ReportComponent function exactly once after it has initialized successfully. When doing so, it registers an IPlatformComponent callback interface on which the Platform Service will notify the component about changes in the system execution state.
- Parameters:
-
- Exceptions:
-
| TToiInvalidArgumentException | An invalid argument exception will be raised if the serviceId parameter is not recognized by the Platform Service. |
| oneway void IPlatformService::ReportPing |
( |
in long |
serviceId | ) |
|
A platform component must call ReportPing after receiving a IPlatformComponent::Ping to report it is still alive.
- Parameters:
-
| void IPlatformService::ReportStartupStatus |
( |
in long |
id, |
|
|
in TStatusCode |
statusCode |
|
) |
| |
| oneway void IPlatformService::RestartPlatformNow |
( |
| ) |
|
Used by appman to restart the platform if an application fails.
| oneway void IPlatformService::SetStartupType |
( |
in TStartupType |
startupType | ) |
|
A platform component can call this method to set the current startup mode.
- Parameters:
-
| startupType | The type to which the current startup type should be set. |
| void IPlatformService::UnloadDone |
( |
in long |
serviceId | ) |
raises (TToiInvalidArgumentException) |
A platform component must call UnloadDone after receiving a IPlatformComponent::OnUnload and shutting down all running applications.
- Parameters:
-
- Exceptions:
-
| TToiInvalidArgumentException | An invalid argument exception will be raised if the serviceId parameter is not recognized by the Platform Service. |
| void IPlatformService::UnregisterFactoryResetHandler |
( |
in long |
handlerId | ) |
raises (TToiInvalidArgumentException) |
Unregisters a previously registered factory reset handler.
- Parameters:
-
| handlerId | The id returned from RegisterFactoryResetHandler. |
- Exceptions:
-
| TToiInvalidArgumentException | Raised if the handler id is invalid. |
|