/*

 * Copyright (c) 2023-2026 Huawei Device Co., Ltd.

 * Licensed under the Apache License, Version 2.0 (the "License");

 * you may not use this file except in compliance with the License.

 * You may obtain a copy of the License at

 *

 *     http://www.apache.org/licenses/LICENSE-2.0

 *

 * Unless required by applicable law or agreed to in writing, software

 * distributed under the License is distributed on an "AS IS" BASIS,

 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

 * See the License for the specific language governing permissions and

 * limitations under the License.

 */



/**

 * @file

 * @kit AudioKit

 */



import type { AsyncCallback } from './@ohos.base';

import type Context from './application/Context';

import type BaseContext from './application/BaseContext';

import type { RingtonePlayer as _RingtonePlayer } from './multimedia/ringtonePlayer';

import type { RingtoneOptions as _RingtoneOptions } from './multimedia/ringtonePlayer';

import type { SystemTonePlayer as _SystemTonePlayer } from './multimedia/systemTonePlayer';

import type { SystemToneOptions as _SystemToneOptions } from './multimedia/systemTonePlayer';

import type { SystemSoundPlayer as _SystemSoundPlayer } from './multimedia/SystemSoundPlayer';



/**

 * This module provides basic capabilities for managing system sound effects, including defining system sound effect 

 * types and obtaining system sound effect players.

 *

 * @syscap SystemCapability.Multimedia.SystemSound.Core

 * @systemapi [since 10 - 22]

 * @publicapi [since 23]

 * @since 10 dynamic

 * @since 23 static

 */

declare namespace systemSoundManager {



  /**

   * Error enum for system sound.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 20 dynamic

   * @since 23 static

   */

  enum SystemSoundError {

    /**

     * IO error.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    ERROR_IO = 5400103,



    /**

     * No error.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    ERROR_OK = 20700000,



    /**

     * Type mismatch.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    ERROR_TYPE_MISMATCH = 20700001,



    /**

     * Unsupported operation.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    ERROR_UNSUPPORTED_OPERATION = 20700003,



    /**

     * Data size exceeds the limit.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    ERROR_DATA_TOO_LARGE = 20700004,



    /**

     * The number of files exceeds the limit.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    ERROR_TOO_MANY_FILES = 20700005,



    /**

     * Insufficient ROM space.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    ERROR_INSUFFICIENT_ROM = 20700006,



    /**

     * Invalid parameter.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    ERROR_INVALID_PARAM = 20700007

  }



  /**

   * Enum for ringtone type.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 10 dynamic

   * @since 23 static

   */

  enum RingtoneType {

    /**

     * Default type.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 10 dynamiconly

     * @deprecated since 11

     * @useinstead systemSoundManager.RingtoneType#RINGTONE_TYPE_SIM_CARD_0

     */

    RINGTONE_TYPE_DEFAULT = 0,



    /**

     * Ringtone type for sim card 0.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     * @since 23 static

     */

    RINGTONE_TYPE_SIM_CARD_0 = 0,



    /**

     * Multi-sim type.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 10 dynamiconly

     * @deprecated since 11

     * @useinstead systemSoundManager.RingtoneType#RINGTONE_TYPE_SIM_CARD_1

     */

    RINGTONE_TYPE_MULTISIM = 1,



    /**

     * Ringtone type for sim card 1.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     * @since 23 static

     */

    RINGTONE_TYPE_SIM_CARD_1 = 1,

    	 

    /**

     * Ringtone type for esim card 0.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @stagemodelonly

     * @since 26.0.0 dynamic&static

     */

    RINGTONE_TYPE_ESIM_CARD_0 = 2,

  

    /**

     * Ringtone type for esim card 1.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @stagemodelonly

     * @since 26.0.0 dynamic&static

     */

    RINGTONE_TYPE_ESIM_CARD_1 = 3,

  }



  /**

   * Enum for system tone type.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 11 dynamic

   * @since 23 static

   */

  enum SystemToneType {

    /**

     * System tone type for sim card 0.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     * @since 23 static

     */

    SYSTEM_TONE_TYPE_SIM_CARD_0 = 0,



    /**

     * System tone type for sim card 1.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     * @since 23 static

     */

    SYSTEM_TONE_TYPE_SIM_CARD_1 = 1,



    /**

     * System tone type for esim card 0.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @stagemodelonly

     * @since 26.0.0 dynamic&static

     */

    SYSTEM_TONE_TYPE_ESIM_CARD_0 = 2,

  

