1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15import { AsyncCallback } from './@ohos.base'; 16import { DataAbilityHelper } from './ability/dataAbilityHelper'; 17import Context from './application/Context'; 18 19/** 20 * This module provides settings data access abilities. 21 * 22 * @namespace settings 23 * @syscap SystemCapability.Applications.settings.Core 24 * @since 7 25 */ 26declare namespace settings { 27 /** 28 * Provides methods for setting time and date formats. 29 * 30 * @namespace date 31 * @syscap SystemCapability.Applications.settings.Core 32 * @since 7 33 */ 34 namespace date { 35 /** 36 * Indicates the date format. 37 * 38 * <p>The formats {@code mm/dd/yyyy}, {@code dd/mm/yyyy}, and {@code yyyy/mm/dd} are available. 39 * 40 * @constant 41 * @syscap SystemCapability.Applications.settings.Core 42 * @since 7 43 */ 44 const DATE_FORMAT: string 45 46 /** 47 * Specifies whether the time is displayed in 12-hour or 24-hour format. 48 * 49 * <p>If the value is {@code 12}, the 12-hour format is used. If the value is {@code 24}, the 24-hour format 50 * is used. 51 * 52 * @constant 53 * @syscap SystemCapability.Applications.settings.Core 54 * @since 7 55 */ 56 const TIME_FORMAT: string 57 58 /** 59 * Specifies whether the date, time, and time zone are automatically obtained from the Network 60 * Identity and Time Zone (NITZ). 61 * 62 * <p>If the value is {@code true}, the information is automatically obtained from NITZ. 63 * If the value is {@code false}, the information is not obtained from NITZ. 64 * 65 * @constant 66 * @syscap SystemCapability.Applications.settings.Core 67 * @since 7 68 */ 69 const AUTO_GAIN_TIME: string 70 71 /** 72 * Specifies whether the time zone is automatically obtained from NITZ. 73 * 74 * <p>If the value is {@code true}, the information is automatically obtained from NITZ. If the value 75 * is {@code false}, the information is not obtained from NITZ. 76 * 77 * @constant 78 * @syscap SystemCapability.Applications.settings.Core 79 * @since 7 80 */ 81 const AUTO_GAIN_TIME_ZONE: string 82 } 83 84 /** 85 * Provides methods for setting the display effect, including the font size, screen brightness, screen rotation, 86 * animation factor, and display color. 87 * 88 * @namespace display 89 * @syscap SystemCapability.Applications.settings.Core 90 * @since 7 91 */ 92 namespace display { 93 /** 94 * Indicates the scaling factor of fonts, which is a float number. 95 * 96 * @constant 97 * @syscap SystemCapability.Applications.settings.Core 98 * @since 7 99 */ 100 const FONT_SCALE: string 101 102 /** 103 * Indicates the screen brightness. The value ranges from 0 to 255. 104 * 105 * @constant 106 * @syscap SystemCapability.Applications.settings.Core 107 * @since 7 108 */ 109 const SCREEN_BRIGHTNESS_STATUS: string 110 111 /** 112 * Specifies whether automatic screen brightness adjustment is enabled. 113 * 114 * <p>If the value is {@code 1}, automatic adjustment is enabled. If the value is {@code 0}, automatic 115 * adjustment is disabled. 116 * 117 * @constant 118 * @syscap SystemCapability.Applications.settings.Core 119 * @since 7 120 */ 121 const AUTO_SCREEN_BRIGHTNESS: string 122 123 /** 124 * Indicates the value of {@code AUTO_SCREEN_BRIGHTNESS} when automatic screen brightness adjustment is used. 125 * 126 * @constant 127 * @syscap SystemCapability.Applications.settings.Core 128 * @since 7 129 */ 130 const AUTO_SCREEN_BRIGHTNESS_MODE: number 131 132 /** 133 * Indicates the value of {@code AUTO_SCREEN_BRIGHTNESS} when manual screen brightness adjustment is used. 134 * 135 * @constant 136 * @syscap SystemCapability.Applications.settings.Core 137 * @since 7 138 */ 139 const MANUAL_SCREEN_BRIGHTNESS_MODE: number 140 141 /** 142 * Indicates the duration that the device waits before going to sleep after a period of inactivity, in 143 * milliseconds. 144 * 145 * @constant 146 * @syscap SystemCapability.Applications.settings.Core 147 * @since 7 148 */ 149 const SCREEN_OFF_TIMEOUT: string 150 151 /** 152 * Indicates the screen rotation when no other policy is available. 153 * 154 * <p>This constant is invalid when auto-rotation is enabled. When auto-rotation is disabled, the following 155 * values are available: 156 * 157 * <ul> 158 * <li>{@code 0} - The screen rotates 0 degrees. 159 * <li>{@code 1} - The screen rotates 90 degrees. 160 * <li>{@code 2} - The screen rotates 180 degrees. 161 * <li>{@code 3} - The screen rotates 270 degrees. 162 * </ul> 163 * 164 * @constant 165 * @syscap SystemCapability.Applications.settings.Core 166 * @since 7 167 */ 168 const DEFAULT_SCREEN_ROTATION: string 169 170 /** 171 * Indicates the scaling factor for the animation duration. 172 * 173 * <p>This affects the start delay and duration of all such animations. If the value is {@code 0}, 174 * the animation ends immediately. The default value is {@code 1}. 175 * 176 * @constant 177 * @syscap SystemCapability.Applications.settings.Core 178 * @since 7 179 */ 180 const ANIMATOR_DURATION_SCALE: string 181 182 /** 183 * Indicates the scaling factor for transition animations. 184 * If the value is {@code 0}, transition animations are disabled. 185 * 186 * @constant 187 * @syscap SystemCapability.Applications.settings.Core 188 * @since 7 189 */ 190 const TRANSITION_ANIMATION_SCALE: string 191 192 /** 193 * Indicates the scaling factor for normal window animations. 194 * If the value is {@code 0}, window animations are disabled. 195 * 196 * @constant 197 * @syscap SystemCapability.Applications.settings.Core 198 * @since 7 199 */ 200 const WINDOW_ANIMATION_SCALE: string 201 202 /** 203 * Specifies whether display color inversion is enabled. 204 * 205 * <p>If the value is {@code 1}, display color inversion is enabled. If the value is {@code 0}, display color 206 * inversion is disabled. 207 * 208 * @constant 209 * @syscap SystemCapability.Applications.settings.Core 210 * @since 7 211 */ 212 const DISPLAY_INVERSION_STATUS: string 213 } 214 215 /** 216 * Provides methods for setting general information about devices, including the device name, startup wizard, 217 * airplane mode, debugging information, accessibility feature switch, and touch exploration status. 218 * 219 * @namespace general 220 * @syscap SystemCapability.Applications.settings.Core 221 * @since 7 222 */ 223 namespace general { 224 /** 225 * Specifies whether the startup wizard has been run. 226 * 227 * <p>If the value is {@code 0}, the startup wizard has not been run. If the value is not {@code 0}, the startup 228 * wizard has been run. 229 * 230 * @constant 231 * @syscap SystemCapability.Applications.settings.Core 232 * @since 7 233 */ 234 const SETUP_WIZARD_FINISHED: string 235 236 /** 237 * Specifies what happens after the user presses the call end button if the user is not in a call. 238 * 239 * <ul> 240 * <li>{@code 0} - Nothing happens. 241 * <li>{@code 1} - The home screen is displayed. 242 * <li>{@code 2} - The device enters the sleep state and the screen is locked. 243 * <li>{@code 3} - The home screen is displayed. If the user is already on the home screen, the device enters 244 * the sleep state. 245 * </ul> 246 * 247 * @constant 248 * @syscap SystemCapability.Applications.settings.Core 249 * @since 7 250 */ 251 const END_BUTTON_ACTION: string 252 253 /** 254 * Specifies whether the accelerometer is used to change screen orientation, that is, whether auto-rotation is 255 * enabled. 256 * 257 * <p>The value {@code 1} indicates that the accelerometer is enabled by default, and {@code 0} indicates that 258 * the accelerometer is disabled by default. 259 * 260 * @constant 261 * @syscap SystemCapability.Applications.settings.Core 262 * @since 7 263 */ 264 const ACCELEROMETER_ROTATION_STATUS: string 265 266 /** 267 * Specifies whether airplane mode is enabled. 268 * 269 * <p>If the value is {@code 1}, airplane mode is enabled. If the value is {@code 0}, airplane mode is disabled. 270 * 271 * @constant 272 * @syscap SystemCapability.Applications.settings.Core 273 * @since 7 274 */ 275 const AIRPLANE_MODE_STATUS: string 276 277 /** 278 * Specifies whether the device is provisioned. 279 * 280 * <p>On a multi-user device with a single system user, the screen may be locked when the value is {@code true}. 281 * In addition, other abilities cannot be started on the system user unless they are marked to display over 282 * the screen lock. 283 * @constant 284 * @syscap SystemCapability.Applications.settings.Core 285 * @since 7 286 */ 287 const DEVICE_PROVISION_STATUS: string 288 289 /** 290 * Specifies whether the hard disk controller (HDC) on USB devices is enabled. 291 * 292 * <p>If the value is {@code true}, the HDC is enabled. If the value is {@code false}, the HDC is disabled. 293 * 294 * @constant 295 * @syscap SystemCapability.Applications.settings.Core 296 * @since 7 297 */ 298 const HDC_STATUS: string 299 300 /** 301 * Indicates the number of boot operations after the device is powered on. 302 * 303 * @constant 304 * @syscap SystemCapability.Applications.settings.Core 305 * @since 7 306 */ 307 const BOOT_COUNTING: string 308 309 /** 310 * Specifies whether contact metadata synchronization is enabled. 311 * 312 * <p>If the value is {@code true}, synchronization is enabled. If the value is {@code false}, 313 * synchronization is disabled. 314 * 315 * @constant 316 * @syscap SystemCapability.Applications.settings.Core 317 * @since 7 318 */ 319 const CONTACT_METADATA_SYNC_STATUS: string 320 321 /** 322 * Specifies whether developer options are enabled. 323 * 324 * <p>If the value is {@code true}, developer options are enabled. 325 * If the value is {@code false}, developer options are disabled. 326 * 327 * @constant 328 * @syscap SystemCapability.Applications.settings.Core 329 * @since 7 330 */ 331 const DEVELOPMENT_SETTINGS_STATUS: string 332 333 /** 334 * Indicates the device name. 335 * 336 * @constant 337 * @syscap SystemCapability.Applications.settings.Core 338 * @since 7 339 */ 340 const DEVICE_NAME: string 341 342 /** 343 * Specifies whether USB mass storage is enabled. 344 * 345 * <p>If the value is {@code true}, USB mass storage is enabled. 346 * If the value is {@code false}, USB mass storage is disabled. 347 * 348 * @constant 349 * @syscap SystemCapability.Applications.settings.Core 350 * @since 7 351 */ 352 const USB_STORAGE_STATUS: string 353 354 /** 355 * Specifies whether the device waits for the debugger when starting an application to debug. 356 * 357 * <p>If the value is {@code 1}, the device waits for the debugger. 358 * If the value is {@code 0}, the system does not wait for the debugger, and so the application runs normally. 359 * 360 * @constant 361 * @syscap SystemCapability.Applications.settings.Core 362 * @since 7 363 */ 364 const DEBUGGER_WAITING: string 365 366 /** 367 * Indicates the bundle name of the application to debug. 368 * 369 * @constant 370 * @syscap SystemCapability.Applications.settings.Core 371 * @since 7 372 */ 373 const DEBUG_APP_PACKAGE: string 374 375 /** 376 * Specifies whether any accessibility feature is enabled. 377 * 378 * <p>If the value is {@code 1}, the accessibility feature is enabled. If the value is {@code 0}, the 379 * accessibility feature is disabled. 380 * 381 * @constant 382 * @syscap SystemCapability.Applications.settings.Core 383 * @since 7 384 */ 385 const ACCESSIBILITY_STATUS: string 386 387 /** 388 * Indicates the list of accessibility features that have been activated. 389 * 390 * @constant 391 * @syscap SystemCapability.Applications.settings.Core 392 * @since 7 393 */ 394 const ACTIVATED_ACCESSIBILITY_SERVICES: string 395 396 /** 397 * Indicates the default geographical location that can be used by the browser. Multiple geographical locations 398 * are separated by spaces. 399 * 400 * @constant 401 * @syscap SystemCapability.Applications.settings.Core 402 * @since 7 403 */ 404 const GEOLOCATION_ORIGINS_ALLOWED: string 405 406 /** 407 * Specifies whether an application should attempt to skip all introductory hints at the first startup. This is 408 * intended for temporary users or users who are familiar with the environment. 409 * 410 * <p>If the value is {@code 1}, the application attempts to skip all introductory hints at the first startup. 411 * If the value is {@code 0}, the application does not skip introductory hints at the first startup. 412 * 413 * @constant 414 * @syscap SystemCapability.Applications.settings.Core 415 * @since 7 416 */ 417 const SKIP_USE_HINTS: string 418 419 /** 420 * Indicates whether touch exploration is enabled. 421 * 422 * <p>If the value is {@code 1}, touch exploration is enabled. If the value is {@code 0}, touch exploration is 423 * disabled. 424 * 425 * @constant 426 * @syscap SystemCapability.Applications.settings.Core 427 * @since 7 428 */ 429 const TOUCH_EXPLORATION_STATUS: string 430 } 431 432 /** 433 * Provides methods for setting information about input methods, including automatic capitalization, automatic 434 * punctuation, autocorrect, password presentation, input method engine, and input method subtypes. 435 * 436 * @namespace input 437 * @syscap SystemCapability.Applications.settings.Core 438 * @since 7 439 */ 440 namespace input { 441 /** 442 * Indicates the default input method and its ID. 443 * 444 * @constant 445 * @syscap SystemCapability.Applications.settings.Core 446 * @since 7 447 */ 448 const DEFAULT_INPUT_METHOD: string 449 450 /** 451 * Indicates the default input method keyboard type and its ID. 452 * 453 * @constant 454 * @syscap SystemCapability.Applications.settings.Core 455 * @since 7 456 */ 457 const ACTIVATED_INPUT_METHOD_SUB_MODE: string 458 459 /** 460 * Indicates the list of input methods that have been activated. 461 * 462 * <p>The list is a string that contains the IDs of activated input methods. The IDs are separated by colons 463 * (:), and keyboardTypes of an input method are separated by semicolons (;). An example format is 464 * {@code ima0:keyboardType0;keyboardType1;ima1:ima2:keyboardTypes0}. The type of <b>imaID</b> is ElementName, 465 * and the type of <b>keyboard</b> is int. 466 * 467 * @constant 468 * @syscap SystemCapability.Applications.settings.Core 469 * @since 7 470 */ 471 const ACTIVATED_INPUT_METHODS: string 472 473 /** 474 * Specifies whether the input method selector is visible. 475 * 476 * <p>If the value is {@code 1}, the input method selector is visible. If the value is {@code 0}, the input 477 * method selector is invisible. 478 * 479 * @constant 480 * @syscap SystemCapability.Applications.settings.Core 481 * @since 7 482 */ 483 const SELECTOR_VISIBILITY_FOR_INPUT_METHOD: string 484 485 /** 486 * Specifies whether automatic capitalization is enabled for the text editor. 487 * 488 * <p>If the value is {@code 0}, automatic capitalization is disabled. If the value {@code 1}, automatic 489 * capitalization is enabled. 490 * 491 * @constant 492 * @syscap SystemCapability.Applications.settings.Core 493 * @since 7 494 */ 495 const AUTO_CAPS_TEXT_INPUT: string 496 497 /** 498 * Specifies whether automatic punctuation is enabled for the text editor. Automatic punctuation enables the 499 * text editor to convert two spaces into a period (.) and a space. 500 * 501 * <p>If the value is {@code 0}, automatic punctuation is disabled. If the value {@code 1}, automatic 502 * punctuation is enabled. 503 * 504 * @constant 505 * @syscap SystemCapability.Applications.settings.Core 506 * @since 7 507 */ 508 const AUTO_PUNCTUATE_TEXT_INPUT: string 509 510 /** 511 * Specifies whether autocorrect is enabled for the text editor. Autocorrect enables the text editor to correct 512 * typos. 513 * 514 * <p>If the value is {@code 0}, autocorrect is disabled. If the value {@code 1}, autocorrect is enabled. 515 * 516 * @constant 517 * @syscap SystemCapability.Applications.settings.Core 518 * @since 7 519 */ 520 const AUTO_REPLACE_TEXT_INPUT: string 521 522 /** 523 * Specifies whether password presentation is enabled in the text editor. Password presentation enables the 524 * text editor to show password characters when the user types them. 525 * 526 * <p>If the value is {@code 0}, password presentation is disabled. If the value {@code 1}, password 527 * presentation is enabled. 528 * 529 * @constant 530 * @syscap SystemCapability.Applications.settings.Core 531 * @since 7 532 */ 533 const SHOW_PASSWORD_TEXT_INPUT: string 534 } 535 536 /** 537 * Provides methods for setting network information, including the data roaming status, HTTP proxy configurations, 538 * and preferred networks. 539 * 540 * @namespace network 541 * @syscap SystemCapability.Applications.settings.Core 542 * @since 7 543 */ 544 namespace network { 545 /** 546 * Specifies whether data roaming is enabled. 547 * 548 * <p>If the value is {@code true}, data roaming is enabled. If the value is {@code false}, 549 * data roaming is disabled. 550 * 551 * @constant 552 * @syscap SystemCapability.Applications.settings.Core 553 * @since 7 554 */ 555 const DATA_ROAMING_STATUS: string 556 557 /** 558 * Indicates the host name and port number of the global HTTP proxy. 559 * The host name and port number are separated by a colon (:). 560 * 561 * @constant 562 * @syscap SystemCapability.Applications.settings.Core 563 * @since 7 564 */ 565 const HTTP_PROXY_CFG: string 566 567 /** 568 * Indicates the user preferences of the network to use. 569 * 570 * @constant 571 * @syscap SystemCapability.Applications.settings.Core 572 * @since 7 573 */ 574 const NETWORK_PREFERENCE_USAGE: string 575 } 576 577 /** 578 * Provides methods for setting the answering mode of incoming and outgoing calls. 579 * 580 * @namespace phone 581 * @syscap SystemCapability.Applications.settings.Core 582 * @since 7 583 */ 584 namespace phone { 585 /** 586 * Specifies whether real-time text (RTT) calling is enabled. If enabled, incoming and outgoing calls are 587 * answered as RTT calls when supported by the device and carrier. If the value is {@code 1}, RTT calling is 588 * enabled. If the value is {@code 0}, RTT calling is disabled. 589 * 590 * @constant 591 * @syscap SystemCapability.Applications.settings.Core 592 * @since 7 593 */ 594 const RTT_CALLING_STATUS: string 595 } 596 597 /** 598 * Provides methods for setting the sound effect, including the ringtone, dial tone, alarm sound, notification tone, 599 * and haptic feedback. 600 * 601 * @namespace sound 602 * @syscap SystemCapability.Applications.settings.Core 603 * @since 7 604 */ 605 namespace sound { 606 /** 607 * Indicates whether the device vibrates when it is ringing for an incoming call. 608 * 609 * <p>This constant will be used by Phone and Settings applications. The value is of the boolean type. 610 * This constant affects only the scenario where the device rings for an incoming call. It does not affect 611 * any other application or scenario. 612 * 613 * @constant 614 * @syscap SystemCapability.Applications.settings.Core 615 * @since 7 616 */ 617 const VIBRATE_WHILE_RINGING: string 618 619 /** 620 * Indicates the storage area of the system default alarm. 621 * 622 * <p>You can obtain the URI of the system default alarm. 623 * 624 * @constant 625 * @syscap SystemCapability.Applications.settings.Core 626 * @since 7 627 */ 628 const DEFAULT_ALARM_ALERT: string 629 630 /** 631 * Indicates the type of the dual-tone multifrequency (DTMF) tone played when dialing. 632 * 633 * <p>The value {@code 0} indicates the normal short sound effect, and {@code 1} indicates the long sound 634 * effect. 635 * 636 * @constant 637 * @syscap SystemCapability.Applications.settings.Core 638 * @since 7 639 */ 640 const DTMF_TONE_TYPE_WHILE_DIALING: string 641 642 /** 643 * Specifies whether the DTMF tone is played when dialing. 644 * 645 * <p>If the value is {@code 1}, the DTMF tone is played. If the value is {@code 0}, the DTMF tone is not 646 * played. 647 * 648 * @constant 649 * @syscap SystemCapability.Applications.settings.Core 650 * @since 7 651 */ 652 const DTMF_TONE_WHILE_DIALING: string 653 654 /** 655 * Specifies which audio streams are affected by changes on the ringing mode and Do Not Disturb (DND) mode. 656 * 657 * <p>If you want a specific audio stream to be affected by changes of the ringing mode and DDN mode, set the 658 * corresponding bit to {@code 1}. 659 * 660 * @constant 661 * @syscap SystemCapability.Applications.settings.Core 662 * @since 7 663 */ 664 const AFFECTED_MODE_RINGER_STREAMS: string 665 666 /** 667 * Specifies which audio streams are affected by the mute mode. 668 * 669 * <p>If you want a specific audio stream to remain muted in mute mode, set the corresponding bit to {@code 1}. 670 * 671 * @constant 672 * @syscap SystemCapability.Applications.settings.Core 673 * @since 7 674 */ 675 const AFFECTED_MUTE_STREAMS: string 676 677 /** 678 * Indicates the storage area of the system default notification tone. 679 * 680 * <p>You can obtain the URI of the system default notification tone. 681 * 682 * @constant 683 * @syscap SystemCapability.Applications.settings.Core 684 * @since 7 685 */ 686 const DEFAULT_NOTIFICATION_SOUND: string 687 688 /** 689 * Indicates the storage area of the system default ringtone. 690 * 691 * <p>You can obtain the URI of the system default ringtone. 692 * 693 * @constant 694 * @syscap SystemCapability.Applications.settings.Core 695 * @since 7 696 */ 697 const DEFAULT_RINGTONE: string 698 699 /** 700 * Specifies whether the sound effects are enabled. 701 * 702 * <p>If the value is {@code 0}, the sound effects are disabled. If the value is {@code 1}, the sound effects 703 * are enabled. 704 * 705 * @constant 706 * @syscap SystemCapability.Applications.settings.Core 707 * @since 7 708 */ 709 const SOUND_EFFECTS_STATUS: string 710 711 /** 712 * Specifies whether the device vibrates for an event. This parameter is used inside the system. 713 * 714 * <p>If the value is {@code 1}, the device vibrates for an event. If the value is {@code 0}, the device does 715 * not vibrate for an event. 716 * 717 * @constant 718 * @syscap SystemCapability.Applications.settings.Core 719 * @since 7 720 */ 721 const VIBRATE_STATUS: string 722 723 /** 724 * Indicates whether the device enables haptic feedback. 725 * 726 * <p>The value is of the boolean type. 727 * 728 * @constant 729 * @syscap SystemCapability.Applications.settings.Core 730 * @since 7 731 */ 732 const HAPTIC_FEEDBACK_STATUS: string 733 } 734 735 /** 736 * Provides methods for setting information about text-to-speech (TTS) conversion, including the pitch, speech rate, 737 * engine, and plug-ins. 738 * 739 * @namespace TTS 740 * @syscap SystemCapability.Applications.settings.Core 741 * @since 7 742 */ 743 namespace TTS { 744 /** 745 * Indicates the default pitch of the text-to-speech (TTS) engine. 746 * 747 * <p>100 = 1x. If the value is set to {@code 200}, the frequency is twice the normal sound frequency. 748 * 749 * @constant 750 * @syscap SystemCapability.Applications.settings.Core 751 * @since 7 752 */ 753 const DEFAULT_TTS_PITCH: string 754 755 /** 756 * Indicates the default speech rate of the TTS engine. 100 = 1x. 757 * 758 * @constant 759 * @syscap SystemCapability.Applications.settings.Core 760 * @since 7 761 */ 762 const DEFAULT_TTS_RATE: string 763 764 /** 765 * Indicates the default TTS engine. 766 * 767 * @constant 768 * @syscap SystemCapability.Applications.settings.Core 769 * @since 7 770 */ 771 const DEFAULT_TTS_SYNTH: string 772 773 /** 774 * Indicates the list of activated plug-in packages used for TTS. Multiple plug-in packages are separated by 775 * spaces. 776 * 777 * @constant 778 * @syscap SystemCapability.Applications.settings.Core 779 * @since 7 780 */ 781 const ENABLED_TTS_PLUGINS: string 782 } 783 784 /** 785 * Provides methods for setting radio network information, including information about Bluetooth, Wi-Fi, Near Field 786 * Communication (NFC), and the airplane mode. 787 * 788 * @namespace wireless 789 * @syscap SystemCapability.Applications.settings.Core 790 * @since 7 791 */ 792 namespace wireless { 793 /** 794 * Specifies whether the device can be discovered or connected by other devices through Bluetooth. 795 * 796 * If the value is {@code 0}, the device cannot be connected or discovered. If the value is {@code 1}, the 797 * device can be connected but cannot be discovered. If the value is {@code 2}, the device can be connected 798 * and discovered. 799 * 800 * @constant 801 * @syscap SystemCapability.Applications.settings.Core 802 * @since 7 803 */ 804 const BLUETOOTH_DISCOVER_ABILITY_STATUS: string 805 806 /** 807 * Indicates the duration (in seconds) that the device can be discovered through Bluetooth. 808 * 809 * <p>After the duration expires, the device cannot be discovered through Bluetooth. 810 * 811 * @constant 812 * @syscap SystemCapability.Applications.settings.Core 813 * @since 7 814 */ 815 const BLUETOOTH_DISCOVER_TIMEOUT: string 816 817 /** 818 * Indicates the list of radio signals to be disabled when airplane mode is enabled. Multiple radio 819 * signals are separated by commas (,). 820 * 821 * <ul> 822 * <li>{@code BLUETOOTH_RADIO} - Bluetooth is disabled in airplane mode. 823 * <li>{@code CELL_RADIO} - Cellular radio is disabled in airplane mode. 824 * <li>{@code NFC_RADIO} - NFC is disabled in airplane mode. 825 * <li>{@code WIFI_RADIO} - Wi-Fi is disabled in airplane mode. 826 * </ul> 827 * 828 * @constant 829 * @syscap SystemCapability.Applications.settings.Core 830 * @since 7 831 */ 832 const AIRPLANE_MODE_RADIOS: string 833 834 /** 835 * Specifies whether Bluetooth is enabled. 836 * 837 * <p>If the value is {@code true}, Bluetooth is enabled. If the value is {@code false}, Bluetooth is disabled. 838 * 839 * @constant 840 * @syscap SystemCapability.Applications.settings.Core 841 * @since 7 842 */ 843 const BLUETOOTH_STATUS: string 844 845 /** 846 * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that Bluetooth is disabled in airplane mode. 847 * 848 * @constant 849 * @syscap SystemCapability.Applications.settings.Core 850 * @since 7 851 */ 852 const BLUETOOTH_RADIO: string 853 854 /** 855 * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that cellular radio is disabled in airplane mode. 856 * 857 * @constant 858 * @syscap SystemCapability.Applications.settings.Core 859 * @since 7 860 */ 861 const CELL_RADIO: string 862 863 /** 864 * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that NFC is disabled in airplane mode. 865 * 866 * @constant 867 * @syscap SystemCapability.Applications.settings.Core 868 * @since 7 869 */ 870 const NFC_RADIO: string 871 872 /** 873 * A constant of {@code AIRPLANE_MODE_RADIOS} to indicate that Wi-Fi is disabled in airplane mode. 874 * 875 * @constant 876 * @syscap SystemCapability.Applications.settings.Core 877 * @since 7 878 */ 879 const WIFI_RADIO: string 880 881 /** 882 * Specifies whether the Wi-Fi configuration created by the application of the device owner should be 883 * locked down. 884 * 885 * <p>If the value is {@code true}, the Wi-Fi configuration should be locked down. 886 * If the value is {@code false}, the Wi-Fi configuration should not be locked down. 887 * 888 * @constant 889 * @syscap SystemCapability.Applications.settings.Core 890 * @since 7 891 */ 892 const OWNER_LOCKDOWN_WIFI_CFG: string 893 894 /** 895 * Indicates the maximum number of attempts to obtain an IP address from the DHCP server. 896 * 897 * @constant 898 * @syscap SystemCapability.Applications.settings.Core 899 * @since 7 900 */ 901 const WIFI_DHCP_MAX_RETRY_COUNT: string 902 903 /** 904 * Indicates the maximum duration to hold a wake lock when waiting for the mobile data connection to 905 * establish after the Wi-Fi connection is disconnected. 906 * 907 * @constant 908 * @syscap SystemCapability.Applications.settings.Core 909 * @since 7 910 */ 911 const WIFI_TO_MOBILE_DATA_AWAKE_TIMEOUT: string 912 913 /** 914 * Specifies whether Wi-Fi is enabled. 915 * 916 * <p>If the value is {@code true}, Wi-Fi is enabled. If the value is {@code false}, Wi-Fi is disabled. 917 * 918 * @constant 919 * @syscap SystemCapability.Applications.settings.Core 920 * @since 7 921 */ 922 const WIFI_STATUS: string 923 924 /** 925 * Specifies whether Wi-Fi watchdog is enabled. 926 * 927 * <p>If the value is {@code true}, Wi-Fi watchdog is enabled. 928 * If the value is {@code false}, Wi-Fi watchdog is disabled. 929 * 930 * @constant 931 * @syscap SystemCapability.Applications.settings.Core 932 * @since 7 933 */ 934 const WIFI_WATCHDOG_STATUS: string 935 } 936 937 /** 938 * Constructs a URI for a specific name-value pair for monitoring data of the ability that uses the Data 939 * template. 940 * 941 * @param { string } name - Indicates the name of the setting to set. 942 * @param { AsyncCallback<object> } [callback] - The callback of getURI result. 943 * @syscap SystemCapability.Applications.settings.Core 944 * @since 7 945 * @deprecated since 9 946 */ 947 function getURI(name: string, callback: AsyncCallback<object>): void; 948 949 /** 950 * Constructs a URI for a specific name-value pair for monitoring data of the ability that uses the Data 951 * template. 952 * 953 * @param { string } name - Indicates the name of the setting to set. 954 * @returns { Promise<object> } Returns the corresponding URI; returns {@code null} if the URI does not exist. 955 * @syscap SystemCapability.Applications.settings.Core 956 * @since 7 957 * @deprecated since 9 958 */ 959 function getURI(name: string): Promise<object>; 960 961 /** 962 * Obtains the value of a specified character string in the database. 963 * 964 * @param { DataAbilityHelper } dataAbilityHelper - Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used 965 * to access the database. 966 * @param { string } name - Indicates the name of the character string. 967 * @param { AsyncCallback<object> } [callback] - The callback of getValue result. 968 * @syscap SystemCapability.Applications.settings.Core 969 * @famodelonly 970 * @since 7 971 * @deprecated since 9 972 * @useinstead ohos.settings#getValue 973 */ 974 function getValue(dataAbilityHelper: DataAbilityHelper, name: string, callback: AsyncCallback<object>): void; 975 976 /** 977 * Obtains the value of a specified character string in the database. 978 * 979 * @param { DataAbilityHelper } dataAbilityHelper - Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used 980 * to access the database. 981 * @param { string } name - Indicates the name of the character string. 982 * @returns { Promise<object> } Returns the value of the character string in the table if any is found; returns {@code 983 * null} otherwise. 984 * @syscap SystemCapability.Applications.settings.Core 985 * @famodelonly 986 * @since 7 987 * @deprecated since 9 988 * @useinstead ohos.settings#getValue 989 */ 990 function getValue(dataAbilityHelper: DataAbilityHelper, name: string): Promise<object>; 991 992 /** 993 * Get value from settingsdata 994 * 995 * @param { Context } context - Indicates the Context or dataAbilityHelper used to access 996 * the database. 997 * @param { string } name - Indicates the name of the character string. 998 * @param { AsyncCallback<string> } [callback] - The callback of getValue result. 999 * @syscap SystemCapability.Applications.settings.Core 1000 * @StageModelOnly 1001 * @since 10 1002 */ 1003 function getValue(context: Context, name: string, callback: AsyncCallback<string>): void; 1004 1005 /** 1006 * Get value from settingsdata 1007 * 1008 * @param { Context } context - Indicates the Context or dataAbilityHelper used to access 1009 * the database. 1010 * @param { string } name - Indicates the name of the character string. 1011 * @returns { Promise<string> } Returns the value of the character string in the table if any is found; returns {@code 1012 * null} otherwise. 1013 * @syscap SystemCapability.Applications.settings.Core 1014 * @StageModelOnly 1015 * @since 10 1016 */ 1017 function getValue(context: Context, name: string): Promise<string>; 1018 1019 /** 1020 * Saves a character string name and its value to the database. 1021 * 1022 * @param { DataAbilityHelper } dataAbilityHelper - Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used 1023 * to access the database. 1024 * @param { string } name - Indicates the name of the character string. 1025 * @param { object } value - Indicates the value of the character string. 1026 * @param { AsyncCallback<boolean> } [callback] - The callback of setValue result. 1027 * @syscap SystemCapability.Applications.settings.Core 1028 * @systemapi Hide this for inner system use. 1029 * @famodelonly 1030 * @since 7 1031 * @deprecated since 9 1032 * @useinstead ohos.settings#setValue 1033 */ 1034 function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object, callback: AsyncCallback<boolean>): void; 1035 1036 /** 1037 * Saves a character string name and its value to the database. 1038 * 1039 * @param { DataAbilityHelper } dataAbilityHelper - Indicates the {@link ohos.aafwk.ability.DataAbilityHelper} used 1040 * to access the database. 1041 * @param { string } name - Indicates the name of the character string. 1042 * @param { object } value - Indicates the value of the character string. 1043 * @returns { Promise<boolean> } Returns {@code true} if the operation is successful; returns {@code false} otherwise. 1044 * @syscap SystemCapability.Applications.settings.Core 1045 * @systemapi Hide this for inner system use. 1046 * @famodelonly 1047 * @since 7 1048 * @deprecated since 9 1049 * @useinstead ohos.settings#setValue 1050 */ 1051 function setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: object): Promise<boolean>; 1052 1053 /** 1054 * Set settingsdata value. 1055 * 1056 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 1057 * @param { Context } context - Indicates Context or dataAbilityHelper instance. 1058 * @param { string } name - Indicates the name of the character string. 1059 * @param { string } value - Indicates the value of the character string. 1060 * @param { AsyncCallback<boolean> } [callback] - The callback of setValue result. 1061 * @syscap SystemCapability.Applications.settings.Core 1062 * @StageModelOnly 1063 * @since 10 1064 */ 1065 function setValue(context: Context, name: string, value: string, callback: AsyncCallback<boolean>): void; 1066 1067 /** 1068 * Set settingsdata value. 1069 * 1070 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 1071 * @param { Context } context - Indicates Context or dataAbilityHelper instance. 1072 * @param { string } name - Indicates the name of the character string. 1073 * @param { string } value - Indicates the value of the character string. 1074 * @returns { Promise<boolean> } Returns {@code true} if the operation is successful; returns {@code false} otherwise. 1075 * @syscap SystemCapability.Applications.settings.Core 1076 * @StageModelOnly 1077 * @since 10 1078 */ 1079 function setValue(context: Context, name: string, value: string): Promise<boolean>; 1080 1081 /** 1082 * Enables or disables airplane mode. 1083 * 1084 * @param { boolean } enable - Specifies whether to enable airplane mode. The value {@code true} means to enable 1085 * airplane mode, and {@code false} means to disable airplane mode. 1086 * @param { AsyncCallback<void> } [callback] - The callback of enableAirplaneMode result. 1087 * @syscap SystemCapability.Applications.settings.Core 1088 * @since 7 1089 */ 1090 function enableAirplaneMode(enable: boolean, callback: AsyncCallback<void>): void; 1091 1092 /** 1093 * Enables or disables airplane mode. 1094 * 1095 * @param { boolean } enable - Specifies whether to enable airplane mode. The value {@code true} means to enable 1096 * airplane mode, and {@code false} means to disable airplane mode. 1097 * @returns { Promise<void> } - Return Promise. 1098 * @syscap SystemCapability.Applications.settings.Core 1099 * @since 7 1100 */ 1101 function enableAirplaneMode(enable: boolean): Promise<void>; 1102 1103 /** 1104 * Checks whether a specified application can show as a floating window. 1105 * 1106 * @param { AsyncCallback<boolean> } [callback] - The callback of canShowFloating result. 1107 * @syscap SystemCapability.Applications.settings.Core 1108 * @since 7 1109 */ 1110 function canShowFloating(callback: AsyncCallback<boolean>): void; 1111 1112 /** 1113 * Checks whether a specified application can show as a floating window. 1114 * 1115 * @returns { Promise<boolean> } Returns {@code true} if the application can draw over other applications; returns 1116 * {@code false} otherwise. 1117 * @syscap SystemCapability.Applications.settings.Core 1118 * @since 7 1119 */ 1120 function canShowFloating(): Promise<boolean>; 1121 1122 /** 1123 * Get settingsdata uri (synchronous method) 1124 * 1125 * @param { string } name - Indicates the name of the setting to set. 1126 * @returns { string } Returns settingsdata uri. 1127 * @syscap SystemCapability.Applications.settings.Core 1128 * @since 8 1129 */ 1130 function getUriSync(name: string): string; 1131 1132 /** 1133 * Get value from settingsdata(synchronous method) 1134 * 1135 * @param { DataAbilityHelper } dataAbilityHelper - Indicates dataAbilityHelper instance. 1136 * @param { string } name - Indicates the name of the character string. 1137 * @param { string } defValue - Indicates the default value of the character string. 1138 * @returns { string } Returns settingsdata value. 1139 * @syscap SystemCapability.Applications.settings.Core 1140 * @famodelonly 1141 * @since 8 1142 * @deprecated since 9 1143 * @useinstead ohos.settings#getValueSync 1144 */ 1145 function getValueSync(dataAbilityHelper: DataAbilityHelper, name: string, defValue: string): string; 1146 1147 /** 1148 * Get value from settingsdata(synchronous method) 1149 * 1150 * @param { Context } context - Indicates Context or dataAbilityHelper instance 1151 * @param { string } name - Indicates the name of the character string. 1152 * @param { string } defValue - Indicates the default value of the character string. 1153 * @returns { string } Returns settingsdata value. 1154 * @syscap SystemCapability.Applications.settings.Core 1155 * @StageModelOnly 1156 * @since 10 1157 */ 1158 function getValueSync(context: Context, name: string, defValue: string): string; 1159 1160 /** 1161 * Set settingsdata value(synchronous method) 1162 * 1163 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 1164 * @param { DataAbilityHelper } dataAbilityHelper Indicates dataAbilityHelper instance. 1165 * @param { string } name Indicates the name of the character string. 1166 * @param { string } value Indicates the value of the character string. 1167 * @returns { boolean } Returns {@code true} if the operation is successful; returns {@code false} otherwise. 1168 * @syscap SystemCapability.Applications.settings.Core 1169 * @famodelonly 1170 * @since 8 1171 * @deprecated since 9 1172 * @useinstead ohos.settings#setValueSync 1173 */ 1174 function setValueSync(dataAbilityHelper: DataAbilityHelper, name: string, value: string): boolean; 1175 1176 /** 1177 * Set settingsdata value(synchronous method) 1178 * 1179 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 1180 * @param { Context } context - Indicates Context or dataAbilityHelper instance. 1181 * @param { string } name - Indicates the name of the character string. 1182 * @param { string } value - Indicates the value of the character string. 1183 * @returns { boolean } Returns {@code true} if the operation is successful; returns {@code false} otherwise. 1184 * @syscap SystemCapability.Applications.settings.Core 1185 * @StageModelOnly 1186 * @since 10 1187 */ 1188 function setValueSync(context: Context, name: string, value: string): boolean; 1189} 1190 1191export default settings;