Debugging OpenHarmony System Ability Management and Pasteboard Service Freeze on the T606 Platform
The article investigates a freeze occurring when dragging icons on an OpenHarmony 3.2.2 device after adapting the Spreadtrum T606 platform, analyzes related system‑ability (SA) logs, explains the SA and SAFWK frameworks, traces the PasteboardService failure to a missing serial‑number configuration, and proposes a practical fix.
After adapting the Spreadtrum T606 platform, dragging an icon on an OpenHarmony 3.2.2 device hangs with a "pasting to Launcher" popup; the desktop becomes unresponsive until the cancel button is pressed.
Log excerpts show errors such as:
01-01 09:01:42.311 1467 1466 E C01800/SA_CLIENT: GetSystemAbilityWrapper sa 6001 didn't start. Returning nullptr
01-01 09:01:42.312 1466 1466 E C04400/Device_Profile: DistributedDeviceProfileClient::GetDeviceProfileService get service failed
01-01 09:01:42.312 1466 1466 E C01c02/PasteboardService: [dev_profile.cpp] GetEnabledStatus# GetDeviceProfile failed, .
...The issue is tied to OpenHarmony's System Ability (SA) management, located under //foundation/systemabilitymgr . The SA manager ( samgr ) registers each SA with a unique ID, while the SAFWK component implements the SA framework.
Key SA interfaces include:
Interface
Description
SystemAbilityManager::AddSystemAbility()
Receives registration messages from the SA framework and caches them.
SystemAbilityManager::CheckSystemAbility()
Queries a registered SA by ID and returns its remote object.
SystemAbilityManager::LoadSystemAbility()
Loads non‑boot SA on demand when
run‑on‑createis false.
The PasteboardService (SA ID 3701) is a distributed SA defined in //foundation/distributeddatamgr/pasteboard . Its profile sets run‑on‑create to true, meaning it should register at boot.
Relevant code snippets:
bool PasteboardService::SetDistributedData(int32_t user, PasteData &data) {
auto clipPlugin = GetClipPlugin();
if (clipPlugin == nullptr) {
PASTEBOARD_HILOGE(PASTEBOARD_MODULE_SERVICE, "clipPlugin null.");
return false;
}
...
}Logs reveal that clipPlugin is always null, caused by DistributedModuleConfig::IsOn() returning false because the device profile cannot obtain the serial number (SN) needed for the distributed module configuration.
The SN is retrieved from the boot parameter ohos.boot.sn or, failing that, from files such as /sys/block/mmcblk0/device/cid or /proc/bootdevice/cid . On the T606 platform the storage is UFS, not eMMC, so the expected CID file does not exist, leaving the SN undefined.
Consequently, the PasteboardService cannot acquire a ClipPlugin , leading to the freeze when the user attempts to paste data.
Solution: ensure a valid serial number is provided at boot, e.g., by copying the Android boot parameter androidboot.serialno to the OpenHarmony parameter ohos.boot.sn , or by adding a proper SN source for UFS devices.
In summary, the root cause is a missing hardware‑specific configuration (SN) that breaks the distributed device profile, causing the PasteboardService to fail and the UI to freeze. Proper default values and graceful degradation for missing parameters are recommended to improve system reliability.
Coolpad Technology Team
Committed to advancing technology and supporting innovators. The Coolpad Technology Team regularly shares forward‑looking insights, product updates, and tech news. Tech experts are welcome to join; everyone is invited to follow us.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.