    /**

     * System tone type for esim card 1.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @stagemodelonly

     * @since 26.0.0 dynamic&static

     */

    SYSTEM_TONE_TYPE_ESIM_CARD_1 = 3,



    /**

     * System tone type notification.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     * @since 23 static

     */

    SYSTEM_TONE_TYPE_NOTIFICATION = 32,

  }



  /**

   * Enum for tone customized type.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 12 dynamic

   * @since 23 static

   */

  enum ToneCustomizedType {

    /**

     * Pre-installed tone type.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    PRE_INSTALLED = 0,

    /**

     * Customized tone type.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    CUSTOMIZED = 1,

  }



  /**

   * Enum for media type.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 20 dynamic

   * @since 23 static

   */

  enum MediaType {

    /**

     * Media type for audio.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    AUDIO = 0,



    /**

     * Media type for vide.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    VIDEO = 1,

  }



   /**

   * Enumerates the system sound effect types.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @stagemodelonly

   * @since 23 dynamic&static

   */

  enum SystemSoundType{

    /**

     * The sound indicates image capture.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @stagemodelonly

     * @since 23 dynamic&static

     */

    PHOTO_SHUTTER = 0,



    /**

     * The sound indicates the beginning of video recording.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @stagemodelonly

     * @since 23 dynamic&static

     */

    VIDEO_RECORDING_BEGIN = 1,



    /**

     * The sound indicates the end of video recording.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @stagemodelonly

     * @since 23 dynamic&static

     */

    VIDEO_RECORDING_END = 2,

  }



  /**

   * Define the ringtone category.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 12 dynamic

   * @since 23 static

   */

  const TONE_CATEGORY_RINGTONE: int;



  /**

   * Define the text message tone category.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 12 dynamic

   * @since 23 static

   */

  const TONE_CATEGORY_TEXT_MESSAGE: int;



  /**

   * Define the notification tone category.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 12 dynamic

   * @since 23 static

   */

  const TONE_CATEGORY_NOTIFICATION: int;



  /**

   * Define the alarm tone category.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 12 dynamic

   * @since 23 static

   */

  const TONE_CATEGORY_ALARM: int;



  /**

   * Define the contact tone category.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @stagemodelonly

   * @since 20 dynamic

   */

  const TONE_CATEGORY_CONTACTS: 16;



  /**

   * Define the contact tone category.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @stagemodelonly

   * @since 23 static

   */

  const TONE_CATEGORY_CONTACTS: int;



  /**

   * Define the app notification tone category.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 22 dynamic

   * @since 23 static

   */

  const TONE_CATEGORY_NOTIFICATION_APP: int;



  /**

   * Tone attributes.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 12 dynamic

   * @since 23 static

   */

  interface ToneAttrs {

    /**

     * Gets title of tone.

     *

     * @returns { string } title.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getTitle(): string;



    /**

     * Sets title of tone.

     *

     * @param { string } title - Title of tone.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    setTitle(title: string): void;



    /**

     * Gets file name of tone.

     *

     * @returns { string } file name.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getFileName(): string;



    /**

     * Sets file name of tone.

     *

     * @param { string } name - file name.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    setFileName(name: string): void;



    /**

     * Gets uri of tone.

     *

     * @returns { string } uri.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getUri(): string;



    /**

     * Gets customized type of tone.

     *

     * @returns { ToneCustomizedType } Customized type of tone.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getCustomizedType(): ToneCustomizedType;



    /**

     * Sets tone category.

     *

     * @param { int } category - tone category. This parameter can be one of {@link TONE_CATEGORY_RINGTONE},

     *     {@link TONE_CATEGORY_TEXT_MESSAGE}, {@link TONE_CATEGORY_NOTIFICATION}, {@link TONE_CATEGORY_ALARM}.

     *     In addition, this parameter can be result of OR logical operator of these constants.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    setCategory(category: int): void;



    /**

     * Gets tone category.

     *

     * @returns { int } Tone category. This value can be one of {@link TONE_CATEGORY_RINGTONE},

     *     {@link TONE_CATEGORY_TEXT_MESSAGE}, {@link TONE_CATEGORY_NOTIFICATION}, {@link TONE_CATEGORY_ALARM}.

     *     In addition, this value can be result of OR logical operator of these constants.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getCategory(): int;



    /**

     * Sets media type.

     *

     * @param { MediaType } type - Target media type.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    setMediaType(type: MediaType): void;



    /**

     * Gets media type. This function returns {@link MediaType#AUDIO} if the media type has not been changed

     * by {@link setMediaType}.

     *

     * @returns { MediaType } Media type.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    getMediaType(): MediaType;

  }



  /**

   * Array of tone attributes.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 12 dynamic

   * @since 23 static

   */

