Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Starting and Stopping Vibration

Read the original article:Starting and Stopping Vibration Requirement Description Wearables and other HarmonyOS devices often rely on haptic feedback to enhance user experience. Developers may need to: Trigger vibration f…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Read the original article:Starting and Stopping Vibration






Requirement Description



Wearables and other HarmonyOS devices often rely on haptic feedback to enhance user experience. Developers may need to:




  • Trigger vibration feedback (short taps, long buzzes, custom vibration patterns).

  • Stop ongoing vibration when necessary.



The Vibrator Service Kit provides the APIs startVibration and stopVibration for these functions.






Background Knowledge




  • Module: @kit.SensorServiceKit

  • System Capability: SystemCapability.Sensors.MiscDevice

  • Supported Devices: Phone, PC/2in1, Tablet, TV, Wearable

  • Permissions Required: ohos.permission.VIBRATE

  • Quick App Support: Yes (API version ≥ 11)



Effect Types (VibrateEffect):




  • VibratePreset – Built-in vibration patterns for taps, long presses, etc.

  • VibrateFromFile – Uses vibration definition from custom configuration file (.json).

  • VibrateTime – Fixed-duration vibration (milliseconds).

  • VibrateFromPattern – Custom vibration sequence defined programmatically.



Stop Modes (VibratorStopMode):





  • VIBRATOR_STOP_MODE_TIME – Stop fixed-duration vibration.


  • VIBRATOR_STOP_MODE_PRESET – Stop preset vibration.



Error Codes:





  • 201: Permission denied.


  • 401: Parameter error (missing, incorrect type).


  • 801: Capability not supported.


  • 14600101: Device operation failed.






Implementation Steps





  1. Import Modules:



    • vibrator from @kit.SensorServiceKit


    • BusinessError from @kit.BasicServicesKit


    • resourceManager from @kit.LocalizationKit (for file-based effects)




  2. Request Permission:
    Add ohos.permission.VIBRATE in module.json5.


  3. Start Vibration using one of four modes:


    • Preset (effectId)

    • File (hapticFd)

    • Time (duration)

    • Pattern (array definition)




  4. Stop Vibration using the appropriate stop mode.


  5. Error Handling: Wrap in try/catch, log err.code and err.message.






Code Snippet (Time-Based)






import { vibrator } from '@kit.SensorServiceKit';
import { BusinessError } from '@kit.BasicServicesKit';

try {
vibrator.startVibration({
type: 'time',
duration: 1000
}, {
id: 0,
usage: 'alarm'
}).then(() => {
console.info('1-second vibration started');
}, (error: BusinessError) => {
console.error(`Failed to start vibration. Code: ${error.code}, message: ${error.message}`);
});
} catch (err) {
let e: BusinessError = err as BusinessError;
console.error(`Unexpected error: ${e.code}, message: ${e.message}`);
}






Stop Vibration (Time Mode) Code:




import { vibrator } from '@kit.SensorServiceKit';
import { BusinessError } from '@kit.BasicServicesKit';

try {
vibrator.stopVibration(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_TIME, (error: BusinessError) => {
if (error) {
console.error(`Failed to stop vibration. Code: ${error.code}, message: ${error.message}`);
return;
}
console.info('Vibration stopped successfully');
});
} catch (err) {
let e: BusinessError = err as BusinessError;
console.error(`Unexpected error: ${e.code}, message: ${e.message}`);
}









Test Results





  • On Wearable (Watch 5):


    • Preset vibration worked for tap feedback.

    • File-based vibration triggered a custom alarm pattern.

    • Time-based vibration ran for 1 second and stopped when stopVibration was called.








  • On PC (emulator):


    • Returned 801 (capability not supported).











Limitations or Considerations





  • Device-Dependent: Some vibration effects are not supported on all devices.


  • Performance: File-based and pattern-based vibration may consume more battery.


  • Permissions: Must include ohos.permission.VIBRATE.


  • Stop Mode: Use the correct stop mode (TIME, PRESET) to terminate vibration.










Written by Taha Enes Kon

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Remote Code Execution (RCE) Defense
Syntax validiert (0 Fehler)
title: Detect Exploitation - Starting and Stopping Vibration
id: 656fd905-39ed-4831-ad5d-c06786ad5405
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-25
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-25"
        description = "YARA Signature for "
    strings:
        $str = "Starting and Stopping Vibratio" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Starting and Stopping Vibration")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Starting and Stopping Vibration*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Starting and Stopping Vibration"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Starting and Stopping Vibration.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Starting and Stopping Vibration

Thematisch verwandte Begriffe: Starting, Stopping, Vibration · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-85291 | InvoicePlane is a self-hosted open source application for managing invoi…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag