1/* 2 * Copyright (c) 2021 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 */ 15 16/** 17 * @file 18 * @kit BasicServicesKit 19 */ 20 21/** 22 * A static class pertaining to the product information. 23 * 24 * @namespace deviceInfo 25 * @syscap SystemCapability.Startup.SystemInfo 26 * @since 6 27 */ 28/** 29 * A static class pertaining to the product information. 30 * 31 * @namespace deviceInfo 32 * @syscap SystemCapability.Startup.SystemInfo 33 * @crossplatform 34 * @atomicservice 35 * @since 11 36 */ 37declare namespace deviceInfo { 38 /** 39 * Obtains the device type represented by a string, 40 * which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable}, 41 * {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}. 42 * 43 * 44 * @syscap SystemCapability.Startup.SystemInfo 45 * @since 6 46 */ 47 /** 48 * Obtains the device type represented by a string, 49 * which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable}, 50 * {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}. 51 * 52 * 53 * @syscap SystemCapability.Startup.SystemInfo 54 * @crossplatform 55 * @since 10 56 */ 57 /** 58 * Obtains the device type represented by a string, 59 * which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable}, 60 * {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}. 61 * 62 * 63 * @syscap SystemCapability.Startup.SystemInfo 64 * @crossplatform 65 * @atomicservice 66 * @since 11 67 */ 68 const deviceType: string; 69 70 /** 71 * Obtains the device manufacturer represented by a string. 72 * 73 * 74 * @syscap SystemCapability.Startup.SystemInfo 75 * @since 6 76 */ 77 /** 78 * Obtains the device manufacturer represented by a string. 79 * 80 * 81 * @syscap SystemCapability.Startup.SystemInfo 82 * @crossplatform 83 * @since 10 84 */ 85 const manufacture: string; 86 87 /** 88 * Obtains the device brand represented by a string. 89 * 90 * 91 * @syscap SystemCapability.Startup.SystemInfo 92 * @since 6 93 */ 94 /** 95 * Obtains the device brand represented by a string. 96 * 97 * 98 * @syscap SystemCapability.Startup.SystemInfo 99 * @crossplatform 100 * @since 10 101 */ 102 /** 103 * Obtains the device brand represented by a string. 104 * 105 * 106 * @syscap SystemCapability.Startup.SystemInfo 107 * @crossplatform 108 * @atomicservice 109 * @since 11 110 */ 111 const brand: string; 112 113 /** 114 * Obtains the external product series represented by a string. 115 * 116 * 117 * @syscap SystemCapability.Startup.SystemInfo 118 * @since 6 119 */ 120 /** 121 * Obtains the external product series represented by a string. 122 * 123 * 124 * @syscap SystemCapability.Startup.SystemInfo 125 * @crossplatform 126 * @since 10 127 */ 128 const marketName: string; 129 130 /** 131 * Obtains the product series represented by a string. 132 * 133 * 134 * @syscap SystemCapability.Startup.SystemInfo 135 * @since 6 136 */ 137 /** 138 * Obtains the product series represented by a string. 139 * 140 * 141 * @syscap SystemCapability.Startup.SystemInfo 142 * @crossplatform 143 * @since 10 144 */ 145 const productSeries: string; 146 147 /** 148 * Obtains the product model represented by a string. 149 * 150 * 151 * @syscap SystemCapability.Startup.SystemInfo 152 * @since 6 153 */ 154 /** 155 * Obtains the product model represented by a string. 156 * 157 * 158 * @syscap SystemCapability.Startup.SystemInfo 159 * @crossplatform 160 * @since 10 161 */ 162 /** 163 * Obtains the product model represented by a string. 164 * 165 * 166 * @syscap SystemCapability.Startup.SystemInfo 167 * @crossplatform 168 * @atomicservice 169 * @since 11 170 */ 171 const productModel: string; 172 173 /** 174 * Obtains the product model alias represented by a string. 175 * 176 * @syscap SystemCapability.Startup.SystemInfo 177 * @crossplatform 178 * @atomicservice 179 * @since 14 180 */ 181 const productModelAlias: string; 182 183 /** 184 * Obtains the software model represented by a string. 185 * 186 * 187 * @syscap SystemCapability.Startup.SystemInfo 188 * @since 6 189 */ 190 /** 191 * Obtains the software model represented by a string. 192 * 193 * 194 * @syscap SystemCapability.Startup.SystemInfo 195 * @crossplatform 196 * @since 10 197 */ 198 const softwareModel: string; 199 200 /** 201 * Obtains the hardware model represented by a string. 202 * 203 * 204 * @syscap SystemCapability.Startup.SystemInfo 205 * @since 6 206 */ 207 /** 208 * Obtains the hardware model represented by a string. 209 * 210 * 211 * @syscap SystemCapability.Startup.SystemInfo 212 * @crossplatform 213 * @since 10 214 */ 215 const hardwareModel: string; 216 217 /** 218 * Obtains the hardware profile represented by a string. 219 * 220 * 221 * @syscap SystemCapability.Startup.SystemInfo 222 * @since 6 223 * @deprecated since 9 224 */ 225 const hardwareProfile: string; 226 227 /** 228 * Obtains the device serial number represented by a string. 229 * 230 * @permission ohos.permission.sec.ACCESS_UDID 231 * 232 * @syscap SystemCapability.Startup.SystemInfo 233 * @since 6 234 */ 235 const serial: string; 236 237 /** 238 * Obtains the bootloader version number represented by a string. 239 * 240 * 241 * @syscap SystemCapability.Startup.SystemInfo 242 * @since 6 243 */ 244 /** 245 * Obtains the bootloader version number represented by a string. 246 * 247 * 248 * @syscap SystemCapability.Startup.SystemInfo 249 * @crossplatform 250 * @since 10 251 */ 252 const bootloaderVersion: string; 253 254 /** 255 * Obtains the application binary interface (Abi) list represented by a string. 256 * 257 * 258 * @syscap SystemCapability.Startup.SystemInfo 259 * @since 6 260 */ 261 /** 262 * Obtains the application binary interface (Abi) list represented by a string. 263 * 264 * 265 * @syscap SystemCapability.Startup.SystemInfo 266 * @crossplatform 267 * @since 10 268 */ 269 const abiList: string; 270 271 /** 272 * Obtains the security patch level represented by a string. 273 * 274 * 275 * @syscap SystemCapability.Startup.SystemInfo 276 * @since 6 277 */ 278 /** 279 * Obtains the security patch level represented by a string. 280 * 281 * 282 * @syscap SystemCapability.Startup.SystemInfo 283 * @crossplatform 284 * @since 10 285 */ 286 const securityPatchTag: string; 287 288 /** 289 * Obtains the product version represented by a string. 290 * 291 * 292 * @syscap SystemCapability.Startup.SystemInfo 293 * @since 6 294 */ 295 /** 296 * Obtains the product version represented by a string. 297 * 298 * 299 * @syscap SystemCapability.Startup.SystemInfo 300 * @crossplatform 301 * @since 10 302 */ 303 const displayVersion: string; 304 305 /** 306 * Obtains the incremental version represented by a string. 307 * 308 * 309 * @syscap SystemCapability.Startup.SystemInfo 310 * @since 6 311 */ 312 /** 313 * Obtains the incremental version represented by a string. 314 * 315 * 316 * @syscap SystemCapability.Startup.SystemInfo 317 * @crossplatform 318 * @since 10 319 */ 320 const incrementalVersion: string; 321 322 /** 323 * Obtains the OS release type represented by a string. 324 * <p>The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}. 325 * The specific release type may be {@code Release}, {@code Beta1}, or others alike. 326 * 327 * 328 * @syscap SystemCapability.Startup.SystemInfo 329 * @since 6 330 */ 331 /** 332 * Obtains the OS release type represented by a string. 333 * <p>The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}. 334 * The specific release type may be {@code Release}, {@code Beta1}, or others alike. 335 * 336 * 337 * @syscap SystemCapability.Startup.SystemInfo 338 * @crossplatform 339 * @since 10 340 */ 341 const osReleaseType: string; 342 343 /** 344 * Obtains the OS version represented by a string. 345 * 346 * 347 * @syscap SystemCapability.Startup.SystemInfo 348 * @since 6 349 */ 350 /** 351 * Obtains the OS version represented by a string. 352 * 353 * 354 * @syscap SystemCapability.Startup.SystemInfo 355 * @crossplatform 356 * @since 10 357 */ 358 /** 359 * Obtains the OS version represented by a string. 360 * 361 * 362 * @syscap SystemCapability.Startup.SystemInfo 363 * @crossplatform 364 * @atomicservice 365 * @since 11 366 */ 367 const osFullName: string; 368 369 /** 370 * Obtains the major (M) version number, which increases with any updates to the overall architecture. 371 * <p>The M version number monotonically increases from 1 to 99. 372 * 373 * 374 * @syscap SystemCapability.Startup.SystemInfo 375 * @since 6 376 */ 377 /** 378 * Obtains the major (M) version number, which increases with any updates to the overall architecture. 379 * <p>The M version number monotonically increases from 1 to 99. 380 * 381 * 382 * @syscap SystemCapability.Startup.SystemInfo 383 * @crossplatform 384 * @since 10 385 */ 386 const majorVersion: number; 387 388 /** 389 * Obtains the senior (S) version number, which increases with any updates to the partial 390 * architecture or major features. 391 * <p>The S version number monotonically increases from 0 to 99. 392 * 393 * 394 * @syscap SystemCapability.Startup.SystemInfo 395 * @since 6 396 */ 397 /** 398 * Obtains the senior (S) version number, which increases with any updates to the partial 399 * architecture or major features. 400 * <p>The S version number monotonically increases from 0 to 99. 401 * 402 * 403 * @syscap SystemCapability.Startup.SystemInfo 404 * @crossplatform 405 * @since 10 406 */ 407 const seniorVersion: number; 408 409 /** 410 * Obtains the feature (F) version number, which increases with any planned new features. 411 * <p>The F version number monotonically increases from 0 or 1 to 99. 412 * 413 * 414 * @syscap SystemCapability.Startup.SystemInfo 415 * @since 6 416 */ 417 /** 418 * Obtains the feature (F) version number, which increases with any planned new features. 419 * <p>The F version number monotonically increases from 0 or 1 to 99. 420 * 421 * 422 * @syscap SystemCapability.Startup.SystemInfo 423 * @crossplatform 424 * @since 10 425 */ 426 const featureVersion: number; 427 428 /** 429 * Obtains the build (B) version number, which increases with each new development build. 430 * <p>The B version number monotonically increases from 0 or 1 to 999. 431 * 432 * 433 * @syscap SystemCapability.Startup.SystemInfo 434 * @since 6 435 */ 436 /** 437 * Obtains the build (B) version number, which increases with each new development build. 438 * <p>The B version number monotonically increases from 0 or 1 to 999. 439 * 440 * 441 * @syscap SystemCapability.Startup.SystemInfo 442 * @crossplatform 443 * @since 10 444 */ 445 const buildVersion: number; 446 447 /** 448 * Obtains the SDK API version number. 449 * 450 * 451 * @syscap SystemCapability.Startup.SystemInfo 452 * @since 6 453 */ 454 /** 455 * Obtains the SDK API version number. 456 * 457 * 458 * @syscap SystemCapability.Startup.SystemInfo 459 * @crossplatform 460 * @since 10 461 */ 462 /** 463 * Obtains the SDK API version number. 464 * 465 * 466 * @syscap SystemCapability.Startup.SystemInfo 467 * @crossplatform 468 * @atomicservice 469 * @since 14 470 */ 471 const sdkApiVersion: number; 472 473 /** 474 * Obtains the first API version number. 475 * 476 * 477 * @syscap SystemCapability.Startup.SystemInfo 478 * @since 6 479 */ 480 /** 481 * Obtains the first API version number. 482 * 483 * 484 * @syscap SystemCapability.Startup.SystemInfo 485 * @crossplatform 486 * @since 10 487 */ 488 const firstApiVersion: number; 489 490 /** 491 * Obtains the version ID by a string. 492 * 493 * 494 * @syscap SystemCapability.Startup.SystemInfo 495 * @since 6 496 */ 497 /** 498 * Obtains the version ID by a string. 499 * 500 * 501 * @syscap SystemCapability.Startup.SystemInfo 502 * @crossplatform 503 * @since 10 504 */ 505 const versionId: string; 506 507 /** 508 * Obtains the build types of the same baseline code. 509 * 510 * 511 * @syscap SystemCapability.Startup.SystemInfo 512 * @since 6 513 */ 514 /** 515 * Obtains the build types of the same baseline code. 516 * 517 * 518 * @syscap SystemCapability.Startup.SystemInfo 519 * @crossplatform 520 * @since 10 521 */ 522 const buildType: string; 523 524 /** 525 * Obtains the different build user of the same baseline code. 526 * 527 * 528 * @syscap SystemCapability.Startup.SystemInfo 529 * @since 6 530 */ 531 /** 532 * Obtains the different build user of the same baseline code. 533 * 534 * 535 * @syscap SystemCapability.Startup.SystemInfo 536 * @crossplatform 537 * @since 10 538 */ 539 const buildUser: string; 540 541 /** 542 * Obtains the different build host of the same baseline code. 543 * 544 * 545 * @syscap SystemCapability.Startup.SystemInfo 546 * @since 6 547 */ 548 /** 549 * Obtains the different build host of the same baseline code. 550 * 551 * 552 * @syscap SystemCapability.Startup.SystemInfo 553 * @crossplatform 554 * @since 10 555 */ 556 const buildHost: string; 557 558 /** 559 * Obtains the build time. 560 * 561 * 562 * @syscap SystemCapability.Startup.SystemInfo 563 * @since 6 564 */ 565 /** 566 * Obtains the build time. 567 * 568 * 569 * @syscap SystemCapability.Startup.SystemInfo 570 * @crossplatform 571 * @since 10 572 */ 573 const buildTime: string; 574 575 /** 576 * Obtains the version hash. 577 * 578 * 579 * @syscap SystemCapability.Startup.SystemInfo 580 * @since 6 581 */ 582 /** 583 * Obtains the version hash. 584 * 585 * 586 * @syscap SystemCapability.Startup.SystemInfo 587 * @crossplatform 588 * @since 10 589 */ 590 const buildRootHash: string; 591 592 /** 593 * Obtains the device udid. 594 * 595 * @permission ohos.permission.sec.ACCESS_UDID 596 * 597 * @syscap SystemCapability.Startup.SystemInfo 598 * @since 7 599 */ 600 const udid: string; 601 602 /** 603 * Obtains the Distribution OS name. 604 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS name. 605 * distributionOsName will return the ISV OS name 606 * If ISV not specified, it will return an empty string 607 * 608 * 609 * @syscap SystemCapability.Startup.SystemInfo 610 * @since 10 611 */ 612 const distributionOSName: string; 613 614 /** 615 * Obtains the Distribution OS version. 616 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS version. 617 * distributionOSVersion will return the ISV OS version 618 * If ISV not specified, it will return the same value as osFullName 619 * 620 * 621 * @syscap SystemCapability.Startup.SystemInfo 622 * @since 10 623 */ 624 const distributionOSVersion: string; 625 626 /** 627 * Obtains the Distribution OS version. 628 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS api version. 629 * distributionOSVersion will return the ISV OS api version 630 * If ISV not specified, it will return the same value as sdkApiVersion 631 * 632 * 633 * @syscap SystemCapability.Startup.SystemInfo 634 * @since 10 635 */ 636 const distributionOSApiVersion: number; 637 638 /** 639 * Obtains the Distribution OS api name. 640 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS api name. 641 * distributionOSApiName will return the ISV OS api name 642 * 643 * @syscap SystemCapability.Startup.SystemInfo 644 * @since 13 645 */ 646 const distributionOSApiName: string; 647 648 /** 649 * Obtains the Distribution OS release type. 650 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS release type. 651 * distributionOSVersion will return the ISV OS release type 652 * If ISV not specified, it will return the same value as osReleaseType 653 * 654 * 655 * @syscap SystemCapability.Startup.SystemInfo 656 * @since 10 657 */ 658 const distributionOSReleaseType: string; 659 660 /** 661 * Open Device Identifier (ODID): a developer-level non-permanent device identifier. 662 * A developer can be an enterprise or individual developer. 663 * Example: dff3cdfd-7beb-1e7d-fdf7-1dbfddd7d30c 664 * 665 * An ODID will be regenerate in the following scenarios: 666 * Restore a phone to its factory settings. 667 * Uninstall and reinstall all apps of one developer on one device. 668 * 669 * An ODID is generated based on the following rules: 670 * For apps from the same developer, which are running on the same device, they have the same ODID. 671 * For apps from different developers, which are running on the same device, each of them has its own ODID. 672 * For apps from the same developer, which are running on different devices, each of them has its own ODID. 673 * For apps from different developers, which are running on different devices, each of them has its own ODID. 674 * 675 * 676 * @syscap SystemCapability.Startup.SystemInfo 677 * @since 12 678 */ 679 const ODID: string; 680 681 /** 682 * Obtaining the hard drive serial number. 683 * 684 * @permission ohos.permission.ACCESS_DISK_PHY_INFO 685 * @syscap SystemCapability.Startup.SystemInfo 686 * @since 15 687 */ 688 const diskSN: string; 689} 690 691export default deviceInfo; 692