  type ToneAttrsArray = Array<ToneAttrs>;



  /**

   * Create customized tone attributes.

   *

   * @returns { ToneAttrs } Tone attributes created.

   * @throws { BusinessError } 202 - Caller is not a system application.

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 12 dynamic

   * @since 23 static

   */

  function createCustomizedToneAttrs(): ToneAttrs;



  /**

   * Definition of haptics feature in tone scenario.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 13 dynamic

   * @since 23 static

   */

  enum ToneHapticsFeature {

    /**

     * Standard haptics feature.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 13 dynamic

     * @since 23 static

     */

    STANDARD = 0,

    /**

     * Gentle haptics feature.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 13 dynamic

     * @since 23 static

     */

    GENTLE = 1,

  }

  /**

   * Enum for haptics in tone scenario.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 14 dynamic

   * @since 23 static

   */

  enum ToneHapticsType {

    /**

     * Haptics in incoming call scenario for sim card 0.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    CALL_SIM_CARD_0 = 0,



    /**

     * Haptics in incoming call scenario for sim card 1.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    CALL_SIM_CARD_1 = 1,



    /**

     * Haptics in incoming call scenario for esim card 0.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @stagemodelonly

     * @since 26.0.0 dynamic&static

     */

    CALL_ESIM_CARD_0 = 2,

  

    /**

     * Haptics in incoming call scenario for esim card 1.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @stagemodelonly

     * @since 26.0.0 dynamic&static

     */

    CALL_ESIM_CARD_1 = 3,



    /**

     * Haptics in text message scenario for sim card 0.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    TEXT_MESSAGE_SIM_CARD_0 = 20,



    /**

     * Haptics in text message scenario for sim card 1.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    TEXT_MESSAGE_SIM_CARD_1 = 21,



    /**

     * Haptics in text message scenario for esim card 0.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @stagemodelonly

     * @since 26.0.0 dynamic&static

     */

    TEXT_MESSAGE_ESIM_CARD_0 = 22,

 	 

    /**

     * Haptics in text message scenario for esim card 1.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @stagemodelonly

     * @since 26.0.0 dynamic&static

     */

    TEXT_MESSAGE_ESIM_CARD_1 = 23,



    /**

     * Haptics in notification scenario.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    NOTIFICATION = 40,

  }



  /**

   * Enum for haptics mode in tone scenario.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 14 dynamic

   * @since 23 static

   */

  enum ToneHapticsMode {

    /**

     * None haptics mode.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    NONE = 0,

    /**

     * Haptics is synchronized with tone.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    SYNC = 1,



    /**

     * Haptics is out of synchronize with tone.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    NON_SYNC = 2,

  }

  /**

   * Haptics settings in tone scenario.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 14 dynamic

   * @since 23 static

   */

  interface ToneHapticsSettings {

    /**

     * Haptics mode.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    mode: ToneHapticsMode;

    /**

     * Haptics uri. Users can set/get this parameter when {@link ToneHapticsSettings#mode} is

     * {@link ToneHapticsMode#NON_SYC}. In other cases, this uri is useless and should be ignored.

     *

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    hapticsUri?: string;

  }



  /**

   * Haptics attributes in tone scenario.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 14 dynamic

   * @since 23 static

   */

  interface ToneHapticsAttrs {

    /**

     * Get haptics uri.

     *

     * @returns { string } Haptics uri.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    getUri(): string;



    /**

     * Get title of haptics.

     *

     * @returns { string } Haptics title.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    getTitle(): string;



    /**

     * Get file name of haptics.

     *

     * @returns { string } Haptics title.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    getFileName(): string;



    /**

     * Get gentle haptics URI.

     *

     * @returns { string | null } Haptics URI or null if not gentle haptics not exist.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 22 dynamic

     * @since 23 static

     */

    getGentleUri(): string | null;



    /**

     * Get title of gentle haptics.

     *

     * @returns { string | null } Haptics title or null if not gentle haptics not exist.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 22 dynamic

     * @since 23 static

     */

    getGentleTitle(): string | null;



    /**

     * Get file name of gentle haptics.

     *

     * @returns { string | null } Haptics file name or null if not gentle haptics not exist.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 22 dynamic

     * @since 23 static

     */

    getGentleFileName(): string | null;

  }



