# TCU activity manager

**Detailed Description**

This section contains APIs related to TCU activity state management.

- *group* Telematics\_power\_manager

    - Typedefs

- typedef std::pair&lt;std::string, std::string&gt; ClientInfo

    - A client represented with a client and machine name pair. First element is client’s name and second element is machine’s name.

Enums

- enum TcuActivityState

    - Power states.

*Values:*

- enumerator UNKNOWN

    - Current power state is unknown

- enumerator SUSPEND

    - Master client uses it to indicate that the given machine(s) should suspend (enter lowest power state). Slave client receives it when the machine is about to suspend.

- enumerator RESUME

    - Master client uses it to indicate that the given machine(s) should resume (resume operating at normal power level). Slave client receives it when the machine is about to suspend.

- enumerator SHUTDOWN

    - Master client uses it to indicate that the given machine(s) should power-off. Slave client receives it when the machine is about to get powered-off.

- enum StateChangeResponse

    - Acknowledgement to accept or deny to transition to the notified power state.

*Values:*

- enumerator ACK

    - Ready to change state

- enumerator NACK

    - Not ready to change state

- enum ClientType

    - Defines a client’s role in the power management. A master client can cause power state change whereas a slave client listens to the state change. In a system there can be only one master client and any number of slave clients.

*Values:*

- enumerator SLAVE

    - Slave client

- enumerator MASTER

    - Master client

- enum MachineEvent

    - Confirms whether a machine is registered with the power management framework or not.

*Values:*

- enumerator AVAILABLE

    - Machine is registered

- enumerator UNAVAILABLE

    - Machine is unregistered (for example, crashed, rebooted, shutdown)

- enum TcuActivityStateAck

    - Defines the acknowledgements to TCU-activity states. The client process sends this after processing the TcuActivityState notification, indicating that it is prepared for state transition.

Acknowledgement for TcuActivityState::RESUME is not required, as the state transition has already happened.

Deprecated The API [ITcuActivityManager::sendActivityStateAck](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a03b13d5d4574f585976f7e2dab5cfbbb) (TCUActivityStateAck) that uses this enum is deprecated. Instead, use [ITcuActivityManager::sendActivityStateAck](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a03b13d5d4574f585976f7e2dab5cfbbb) (StateChangeResponse, TcuActivityState).

*Values:*

- enumerator SUSPEND\_ACK

    - processed TcuActivityState::SUSPEND notification

- enumerator SHUTDOWN\_ACK

    - processed TcuActivityState::SHUTDOWN notification

Variables

- static const std::string ALL\_MACHINES = "ALL\_MACHINES"

    - Collectively represents all the machines on the platform. For example, on hypervisor based system it includes hostvm, televm and fotavm.

- static const std::string LOCAL\_MACHINE = "LOCAL\_MACHINE"

    - Machine on which the caller process is running. On hypervisor based system local machine is the virtual machine on which the caller process is running.

- class PowerFactory

    - [PowerFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00571) allows creation of an [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574).

Public Functions