  /**

   * Type definition of tone haptics array.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 14 dynamic

   * @since 23 static

   */

  type ToneHapticsAttrsArray = Array<ToneHapticsAttrs>;



  /**

   * Gets system sound manager for all type sound.

   *

   * @returns { SystemSoundManager } SystemSoundManager instance.

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 10 dynamic

   * @since 23 static

   */

  function getSystemSoundManager(): SystemSoundManager;



  /**

   * System sound manager object.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 10 dynamic

   * @since 23 static

   */

  interface SystemSoundManager {

    /**

     * Sets the ringtone uri to system.

     *

     * @param { Context } context - Current application context.

     * @param { string } uri - Ringtone uri to set.

     * @param { RingtoneType } type - Ringtone type to set.

     * @param { AsyncCallback<void> } callback - Callback used to return the set uri result.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 10 dynamiconly

     * @deprecated since 11

     * @useinstead systemSoundManager.SystemSoundManager#setRingtoneUri

     */

    setSystemRingtoneUri(context: Context, uri: string, type: RingtoneType, callback: AsyncCallback<void>): void;



    /**

     * Sets the ringtone uri to system.

     *

     * @param { Context } context - Current application context.

     * @param { string } uri - Ringtone uri to set.

     * @param { RingtoneType } type - Ringtone type to set.

     * @returns { Promise<void> } Promise used to return the set uri result.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 10 dynamiconly

     * @deprecated since 11

     * @useinstead systemSoundManager.SystemSoundManager#setRingtoneUri

     */

    setSystemRingtoneUri(context: Context, uri: string, type: RingtoneType): Promise<void>;



    /**

     * Sets the ringtone uri to system.

     *

     * @param { BaseContext } context - Current application context.

     * @param { string } uri - Ringtone uri to set.

     * @param { RingtoneType } type - Ringtone type to set.

     * @returns { Promise<void> } Promise used to return the set uri result.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     * @since 23 static

     */

    setRingtoneUri(context: BaseContext, uri: string, type: RingtoneType): Promise<void>;



    /**

     * Gets the ringtone uri.

     *

     * @param { Context } context - Current application context.

     * @param { RingtoneType } type - Ringtone type to get.

     * @param { AsyncCallback<string> } callback - Callback used to return the ringtone uri maintained in system.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 10 dynamiconly

     * @deprecated since 11

     * @useinstead systemSoundManager.SystemSoundManager#getRingtoneUri

     */

    getSystemRingtoneUri(context: Context, type: RingtoneType, callback: AsyncCallback<string>): void;



    /**

     * Gets the ringtone uri.

     *

     * @param { Context } context - Current application context.

     * @param { RingtoneType } type - Ringtone type to get.

     * @returns { Promise<string> } Promise used to return the ringtone uri maintained in system.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 10 dynamiconly

     * @deprecated since 11

     * @useinstead systemSoundManager.SystemSoundManager#getRingtoneUri

     */

    getSystemRingtoneUri(context: Context, type: RingtoneType): Promise<string>;



    /**

     * Gets the ringtone uri.

     *

     * @param { BaseContext } context - Current application context.

     * @param { RingtoneType } type - Ringtone type to get.

     * @returns { Promise<string> } Promise used to return the ringtone uri maintained in system.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     * @since 23 static

     */

    getRingtoneUri(context: BaseContext, type: RingtoneType): Promise<string>;



    /**

     * Gets the ringtone attribute which is in use.

     *

     * @param { RingtoneType } type - Ringtone type to get.

     * @returns { Promise<ToneAttrs> } Promise used to return the ringtone attribute in system.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    getCurrentRingtoneAttribute(type: RingtoneType): Promise<ToneAttrs>;



    /**

     * Gets attributes of the default ringtone.

     *

     * @param { BaseContext } context - Current application context.

     * @param { RingtoneType } type - Ringtone type to get.

     * @returns { Promise<ToneAttrs> } Promise used to return attributes of the default ringtone.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getDefaultRingtoneAttrs(context: BaseContext, type: RingtoneType): Promise<ToneAttrs>;



    /**

     * Gets attribute list of ringtones.

     *

     * @param { BaseContext } context - Current application context.

     * @param { RingtoneType } type - Ringtone type to get.

     * @returns { Promise<ToneAttrsArray> } Promise used to return attribute list of ringtone.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getRingtoneAttrList(context: BaseContext, type: RingtoneType): Promise<ToneAttrsArray>;



    /**

     * Gets the ringtone player.

     *

     * @param { Context } context - Current application context.

     * @param { RingtoneType } type - Ringtone type to get.

     * @param { AsyncCallback<RingtonePlayer> } callback - Callback used to return a ringtone player instance.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 10 dynamiconly

     * @deprecated since 11

     * @useinstead systemSoundManager.SystemSoundManager#getRingtonePlayer

     */

    getSystemRingtonePlayer(context: Context, type: RingtoneType, callback: AsyncCallback<RingtonePlayer>): void;



    /**

     * Gets the ringtone player.

     *

     * @param { Context } context - Current application context.

     * @param { RingtoneType } type - Ringtone type to get.

     * @returns { Promise<RingtonePlayer> } Promise used to return a ringtone player instance.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 10 dynamiconly

     * @deprecated since 11

     * @useinstead systemSoundManager.SystemSoundManager#getRingtonePlayer

     */

    getSystemRingtonePlayer(context: Context, type: RingtoneType): Promise<RingtonePlayer>;



    /**

     * Gets the ringtone player.

     *

     * @param { BaseContext } context - Current application context.

     * @param { RingtoneType } type - Ringtone type to get.

     * @returns { Promise<RingtonePlayer> } Promise used to return a ringtone player instance.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     */

    getRingtonePlayer(context: BaseContext, type: RingtoneType): Promise<RingtonePlayer>;



    /**

     * Gets the ringtone player.

     *

     * @param { BaseContext } context - Current application context.

     * @param { RingtoneType } type - Ringtone type to get.

     * @returns { Promise<RingtonePlayer | null> } Promise used to return a ringtone player instance,

     *     or null when an error happens.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 23 static

     */

    getRingtonePlayer(context: BaseContext, type: RingtoneType): Promise<RingtonePlayer | null>;



    /**

     * Obtains a mock haptic ringtone player for playing vibration files and their corresponding mock haptic

     * sound files. This API uses a promise to return the result.

     * Before calling this interface, ensure that the incoming hapticUri actually exists in the system.

     * Otherwise, exceptions and errors will occur, such as failure to play the matched haptic sound file.

     * After obtaining the instance through this interface, actively call {@link RingtonePlayer#release} method

     * of the ringtone player to release player resources when the service is terminated.

     *

     * @param { BaseContext } context - Current application context.

     * @param { string } hapticUri - Haptic uri to get.

     * @returns { Promise<RingtonePlayer | null> } Promise used to return a ringtone player instance,

     *     or null when an error happens.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 20700002 - Parameter verification failed. The hapticUri does not exist or is

     *     incorrectly formatted. Ensure it is a JSON file and that it exists in the system's file system.

     * @throws { BusinessError } 5400103 - I/O error. The ringtone database access timed out or encountered an error.

     *     It is recommended to restart your phone.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @stagemodelonly

     * @since 26.0.0 dynamic&static

     */

    getMockHapticRingtonePlayer(context: BaseContext, hapticUri: string): Promise<RingtonePlayer | null>;



    /**

     * Obtains a mock haptic ringtone player for playing vibration files and their corresponding mock haptic

     * sound files. This API uses a promise to return the result.

     * Before calling this interface, ensure that the incoming ringtoneUri actually exists in the system.

     * Otherwise, exceptions and errors will occur, such as failure to play the matched haptic sound file.

     * After obtaining the instance through this interface, actively call {@link RingtonePlayer#release} method

     * of the ringtone player to release player resources when the service is terminated.

     *

     * @param { BaseContext } context - Current application context.

     * @param { RingtoneType } type - Ringtone type to get.

     * @param { string } ringtoneUri - Ringtone uri to get.

     * @returns { Promise<RingtonePlayer | null> } Promise used to return a ringtone player instance,

     *     or null when an error happens.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 20700002 - Parameter verification failed. Possible causes:

     *     1.The type exceeds the valid range, please use the RingtoneType enum for input.

     *     2.The ringtoneUri does not exist or is incorrectly formatted, please use the ringtoneUri returned by

     *     the {@link SystemSoundManager#addCustomizedTone}.

     * @throws { BusinessError } 5400103 - I/O error. The ringtone database access timed out or encountered an error.

     *     It is recommended to restart your phone.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @stagemodelonly

     * @since 26.0.0 dynamic&static

     */

    getMockHapticRingtonePlayer(context: BaseContext, type: RingtoneType, ringtoneUri: string): Promise<RingtonePlayer | null>;