- virtual std::shared\_ptr&lt;[ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00574.html#_CPPv4N5telux5power19ITcuActivityManagerE)&gt; getTcuActivityManager([ClientInstanceConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#_CPPv4N5telux5power20ClientInstanceConfigE) config, telux::common::[InitResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1ab92f90010203f914a62cec6bd7af0a1a.html#_CPPv4N5telux6common14InitResponseCbE) callback = nullptr) = 0

    - Gets the [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574) instance.

The instance is configured for the given client type (master/slave role) and identified with the given unique name.

Note

Recommended for both hypervisor and non-hypervisor based systems.

- Parameters:

    - - **config** – **[in]** Describes the client
- **callback** – **[in]** Optional, receives result of the [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574) initialization

- Returns:

    - [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574) instance

- virtual std::shared\_ptr&lt;[IWakeupManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00578.html#_CPPv4N5telux5power14IWakeupManagerE)&gt; getWakeupManager(telux::common::[InitResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1ab92f90010203f914a62cec6bd7af0a1a.html#_CPPv4N5telux6common14InitResponseCbE) callback = nullptr) = 0

    - Gets the [IWakeupManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00578.html#a00578) instance.

- Parameters:

    - **callback** – **[in]** Optional, receives result of the [IWakeupManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00578.html#a00578) initialization

- Returns:

    - [IWakeupManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00578.html#a00578) instance

- virtual std::shared\_ptr&lt;[ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00574.html#_CPPv4N5telux5power19ITcuActivityManagerE)&gt; getTcuActivityManager([ClientType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1gae6b12b123cc294599f69b9a846baf4b9.html#_CPPv4N5telux5power10ClientTypeE) clientType = [ClientType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1gae6b12b123cc294599f69b9a846baf4b9.html#_CPPv4N5telux5power10ClientTypeE)::[SLAVE](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1gae6b12b123cc294599f69b9a846baf4b9.html#_CPPv4N5telux5power10ClientType5SLAVEE), common::[ProcType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1gac0611885856c28dedfac20b47bcd93e2.html#_CPPv4N5telux6common8ProcTypeE) procType = common::[ProcType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1gac0611885856c28dedfac20b47bcd93e2.html#_CPPv4N5telux6common8ProcTypeE)::[LOCAL\_PROC](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1gac0611885856c28dedfac20b47bcd93e2.html#_CPPv4N5telux6common8ProcType10LOCAL_PROCE), telux::common::[InitResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1ab92f90010203f914a62cec6bd7af0a1a.html#_CPPv4N5telux6common14InitResponseCbE) callback = nullptr) = 0

    - Gets the [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574) instance.

Deprecated Use [PowerFactory::getTcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00571_1a847a4258315253ac21004cbeb0dd597f)([ClientInstanceConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00572.html#a00572) config, [telux::common::InitResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1ab92f90010203f914a62cec6bd7af0a1a.html#a00235_1ab92f90010203f914a62cec6bd7af0a1a) callback) instead.

Note

This cannot be used on hypervisor based systems. Alternative API [PowerFactory::getTcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00571_1a847a4258315253ac21004cbeb0dd597f)([ClientInstanceConfig](https://docs.qualcomm.com/doc/80-PF458-8/topic/struct_a00572.html#a00572) config, [telux::common::InitResponseCb](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1ab92f90010203f914a62cec6bd7af0a1a.html#a00235_1ab92f90010203f914a62cec6bd7af0a1a) callback) should be used.

- Parameters:

    - - **clientType** – **[in]** Defines the role; master or slave
- **procType** – **[in]** Processor type on which the operations will be performed [telux::common::ProcType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1gac0611885856c28dedfac20b47bcd93e2.html#a00023_1gac0611885856c28dedfac20b47bcd93e2). telux::common::ProcType::REMOTE\_PROC is not supported.
- **callback** – **[in]** Optional, receives result of the [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574) initialization

- Returns:

    - [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574) instance

Public Static Functions

- static [PowerFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00571.html#_CPPv4N5telux5power12PowerFactoryE) &getInstance()

    - Gets the [PowerFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00571) instance.

Private Functions

- PowerFactory(const [PowerFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00571.html#_CPPv4N5telux5power12PowerFactory12PowerFactoryERK12PowerFactory)&) = delete

    - 

- [PowerFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00571.html#_CPPv4N5telux5power12PowerFactoryE) &operator=(const [PowerFactory](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00571.html#_CPPv4N5telux5power12PowerFactoryE)&) = delete

    -

- struct ClientInstanceConfig

    - [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574) configuration.

Public Members

- [ClientType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1gae6b12b123cc294599f69b9a846baf4b9.html#_CPPv4N5telux5power10ClientTypeE) clientType = [ClientType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1gae6b12b123cc294599f69b9a846baf4b9.html#_CPPv4N5telux5power10ClientTypeE)::[SLAVE](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1gae6b12b123cc294599f69b9a846baf4b9.html#_CPPv4N5telux5power10ClientType5SLAVEE)

    - [ClientType](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1gae6b12b123cc294599f69b9a846baf4b9.html#a00019_1gae6b12b123cc294599f69b9a846baf4b9) (master or slave).

- std::string clientName

    - Uniquely identifies a client. This name is passed back to the client by [ITcuActivityListener::onSlaveAckStatusUpdate](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00573_1ae72a31a385f4855fc355a3f5a8fd22b2).

It is mandatory and must be unique. To maintain uniqueness, a tuple of machine name, process name and process ID can be used (machineName\_ProcessName\_ProcessId).

- std::string machineName = [LOCAL\_MACHINE](https://docs.qualcomm.com/doc/80-PF458-8/topic/variable_a00019_1gacaa7dbccc13f14fff18617e49e9c3e48.html#_CPPv4N5telux5power13LOCAL_MACHINEE)

    - For slave clients, specifies machine(s) whose power state change it will listen to. [ALL\_MACHINES](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00019_1ga6b9b71cb4cc8dbb8e22080d7cfce02af) can be used to listen to all machines. By default, local machine on which the client process is running is listened.

For master clients it is unused.

- class ITcuActivityListener : public telux::common::[ISDKListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00046.html#_CPPv4N5telux6common12ISDKListenerE)

    - Receives notifications when there is a machine’s power state change, machine’s availability change or consolidated acknowledgement from the slave clients.

It is recommended that the client should not perform any blocking/sleeping operation from within methods in this class to ensure smooth transitions into different power states. Also the implementation should be thread safe.

Public Functions

- inline virtual void onTcuActivityStateUpdate([TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#_CPPv4N5telux5power16TcuActivityStateE) newState, std::string machineName)

    - Called when the power state of the machine for which the client registered is about to change. Called only for the slave clients not for the master client.

Upon receiving this update, client must acknowledge with the appropriate response StateChangeResponsethrough using [ITcuActivityManager::sendActivityStateAck](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a03b13d5d4574f585976f7e2dab5cfbbb) so that the platform’s power management framework can take the next appropriate step.

When a slave client receives this update for suspend state, it is expected that it should release all wakelocks and either pause or terminate operations that may prevent the given machine from entering into low power state.

- Parameters:

    - - **newState** – **[in]** New power state
- **machineName** – **[in]** Machine changing the state; [LOCAL\_MACHINE](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00019_1gacaa7dbccc13f14fff18617e49e9c3e48) or [ALL\_MACHINES](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00019_1ga6b9b71cb4cc8dbb8e22080d7cfce02af)

- inline virtual void onSlaveAckStatusUpdate(const telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) status, const std::string machineName, const std::vector&lt;[ClientInfo](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00019_1ga029b9950378692e5ab44093829cf303b.html#_CPPv4N5telux5power10ClientInfoE)&gt; unresponsiveClients, const std::vector&lt;[ClientInfo](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00019_1ga029b9950378692e5ab44093829cf303b.html#_CPPv4N5telux5power10ClientInfoE)&gt; nackResponseClients)

    - Called only for the master client, provides consolidated responses from the slave clients. This is not called for transitioning to resumed state.

On platforms with access control enabled, the client needs to have TELUX\_POWER\_CONTROL\_STATE permission for this listener API to be invoked.

Note

Recommended for both hypervisor and non-hypervisor based systems.

- Parameters:

    - - **status** – **[in]** telux::common::Status::SUCCESS if all the slaves responded with StateChangeResponse::ACK, telux::common::Status::EXPIRED if at least one slave did not respond within time limit, telux::common::Status::NOTREADY if at least one slave responded with StateChangeResponse::NACK, appropriate status code corresponding to the most number of clients if they responded differently.
- **machineName** – **[in]** Machine changing the state; [LOCAL\_MACHINE](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00019_1gacaa7dbccc13f14fff18617e49e9c3e48) or [ALL\_MACHINES](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00019_1ga6b9b71cb4cc8dbb8e22080d7cfce02af)
- **unresponsiveClients** – **[in]** Slaves that did not respond at all
- **nackResponseClients** – **[in]** Slaves with TcuActivityStateChangeResponse::NACK response

- inline virtual void onMachineUpdate(const std::string machineName, const [MachineEvent](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1gab37e224585e14d20f72e6ec2ce69d068.html#_CPPv4N5telux5power12MachineEventE) machineEvent)

    - Called when a machine registers/unregisters with the power management framework to participate in the platform coordinated suspend/resume/shutdown state transitions.

Primarily intended for the master client.

- Parameters:

    - - **machineName** – **[in]** Machine (for example, qcom,mdm or qcom,eap, etc.)
- **machineEvent** – **[in]** MachineEvent::AVAILABLE if the machine is registered MachineEvent::UNAVAILABLE if the machine is unregistered

- inline virtual void onServiceStatusChange(telux::common::[ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#_CPPv4N5telux6common13ServiceStatusE) status, std::string machName, [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#_CPPv4N5telux5power16TcuActivityStateE) currState)

    - This API is invoked for all clients (both master and slave) when the power management subsystem restarts or state changes. Considering a scenario in which the system was in the suspended state and the power management subsystem restarts, this API will broadcast the unsolicited transition of the [telux::power::TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62) across all the registered clients. With this approach, the power manager and the clients - master and slaves will be aware of the system state when the service restarts or when the state changes. When the subsystem service status is other than [telux::common::ServiceStatus::SERVICE\_AVAILABLE](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00060_1ga22f72b0f4dcf2e9569df17174c8d0dfc.html#a00060_1gga22f72b0f4dcf2e9569df17174c8d0dfcafcbb111f642c075be2582dcb12622ee8), the tcu state of the machine for which the client has registered will be telux::power::TcuActivityState::UNKNOWN

- Parameters:

    - - **status** – **[in]** - [telux::common::ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#a00023_1ga7063b4a1071b6581022e30b730684e4d)
- **machName** – **[in]** - The machine for which the client has registered.
- **currState** – **[in]** - Current TCU State of the machine for which the client has registered.

- inline virtual void onSlaveAckStatusUpdate(telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) status)

    - Called only for the master client, provides consolidated responses from the slave clients.

On platforms with access control enabled, the client needs to have TELUX\_POWER\_CONTROL\_STATE permission for this listener API to be invoked.

Deprecated Use [onSlaveAckStatusUpdate](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00573_1ae72a31a385f4855fc355a3f5a8fd22b2)(const [telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d) status, const std::string machineName, const std::vector&lt;std::pair&lt;std::string, std::string&gt;&gt; unresponsiveClients, const std::vector&lt;std::pair&lt;std::string, std::string&gt;&gt; nackResponseClients) instead.

Note

This API should not be used on virtual machines or on systems with hypervisor. The alternative API [onSlaveAckStatusUpdate](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00573_1ae72a31a385f4855fc355a3f5a8fd22b2)([telux::common::Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d) status, std::string machineName, std::vector&lt;std::string&gt; unresponsiveClients, std::vector&lt;std::string&gt; nackResponseClients) should be used.

- Parameters:

    - **status** – **[in]** Status of the slave client’s acknowledgements

- inline virtual void onTcuActivityStateUpdate([TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#_CPPv4N5telux5power16TcuActivityStateE) newState)

    - Called when the power state is going to change.

Deprecated Use [onTcuActivityStateUpdate](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00573_1a7e4c3a2b8e312af467553b7c6ce95587)(TcuActivityState newState, bool isGlobalStateChange) instead.

- Parameters:

    - **newState** – **[in]** New power state

- inline virtual ~ITcuActivityListener()

    - Destructor of [ITcuActivityListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00573).

- class ITcuActivityManager

    - [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574) provides interface to register and de-register listeners to get TCU-activity state updates. And also API to initiate TCU-activity state transition.

An application can get the appropriate TCU-activity manager (i.e. ClientType::SLAVE or ClientType::MASTER) object from the power factory. The TCU-activity manager configured as the ClientType::MASTER is responsible for triggering state transitions. TCU-activity manager configured as a ClientType::SLAVE is responsible for listening to state change indications and acknowledging when it performs necessary tasks and prepares for the state transition. A machine in this power management framework represents an application processor subsystem or a host/guest virtual machine on hypervisor based platforms.

- Only one ClientType::MASTER is allowed in the system. This master can exist only on the primary/host machine and not on the guest virtual machine or an external application processor (EAP).
- It is expected that all processes interested in a TCU-activity state change should register as ClientType::SLAVE.
- When the ClientType::MASTER changes the TCU-activate state, ClientType::SLAVEs connected to the impacted machine are notified.
- ClientType::MASTER can trigger the TCU-activity state change of a specific machine or all machines at once.
- If the ClientType::SLAVE wants to differentiate between a state change indication that is the result of a trigger for all machines or a trigger for its specific machines, it can be detected using the machine name provided in the listener API.
- When the ClientType::MASTER triggers an all machines TCU-activity state change, only the machines that are not in the desired state will undergo the state transition, and the ClientType::SLAVEs to those machines will be notified.
- In the case of

    - TcuActivityState::SUSPEND or TcuActivityState::SHUTDOWN trigger:

        - After becoming ready for state change, all ClientType::SLAVE should acknowledge back.
        - The ClientType::MASTER will get notification about the consolidated acknowledgement status of all ClientType::SLAVEs.
        - On getting a successful consolidated acknowledgement from all the ClientType::SLAVE for the suspend trigger, the power framework allows the respective machine to suspend. On getting a successful consolidated acknowledgement from all the ClientType::SLAVEs for the shutdown trigger, the power framework triggers the respective machine shutdown without waiting further.
        - If the ClientType::SLAVE sends a NACK to indicate that it is not ready for state transition or fails to acknowledge before the configured time, then the ClientType::MASTER will get to know via a consolidated/slave acknowledgement status notification.
        - In such failed cases, if the ClientType::MASTER wants to stop the state transition considering the information in the consolidated acknowledgement, then the ClientType::MASTER is allowed to trigger a new TCU-activity state change, or else the state transition will proceed after the configured timeout.
    - TcuActivityState::RESUME trigger:

        - Power framework will prevent the respective machine from going into suspend.
        - No acknowledgement will be required from ClientType::SLAVE and the ClientType::MASTER will not be getting consolidated/slave acknowledgement as machine will be already resumed.

When the application is notified about the service being unavailable, the TCU-activity state notifications will be inactive. After the service becomes available, the existing listener registrations will be maintained.

Public Functions

- virtual telux::common::[ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#_CPPv4N5telux6common13ServiceStatusE) getServiceStatus() = 0

    - Gets the power management service’s functional status.

- Returns:

    - [telux::common::ServiceStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga7063b4a1071b6581022e30b730684e4d.html#a00023_1ga7063b4a1071b6581022e30b730684e4d)

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) registerListener(std::weak\_ptr&lt;[ITcuActivityListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00573.html#_CPPv4N5telux5power20ITcuActivityListenerE)&gt; listener) = 0

    - Registers the listener to receive power state change, machine availability update and response from the slave clients.

- Parameters:

    - **listener** – **[in]** Receives updates

- Returns:

    - telux::common::Status::SUCCESS if the listener is registered, otherwise, an appropriate error code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) deregisterListener(std::weak\_ptr&lt;[ITcuActivityListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00573.html#_CPPv4N5telux5power20ITcuActivityListenerE)&gt; listener) = 0

    - Deregisters the given listener registered previously with [ITcuActivityManager::registerListener()](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1ae5a25a6ae3e0d6051c60e090860a3686).

- Parameters:

    - **listener** – **[in]** Listener to deregister

- Returns:

    - telux::common::Status::SUCCESS if the listener is deregistered, otherwise, an appropriate error code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) getMachineName(std::string &machineName) = 0

    - Gets machine’s platform name on which the caller process is running. It can be used to identify the local machine on a platform with multiple machines registered with the platform’s power management framework.

- Parameters:

    - **machineName** – **[out]** Machine name (example, qcom,mdm or qcom,eap, etc.)

- Returns:

    - telux::common::Status::SUCCESS if the machine name is obtained, otherwise, an appropriate error code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) getAllMachineNames(std::vector&lt;std::string&gt; &machineNames) = 0

    - Provides name of all the machines currently registered with the platform’s power management framework.

A master client can identify a particular machine by its name and then it can alter the state of that particular machine by passing the machine name to the [setActivityState()](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a495d321e505caa245c4b58d295482199) API.

- Parameters:

    - **machineNames** – **[out]** List of machine names

- Returns:

    - telux::common::Status::SUCCESS if all machine names are obtained, otherwise, an appropriate error code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) setActivityState([TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#_CPPv4N5telux5power16TcuActivityStateE) state, std::string machineName, telux::common::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Initiates transition to the power state specified by [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62).

Used by the master client only.

On platforms with access control enabled, caller needs to have TELUX\_POWER\_CONTROL\_STATE permission to invoke this API successfully.

Guest VM can only be suspended/resumed. It cannot be shut down using this API.

- Parameters:

    - - **state** – **[in]** Power state to which to change
- **machineName** – **[in]** [LOCAL\_MACHINE](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00019_1gacaa7dbccc13f14fff18617e49e9c3e48) if the machine on which client is running should enter this state, [ALL\_MACHINES](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00019_1ga6b9b71cb4cc8dbb8e22080d7cfce02af) if all the machines should enter this state, else a specific machine (obtained from [getMachineName()](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1af45af719c04d7e3e18f38cb75e9717b3) API) that should enter this state.
- **callback** – **[in]** Optional, receives telux::common::ErrorCode::SUCCESS if the power management framework confirms that it has received state transition request

- Returns:

    - telux::common::Status::SUCCESS if the state transition is initiated, otherwise, an appropriate error code

- virtual telux::common::[ErrorCode](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga84acdb74b7d34616b1ca497c7369810d.html#_CPPv4N5telux6common9ErrorCodeE) getActivityState(std::string machineName, [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#_CPPv4N5telux5power16TcuActivityStateE) &state) = 0

    - For the master client, gives the [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62) of the machine specified by machineName.

For the slave client, gives the [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62) of the local machine.

Note

Eval: This is a new API and is being evaluated. It is subject to change and could break backwards compatibility.

- Parameters:

    - - **machineName** – **[in]** Machine’s name for which the [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62) is requested. Machine names can be obtained through getAllMachines().
- **state** – **[out]** Current [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62) for the given machineName specified by [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62).

- Returns:

    - telux::common::ErrorCode::SUCCESS if the state is retrieved, telux::common::ErrorCode::OPERATION\_NOT\_ALLOWED if a slave client tries to get state of a machine other than the one they’re running on, an appropriate error code otherwise.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) sendActivityStateAck([StateChangeResponse](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga3a53da8d988dac10e96911f6c5c96b65.html#_CPPv4N5telux5power19StateChangeResponseE) ack, [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#_CPPv4N5telux5power16TcuActivityStateE) state) = 0

    - When a slave client receives notification in [ITcuActivityListener::onTcuActivityStateUpdate](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00573_1a7e4c3a2b8e312af467553b7c6ce95587), it must acknowledge whether it agrees to enter the new power state or not through this method. Based on this response, platform power management framework takes the next appropriate step.

Must be called only once per slave client irrespective of the number of listeners it registered.

There is no need to send response for TcuActivityState::RESUME state.

- Parameters:

    - - **ack** – **[in]** StateChangeResponse::ACK to agree to enter the new state, else StateChangeResponse::NACK to deny
- **state** – **[in]** State for which this acknowledgement is sent

- Returns:

    - telux::common::Status::SUCCESS if the acknowledgement is sent, otherwise, an appropriate error code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) setModemActivityState([TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#_CPPv4N5telux5power16TcuActivityStateE) state) = 0

    - Explicitly enables/disables certain behavior in the modem peripheral subsystem (MPSS) to conserve power. For example, specific functionalities like LTE and 5G search or measurement are scaled down.

Primarily intended for the master clients, should be used cautiously, as it could affect WWAN functionalities.

On platforms with access control enabled, caller needs to have TELUX\_POWER\_CONTROL\_STATE permission to invoke this API successfully.

- Parameters:

    - **state** – **[in]** For TcuActivityState::SUSPEND functionalities are throttled, for TcuActivityState::RESUME functionalities are unthrottled

- Returns:

    - telux::common::Status::SUCCESS if the new state is set, otherwise, an appropriate error code

- virtual bool isReady() = 0

    - Returns true if the power management service is functionally ready, false otherwise.

Deprecated Use [ITcuActivityManager::getServiceStatus()](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a3ebfa52c2d23326b9db1af4cae50b66b) API. [telux::power::ITcuActivityManager::getServiceStatus](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a3ebfa52c2d23326b9db1af4cae50b66b)

- Returns:

    - True if service is ready, false otherwise

- virtual std::future&lt;bool&gt; onReady() = 0

    - Provides a mechanism to wait for the power management service to be functionally ready.

Deprecated Use InitResponseCb in [PowerFactory::getTcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00571_1a847a4258315253ac21004cbeb0dd597f) instead.

- Returns:

    - Future object on which the caller can wait

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) setActivityState([TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#_CPPv4N5telux5power16TcuActivityStateE) state, telux::common::[ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1a8f614f0a0eeca90c94dad1967ca93bcd.html#_CPPv4N5telux6common16ResponseCallbackE) callback = nullptr) = 0

    - Initiates a TCU-activity state transition. If the platform is configured to change the modem activity state automatically when the TCU activity state is changed, this API initiates the relevant internal operation.

This API needs to be used cautiously, as it could change the power-state of the system and may affect other processes.

This API should only be invoked by a client that has instantiated the [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574) instance using ClientType::MASTER

On platforms with access control enabled, the caller needs to have TELUX\_POWER\_CONTROL\_STATE permission to invoke this API successfully.

Deprecated Use [setActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a495d321e505caa245c4b58d295482199)(TcuActivityState state, std::string machineName, [telux::common::ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1a8f614f0a0eeca90c94dad1967ca93bcd.html#a00235_1a8f614f0a0eeca90c94dad1967ca93bcd)) instead.

Note

This API should not be used on virtual machines or on systems with hypervisor. The alternative API [setActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a495d321e505caa245c4b58d295482199)( TcuActivityState state, std::string machineName = “”,[telux::common::ResponseCallback](https://docs.qualcomm.com/doc/80-PF458-8/topic/typedef_a00235_1a8f614f0a0eeca90c94dad1967ca93bcd.html#a00235_1a8f614f0a0eeca90c94dad1967ca93bcd) callback = nullptr) should be used.

- Parameters:

    - - **state** – **[in]** TCU-activity state that the system is intended to enter
- **callback** – **[in]** Optional callback to get the response for the TCU-activity state transition command

- Returns:

    - Status of setActivityState i.e. success or suitable status code.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) sendActivityStateAck([TcuActivityStateAck](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga81b4daa0c27b91b116f93e2e80d1ec3a.html#_CPPv4N5telux5power19TcuActivityStateAckE) ack) = 0

    - When a slave client receives notification in [ITcuActivityListener::onTcuActivityStateUpdate](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00573_1a7e4c3a2b8e312af467553b7c6ce95587), it must acknowledge whether it agrees to enter the new power state or not through this method. Based on this response, power management framework takes the next appropriate step.

Must be called only once per slave client irrespective of the number of listeners it registered.

Deprecated Use [sendActivityStateAck](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a03b13d5d4574f585976f7e2dab5cfbbb)( TcuActivityState state, StateChangeResponse ack) instead.

- Parameters:

    - **ack** – **[in]** StateChangeResponse::ACK to agree to enter the new state

- Returns:

    - telux::common::Status::SUCCESS if the acknowledgement is sent, otherwise, an appropriate error code

- virtual [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#_CPPv4N5telux5power16TcuActivityStateE) getActivityState() = 0

    - Gets the current [TcuActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62.html#a00019_1ga6efe388feb8f1e42a4edf85ec56f1b62) of the machine where the client is running on.

Deprecated Use [getActivityState](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a2c3a41e76be591938f024d01c2b4b322)(std::string machineName, TcuActivityState &state) instead.

- Returns:

    - TcuActivityState- the current TcuActivityState of the machine where the client is running on.

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) registerServiceStateListener(std::weak\_ptr&lt;telux::common::[IServiceStatusListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00049.html#_CPPv4N5telux6common22IServiceStatusListenerE)&gt; listener) = 0

    - Register the given listener to listen power management service’s functional status change.

Deprecated Use [telux::power::ITcuActivityManager::registerListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1ae5a25a6ae3e0d6051c60e090860a3686)( std::weak\_ptr&lt;ITcuActivityListener&gt; listener) API to get notified about power management service state change via [telux::power::ITcuActivityListener::onServiceStatusChange](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00573_1aa6b8570972d4d14318b96d7d2cb5e2f0)

- Parameters:

    - **listener** – **[in]** Receives status change updates

- Returns:

    - telux::common::Status::SUCCESS if the listener is registered, otherwise, an appropriate error code

- virtual telux::common::[Status](https://docs.qualcomm.com/doc/80-PF458-8/topic/enum_a00023_1ga45eeeff7c2860e02ae447d588d3d6e4d.html#_CPPv4N5telux6common6StatusE) deregisterServiceStateListener(std::weak\_ptr&lt;telux::common::[IServiceStatusListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/class_a00049.html#_CPPv4N5telux6common22IServiceStatusListenerE)&gt; listener) = 0

    - Deregisters the given listener registered previously with [ITcuActivityManager::registerServiceStateListener()](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1ab3d618a166b0278f8d4fd593cd9adeb9).

Deprecated Use [telux::power::ITcuActivityManager::deregisterListener](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574_1a454efcaae2bfdd27d1794d37e25ece2b)( std::weak\_ptr&lt;ITcuActivityListener&gt; listener) API instead.

- Parameters:

    - **listener** – **[in]** Listener to deregister

- Returns:

    - telux::common::Status::SUCCESS if the listener is deregistered, otherwise, an appropriate error code

- inline virtual ~ITcuActivityManager()

    - Destructor of [ITcuActivityManager](https://docs.qualcomm.com/doc/80-PF458-8/topic/tcu_activity_manager.html#a00574).

Last Published: May 20, 2026

[Previous Topic
Power](https://docs.qualcomm.com/bundle/publicresource/80-PF458-8/topics/power.md) [Next Topic
Security](https://docs.qualcomm.com/bundle/publicresource/80-PF458-8/topics/security.md)