    /**

     * Sets the system tone uri to system.

     * @param { BaseContext } context - Current application context.

     * @param { string } uri - Ringtone uri to set.

     * @param { SystemToneType } type - System tone type to set.

     * @returns { Promise<void> } Promise used to return the result of set system tone uri.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     * @since 23 static

     */

    setSystemToneUri(context: BaseContext, uri: string, type: SystemToneType): Promise<void>;



    /**

     * Gets the system tone uri.

     *

     * @param { BaseContext } context - Current application context.

     * @param { SystemToneType } type - System tone type to get.

     * @returns { Promise<string> } Promise used to return the system tone maintained in system.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     * @since 23 static

     */

    getSystemToneUri(context: BaseContext, type: SystemToneType): Promise<string>;



    /**

     * Gets attributes of the default system tone.

     *

     * @param { BaseContext } context - Current application context.

     * @param { SystemToneType } type - system tone type to get.

     * @returns { Promise<ToneAttrs> } Promise used to return attributes of the default system tone.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getDefaultSystemToneAttrs(context: BaseContext, type: SystemToneType): Promise<ToneAttrs>;



    /**

     * Gets attribute list of alarm tones.

     *

     * @param { BaseContext } context - Current application context.

     * @param { SystemToneType } type - System tone type to get.

     * @returns { Promise<ToneAttrsArray> } Promise used to return attribute list of system tone.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getSystemToneAttrList(context: BaseContext, type: SystemToneType): Promise<ToneAttrsArray>;



    /**

     * Gets the system tone player.

     *

     * @param { BaseContext } context - Current application context.

     * @param { SystemToneType } type - System tone type to get.

     * @returns { Promise<SystemTonePlayer> } Promise used to return the SystemTonePlayer.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 11 dynamic

     */

    getSystemTonePlayer(context: BaseContext, type: SystemToneType): Promise<SystemTonePlayer>;



    /**

     * Gets the system tone player.

     *

     * @param { BaseContext } context - Current application context.

     * @param { SystemToneType } type - System tone type to get.

     * @returns { Promise<SystemTonePlayer | null> } Promise used to return the SystemTonePlayer, or

     *     null when an error happens.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 23 static

     */

    getSystemTonePlayer(context: BaseContext, type: SystemToneType): Promise<SystemTonePlayer | null>;



    /**

     * Gets attributes of the default alarm tone.

     *

     * @param { BaseContext } context - Current application context.

     * @returns { Promise<ToneAttrs> } Promise used to return attributes of the default alarm tone.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getDefaultAlarmToneAttrs(context: BaseContext): Promise<ToneAttrs>;



    /**

     * Sets uri of the current alarm tone.

     *

     * @param { BaseContext } context - Current application context.

     * @param { string } uri - Alarm tone uri.

     * @returns { Promise<void> } Promise used to return result of set alarm tone.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @throws { BusinessError } 20700001 - Tone type mismatch, e.g. tone of input uri is not an alarm tone.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    setAlarmToneUri(context: BaseContext, uri: string): Promise<void>;



    /**

     * Gets uri of the current alarm tone.

     *

     * @param { BaseContext } context - Current application context.

     * @returns { Promise<string> } Promise used to return uri of current alarm tone.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getAlarmToneUri(context: BaseContext): Promise<string>;



    /**

     * Gets attribute list of alarm tones.

     *

     * @param { BaseContext } context - Current application context.

     * @returns { Promise<ToneAttrsArray> } Promise used to return attribute list of system tone.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    getAlarmToneAttrList(context: BaseContext): Promise<ToneAttrsArray>;



    /**

     * Open alarm tone file.

     *

     * @param { BaseContext } context - Current application context.

     * @param { string } uri - Uri of alarm tone to open.

     * @returns { Promise<int> } Promise used to return fd.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @throws { BusinessError } 20700001 - Tone type mismatch, e.g. tone of uri is notification instead of alarm.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    openAlarmTone(context: BaseContext, uri: string): Promise<int>;



    /**

     * Open tone list in batch.

     *

     * @param { Array<string> } uriList - List of uri to open. The length must be no more than 1024.

     * @returns { Promise<Array<[string, long, SystemSoundError]>> } Promise used to return results of this

     *     operation. In each returned array number, the first item is uri of tone, the second item is fd, and the

     *     third item is error code. If the uri open failed, the fd will be -1, and the reason is indicated by the

     *     error code.

     * @throws { BusinessError } 202 - Calleris not a system application.

     * @throws { BusinessError } 20700007 - Parameter is invalid, e.g. the length of uriList is too long.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    openToneList(uriList: Array<string>): Promise<Array<[string, long, SystemSoundError]>>;



    /**

     * Close fd.

     *

     * @param { int } fd - File descriptor to close.

     * @returns { Promise<void> } Promise used to return the result of close fd.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    close(fd: int): Promise<void>;



    /**

     * Add customized tone into ringtone library.

     *

     * @permission ohos.permission.WRITE_RINGTONE

     * @param { BaseContext } context - Current application context.

     * @param { ToneAttrs } toneAttr - Tone attributes created by {@link createCustomizedToneAttrs}.

     * @param { string } externalUri - Tone uri in external storage.

     * @returns { Promise<string> } Tone uri after adding into ringtone library.

     * @throws { BusinessError } 201 - Permission denied.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400102 - Operation is not allowed, e.g. ringtone to add is not customized.

     * @throws { BusinessError } 5400103 - I/O error. Possible causes:

     *     1. The target file size exceeds 2 GB;

     *     2. Failed to find the specified file;

     *     3. System sound manager service error.

     * @throws { BusinessError } 20700004 - Data size exceeds the limit. Note:

     *     This error is returned when the file size is between 200MB and 2GB. [since 20]

     * @throws { BusinessError } 20700005 - The number of files exceeds the limit. [since 20]

     * @throws { BusinessError } 20700006 - Insufficient ROM space. [since 20]

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    addCustomizedTone(context: BaseContext, toneAttr: ToneAttrs, externalUri: string): Promise<string>;



    /**

     * Add customized tone into ringtone library.

     *

     * @permission ohos.permission.WRITE_RINGTONE

     * @param { BaseContext } context - Current application context.

     * @param { ToneAttrs } toneAttr - Tone attributes created by {@link createCustomizedToneAttrs}.

     * @param { int } fd - File descriptor.

     * @param { long } [offset] - The offset in the file where the data to be read, in bytes. By default, the offset

     *     is zero.

     * @param { long } [length] - The length in bytes of the data to be read. By default, the length is the rest of

     *     bytes in the file from the offset.

     * @returns { Promise<string> } Tone uri after adding into ringtone library.

     * @throws { BusinessError } 201 - Permission denied.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400102 - Operation is not allowed, e.g. ringtone to add is not customized.

     * @throws { BusinessError } 5400103 - I/O error. Possible causes:

     *     1. The target file size exceeds 2 GB;

     *     2. Failed to find the specified file;

     *     3. Ringtone library error.

     *     4. System sound manager service error.

     * @throws { BusinessError } 20700004 - Data size exceeds the limit. Note:

     *     This error is returned when the file size is between 200MB and 2GB. [since 20]

     * @throws { BusinessError } 20700005 - The number of files exceeds the limit. [since 20]

     * @throws { BusinessError } 20700006 - Insufficient ROM space. [since 20]

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    addCustomizedTone(context: BaseContext, toneAttr: ToneAttrs, fd: int, offset?: long, length?: long)

      : Promise<string>;



    /**

     * Remove customized tone in ringtone library.

     *

     * @permission ohos.permission.WRITE_RINGTONE

     * @param { BaseContext } context - Current application context.

     * @param { string } uri - Tone uri.

     * @returns { Promise<void> } Promise used to return removing result.

     * @throws { BusinessError } 201 - Permission denied.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400102 - Operation is not allowed, e.g. ringtone of this uri is not customized.

     * @throws { BusinessError } 5400103 - I/O error.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 12 dynamic

     * @since 23 static

     */

    removeCustomizedTone(context: BaseContext, uri:string): Promise<void>;



    /**

     * Remove customized tone list in batch.

     *

     * @permission ohos.permission.WRITE_RINGTONE

     * @param { Array<string> } uriList - Uri list to remove. The length must be no more than 1024.

     * @returns { Promise<Array<[string, SystemSoundError]>> } Promise used to return removing result array.

     *     In each array memeber, the first item is the tone uri, and the second item is the error code.

     * @throws { BusinessError } 201 - Permission denied.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 20700007 - Parameter is invalid, e.g. the length of uriList is too long.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 20 dynamic

     * @since 23 static

     */

    removeCustomizedToneList(uriList: Array<string>): Promise<Array<[string, SystemSoundError]>>;



    /**

     * Get haptics settings.

     *

     * @param { BaseContext } context - Current application context.

     * @param { ToneHapticsType } type - Tone haptics type.

     * @returns { Promise<ToneHapticsSettings> } Promise used to return results of this call.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @throws { BusinessError } 20700003 - Unsupported operation.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    getToneHapticsSettings(context: BaseContext, type: ToneHapticsType): Promise<ToneHapticsSettings>;



    /**

     * Set haptics settings.

     *

     * @param { BaseContext } context - Current application context.

     * @param { ToneHapticsType } type - Tone haptics type.

     * @param { ToneHapticsSettings } settings - Tone haptics settings.

     * @returns { Promise<void> } Promise used to return results of this call.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400102 - Operation not allowed. For example, the input URI is not valid.

     * @throws { BusinessError } 5400103 - I/O error.

     * @throws { BusinessError } 20700003 - Unsupported operation.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    setToneHapticsSettings(context: BaseContext, type: ToneHapticsType, settings: ToneHapticsSettings): Promise<void>;



    /**

     * Get haptics list.

     *

     * @param { BaseContext } context - Current application context.

     * @param { boolean } isSynced - The queried haptics is synchronized with tone or not.

     * @returns { Promise<ToneHapticsAttrsArray> } Promise used to return ToneHapticsAttrsArray.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400103 - I/O error.

     * @throws { BusinessError } 20700003 - Unsupported operation.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    getToneHapticsList(context: BaseContext, isSynced: boolean): Promise<ToneHapticsAttrsArray>;



    /**

     * Get attributes of haptics which is synchronized with one tone. If no haptics is found, then the attributes in

     * the returned ToneHapticsAttrs is empty.

     *

     * @param { BaseContext } context - Current application context.

     * @param { string } toneUri - Uri of tone to query.

     * @returns { Promise<ToneHapticsAttrs> } Promise used to return ToneHapticsAttrs.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *     1.Mandatory parameters are left unspecified;

     *     2.Incorrect parameter types.

     * @throws { BusinessError } 5400102 - Operation not allowed. For example, the input URI is not used for tones.

     * @throws { BusinessError } 5400103 - I/O error.

     * @throws { BusinessError } 20700003 - Unsupported operation.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    getHapticsAttrsSyncedWithTone(context: BaseContext, toneUri: string): Promise<ToneHapticsAttrs>;



    /**

     * Open haptics.

     *

     * @param { BaseContext } context - Current application context.

     * @param { string } hapticsUri - Uri of haptics to open.

     * @returns { Promise<int> } Promise used to return fd.

     * @throws { BusinessError } 202 - Caller is not a system application.

     * @throws { BusinessError } 401 - Parameter error. Possible causes:

     *                                 1.Mandatory parameters are left unspecified;

     *                                 2.Incorrect parameter types.

     * @throws { BusinessError } 5400102 - Operation not allowed. For example, the input URI is not one for haptics.

     * @throws { BusinessError } 5400103 - I/O error.

     * @throws { BusinessError } 20700003 - Unsupported operation.

     * @syscap SystemCapability.Multimedia.SystemSound.Core

     * @systemapi

     * @since 14 dynamic

     * @since 23 static

     */

    openToneHaptics(context: BaseContext, hapticsUri: string): Promise<int>;

  }



  /**

   * Creates a SystemSoundPlayer instance. This function uses a promise to return the result.

   * This player can be used to play some system sounds for media or camera actions.

   *

   * @returns { Promise<SystemSoundPlayer | null> } Promise used to return the result.

   *     If the operation is successful, a SystemSoundPlayer instance is returned.

   *     Otherwise, null is returned. The instance is used for loading and playback.

   * @throws { BusinessError } 5400101 - No memory. Return by promise.

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @since 23 dynamic&static

   */

  function createSystemSoundPlayer(): Promise<SystemSoundPlayer | null>;



  /**

   * Ringtone player object.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 10 dynamic

   * @since 23 static

   */

  type RingtonePlayer = _RingtonePlayer;



  /**

   * SystemTone player object.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 11 dynamic

   * @since 23 static

   */

  type SystemTonePlayer = _SystemTonePlayer;



  /**

   * Interface for ringtone options.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 10 dynamic

   * @since 23 static

   */

  type RingtoneOptions = _RingtoneOptions;



  /**

   * System tone options.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @systemapi

   * @since 11 dynamic

   * @since 23 static

   */

  type SystemToneOptions = _SystemToneOptions;



  /**

   * Represents the system sound effect player object.

   *

   * @syscap SystemCapability.Multimedia.SystemSound.Core

   * @since 23 dynamic&static

   */

  type SystemSoundPlayer = _SystemSoundPlayer;

}



export default systemSoundManager;