| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.content.pm; |
| 18 |
|
| 19 |
import static android.os.Build.VERSION_CODES.DONUT; |
| 20 |
|
| 21 |
import android.annotation.IntDef; |
| 22 |
import android.annotation.NonNull; |
| 23 |
import android.annotation.Nullable; |
| 24 |
import android.annotation.SystemApi; |
| 25 |
import android.annotation.TestApi; |
| 26 |
import android.compat.annotation.UnsupportedAppUsage; |
| 27 |
import android.content.Context; |
| 28 |
import android.content.pm.PackageManager.NameNotFoundException; |
| 29 |
import android.content.res.Resources; |
| 30 |
import android.graphics.drawable.Drawable; |
| 31 |
import android.os.Build; |
| 32 |
import android.os.Environment; |
| 33 |
import android.os.Parcel; |
| 34 |
import android.os.Parcelable; |
| 35 |
import android.os.SystemClock; |
| 36 |
import android.os.UserHandle; |
| 37 |
import android.os.storage.StorageManager; |
| 38 |
import android.util.ArrayMap; |
| 39 |
import android.util.ArraySet; |
| 40 |
import android.util.Printer; |
| 41 |
import android.util.SparseArray; |
| 42 |
import android.util.proto.ProtoOutputStream; |
| 43 |
import android.window.OnBackInvokedCallback; |
| 44 |
|
| 45 |
import com.android.internal.util.ArrayUtils; |
| 46 |
import com.android.internal.util.Parcelling; |
| 47 |
import com.android.internal.util.Parcelling.BuiltIn.ForBoolean; |
| 48 |
import com.android.server.SystemConfig; |
| 49 |
|
| 50 |
import java.lang.annotation.Retention; |
| 51 |
import java.lang.annotation.RetentionPolicy; |
| 52 |
import java.text.Collator; |
| 53 |
import java.util.ArrayList; |
| 54 |
import java.util.Arrays; |
| 55 |
import java.util.Collections; |
| 56 |
import java.util.Comparator; |
| 57 |
import java.util.List; |
| 58 |
import java.util.Locale; |
| 59 |
import java.util.Objects; |
| 60 |
import java.util.Set; |
| 61 |
import java.util.UUID; |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
public class ApplicationInfo extends PackageItemInfo implements Parcelable { |
| 69 |
private static ForBoolean sForBoolean = Parcelling.Cache.getOrCreate(ForBoolean.class); |
| 70 |
private static final Parcelling.BuiltIn.ForStringSet sForStringSet = |
| 71 |
Parcelling.Cache.getOrCreate(Parcelling.BuiltIn.ForStringSet.class); |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
public String taskAffinity; |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
public String permission; |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
public String processName; |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
public String className; |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
public int descriptionRes; |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
public int theme; |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
public String manageSpaceActivityName; |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
public String backupAgentName; |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) |
| 146 |
public int fullBackupContent = 0; |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
public int dataExtractionRulesRes = 0; |
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
public boolean crossProfile; |
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
public int uiOptions = 0; |
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
public static final int FLAG_SYSTEM = 1<<0; |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
public static final int FLAG_DEBUGGABLE = 1<<1; |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
public static final int FLAG_HAS_CODE = 1<<2; |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
public static final int FLAG_PERSISTENT = 1<<3; |
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
public static final int FLAG_FACTORY_TEST = 1<<4; |
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
public static final int FLAG_ALLOW_TASK_REPARENTING = 1<<5; |
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
public static final int FLAG_ALLOW_CLEAR_USER_DATA = 1<<6; |
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
public static final int FLAG_UPDATED_SYSTEM_APP = 1<<7; |
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
public static final int FLAG_TEST_ONLY = 1<<8; |
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
public static final int FLAG_SUPPORTS_SMALL_SCREENS = 1<<9; |
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1<<10; |
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
public static final int FLAG_SUPPORTS_LARGE_SCREENS = 1<<11; |
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
public static final int FLAG_RESIZEABLE_FOR_SCREENS = 1<<12; |
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
@Deprecated |
| 287 |
public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13; |
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
public static final int FLAG_VM_SAFE_MODE = 1<<14; |
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
public static final int FLAG_ALLOW_BACKUP = 1<<15; |
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
public static final int FLAG_KILL_AFTER_RESTORE = 1<<16; |
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
public static final int FLAG_RESTORE_ANY_VERSION = 1<<17; |
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
public static final int FLAG_EXTERNAL_STORAGE = 1<<18; |
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19; |
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
public static final int FLAG_LARGE_HEAP = 1<<20; |
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
public static final int FLAG_STOPPED = 1<<21; |
| 377 |
|
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
public static final int FLAG_SUPPORTS_RTL = 1<<22; |
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
public static final int FLAG_INSTALLED = 1<<23; |
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
public static final int FLAG_IS_DATA_ONLY = 1<<24; |
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
@Deprecated |
| 409 |
public static final int FLAG_IS_GAME = 1<<25; |
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
|
| 418 |
public static final int FLAG_FULL_BACKUP_ONLY = 1<<26; |
| 419 |
|
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
public static final int FLAG_USES_CLEARTEXT_TRAFFIC = 1<<27; |
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
public static final int FLAG_EXTRACT_NATIVE_LIBS = 1<<28; |
| 443 |
|
| 444 |
|
| 445 |
|
| 446 |
|
| 447 |
|
| 448 |
public static final int FLAG_HARDWARE_ACCELERATED = 1<<29; |
| 449 |
|
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
public static final int FLAG_SUSPENDED = 1<<30; |
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
public static final int FLAG_MULTIARCH = 1 << 31; |
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
public int flags = 0; |
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
public static final int PRIVATE_FLAG_HIDDEN = 1<<0; |
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
|
| 503 |
|
| 504 |
|
| 505 |
|
| 506 |
|
| 507 |
|
| 508 |
public static final int PRIVATE_FLAG_CANT_SAVE_STATE = 1<<1; |
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
|
| 514 |
|
| 515 |
|
| 516 |
@UnsupportedAppUsage |
| 517 |
@TestApi |
| 518 |
public static final int PRIVATE_FLAG_PRIVILEGED = 1<<3; |
| 519 |
|
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
|
| 524 |
|
| 525 |
|
| 526 |
public static final int PRIVATE_FLAG_HAS_DOMAIN_URLS = 1<<4; |
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
public static final int PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE = 1 << 5; |
| 535 |
|
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
public static final int PRIVATE_FLAG_DIRECT_BOOT_AWARE = 1 << 6; |
| 543 |
|
| 544 |
|
| 545 |
|
| 546 |
|
| 547 |
|
| 548 |
|
| 549 |
|
| 550 |
public static final int PRIVATE_FLAG_INSTANT = 1 << 7; |
| 551 |
|
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
|
| 557 |
|
| 558 |
public static final int PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE = 1 << 8; |
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
|
| 565 |
|
| 566 |
|
| 567 |
public static final int PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER = 1 << 9; |
| 568 |
|
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
public static final int PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE = 1 << 10; |
| 576 |
|
| 577 |
|
| 578 |
|
| 579 |
|
| 580 |
|
| 581 |
|
| 582 |
|
| 583 |
|
| 584 |
public static final int PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_UNRESIZEABLE = 1 << 11; |
| 585 |
|
| 586 |
|
| 587 |
|
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
|
| 592 |
|
| 593 |
|
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
public static final int PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION = |
| 599 |
1 << 12; |
| 600 |
|
| 601 |
|
| 602 |
|
| 603 |
|
| 604 |
|
| 605 |
|
| 606 |
|
| 607 |
public static final int PRIVATE_FLAG_BACKUP_IN_FOREGROUND = 1 << 13; |
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
|
| 612 |
|
| 613 |
|
| 614 |
public static final int PRIVATE_FLAG_STATIC_SHARED_LIBRARY = 1 << 14; |
| 615 |
|
| 616 |
|
| 617 |
|
| 618 |
|
| 619 |
|
| 620 |
|
| 621 |
|
| 622 |
public static final int PRIVATE_FLAG_ISOLATED_SPLIT_LOADING = 1 << 15; |
| 623 |
|
| 624 |
|
| 625 |
|
| 626 |
|
| 627 |
|
| 628 |
|
| 629 |
public static final int PRIVATE_FLAG_VIRTUAL_PRELOAD = 1 << 16; |
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
|
| 636 |
public static final int PRIVATE_FLAG_OEM = 1 << 17; |
| 637 |
|
| 638 |
|
| 639 |
|
| 640 |
|
| 641 |
|
| 642 |
|
| 643 |
public static final int PRIVATE_FLAG_VENDOR = 1 << 18; |
| 644 |
|
| 645 |
|
| 646 |
|
| 647 |
|
| 648 |
|
| 649 |
|
| 650 |
public static final int PRIVATE_FLAG_PRODUCT = 1 << 19; |
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
|
| 655 |
|
| 656 |
|
| 657 |
public static final int PRIVATE_FLAG_SIGNED_WITH_PLATFORM_KEY = 1 << 20; |
| 658 |
|
| 659 |
|
| 660 |
|
| 661 |
|
| 662 |
|
| 663 |
|
| 664 |
public static final int PRIVATE_FLAG_SYSTEM_EXT = 1 << 21; |
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
public static final int PRIVATE_FLAG_USES_NON_SDK_API = 1 << 22; |
| 672 |
|
| 673 |
|
| 674 |
|
| 675 |
|
| 676 |
|
| 677 |
|
| 678 |
public static final int PRIVATE_FLAG_PROFILEABLE_BY_SHELL = 1 << 23; |
| 679 |
|
| 680 |
|
| 681 |
|
| 682 |
|
| 683 |
|
| 684 |
|
| 685 |
public static final int PRIVATE_FLAG_HAS_FRAGILE_USER_DATA = 1 << 24; |
| 686 |
|
| 687 |
|
| 688 |
|
| 689 |
|
| 690 |
|
| 691 |
|
| 692 |
|
| 693 |
|
| 694 |
|
| 695 |
|
| 696 |
public static final int PRIVATE_FLAG_USE_EMBEDDED_DEX = 1 << 25; |
| 697 |
|
| 698 |
|
| 699 |
|
| 700 |
|
| 701 |
|
| 702 |
|
| 703 |
|
| 704 |
|
| 705 |
|
| 706 |
|
| 707 |
|
| 708 |
public static final int PRIVATE_FLAG_ALLOW_CLEAR_USER_DATA_ON_FAILED_RESTORE = 1 << 26; |
| 709 |
|
| 710 |
|
| 711 |
|
| 712 |
|
| 713 |
|
| 714 |
|
| 715 |
|
| 716 |
public static final int PRIVATE_FLAG_ALLOW_AUDIO_PLAYBACK_CAPTURE = 1 << 27; |
| 717 |
|
| 718 |
|
| 719 |
|
| 720 |
|
| 721 |
|
| 722 |
|
| 723 |
public static final int PRIVATE_FLAG_IS_RESOURCE_OVERLAY = 1 << 28; |
| 724 |
|
| 725 |
|
| 726 |
|
| 727 |
|
| 728 |
|
| 729 |
|
| 730 |
|
| 731 |
|
| 732 |
public static final int PRIVATE_FLAG_REQUEST_LEGACY_EXTERNAL_STORAGE = 1 << 29; |
| 733 |
|
| 734 |
|
| 735 |
|
| 736 |
|
| 737 |
|
| 738 |
|
| 739 |
public static final int PRIVATE_FLAG_ODM = 1 << 30; |
| 740 |
|
| 741 |
|
| 742 |
|
| 743 |
|
| 744 |
|
| 745 |
|
| 746 |
public static final int PRIVATE_FLAG_ALLOW_NATIVE_HEAP_POINTER_TAGGING = 1 << 31; |
| 747 |
|
| 748 |
|
| 749 |
@IntDef(flag = true, prefix = { "PRIVATE_FLAG_" }, value = { |
| 750 |
PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE, |
| 751 |
PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION, |
| 752 |
PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_UNRESIZEABLE, |
| 753 |
PRIVATE_FLAG_BACKUP_IN_FOREGROUND, |
| 754 |
PRIVATE_FLAG_CANT_SAVE_STATE, |
| 755 |
PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE, |
| 756 |
PRIVATE_FLAG_DIRECT_BOOT_AWARE, |
| 757 |
PRIVATE_FLAG_HAS_DOMAIN_URLS, |
| 758 |
PRIVATE_FLAG_HIDDEN, |
| 759 |
PRIVATE_FLAG_INSTANT, |
| 760 |
PRIVATE_FLAG_IS_RESOURCE_OVERLAY, |
| 761 |
PRIVATE_FLAG_ISOLATED_SPLIT_LOADING, |
| 762 |
PRIVATE_FLAG_OEM, |
| 763 |
PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE, |
| 764 |
PRIVATE_FLAG_USE_EMBEDDED_DEX, |
| 765 |
PRIVATE_FLAG_PRIVILEGED, |
| 766 |
PRIVATE_FLAG_PRODUCT, |
| 767 |
PRIVATE_FLAG_SYSTEM_EXT, |
| 768 |
PRIVATE_FLAG_PROFILEABLE_BY_SHELL, |
| 769 |
PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER, |
| 770 |
PRIVATE_FLAG_SIGNED_WITH_PLATFORM_KEY, |
| 771 |
PRIVATE_FLAG_STATIC_SHARED_LIBRARY, |
| 772 |
PRIVATE_FLAG_VENDOR, |
| 773 |
PRIVATE_FLAG_VIRTUAL_PRELOAD, |
| 774 |
PRIVATE_FLAG_HAS_FRAGILE_USER_DATA, |
| 775 |
PRIVATE_FLAG_ALLOW_CLEAR_USER_DATA_ON_FAILED_RESTORE, |
| 776 |
PRIVATE_FLAG_ALLOW_AUDIO_PLAYBACK_CAPTURE, |
| 777 |
PRIVATE_FLAG_REQUEST_LEGACY_EXTERNAL_STORAGE, |
| 778 |
PRIVATE_FLAG_ODM, |
| 779 |
PRIVATE_FLAG_ALLOW_NATIVE_HEAP_POINTER_TAGGING, |
| 780 |
}) |
| 781 |
@Retention(RetentionPolicy.SOURCE) |
| 782 |
public @interface ApplicationInfoPrivateFlags {} |
| 783 |
|
| 784 |
|
| 785 |
|
| 786 |
|
| 787 |
|
| 788 |
|
| 789 |
public static final int PRIVATE_FLAG_EXT_PROFILEABLE = 1 << 0; |
| 790 |
|
| 791 |
|
| 792 |
|
| 793 |
|
| 794 |
|
| 795 |
|
| 796 |
|
| 797 |
public static final int PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION = 1 << 1; |
| 798 |
|
| 799 |
|
| 800 |
|
| 801 |
|
| 802 |
|
| 803 |
|
| 804 |
public static final int PRIVATE_FLAG_EXT_ATTRIBUTIONS_ARE_USER_VISIBLE = 1 << 2; |
| 805 |
|
| 806 |
|
| 807 |
|
| 808 |
|
| 809 |
|
| 810 |
|
| 811 |
|
| 812 |
|
| 813 |
|
| 814 |
|
| 815 |
|
| 816 |
public static final int PRIVATE_FLAG_EXT_ENABLE_ON_BACK_INVOKED_CALLBACK = 1 << 3; |
| 817 |
|
| 818 |
|
| 819 |
@IntDef(flag = true, prefix = { "PRIVATE_FLAG_EXT_" }, value = { |
| 820 |
PRIVATE_FLAG_EXT_PROFILEABLE, |
| 821 |
PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION, |
| 822 |
PRIVATE_FLAG_EXT_ATTRIBUTIONS_ARE_USER_VISIBLE, |
| 823 |
PRIVATE_FLAG_EXT_ENABLE_ON_BACK_INVOKED_CALLBACK, |
| 824 |
}) |
| 825 |
@Retention(RetentionPolicy.SOURCE) |
| 826 |
public @interface ApplicationInfoPrivateFlagsExt {} |
| 827 |
|
| 828 |
|
| 829 |
|
| 830 |
|
| 831 |
|
| 832 |
|
| 833 |
public static final int AUTO_REVOKE_ALLOWED = 0; |
| 834 |
|
| 835 |
|
| 836 |
|
| 837 |
|
| 838 |
|
| 839 |
|
| 840 |
|
| 841 |
public static final int AUTO_REVOKE_DISCOURAGED = 1; |
| 842 |
|
| 843 |
|
| 844 |
|
| 845 |
|
| 846 |
|
| 847 |
|
| 848 |
|
| 849 |
public static final int AUTO_REVOKE_DISALLOWED = 2; |
| 850 |
|
| 851 |
|
| 852 |
|
| 853 |
|
| 854 |
|
| 855 |
@UnsupportedAppUsage |
| 856 |
@TestApi |
| 857 |
public @ApplicationInfoPrivateFlags int privateFlags; |
| 858 |
|
| 859 |
|
| 860 |
|
| 861 |
|
| 862 |
|
| 863 |
public @ApplicationInfoPrivateFlagsExt int privateFlagsExt; |
| 864 |
|
| 865 |
|
| 866 |
|
| 867 |
|
| 868 |
public static final String METADATA_PRELOADED_FONTS = "preloaded_fonts"; |
| 869 |
|
| 870 |
|
| 871 |
|
| 872 |
|
| 873 |
|
| 874 |
|
| 875 |
|
| 876 |
public int requiresSmallestWidthDp = 0; |
| 877 |
|
| 878 |
|
| 879 |
|
| 880 |
|
| 881 |
|
| 882 |
|
| 883 |
|
| 884 |
public int compatibleWidthLimitDp = 0; |
| 885 |
|
| 886 |
|
| 887 |
|
| 888 |
|
| 889 |
|
| 890 |
|
| 891 |
|
| 892 |
public int largestWidthLimitDp = 0; |
| 893 |
|
| 894 |
|
| 895 |
|
| 896 |
|
| 897 |
|
| 898 |
|
| 899 |
|
| 900 |
|
| 901 |
public float maxAspectRatio; |
| 902 |
|
| 903 |
|
| 904 |
|
| 905 |
|
| 906 |
|
| 907 |
|
| 908 |
|
| 909 |
|
| 910 |
public float minAspectRatio; |
| 911 |
|
| 912 |
|
| 913 |
public String volumeUuid; |
| 914 |
|
| 915 |
|
| 916 |
|
| 917 |
|
| 918 |
|
| 919 |
|
| 920 |
|
| 921 |
public UUID storageUuid; |
| 922 |
|
| 923 |
|
| 924 |
@UnsupportedAppUsage |
| 925 |
public String scanSourceDir; |
| 926 |
|
| 927 |
@UnsupportedAppUsage |
| 928 |
public String scanPublicSourceDir; |
| 929 |
|
| 930 |
|
| 931 |
|
| 932 |
|
| 933 |
public String sourceDir; |
| 934 |
|
| 935 |
|
| 936 |
|
| 937 |
|
| 938 |
|
| 939 |
|
| 940 |
public String publicSourceDir; |
| 941 |
|
| 942 |
|
| 943 |
|
| 944 |
|
| 945 |
public String[] splitNames; |
| 946 |
|
| 947 |
|
| 948 |
|
| 949 |
|
| 950 |
public String[] splitSourceDirs; |
| 951 |
|
| 952 |
|
| 953 |
|
| 954 |
|
| 955 |
|
| 956 |
|
| 957 |
|
| 958 |
|
| 959 |
public String[] splitPublicSourceDirs; |
| 960 |
|
| 961 |
|
| 962 |
|
| 963 |
|
| 964 |
|
| 965 |
|
| 966 |
|
| 967 |
|
| 968 |
|
| 969 |
|
| 970 |
|
| 971 |
|
| 972 |
|
| 973 |
|
| 974 |
|
| 975 |
|
| 976 |
|
| 977 |
|
| 978 |
|
| 979 |
|
| 980 |
|
| 981 |
|
| 982 |
|
| 983 |
|
| 984 |
public SparseArray<int[]> splitDependencies; |
| 985 |
|
| 986 |
|
| 987 |
|
| 988 |
|
| 989 |
|
| 990 |
|
| 991 |
|
| 992 |
|
| 993 |
@UnsupportedAppUsage |
| 994 |
public String[] resourceDirs; |
| 995 |
|
| 996 |
|
| 997 |
|
| 998 |
|
| 999 |
|
| 1000 |
|
| 1001 |
|
| 1002 |
public String[] overlayPaths; |
| 1003 |
|
| 1004 |
|
| 1005 |
|
| 1006 |
|
| 1007 |
|
| 1008 |
|
| 1009 |
|
| 1010 |
|
| 1011 |
public String seInfo; |
| 1012 |
|
| 1013 |
|
| 1014 |
|
| 1015 |
|
| 1016 |
|
| 1017 |
|
| 1018 |
|
| 1019 |
|
| 1020 |
|
| 1021 |
|
| 1022 |
|
| 1023 |
|
| 1024 |
|
| 1025 |
public String seInfoUser; |
| 1026 |
|
| 1027 |
|
| 1028 |
|
| 1029 |
|
| 1030 |
|
| 1031 |
|
| 1032 |
|
| 1033 |
public String[] sharedLibraryFiles; |
| 1034 |
|
| 1035 |
|
| 1036 |
|
| 1037 |
|
| 1038 |
|
| 1039 |
|
| 1040 |
|
| 1041 |
|
| 1042 |
|
| 1043 |
public List<SharedLibraryInfo> sharedLibraryInfos; |
| 1044 |
|
| 1045 |
|
| 1046 |
|
| 1047 |
|
| 1048 |
|
| 1049 |
public String dataDir; |
| 1050 |
|
| 1051 |
|
| 1052 |
|
| 1053 |
|
| 1054 |
|
| 1055 |
|
| 1056 |
|
| 1057 |
public String deviceProtectedDataDir; |
| 1058 |
|
| 1059 |
|
| 1060 |
|
| 1061 |
|
| 1062 |
|
| 1063 |
|
| 1064 |
|
| 1065 |
@SystemApi |
| 1066 |
public String credentialProtectedDataDir; |
| 1067 |
|
| 1068 |
|
| 1069 |
|
| 1070 |
|
| 1071 |
public String nativeLibraryDir; |
| 1072 |
|
| 1073 |
|
| 1074 |
|
| 1075 |
|
| 1076 |
|
| 1077 |
|
| 1078 |
|
| 1079 |
|
| 1080 |
|
| 1081 |
|
| 1082 |
|
| 1083 |
|
| 1084 |
|
| 1085 |
|
| 1086 |
|
| 1087 |
|
| 1088 |
@UnsupportedAppUsage |
| 1089 |
public String secondaryNativeLibraryDir; |
| 1090 |
|
| 1091 |
|
| 1092 |
|
| 1093 |
|
| 1094 |
|
| 1095 |
|
| 1096 |
|
| 1097 |
|
| 1098 |
|
| 1099 |
|
| 1100 |
@UnsupportedAppUsage |
| 1101 |
public String nativeLibraryRootDir; |
| 1102 |
|
| 1103 |
|
| 1104 |
|
| 1105 |
|
| 1106 |
|
| 1107 |
|
| 1108 |
|
| 1109 |
public boolean nativeLibraryRootRequiresIsa; |
| 1110 |
|
| 1111 |
|
| 1112 |
|
| 1113 |
|
| 1114 |
|
| 1115 |
|
| 1116 |
|
| 1117 |
|
| 1118 |
|
| 1119 |
|
| 1120 |
@UnsupportedAppUsage |
| 1121 |
public String primaryCpuAbi; |
| 1122 |
|
| 1123 |
|
| 1124 |
|
| 1125 |
|
| 1126 |
|
| 1127 |
|
| 1128 |
|
| 1129 |
|
| 1130 |
@UnsupportedAppUsage |
| 1131 |
public String secondaryCpuAbi; |
| 1132 |
|
| 1133 |
|
| 1134 |
|
| 1135 |
|
| 1136 |
|
| 1137 |
|
| 1138 |
public int uid; |
| 1139 |
|
| 1140 |
|
| 1141 |
|
| 1142 |
|
| 1143 |
|
| 1144 |
public int minSdkVersion; |
| 1145 |
|
| 1146 |
|
| 1147 |
|
| 1148 |
|
| 1149 |
|
| 1150 |
|
| 1151 |
|
| 1152 |
|
| 1153 |
|
| 1154 |
public int targetSdkVersion; |
| 1155 |
|
| 1156 |
|
| 1157 |
|
| 1158 |
|
| 1159 |
|
| 1160 |
public long longVersionCode; |
| 1161 |
|
| 1162 |
|
| 1163 |
|
| 1164 |
|
| 1165 |
|
| 1166 |
|
| 1167 |
|
| 1168 |
|
| 1169 |
@Deprecated |
| 1170 |
@UnsupportedAppUsage |
| 1171 |
public int versionCode; |
| 1172 |
|
| 1173 |
|
| 1174 |
|
| 1175 |
|
| 1176 |
|
| 1177 |
public long createTimestamp; |
| 1178 |
|
| 1179 |
|
| 1180 |
|
| 1181 |
|
| 1182 |
|
| 1183 |
|
| 1184 |
|
| 1185 |
|
| 1186 |
public int compileSdkVersion; |
| 1187 |
|
| 1188 |
|
| 1189 |
|
| 1190 |
|
| 1191 |
|
| 1192 |
|
| 1193 |
|
| 1194 |
|
| 1195 |
@Nullable |
| 1196 |
public String compileSdkVersionCodename; |
| 1197 |
|
| 1198 |
|
| 1199 |
|
| 1200 |
|
| 1201 |
|
| 1202 |
public boolean enabled = true; |
| 1203 |
|
| 1204 |
|
| 1205 |
|
| 1206 |
|
| 1207 |
|
| 1208 |
@UnsupportedAppUsage |
| 1209 |
public int enabledSetting = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; |
| 1210 |
|
| 1211 |
|
| 1212 |
|
| 1213 |
|
| 1214 |
|
| 1215 |
@UnsupportedAppUsage |
| 1216 |
public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; |
| 1217 |
|
| 1218 |
|
| 1219 |
|
| 1220 |
|
| 1221 |
|
| 1222 |
public int networkSecurityConfigRes; |
| 1223 |
|
| 1224 |
|
| 1225 |
|
| 1226 |
|
| 1227 |
|
| 1228 |
@SystemApi |
| 1229 |
public int targetSandboxVersion; |
| 1230 |
|
| 1231 |
|
| 1232 |
|
| 1233 |
|
| 1234 |
|
| 1235 |
|
| 1236 |
public String appComponentFactory; |
| 1237 |
|
| 1238 |
|
| 1239 |
|
| 1240 |
|
| 1241 |
|
| 1242 |
public int iconRes; |
| 1243 |
|
| 1244 |
|
| 1245 |
|
| 1246 |
|
| 1247 |
|
| 1248 |
public int roundIconRes; |
| 1249 |
|
| 1250 |
|
| 1251 |
|
| 1252 |
|
| 1253 |
|
| 1254 |
|
| 1255 |
|
| 1256 |
|
| 1257 |
|
| 1258 |
|
| 1259 |
|
| 1260 |
|
| 1261 |
public @Category int category = CATEGORY_UNDEFINED; |
| 1262 |
|
| 1263 |
|
| 1264 |
@IntDef(prefix = { "CATEGORY_" }, value = { |
| 1265 |
CATEGORY_UNDEFINED, |
| 1266 |
CATEGORY_GAME, |
| 1267 |
CATEGORY_AUDIO, |
| 1268 |
CATEGORY_VIDEO, |
| 1269 |
CATEGORY_IMAGE, |
| 1270 |
CATEGORY_SOCIAL, |
| 1271 |
CATEGORY_NEWS, |
| 1272 |
CATEGORY_MAPS, |
| 1273 |
CATEGORY_PRODUCTIVITY, |
| 1274 |
CATEGORY_ACCESSIBILITY |
| 1275 |
}) |
| 1276 |
@Retention(RetentionPolicy.SOURCE) |
| 1277 |
public @interface Category { |
| 1278 |
} |
| 1279 |
|
| 1280 |
|
| 1281 |
|
| 1282 |
|
| 1283 |
|
| 1284 |
|
| 1285 |
public static final int CATEGORY_UNDEFINED = -1; |
| 1286 |
|
| 1287 |
|
| 1288 |
|
| 1289 |
|
| 1290 |
|
| 1291 |
|
| 1292 |
public static final int CATEGORY_GAME = 0; |
| 1293 |
|
| 1294 |
|
| 1295 |
|
| 1296 |
|
| 1297 |
|
| 1298 |
|
| 1299 |
|
| 1300 |
public static final int CATEGORY_AUDIO = 1; |
| 1301 |
|
| 1302 |
|
| 1303 |
|
| 1304 |
|
| 1305 |
|
| 1306 |
|
| 1307 |
|
| 1308 |
public static final int CATEGORY_VIDEO = 2; |
| 1309 |
|
| 1310 |
|
| 1311 |
|
| 1312 |
|
| 1313 |
|
| 1314 |
|
| 1315 |
|
| 1316 |
public static final int CATEGORY_IMAGE = 3; |
| 1317 |
|
| 1318 |
|
| 1319 |
|
| 1320 |
|
| 1321 |
|
| 1322 |
|
| 1323 |
|
| 1324 |
public static final int CATEGORY_SOCIAL = 4; |
| 1325 |
|
| 1326 |
|
| 1327 |
|
| 1328 |
|
| 1329 |
|
| 1330 |
|
| 1331 |
|
| 1332 |
public static final int CATEGORY_NEWS = 5; |
| 1333 |
|
| 1334 |
|
| 1335 |
|
| 1336 |
|
| 1337 |
|
| 1338 |
|
| 1339 |
public static final int CATEGORY_MAPS = 6; |
| 1340 |
|
| 1341 |
|
| 1342 |
|
| 1343 |
|
| 1344 |
|
| 1345 |
|
| 1346 |
|
| 1347 |
public static final int CATEGORY_PRODUCTIVITY = 7; |
| 1348 |
|
| 1349 |
|
| 1350 |
|
| 1351 |
|
| 1352 |
|
| 1353 |
|
| 1354 |
public static final int CATEGORY_ACCESSIBILITY = 8; |
| 1355 |
|
| 1356 |
|
| 1357 |
|
| 1358 |
|
| 1359 |
|
| 1360 |
|
| 1361 |
|
| 1362 |
|
| 1363 |
public static CharSequence getCategoryTitle(Context context, @Category int category) { |
| 1364 |
switch (category) { |
| 1365 |
case ApplicationInfo.CATEGORY_GAME: |
| 1366 |
return context.getText(com.android.internal.R.string.app_category_game); |
| 1367 |
case ApplicationInfo.CATEGORY_AUDIO: |
| 1368 |
return context.getText(com.android.internal.R.string.app_category_audio); |
| 1369 |
case ApplicationInfo.CATEGORY_VIDEO: |
| 1370 |
return context.getText(com.android.internal.R.string.app_category_video); |
| 1371 |
case ApplicationInfo.CATEGORY_IMAGE: |
| 1372 |
return context.getText(com.android.internal.R.string.app_category_image); |
| 1373 |
case ApplicationInfo.CATEGORY_SOCIAL: |
| 1374 |
return context.getText(com.android.internal.R.string.app_category_social); |
| 1375 |
case ApplicationInfo.CATEGORY_NEWS: |
| 1376 |
return context.getText(com.android.internal.R.string.app_category_news); |
| 1377 |
case ApplicationInfo.CATEGORY_MAPS: |
| 1378 |
return context.getText(com.android.internal.R.string.app_category_maps); |
| 1379 |
case ApplicationInfo.CATEGORY_PRODUCTIVITY: |
| 1380 |
return context.getText(com.android.internal.R.string.app_category_productivity); |
| 1381 |
case ApplicationInfo.CATEGORY_ACCESSIBILITY: |
| 1382 |
return context.getText(com.android.internal.R.string.app_category_accessibility); |
| 1383 |
default: |
| 1384 |
return null; |
| 1385 |
} |
| 1386 |
} |
| 1387 |
|
| 1388 |
|
| 1389 |
public String classLoaderName; |
| 1390 |
|
| 1391 |
|
| 1392 |
public String[] splitClassLoaderNames; |
| 1393 |
|
| 1394 |
|
| 1395 |
public boolean hiddenUntilInstalled; |
| 1396 |
|
| 1397 |
|
| 1398 |
public String zygotePreloadName; |
| 1399 |
|
| 1400 |
|
| 1401 |
|
| 1402 |
|
| 1403 |
public static final int GWP_ASAN_DEFAULT = -1; |
| 1404 |
|
| 1405 |
|
| 1406 |
|
| 1407 |
|
| 1408 |
public static final int GWP_ASAN_NEVER = 0; |
| 1409 |
|
| 1410 |
|
| 1411 |
|
| 1412 |
|
| 1413 |
public static final int GWP_ASAN_ALWAYS = 1; |
| 1414 |
|
| 1415 |
|
| 1416 |
|
| 1417 |
|
| 1418 |
|
| 1419 |
@IntDef(prefix = {"GWP_ASAN_"}, value = { |
| 1420 |
GWP_ASAN_DEFAULT, |
| 1421 |
GWP_ASAN_NEVER, |
| 1422 |
GWP_ASAN_ALWAYS, |
| 1423 |
}) |
| 1424 |
@Retention(RetentionPolicy.SOURCE) |
| 1425 |
public @interface GwpAsanMode {} |
| 1426 |
|
| 1427 |
|
| 1428 |
|
| 1429 |
|
| 1430 |
|
| 1431 |
private @GwpAsanMode int gwpAsanMode = GWP_ASAN_DEFAULT; |
| 1432 |
|
| 1433 |
|
| 1434 |
|
| 1435 |
|
| 1436 |
public static final int MEMTAG_DEFAULT = -1; |
| 1437 |
|
| 1438 |
|
| 1439 |
|
| 1440 |
|
| 1441 |
public static final int MEMTAG_OFF = 0; |
| 1442 |
|
| 1443 |
|
| 1444 |
|
| 1445 |
|
| 1446 |
public static final int MEMTAG_ASYNC = 1; |
| 1447 |
|
| 1448 |
|
| 1449 |
|
| 1450 |
|
| 1451 |
public static final int MEMTAG_SYNC = 2; |
| 1452 |
|
| 1453 |
|
| 1454 |
|
| 1455 |
|
| 1456 |
|
| 1457 |
@IntDef(prefix = {"MEMTAG_"}, value = { |
| 1458 |
MEMTAG_DEFAULT, |
| 1459 |
MEMTAG_OFF, |
| 1460 |
MEMTAG_ASYNC, |
| 1461 |
MEMTAG_SYNC, |
| 1462 |
}) |
| 1463 |
@Retention(RetentionPolicy.SOURCE) |
| 1464 |
public @interface MemtagMode {} |
| 1465 |
|
| 1466 |
|
| 1467 |
|
| 1468 |
|
| 1469 |
|
| 1470 |
private @MemtagMode int memtagMode = MEMTAG_DEFAULT; |
| 1471 |
|
| 1472 |
|
| 1473 |
|
| 1474 |
|
| 1475 |
public static final int ZEROINIT_DEFAULT = -1; |
| 1476 |
|
| 1477 |
|
| 1478 |
|
| 1479 |
|
| 1480 |
public static final int ZEROINIT_DISABLED = 0; |
| 1481 |
|
| 1482 |
|
| 1483 |
|
| 1484 |
|
| 1485 |
public static final int ZEROINIT_ENABLED = 1; |
| 1486 |
|
| 1487 |
|
| 1488 |
|
| 1489 |
|
| 1490 |
@IntDef(prefix = {"ZEROINIT_"}, value = { |
| 1491 |
ZEROINIT_DEFAULT, |
| 1492 |
ZEROINIT_DISABLED, |
| 1493 |
ZEROINIT_ENABLED, |
| 1494 |
}) |
| 1495 |
@Retention(RetentionPolicy.SOURCE) |
| 1496 |
public @interface NativeHeapZeroInitialized {} |
| 1497 |
|
| 1498 |
|
| 1499 |
|
| 1500 |
|
| 1501 |
private @NativeHeapZeroInitialized int nativeHeapZeroInitialized = ZEROINIT_DEFAULT; |
| 1502 |
|
| 1503 |
|
| 1504 |
|
| 1505 |
|
| 1506 |
|
| 1507 |
@Nullable |
| 1508 |
private Boolean requestRawExternalStorageAccess; |
| 1509 |
|
| 1510 |
|
| 1511 |
|
| 1512 |
|
| 1513 |
|
| 1514 |
|
| 1515 |
public static final int HIDDEN_API_ENFORCEMENT_DEFAULT = -1; |
| 1516 |
|
| 1517 |
|
| 1518 |
|
| 1519 |
|
| 1520 |
|
| 1521 |
public static final int HIDDEN_API_ENFORCEMENT_DISABLED = 0; |
| 1522 |
|
| 1523 |
|
| 1524 |
|
| 1525 |
|
| 1526 |
|
| 1527 |
|
| 1528 |
public static final int HIDDEN_API_ENFORCEMENT_JUST_WARN = 1; |
| 1529 |
|
| 1530 |
|
| 1531 |
|
| 1532 |
|
| 1533 |
public static final int HIDDEN_API_ENFORCEMENT_ENABLED = 2; |
| 1534 |
|
| 1535 |
private static final int HIDDEN_API_ENFORCEMENT_MIN = HIDDEN_API_ENFORCEMENT_DEFAULT; |
| 1536 |
private static final int HIDDEN_API_ENFORCEMENT_MAX = HIDDEN_API_ENFORCEMENT_ENABLED; |
| 1537 |
|
| 1538 |
|
| 1539 |
|
| 1540 |
|
| 1541 |
|
| 1542 |
|
| 1543 |
@IntDef(prefix = { "HIDDEN_API_ENFORCEMENT_" }, value = { |
| 1544 |
HIDDEN_API_ENFORCEMENT_DEFAULT, |
| 1545 |
HIDDEN_API_ENFORCEMENT_DISABLED, |
| 1546 |
HIDDEN_API_ENFORCEMENT_JUST_WARN, |
| 1547 |
HIDDEN_API_ENFORCEMENT_ENABLED, |
| 1548 |
}) |
| 1549 |
@Retention(RetentionPolicy.SOURCE) |
| 1550 |
public @interface HiddenApiEnforcementPolicy {} |
| 1551 |
|
| 1552 |
|
| 1553 |
public static boolean isValidHiddenApiEnforcementPolicy(int policy) { |
| 1554 |
return policy >= HIDDEN_API_ENFORCEMENT_MIN && policy <= HIDDEN_API_ENFORCEMENT_MAX; |
| 1555 |
} |
| 1556 |
|
| 1557 |
private int mHiddenApiPolicy = HIDDEN_API_ENFORCEMENT_DEFAULT; |
| 1558 |
|
| 1559 |
|
| 1560 |
|
| 1561 |
|
| 1562 |
|
| 1563 |
|
| 1564 |
|
| 1565 |
@Nullable |
| 1566 |
private ArrayMap<String, String> mAppClassNamesByProcess; |
| 1567 |
|
| 1568 |
|
| 1569 |
|
| 1570 |
|
| 1571 |
private int localeConfigRes; |
| 1572 |
|
| 1573 |
|
| 1574 |
|
| 1575 |
|
| 1576 |
|
| 1577 |
@Nullable |
| 1578 |
private Set<String> mKnownActivityEmbeddingCerts; |
| 1579 |
|
| 1580 |
public void dump(Printer pw, String prefix) { |
| 1581 |
dump(pw, prefix, DUMP_FLAG_ALL); |
| 1582 |
} |
| 1583 |
|
| 1584 |
|
| 1585 |
public void dump(Printer pw, String prefix, int dumpFlags) { |
| 1586 |
super.dumpFront(pw, prefix); |
| 1587 |
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { |
| 1588 |
if (className != null) { |
| 1589 |
pw.println(prefix + "className=" + className); |
| 1590 |
} |
| 1591 |
for (int i = 0; i < ArrayUtils.size(mAppClassNamesByProcess); i++) { |
| 1592 |
pw.println(prefix + " process=" + mAppClassNamesByProcess.keyAt(i) |
| 1593 |
+ " className=" + mAppClassNamesByProcess.valueAt(i)); |
| 1594 |
} |
| 1595 |
} |
| 1596 |
if (permission != null) { |
| 1597 |
pw.println(prefix + "permission=" + permission); |
| 1598 |
} |
| 1599 |
pw.println(prefix + "processName=" + processName); |
| 1600 |
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { |
| 1601 |
pw.println(prefix + "taskAffinity=" + taskAffinity); |
| 1602 |
} |
| 1603 |
pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags) |
| 1604 |
+ " privateFlags=0x" + Integer.toHexString(privateFlags) |
| 1605 |
+ " theme=0x" + Integer.toHexString(theme)); |
| 1606 |
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { |
| 1607 |
pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp |
| 1608 |
+ " compatibleWidthLimitDp=" + compatibleWidthLimitDp |
| 1609 |
+ " largestWidthLimitDp=" + largestWidthLimitDp); |
| 1610 |
} |
| 1611 |
pw.println(prefix + "sourceDir=" + sourceDir); |
| 1612 |
if (!Objects.equals(sourceDir, publicSourceDir)) { |
| 1613 |
pw.println(prefix + "publicSourceDir=" + publicSourceDir); |
| 1614 |
} |
| 1615 |
if (!ArrayUtils.isEmpty(splitSourceDirs)) { |
| 1616 |
pw.println(prefix + "splitSourceDirs=" + Arrays.toString(splitSourceDirs)); |
| 1617 |
} |
| 1618 |
if (!ArrayUtils.isEmpty(splitPublicSourceDirs) |
| 1619 |
&& !Arrays.equals(splitSourceDirs, splitPublicSourceDirs)) { |
| 1620 |
pw.println(prefix + "splitPublicSourceDirs=" + Arrays.toString(splitPublicSourceDirs)); |
| 1621 |
} |
| 1622 |
if (resourceDirs != null) { |
| 1623 |
pw.println(prefix + "resourceDirs=" + Arrays.toString(resourceDirs)); |
| 1624 |
} |
| 1625 |
if (overlayPaths != null) { |
| 1626 |
pw.println(prefix + "overlayPaths=" + Arrays.toString(overlayPaths)); |
| 1627 |
} |
| 1628 |
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0 && seInfo != null) { |
| 1629 |
pw.println(prefix + "seinfo=" + seInfo); |
| 1630 |
pw.println(prefix + "seinfoUser=" + seInfoUser); |
| 1631 |
} |
| 1632 |
pw.println(prefix + "dataDir=" + dataDir); |
| 1633 |
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { |
| 1634 |
pw.println(prefix + "deviceProtectedDataDir=" + deviceProtectedDataDir); |
| 1635 |
pw.println(prefix + "credentialProtectedDataDir=" + credentialProtectedDataDir); |
| 1636 |
if (sharedLibraryFiles != null) { |
| 1637 |
pw.println(prefix + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles)); |
| 1638 |
} |
| 1639 |
} |
| 1640 |
if (classLoaderName != null) { |
| 1641 |
pw.println(prefix + "classLoaderName=" + classLoaderName); |
| 1642 |
} |
| 1643 |
if (!ArrayUtils.isEmpty(splitClassLoaderNames)) { |
| 1644 |
pw.println(prefix + "splitClassLoaderNames=" + Arrays.toString(splitClassLoaderNames)); |
| 1645 |
} |
| 1646 |
|
| 1647 |
pw.println(prefix + "enabled=" + enabled |
| 1648 |
+ " minSdkVersion=" + minSdkVersion |
| 1649 |
+ " targetSdkVersion=" + targetSdkVersion |
| 1650 |
+ " versionCode=" + longVersionCode |
| 1651 |
+ " targetSandboxVersion=" + targetSandboxVersion); |
| 1652 |
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { |
| 1653 |
if (manageSpaceActivityName != null) { |
| 1654 |
pw.println(prefix + "manageSpaceActivityName=" + manageSpaceActivityName); |
| 1655 |
} |
| 1656 |
if (descriptionRes != 0) { |
| 1657 |
pw.println(prefix + "description=0x" + Integer.toHexString(descriptionRes)); |
| 1658 |
} |
| 1659 |
if (uiOptions != 0) { |
| 1660 |
pw.println(prefix + "uiOptions=0x" + Integer.toHexString(uiOptions)); |
| 1661 |
} |
| 1662 |
pw.println(prefix + "supportsRtl=" + (hasRtlSupport() ? "true" : "false")); |
| 1663 |
if (fullBackupContent > 0) { |
| 1664 |
pw.println(prefix + "fullBackupContent=@xml/" + fullBackupContent); |
| 1665 |
} else { |
| 1666 |
pw.println(prefix + "fullBackupContent=" |
| 1667 |
+ (fullBackupContent < 0 ? "false" : "true")); |
| 1668 |
} |
| 1669 |
if (dataExtractionRulesRes != 0) { |
| 1670 |
pw.println(prefix + "dataExtractionRules=@xml/" + dataExtractionRulesRes); |
| 1671 |
} |
| 1672 |
pw.println(prefix + "crossProfile=" + (crossProfile ? "true" : "false")); |
| 1673 |
if (networkSecurityConfigRes != 0) { |
| 1674 |
pw.println(prefix + "networkSecurityConfigRes=0x" |
| 1675 |
+ Integer.toHexString(networkSecurityConfigRes)); |
| 1676 |
} |
| 1677 |
if (category != CATEGORY_UNDEFINED) { |
| 1678 |
pw.println(prefix + "category=" + category); |
| 1679 |
} |
| 1680 |
pw.println(prefix + "HiddenApiEnforcementPolicy=" + getHiddenApiEnforcementPolicy()); |
| 1681 |
pw.println(prefix + "usesNonSdkApi=" + usesNonSdkApi()); |
| 1682 |
pw.println(prefix + "allowsPlaybackCapture=" |
| 1683 |
+ (isAudioPlaybackCaptureAllowed() ? "true" : "false")); |
| 1684 |
if (gwpAsanMode != GWP_ASAN_DEFAULT) { |
| 1685 |
pw.println(prefix + "gwpAsanMode=" + gwpAsanMode); |
| 1686 |
} |
| 1687 |
if (memtagMode != MEMTAG_DEFAULT) { |
| 1688 |
pw.println(prefix + "memtagMode=" + memtagMode); |
| 1689 |
} |
| 1690 |
if (nativeHeapZeroInitialized != ZEROINIT_DEFAULT) { |
| 1691 |
pw.println(prefix + "nativeHeapZeroInitialized=" + nativeHeapZeroInitialized); |
| 1692 |
} |
| 1693 |
if (requestRawExternalStorageAccess != null) { |
| 1694 |
pw.println(prefix + "requestRawExternalStorageAccess=" |
| 1695 |
+ requestRawExternalStorageAccess); |
| 1696 |
} |
| 1697 |
if (localeConfigRes != 0) { |
| 1698 |
pw.println(prefix + "localeConfigRes=0x" |
| 1699 |
+ Integer.toHexString(localeConfigRes)); |
| 1700 |
} |
| 1701 |
pw.println(prefix + "enableOnBackInvokedCallback=" + isOnBackInvokedCallbackEnabled()); |
| 1702 |
} |
| 1703 |
pw.println(prefix + "createTimestamp=" + createTimestamp); |
| 1704 |
if (mKnownActivityEmbeddingCerts != null) { |
| 1705 |
pw.println(prefix + "knownActivityEmbeddingCerts=" + mKnownActivityEmbeddingCerts); |
| 1706 |
} |
| 1707 |
super.dumpBack(pw, prefix); |
| 1708 |
} |
| 1709 |
|
| 1710 |
|
| 1711 |
public void dumpDebug(ProtoOutputStream proto, long fieldId, int dumpFlags) { |
| 1712 |
long token = proto.start(fieldId); |
| 1713 |
super.dumpDebug(proto, ApplicationInfoProto.PACKAGE, dumpFlags); |
| 1714 |
proto.write(ApplicationInfoProto.PERMISSION, permission); |
| 1715 |
proto.write(ApplicationInfoProto.PROCESS_NAME, processName); |
| 1716 |
proto.write(ApplicationInfoProto.UID, uid); |
| 1717 |
proto.write(ApplicationInfoProto.FLAGS, flags); |
| 1718 |
proto.write(ApplicationInfoProto.PRIVATE_FLAGS, privateFlags); |
| 1719 |
proto.write(ApplicationInfoProto.THEME, theme); |
| 1720 |
proto.write(ApplicationInfoProto.SOURCE_DIR, sourceDir); |
| 1721 |
if (!Objects.equals(sourceDir, publicSourceDir)) { |
| 1722 |
proto.write(ApplicationInfoProto.PUBLIC_SOURCE_DIR, publicSourceDir); |
| 1723 |
} |
| 1724 |
if (!ArrayUtils.isEmpty(splitSourceDirs)) { |
| 1725 |
for (String dir : splitSourceDirs) { |
| 1726 |
proto.write(ApplicationInfoProto.SPLIT_SOURCE_DIRS, dir); |
| 1727 |
} |
| 1728 |
} |
| 1729 |
if (!ArrayUtils.isEmpty(splitPublicSourceDirs) |
| 1730 |
&& !Arrays.equals(splitSourceDirs, splitPublicSourceDirs)) { |
| 1731 |
for (String dir : splitPublicSourceDirs) { |
| 1732 |
proto.write(ApplicationInfoProto.SPLIT_PUBLIC_SOURCE_DIRS, dir); |
| 1733 |
} |
| 1734 |
} |
| 1735 |
if (resourceDirs != null) { |
| 1736 |
for (String dir : resourceDirs) { |
| 1737 |
proto.write(ApplicationInfoProto.RESOURCE_DIRS, dir); |
| 1738 |
} |
| 1739 |
} |
| 1740 |
if (overlayPaths != null) { |
| 1741 |
for (String dir : overlayPaths) { |
| 1742 |
proto.write(ApplicationInfoProto.OVERLAY_PATHS, dir); |
| 1743 |
} |
| 1744 |
} |
| 1745 |
proto.write(ApplicationInfoProto.DATA_DIR, dataDir); |
| 1746 |
proto.write(ApplicationInfoProto.CLASS_LOADER_NAME, classLoaderName); |
| 1747 |
if (!ArrayUtils.isEmpty(splitClassLoaderNames)) { |
| 1748 |
for (String name : splitClassLoaderNames) { |
| 1749 |
proto.write(ApplicationInfoProto.SPLIT_CLASS_LOADER_NAMES, name); |
| 1750 |
} |
| 1751 |
} |
| 1752 |
|
| 1753 |
long versionToken = proto.start(ApplicationInfoProto.VERSION); |
| 1754 |
proto.write(ApplicationInfoProto.Version.ENABLED, enabled); |
| 1755 |
proto.write(ApplicationInfoProto.Version.MIN_SDK_VERSION, minSdkVersion); |
| 1756 |
proto.write(ApplicationInfoProto.Version.TARGET_SDK_VERSION, targetSdkVersion); |
| 1757 |
proto.write(ApplicationInfoProto.Version.VERSION_CODE, longVersionCode); |
| 1758 |
proto.write(ApplicationInfoProto.Version.TARGET_SANDBOX_VERSION, targetSandboxVersion); |
| 1759 |
proto.end(versionToken); |
| 1760 |
|
| 1761 |
if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { |
| 1762 |
long detailToken = proto.start(ApplicationInfoProto.DETAIL); |
| 1763 |
if (className != null) { |
| 1764 |
proto.write(ApplicationInfoProto.Detail.CLASS_NAME, className); |
| 1765 |
} |
| 1766 |
proto.write(ApplicationInfoProto.Detail.TASK_AFFINITY, taskAffinity); |
| 1767 |
proto.write(ApplicationInfoProto.Detail.REQUIRES_SMALLEST_WIDTH_DP, |
| 1768 |
requiresSmallestWidthDp); |
| 1769 |
proto.write(ApplicationInfoProto.Detail.COMPATIBLE_WIDTH_LIMIT_DP, |
| 1770 |
compatibleWidthLimitDp); |
| 1771 |
proto.write(ApplicationInfoProto.Detail.LARGEST_WIDTH_LIMIT_DP, |
| 1772 |
largestWidthLimitDp); |
| 1773 |
if (seInfo != null) { |
| 1774 |
proto.write(ApplicationInfoProto.Detail.SEINFO, seInfo); |
| 1775 |
proto.write(ApplicationInfoProto.Detail.SEINFO_USER, seInfoUser); |
| 1776 |
} |
| 1777 |
proto.write(ApplicationInfoProto.Detail.DEVICE_PROTECTED_DATA_DIR, |
| 1778 |
deviceProtectedDataDir); |
| 1779 |
proto.write(ApplicationInfoProto.Detail.CREDENTIAL_PROTECTED_DATA_DIR, |
| 1780 |
credentialProtectedDataDir); |
| 1781 |
if (sharedLibraryFiles != null) { |
| 1782 |
for (String f : sharedLibraryFiles) { |
| 1783 |
proto.write(ApplicationInfoProto.Detail.SHARED_LIBRARY_FILES, f); |
| 1784 |
} |
| 1785 |
} |
| 1786 |
if (manageSpaceActivityName != null) { |
| 1787 |
proto.write(ApplicationInfoProto.Detail.MANAGE_SPACE_ACTIVITY_NAME, |
| 1788 |
manageSpaceActivityName); |
| 1789 |
} |
| 1790 |
if (descriptionRes != 0) { |
| 1791 |
proto.write(ApplicationInfoProto.Detail.DESCRIPTION_RES, descriptionRes); |
| 1792 |
} |
| 1793 |
if (uiOptions != 0) { |
| 1794 |
proto.write(ApplicationInfoProto.Detail.UI_OPTIONS, uiOptions); |
| 1795 |
} |
| 1796 |
proto.write(ApplicationInfoProto.Detail.SUPPORTS_RTL, hasRtlSupport()); |
| 1797 |
if (fullBackupContent > 0) { |
| 1798 |
proto.write(ApplicationInfoProto.Detail.CONTENT, "@xml/" + fullBackupContent); |
| 1799 |
} else { |
| 1800 |
proto.write(ApplicationInfoProto.Detail.IS_FULL_BACKUP, fullBackupContent == 0); |
| 1801 |
} |
| 1802 |
if (networkSecurityConfigRes != 0) { |
| 1803 |
proto.write(ApplicationInfoProto.Detail.NETWORK_SECURITY_CONFIG_RES, |
| 1804 |
networkSecurityConfigRes); |
| 1805 |
} |
| 1806 |
if (category != CATEGORY_UNDEFINED) { |
| 1807 |
proto.write(ApplicationInfoProto.Detail.CATEGORY, category); |
| 1808 |
} |
| 1809 |
if (gwpAsanMode != GWP_ASAN_DEFAULT) { |
| 1810 |
proto.write(ApplicationInfoProto.Detail.ENABLE_GWP_ASAN, gwpAsanMode); |
| 1811 |
} |
| 1812 |
if (memtagMode != MEMTAG_DEFAULT) { |
| 1813 |
proto.write(ApplicationInfoProto.Detail.ENABLE_MEMTAG, memtagMode); |
| 1814 |
} |
| 1815 |
if (nativeHeapZeroInitialized != ZEROINIT_DEFAULT) { |
| 1816 |
proto.write(ApplicationInfoProto.Detail.NATIVE_HEAP_ZERO_INIT, |
| 1817 |
nativeHeapZeroInitialized); |
| 1818 |
} |
| 1819 |
proto.end(detailToken); |
| 1820 |
} |
| 1821 |
if (!ArrayUtils.isEmpty(mKnownActivityEmbeddingCerts)) { |
| 1822 |
for (String knownCert : mKnownActivityEmbeddingCerts) { |
| 1823 |
proto.write(ApplicationInfoProto.KNOWN_ACTIVITY_EMBEDDING_CERTS, knownCert); |
| 1824 |
} |
| 1825 |
} |
| 1826 |
proto.end(token); |
| 1827 |
} |
| 1828 |
|
| 1829 |
|
| 1830 |
|
| 1831 |
|
| 1832 |
|
| 1833 |
@UnsupportedAppUsage |
| 1834 |
public boolean hasRtlSupport() { |
| 1835 |
return (flags & FLAG_SUPPORTS_RTL) == FLAG_SUPPORTS_RTL; |
| 1836 |
} |
| 1837 |
|
| 1838 |
|
| 1839 |
public boolean hasCode() { |
| 1840 |
return (flags & FLAG_HAS_CODE) != 0; |
| 1841 |
} |
| 1842 |
|
| 1843 |
public static class DisplayNameComparator |
| 1844 |
implements Comparator<ApplicationInfo> { |
| 1845 |
public DisplayNameComparator(PackageManager pm) { |
| 1846 |
mPM = pm; |
| 1847 |
} |
| 1848 |
|
| 1849 |
public final int compare(ApplicationInfo aa, ApplicationInfo ab) { |
| 1850 |
CharSequence sa = mPM.getApplicationLabel(aa); |
| 1851 |
if (sa == null) { |
| 1852 |
sa = aa.packageName; |
| 1853 |
} |
| 1854 |
CharSequence sb = mPM.getApplicationLabel(ab); |
| 1855 |
if (sb == null) { |
| 1856 |
sb = ab.packageName; |
| 1857 |
} |
| 1858 |
|
| 1859 |
return sCollator.compare(sa.toString(), sb.toString()); |
| 1860 |
} |
| 1861 |
|
| 1862 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 1863 |
private final Collator sCollator = Collator.getInstance(); |
| 1864 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 1865 |
private PackageManager mPM; |
| 1866 |
} |
| 1867 |
|
| 1868 |
public ApplicationInfo() { |
| 1869 |
createTimestamp = SystemClock.uptimeMillis(); |
| 1870 |
} |
| 1871 |
|
| 1872 |
public ApplicationInfo(ApplicationInfo orig) { |
| 1873 |
super(orig); |
| 1874 |
taskAffinity = orig.taskAffinity; |
| 1875 |
permission = orig.permission; |
| 1876 |
mKnownActivityEmbeddingCerts = orig.mKnownActivityEmbeddingCerts; |
| 1877 |
processName = orig.processName; |
| 1878 |
className = orig.className; |
| 1879 |
theme = orig.theme; |
| 1880 |
flags = orig.flags; |
| 1881 |
privateFlags = orig.privateFlags; |
| 1882 |
privateFlagsExt = orig.privateFlagsExt; |
| 1883 |
requiresSmallestWidthDp = orig.requiresSmallestWidthDp; |
| 1884 |
compatibleWidthLimitDp = orig.compatibleWidthLimitDp; |
| 1885 |
largestWidthLimitDp = orig.largestWidthLimitDp; |
| 1886 |
volumeUuid = orig.volumeUuid; |
| 1887 |
storageUuid = orig.storageUuid; |
| 1888 |
scanSourceDir = orig.scanSourceDir; |
| 1889 |
scanPublicSourceDir = orig.scanPublicSourceDir; |
| 1890 |
sourceDir = orig.sourceDir; |
| 1891 |
publicSourceDir = orig.publicSourceDir; |
| 1892 |
splitNames = orig.splitNames; |
| 1893 |
splitSourceDirs = orig.splitSourceDirs; |
| 1894 |
splitPublicSourceDirs = orig.splitPublicSourceDirs; |
| 1895 |
splitDependencies = orig.splitDependencies; |
| 1896 |
nativeLibraryDir = orig.nativeLibraryDir; |
| 1897 |
secondaryNativeLibraryDir = orig.secondaryNativeLibraryDir; |
| 1898 |
nativeLibraryRootDir = orig.nativeLibraryRootDir; |
| 1899 |
nativeLibraryRootRequiresIsa = orig.nativeLibraryRootRequiresIsa; |
| 1900 |
primaryCpuAbi = orig.primaryCpuAbi; |
| 1901 |
secondaryCpuAbi = orig.secondaryCpuAbi; |
| 1902 |
resourceDirs = orig.resourceDirs; |
| 1903 |
overlayPaths = orig.overlayPaths; |
| 1904 |
seInfo = orig.seInfo; |
| 1905 |
seInfoUser = orig.seInfoUser; |
| 1906 |
sharedLibraryFiles = orig.sharedLibraryFiles; |
| 1907 |
sharedLibraryInfos = orig.sharedLibraryInfos; |
| 1908 |
dataDir = orig.dataDir; |
| 1909 |
deviceProtectedDataDir = orig.deviceProtectedDataDir; |
| 1910 |
credentialProtectedDataDir = orig.credentialProtectedDataDir; |
| 1911 |
uid = orig.uid; |
| 1912 |
minSdkVersion = orig.minSdkVersion; |
| 1913 |
targetSdkVersion = orig.targetSdkVersion; |
| 1914 |
setVersionCode(orig.longVersionCode); |
| 1915 |
enabled = orig.enabled; |
| 1916 |
enabledSetting = orig.enabledSetting; |
| 1917 |
installLocation = orig.installLocation; |
| 1918 |
manageSpaceActivityName = orig.manageSpaceActivityName; |
| 1919 |
descriptionRes = orig.descriptionRes; |
| 1920 |
uiOptions = orig.uiOptions; |
| 1921 |
backupAgentName = orig.backupAgentName; |
| 1922 |
fullBackupContent = orig.fullBackupContent; |
| 1923 |
dataExtractionRulesRes = orig.dataExtractionRulesRes; |
| 1924 |
crossProfile = orig.crossProfile; |
| 1925 |
networkSecurityConfigRes = orig.networkSecurityConfigRes; |
| 1926 |
category = orig.category; |
| 1927 |
targetSandboxVersion = orig.targetSandboxVersion; |
| 1928 |
classLoaderName = orig.classLoaderName; |
| 1929 |
splitClassLoaderNames = orig.splitClassLoaderNames; |
| 1930 |
appComponentFactory = orig.appComponentFactory; |
| 1931 |
iconRes = orig.iconRes; |
| 1932 |
roundIconRes = orig.roundIconRes; |
| 1933 |
compileSdkVersion = orig.compileSdkVersion; |
| 1934 |
compileSdkVersionCodename = orig.compileSdkVersionCodename; |
| 1935 |
mHiddenApiPolicy = orig.mHiddenApiPolicy; |
| 1936 |
hiddenUntilInstalled = orig.hiddenUntilInstalled; |
| 1937 |
zygotePreloadName = orig.zygotePreloadName; |
| 1938 |
gwpAsanMode = orig.gwpAsanMode; |
| 1939 |
memtagMode = orig.memtagMode; |
| 1940 |
nativeHeapZeroInitialized = orig.nativeHeapZeroInitialized; |
| 1941 |
requestRawExternalStorageAccess = orig.requestRawExternalStorageAccess; |
| 1942 |
localeConfigRes = orig.localeConfigRes; |
| 1943 |
createTimestamp = SystemClock.uptimeMillis(); |
| 1944 |
} |
| 1945 |
|
| 1946 |
public String toString() { |
| 1947 |
return "ApplicationInfo{" |
| 1948 |
+ Integer.toHexString(System.identityHashCode(this)) |
| 1949 |
+ " " + packageName + "}"; |
| 1950 |
} |
| 1951 |
|
| 1952 |
public int describeContents() { |
| 1953 |
return 0; |
| 1954 |
} |
| 1955 |
|
| 1956 |
@SuppressWarnings("unchecked") |
| 1957 |
public void writeToParcel(Parcel dest, int parcelableFlags) { |
| 1958 |
if (dest.maybeWriteSquashed(this)) { |
| 1959 |
return; |
| 1960 |
} |
| 1961 |
super.writeToParcel(dest, parcelableFlags); |
| 1962 |
dest.writeString8(taskAffinity); |
| 1963 |
dest.writeString8(permission); |
| 1964 |
dest.writeString8(processName); |
| 1965 |
dest.writeString8(className); |
| 1966 |
dest.writeInt(theme); |
| 1967 |
dest.writeInt(flags); |
| 1968 |
dest.writeInt(privateFlags); |
| 1969 |
dest.writeInt(privateFlagsExt); |
| 1970 |
dest.writeInt(requiresSmallestWidthDp); |
| 1971 |
dest.writeInt(compatibleWidthLimitDp); |
| 1972 |
dest.writeInt(largestWidthLimitDp); |
| 1973 |
if (storageUuid != null) { |
| 1974 |
dest.writeInt(1); |
| 1975 |
dest.writeLong(storageUuid.getMostSignificantBits()); |
| 1976 |
dest.writeLong(storageUuid.getLeastSignificantBits()); |
| 1977 |
} else { |
| 1978 |
dest.writeInt(0); |
| 1979 |
} |
| 1980 |
dest.writeString8(scanSourceDir); |
| 1981 |
dest.writeString8(scanPublicSourceDir); |
| 1982 |
dest.writeString8(sourceDir); |
| 1983 |
dest.writeString8(publicSourceDir); |
| 1984 |
dest.writeString8Array(splitNames); |
| 1985 |
dest.writeString8Array(splitSourceDirs); |
| 1986 |
dest.writeString8Array(splitPublicSourceDirs); |
| 1987 |
dest.writeSparseArray((SparseArray) splitDependencies); |
| 1988 |
dest.writeString8(nativeLibraryDir); |
| 1989 |
dest.writeString8(secondaryNativeLibraryDir); |
| 1990 |
dest.writeString8(nativeLibraryRootDir); |
| 1991 |
dest.writeInt(nativeLibraryRootRequiresIsa ? 1 : 0); |
| 1992 |
dest.writeString8(primaryCpuAbi); |
| 1993 |
dest.writeString8(secondaryCpuAbi); |
| 1994 |
dest.writeString8Array(resourceDirs); |
| 1995 |
dest.writeString8Array(overlayPaths); |
| 1996 |
dest.writeString8(seInfo); |
| 1997 |
dest.writeString8(seInfoUser); |
| 1998 |
dest.writeString8Array(sharedLibraryFiles); |
| 1999 |
dest.writeTypedList(sharedLibraryInfos); |
| 2000 |
dest.writeString8(dataDir); |
| 2001 |
dest.writeString8(deviceProtectedDataDir); |
| 2002 |
dest.writeString8(credentialProtectedDataDir); |
| 2003 |
dest.writeInt(uid); |
| 2004 |
dest.writeInt(minSdkVersion); |
| 2005 |
dest.writeInt(targetSdkVersion); |
| 2006 |
dest.writeLong(longVersionCode); |
| 2007 |
dest.writeInt(enabled ? 1 : 0); |
| 2008 |
dest.writeInt(enabledSetting); |
| 2009 |
dest.writeInt(installLocation); |
| 2010 |
dest.writeString8(manageSpaceActivityName); |
| 2011 |
dest.writeString8(backupAgentName); |
| 2012 |
dest.writeInt(descriptionRes); |
| 2013 |
dest.writeInt(uiOptions); |
| 2014 |
dest.writeInt(fullBackupContent); |
| 2015 |
dest.writeInt(dataExtractionRulesRes); |
| 2016 |
dest.writeBoolean(crossProfile); |
| 2017 |
dest.writeInt(networkSecurityConfigRes); |
| 2018 |
dest.writeInt(category); |
| 2019 |
dest.writeInt(targetSandboxVersion); |
| 2020 |
dest.writeString8(classLoaderName); |
| 2021 |
dest.writeString8Array(splitClassLoaderNames); |
| 2022 |
dest.writeInt(compileSdkVersion); |
| 2023 |
dest.writeString8(compileSdkVersionCodename); |
| 2024 |
dest.writeString8(appComponentFactory); |
| 2025 |
dest.writeInt(iconRes); |
| 2026 |
dest.writeInt(roundIconRes); |
| 2027 |
dest.writeInt(mHiddenApiPolicy); |
| 2028 |
dest.writeInt(hiddenUntilInstalled ? 1 : 0); |
| 2029 |
dest.writeString8(zygotePreloadName); |
| 2030 |
dest.writeInt(gwpAsanMode); |
| 2031 |
dest.writeInt(memtagMode); |
| 2032 |
dest.writeInt(nativeHeapZeroInitialized); |
| 2033 |
sForBoolean.parcel(requestRawExternalStorageAccess, dest, parcelableFlags); |
| 2034 |
dest.writeLong(createTimestamp); |
| 2035 |
if (mAppClassNamesByProcess == null) { |
| 2036 |
dest.writeInt(0); |
| 2037 |
} else { |
| 2038 |
final int size = mAppClassNamesByProcess.size(); |
| 2039 |
dest.writeInt(size); |
| 2040 |
for (int i = 0; i < size; i++) { |
| 2041 |
dest.writeString(mAppClassNamesByProcess.keyAt(i)); |
| 2042 |
dest.writeString(mAppClassNamesByProcess.valueAt(i)); |
| 2043 |
} |
| 2044 |
} |
| 2045 |
dest.writeInt(localeConfigRes); |
| 2046 |
sForStringSet.parcel(mKnownActivityEmbeddingCerts, dest, flags); |
| 2047 |
} |
| 2048 |
|
| 2049 |
public static final @android.annotation.NonNull Parcelable.Creator<ApplicationInfo> CREATOR |
| 2050 |
= new Parcelable.Creator<ApplicationInfo>() { |
| 2051 |
@Override |
| 2052 |
public ApplicationInfo createFromParcel(Parcel source) { |
| 2053 |
return source.readSquashed(ApplicationInfo::new); |
| 2054 |
} |
| 2055 |
|
| 2056 |
@Override |
| 2057 |
public ApplicationInfo[] newArray(int size) { |
| 2058 |
return new ApplicationInfo[size]; |
| 2059 |
} |
| 2060 |
}; |
| 2061 |
|
| 2062 |
@SuppressWarnings("unchecked") |
| 2063 |
private ApplicationInfo(Parcel source) { |
| 2064 |
super(source); |
| 2065 |
taskAffinity = source.readString8(); |
| 2066 |
permission = source.readString8(); |
| 2067 |
processName = source.readString8(); |
| 2068 |
className = source.readString8(); |
| 2069 |
theme = source.readInt(); |
| 2070 |
flags = source.readInt(); |
| 2071 |
privateFlags = source.readInt(); |
| 2072 |
privateFlagsExt = source.readInt(); |
| 2073 |
requiresSmallestWidthDp = source.readInt(); |
| 2074 |
compatibleWidthLimitDp = source.readInt(); |
| 2075 |
largestWidthLimitDp = source.readInt(); |
| 2076 |
if (source.readInt() != 0) { |
| 2077 |
storageUuid = new UUID(source.readLong(), source.readLong()); |
| 2078 |
volumeUuid = StorageManager.convert(storageUuid); |
| 2079 |
} |
| 2080 |
scanSourceDir = source.readString8(); |
| 2081 |
scanPublicSourceDir = source.readString8(); |
| 2082 |
sourceDir = source.readString8(); |
| 2083 |
publicSourceDir = source.readString8(); |
| 2084 |
splitNames = source.createString8Array(); |
| 2085 |
splitSourceDirs = source.createString8Array(); |
| 2086 |
splitPublicSourceDirs = source.createString8Array(); |
| 2087 |
splitDependencies = source.readSparseArray(null, int[].class); |
| 2088 |
nativeLibraryDir = source.readString8(); |
| 2089 |
secondaryNativeLibraryDir = source.readString8(); |
| 2090 |
nativeLibraryRootDir = source.readString8(); |
| 2091 |
nativeLibraryRootRequiresIsa = source.readInt() != 0; |
| 2092 |
primaryCpuAbi = source.readString8(); |
| 2093 |
secondaryCpuAbi = source.readString8(); |
| 2094 |
resourceDirs = source.createString8Array(); |
| 2095 |
overlayPaths = source.createString8Array(); |
| 2096 |
seInfo = source.readString8(); |
| 2097 |
seInfoUser = source.readString8(); |
| 2098 |
sharedLibraryFiles = source.createString8Array(); |
| 2099 |
sharedLibraryInfos = source.createTypedArrayList(SharedLibraryInfo.CREATOR); |
| 2100 |
dataDir = source.readString8(); |
| 2101 |
deviceProtectedDataDir = source.readString8(); |
| 2102 |
credentialProtectedDataDir = source.readString8(); |
| 2103 |
uid = source.readInt(); |
| 2104 |
minSdkVersion = source.readInt(); |
| 2105 |
targetSdkVersion = source.readInt(); |
| 2106 |
setVersionCode(source.readLong()); |
| 2107 |
enabled = source.readInt() != 0; |
| 2108 |
enabledSetting = source.readInt(); |
| 2109 |
installLocation = source.readInt(); |
| 2110 |
manageSpaceActivityName = source.readString8(); |
| 2111 |
backupAgentName = source.readString8(); |
| 2112 |
descriptionRes = source.readInt(); |
| 2113 |
uiOptions = source.readInt(); |
| 2114 |
fullBackupContent = source.readInt(); |
| 2115 |
dataExtractionRulesRes = source.readInt(); |
| 2116 |
crossProfile = source.readBoolean(); |
| 2117 |
networkSecurityConfigRes = source.readInt(); |
| 2118 |
category = source.readInt(); |
| 2119 |
targetSandboxVersion = source.readInt(); |
| 2120 |
classLoaderName = source.readString8(); |
| 2121 |
splitClassLoaderNames = source.createString8Array(); |
| 2122 |
compileSdkVersion = source.readInt(); |
| 2123 |
compileSdkVersionCodename = source.readString8(); |
| 2124 |
appComponentFactory = source.readString8(); |
| 2125 |
iconRes = source.readInt(); |
| 2126 |
roundIconRes = source.readInt(); |
| 2127 |
mHiddenApiPolicy = source.readInt(); |
| 2128 |
hiddenUntilInstalled = source.readInt() != 0; |
| 2129 |
zygotePreloadName = source.readString8(); |
| 2130 |
gwpAsanMode = source.readInt(); |
| 2131 |
memtagMode = source.readInt(); |
| 2132 |
nativeHeapZeroInitialized = source.readInt(); |
| 2133 |
requestRawExternalStorageAccess = sForBoolean.unparcel(source); |
| 2134 |
createTimestamp = source.readLong(); |
| 2135 |
final int allClassesSize = source.readInt(); |
| 2136 |
if (allClassesSize > 0) { |
| 2137 |
mAppClassNamesByProcess = new ArrayMap<>(allClassesSize); |
| 2138 |
for (int i = 0; i < allClassesSize; i++) { |
| 2139 |
mAppClassNamesByProcess.put(source.readString(), source.readString()); |
| 2140 |
} |
| 2141 |
} |
| 2142 |
localeConfigRes = source.readInt(); |
| 2143 |
mKnownActivityEmbeddingCerts = sForStringSet.unparcel(source); |
| 2144 |
if (mKnownActivityEmbeddingCerts.isEmpty()) { |
| 2145 |
mKnownActivityEmbeddingCerts = null; |
| 2146 |
} |
| 2147 |
} |
| 2148 |
|
| 2149 |
|
| 2150 |
|
| 2151 |
|
| 2152 |
|
| 2153 |
|
| 2154 |
|
| 2155 |
|
| 2156 |
|
| 2157 |
|
| 2158 |
|
| 2159 |
|
| 2160 |
public CharSequence loadDescription(PackageManager pm) { |
| 2161 |
if (descriptionRes != 0) { |
| 2162 |
CharSequence label = pm.getText(packageName, descriptionRes, this); |
| 2163 |
if (label != null) { |
| 2164 |
return label; |
| 2165 |
} |
| 2166 |
} |
| 2167 |
return null; |
| 2168 |
} |
| 2169 |
|
| 2170 |
|
| 2171 |
|
| 2172 |
|
| 2173 |
|
| 2174 |
|
| 2175 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 2176 |
public void disableCompatibilityMode() { |
| 2177 |
flags |= (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS | |
| 2178 |
FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS | |
| 2179 |
FLAG_SUPPORTS_SCREEN_DENSITIES | FLAG_SUPPORTS_XLARGE_SCREENS); |
| 2180 |
} |
| 2181 |
|
| 2182 |
|
| 2183 |
|
| 2184 |
|
| 2185 |
|
| 2186 |
|
| 2187 |
public boolean usesCompatibilityMode() { |
| 2188 |
return targetSdkVersion < DONUT || |
| 2189 |
(flags & (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS | |
| 2190 |
FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS | |
| 2191 |
FLAG_SUPPORTS_SCREEN_DENSITIES | FLAG_SUPPORTS_XLARGE_SCREENS)) == 0; |
| 2192 |
} |
| 2193 |
|
| 2194 |
|
| 2195 |
public void initForUser(int userId) { |
| 2196 |
uid = UserHandle.getUid(userId, UserHandle.getAppId(uid)); |
| 2197 |
|
| 2198 |
if ("android".equals(packageName)) { |
| 2199 |
dataDir = Environment.getDataSystemDirectory().getAbsolutePath(); |
| 2200 |
return; |
| 2201 |
} |
| 2202 |
|
| 2203 |
deviceProtectedDataDir = Environment |
| 2204 |
.getDataUserDePackageDirectory(volumeUuid, userId, packageName) |
| 2205 |
.getAbsolutePath(); |
| 2206 |
credentialProtectedDataDir = Environment |
| 2207 |
.getDataUserCePackageDirectory(volumeUuid, userId, packageName) |
| 2208 |
.getAbsolutePath(); |
| 2209 |
|
| 2210 |
if ((privateFlags & PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE) != 0 |
| 2211 |
&& PackageManager.APPLY_DEFAULT_TO_DEVICE_PROTECTED_STORAGE) { |
| 2212 |
dataDir = deviceProtectedDataDir; |
| 2213 |
} else { |
| 2214 |
dataDir = credentialProtectedDataDir; |
| 2215 |
} |
| 2216 |
} |
| 2217 |
|
| 2218 |
private boolean isPackageWhitelistedForHiddenApis() { |
| 2219 |
return SystemConfig.getInstance().getHiddenApiWhitelistedApps().contains(packageName); |
| 2220 |
} |
| 2221 |
|
| 2222 |
|
| 2223 |
|
| 2224 |
|
| 2225 |
public boolean usesNonSdkApi() { |
| 2226 |
return (privateFlags & PRIVATE_FLAG_USES_NON_SDK_API) != 0; |
| 2227 |
} |
| 2228 |
|
| 2229 |
|
| 2230 |
|
| 2231 |
|
| 2232 |
|
| 2233 |
|
| 2234 |
|
| 2235 |
|
| 2236 |
public boolean hasFragileUserData() { |
| 2237 |
return (privateFlags & PRIVATE_FLAG_HAS_FRAGILE_USER_DATA) != 0; |
| 2238 |
} |
| 2239 |
|
| 2240 |
|
| 2241 |
|
| 2242 |
|
| 2243 |
|
| 2244 |
|
| 2245 |
|
| 2246 |
|
| 2247 |
public boolean isAudioPlaybackCaptureAllowed() { |
| 2248 |
return (privateFlags & PRIVATE_FLAG_ALLOW_AUDIO_PLAYBACK_CAPTURE) != 0; |
| 2249 |
} |
| 2250 |
|
| 2251 |
|
| 2252 |
|
| 2253 |
|
| 2254 |
|
| 2255 |
|
| 2256 |
public boolean hasRequestedLegacyExternalStorage() { |
| 2257 |
return (privateFlags & PRIVATE_FLAG_REQUEST_LEGACY_EXTERNAL_STORAGE) != 0; |
| 2258 |
} |
| 2259 |
|
| 2260 |
|
| 2261 |
|
| 2262 |
|
| 2263 |
|
| 2264 |
public static final int RAW_EXTERNAL_STORAGE_ACCESS_DEFAULT = 0; |
| 2265 |
|
| 2266 |
|
| 2267 |
|
| 2268 |
|
| 2269 |
public static final int RAW_EXTERNAL_STORAGE_ACCESS_REQUESTED = 1; |
| 2270 |
|
| 2271 |
|
| 2272 |
|
| 2273 |
|
| 2274 |
public static final int RAW_EXTERNAL_STORAGE_ACCESS_NOT_REQUESTED = 2; |
| 2275 |
|
| 2276 |
|
| 2277 |
|
| 2278 |
|
| 2279 |
|
| 2280 |
|
| 2281 |
|
| 2282 |
@IntDef(prefix = {"RAW_EXTERNAL_STORAGE_"}, value = { |
| 2283 |
RAW_EXTERNAL_STORAGE_ACCESS_DEFAULT, |
| 2284 |
RAW_EXTERNAL_STORAGE_ACCESS_REQUESTED, |
| 2285 |
RAW_EXTERNAL_STORAGE_ACCESS_NOT_REQUESTED, |
| 2286 |
}) |
| 2287 |
@Retention(RetentionPolicy.SOURCE) |
| 2288 |
public @interface RawExternalStorage {} |
| 2289 |
|
| 2290 |
|
| 2291 |
|
| 2292 |
|
| 2293 |
|
| 2294 |
|
| 2295 |
|
| 2296 |
|
| 2297 |
|
| 2298 |
|
| 2299 |
|
| 2300 |
|
| 2301 |
|
| 2302 |
|
| 2303 |
|
| 2304 |
|
| 2305 |
|
| 2306 |
public @RawExternalStorage int getRequestRawExternalStorageAccess() { |
| 2307 |
if (requestRawExternalStorageAccess == null) { |
| 2308 |
return RAW_EXTERNAL_STORAGE_ACCESS_DEFAULT; |
| 2309 |
} |
| 2310 |
return requestRawExternalStorageAccess ? RAW_EXTERNAL_STORAGE_ACCESS_REQUESTED |
| 2311 |
: RAW_EXTERNAL_STORAGE_ACCESS_NOT_REQUESTED; |
| 2312 |
} |
| 2313 |
|
| 2314 |
|
| 2315 |
|
| 2316 |
|
| 2317 |
|
| 2318 |
|
| 2319 |
public boolean allowsNativeHeapPointerTagging() { |
| 2320 |
return (privateFlags & PRIVATE_FLAG_ALLOW_NATIVE_HEAP_POINTER_TAGGING) != 0; |
| 2321 |
} |
| 2322 |
|
| 2323 |
private boolean isAllowedToUseHiddenApis() { |
| 2324 |
if (isSignedWithPlatformKey()) { |
| 2325 |
return true; |
| 2326 |
} else if (isSystemApp() || isUpdatedSystemApp()) { |
| 2327 |
return usesNonSdkApi() || isPackageWhitelistedForHiddenApis(); |
| 2328 |
} else { |
| 2329 |
return false; |
| 2330 |
} |
| 2331 |
} |
| 2332 |
|
| 2333 |
|
| 2334 |
|
| 2335 |
|
| 2336 |
public @HiddenApiEnforcementPolicy int getHiddenApiEnforcementPolicy() { |
| 2337 |
if (isAllowedToUseHiddenApis()) { |
| 2338 |
return HIDDEN_API_ENFORCEMENT_DISABLED; |
| 2339 |
} |
| 2340 |
if (mHiddenApiPolicy != HIDDEN_API_ENFORCEMENT_DEFAULT) { |
| 2341 |
return mHiddenApiPolicy; |
| 2342 |
} |
| 2343 |
return HIDDEN_API_ENFORCEMENT_ENABLED; |
| 2344 |
} |
| 2345 |
|
| 2346 |
|
| 2347 |
|
| 2348 |
|
| 2349 |
public void setHiddenApiEnforcementPolicy(@HiddenApiEnforcementPolicy int policy) { |
| 2350 |
if (!isValidHiddenApiEnforcementPolicy(policy)) { |
| 2351 |
throw new IllegalArgumentException("Invalid API enforcement policy: " + policy); |
| 2352 |
} |
| 2353 |
mHiddenApiPolicy = policy; |
| 2354 |
} |
| 2355 |
|
| 2356 |
|
| 2357 |
|
| 2358 |
|
| 2359 |
|
| 2360 |
|
| 2361 |
|
| 2362 |
|
| 2363 |
|
| 2364 |
|
| 2365 |
|
| 2366 |
public void maybeUpdateHiddenApiEnforcementPolicy(@HiddenApiEnforcementPolicy int policy) { |
| 2367 |
if (isPackageWhitelistedForHiddenApis()) { |
| 2368 |
return; |
| 2369 |
} |
| 2370 |
setHiddenApiEnforcementPolicy(policy); |
| 2371 |
} |
| 2372 |
|
| 2373 |
|
| 2374 |
|
| 2375 |
|
| 2376 |
public void setVersionCode(long newVersionCode) { |
| 2377 |
longVersionCode = newVersionCode; |
| 2378 |
versionCode = (int) newVersionCode; |
| 2379 |
} |
| 2380 |
|
| 2381 |
|
| 2382 |
|
| 2383 |
|
| 2384 |
@Override |
| 2385 |
public Drawable loadDefaultIcon(PackageManager pm) { |
| 2386 |
if ((flags & FLAG_EXTERNAL_STORAGE) != 0 |
| 2387 |
&& isPackageUnavailable(pm)) { |
| 2388 |
return Resources.getSystem().getDrawable( |
| 2389 |
com.android.internal.R.drawable.sym_app_on_sd_unavailable_icon); |
| 2390 |
} |
| 2391 |
return pm.getDefaultActivityIcon(); |
| 2392 |
} |
| 2393 |
|
| 2394 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 2395 |
private boolean isPackageUnavailable(PackageManager pm) { |
| 2396 |
try { |
| 2397 |
return pm.getPackageInfo(packageName, 0) == null; |
| 2398 |
} catch (NameNotFoundException ex) { |
| 2399 |
return true; |
| 2400 |
} |
| 2401 |
} |
| 2402 |
|
| 2403 |
|
| 2404 |
public boolean isDefaultToDeviceProtectedStorage() { |
| 2405 |
return (privateFlags |
| 2406 |
& ApplicationInfo.PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE) != 0; |
| 2407 |
} |
| 2408 |
|
| 2409 |
|
| 2410 |
public boolean isDirectBootAware() { |
| 2411 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_DIRECT_BOOT_AWARE) != 0; |
| 2412 |
} |
| 2413 |
|
| 2414 |
|
| 2415 |
|
| 2416 |
|
| 2417 |
|
| 2418 |
|
| 2419 |
|
| 2420 |
|
| 2421 |
|
| 2422 |
@SystemApi |
| 2423 |
public boolean isEncryptionAware() { |
| 2424 |
return isDirectBootAware() || isPartiallyDirectBootAware(); |
| 2425 |
} |
| 2426 |
|
| 2427 |
|
| 2428 |
public boolean isExternal() { |
| 2429 |
return (flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0; |
| 2430 |
} |
| 2431 |
|
| 2432 |
|
| 2433 |
|
| 2434 |
|
| 2435 |
|
| 2436 |
@SystemApi |
| 2437 |
public boolean isInstantApp() { |
| 2438 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_INSTANT) != 0; |
| 2439 |
} |
| 2440 |
|
| 2441 |
|
| 2442 |
public boolean isInternal() { |
| 2443 |
return (flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == 0; |
| 2444 |
} |
| 2445 |
|
| 2446 |
|
| 2447 |
|
| 2448 |
|
| 2449 |
|
| 2450 |
@SystemApi |
| 2451 |
public boolean isOem() { |
| 2452 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_OEM) != 0; |
| 2453 |
} |
| 2454 |
|
| 2455 |
|
| 2456 |
public boolean isOdm() { |
| 2457 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_ODM) != 0; |
| 2458 |
} |
| 2459 |
|
| 2460 |
|
| 2461 |
public boolean isPartiallyDirectBootAware() { |
| 2462 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE) != 0; |
| 2463 |
} |
| 2464 |
|
| 2465 |
|
| 2466 |
public boolean isSignedWithPlatformKey() { |
| 2467 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_SIGNED_WITH_PLATFORM_KEY) != 0; |
| 2468 |
} |
| 2469 |
|
| 2470 |
|
| 2471 |
@TestApi |
| 2472 |
public boolean isPrivilegedApp() { |
| 2473 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) != 0; |
| 2474 |
} |
| 2475 |
|
| 2476 |
|
| 2477 |
public boolean isRequiredForSystemUser() { |
| 2478 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER) != 0; |
| 2479 |
} |
| 2480 |
|
| 2481 |
|
| 2482 |
public boolean isStaticSharedLibrary() { |
| 2483 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_STATIC_SHARED_LIBRARY) != 0; |
| 2484 |
} |
| 2485 |
|
| 2486 |
|
| 2487 |
@TestApi |
| 2488 |
public boolean isSystemApp() { |
| 2489 |
return (flags & ApplicationInfo.FLAG_SYSTEM) != 0; |
| 2490 |
} |
| 2491 |
|
| 2492 |
|
| 2493 |
public boolean isUpdatedSystemApp() { |
| 2494 |
return (flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0; |
| 2495 |
} |
| 2496 |
|
| 2497 |
|
| 2498 |
|
| 2499 |
|
| 2500 |
|
| 2501 |
@SystemApi |
| 2502 |
public boolean isVendor() { |
| 2503 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_VENDOR) != 0; |
| 2504 |
} |
| 2505 |
|
| 2506 |
|
| 2507 |
|
| 2508 |
|
| 2509 |
|
| 2510 |
@SystemApi |
| 2511 |
public boolean isProduct() { |
| 2512 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PRODUCT) != 0; |
| 2513 |
} |
| 2514 |
|
| 2515 |
|
| 2516 |
public boolean isSystemExt() { |
| 2517 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_SYSTEM_EXT) != 0; |
| 2518 |
} |
| 2519 |
|
| 2520 |
|
| 2521 |
public boolean isEmbeddedDexUsed() { |
| 2522 |
return (privateFlags & PRIVATE_FLAG_USE_EMBEDDED_DEX) != 0; |
| 2523 |
} |
| 2524 |
|
| 2525 |
|
| 2526 |
|
| 2527 |
|
| 2528 |
public boolean isVirtualPreload() { |
| 2529 |
return (privateFlags & PRIVATE_FLAG_VIRTUAL_PRELOAD) != 0; |
| 2530 |
} |
| 2531 |
|
| 2532 |
|
| 2533 |
|
| 2534 |
|
| 2535 |
|
| 2536 |
public boolean isProfileableByShell() { |
| 2537 |
return (privateFlags & PRIVATE_FLAG_PROFILEABLE_BY_SHELL) != 0; |
| 2538 |
} |
| 2539 |
|
| 2540 |
|
| 2541 |
|
| 2542 |
|
| 2543 |
public boolean isProfileable() { |
| 2544 |
return (privateFlagsExt & PRIVATE_FLAG_EXT_PROFILEABLE) != 0; |
| 2545 |
} |
| 2546 |
|
| 2547 |
|
| 2548 |
|
| 2549 |
|
| 2550 |
|
| 2551 |
|
| 2552 |
public boolean areAttributionsUserVisible() { |
| 2553 |
return (privateFlagsExt & PRIVATE_FLAG_EXT_ATTRIBUTIONS_ARE_USER_VISIBLE) != 0; |
| 2554 |
} |
| 2555 |
|
| 2556 |
|
| 2557 |
|
| 2558 |
|
| 2559 |
|
| 2560 |
|
| 2561 |
public boolean requestsIsolatedSplitLoading() { |
| 2562 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_ISOLATED_SPLIT_LOADING) != 0; |
| 2563 |
} |
| 2564 |
|
| 2565 |
|
| 2566 |
|
| 2567 |
|
| 2568 |
|
| 2569 |
public boolean isResourceOverlay() { |
| 2570 |
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_IS_RESOURCE_OVERLAY) != 0; |
| 2571 |
} |
| 2572 |
|
| 2573 |
|
| 2574 |
|
| 2575 |
|
| 2576 |
|
| 2577 |
|
| 2578 |
@TestApi |
| 2579 |
public boolean hasRequestForegroundServiceExemption() { |
| 2580 |
return (privateFlagsExt |
| 2581 |
& ApplicationInfo.PRIVATE_FLAG_EXT_REQUEST_FOREGROUND_SERVICE_EXEMPTION) != 0; |
| 2582 |
} |
| 2583 |
|
| 2584 |
|
| 2585 |
|
| 2586 |
|
| 2587 |
|
| 2588 |
|
| 2589 |
|
| 2590 |
|
| 2591 |
public boolean isOnBackInvokedCallbackEnabled() { |
| 2592 |
return ((privateFlagsExt & PRIVATE_FLAG_EXT_ENABLE_ON_BACK_INVOKED_CALLBACK)) != 0; |
| 2593 |
} |
| 2594 |
|
| 2595 |
|
| 2596 |
|
| 2597 |
|
| 2598 |
@Override protected ApplicationInfo getApplicationInfo() { |
| 2599 |
return this; |
| 2600 |
} |
| 2601 |
|
| 2602 |
|
| 2603 |
|
| 2604 |
|
| 2605 |
|
| 2606 |
|
| 2607 |
public String[] getAllApkPaths() { |
| 2608 |
final String[][] inputLists = { |
| 2609 |
splitSourceDirs, sharedLibraryFiles, resourceDirs, overlayPaths |
| 2610 |
}; |
| 2611 |
final List<String> output = new ArrayList<>(10); |
| 2612 |
if (sourceDir != null) { |
| 2613 |
output.add(sourceDir); |
| 2614 |
} |
| 2615 |
for (String[] inputList : inputLists) { |
| 2616 |
if (inputList != null) { |
| 2617 |
for (String input : inputList) { |
| 2618 |
output.add(input); |
| 2619 |
} |
| 2620 |
} |
| 2621 |
} |
| 2622 |
return output.toArray(new String[output.size()]); |
| 2623 |
} |
| 2624 |
|
| 2625 |
public void setCodePath(String codePath) { scanSourceDir = codePath; } |
| 2626 |
public void setBaseCodePath(String baseCodePath) { sourceDir = baseCodePath; } |
| 2627 |
public void setSplitCodePaths(String[] splitCodePaths) { splitSourceDirs = splitCodePaths; } |
| 2628 |
public void setResourcePath(String resourcePath) { scanPublicSourceDir = resourcePath; } |
| 2629 |
public void setBaseResourcePath(String baseResourcePath) { publicSourceDir = baseResourcePath; } |
| 2630 |
public void setSplitResourcePaths(String[] splitResourcePaths) { splitPublicSourceDirs = splitResourcePaths; } |
| 2631 |
public void setGwpAsanMode(@GwpAsanMode int value) { gwpAsanMode = value; } |
| 2632 |
public void setMemtagMode(@MemtagMode int value) { memtagMode = value; } |
| 2633 |
public void setNativeHeapZeroInitialized(@NativeHeapZeroInitialized int value) { |
| 2634 |
nativeHeapZeroInitialized = value; |
| 2635 |
} |
| 2636 |
|
| 2637 |
public void setRequestRawExternalStorageAccess(@Nullable Boolean value) { |
| 2638 |
requestRawExternalStorageAccess = value; |
| 2639 |
} |
| 2640 |
|
| 2641 |
|
| 2642 |
|
| 2643 |
|
| 2644 |
|
| 2645 |
|
| 2646 |
public void setAppClassNamesByProcess(@Nullable ArrayMap<String, String> value) { |
| 2647 |
if (ArrayUtils.size(value) == 0) { |
| 2648 |
mAppClassNamesByProcess = null; |
| 2649 |
} else { |
| 2650 |
mAppClassNamesByProcess = value; |
| 2651 |
} |
| 2652 |
} |
| 2653 |
|
| 2654 |
|
| 2655 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) |
| 2656 |
public String getCodePath() { return scanSourceDir; } |
| 2657 |
public String getBaseCodePath() { return sourceDir; } |
| 2658 |
public String[] getSplitCodePaths() { return splitSourceDirs; } |
| 2659 |
public String getResourcePath() { return scanPublicSourceDir; } |
| 2660 |
|
| 2661 |
@UnsupportedAppUsage |
| 2662 |
public String getBaseResourcePath() { return publicSourceDir; } |
| 2663 |
public String[] getSplitResourcePaths() { return splitPublicSourceDirs; } |
| 2664 |
@GwpAsanMode |
| 2665 |
public int getGwpAsanMode() { return gwpAsanMode; } |
| 2666 |
|
| 2667 |
|
| 2668 |
|
| 2669 |
|
| 2670 |
|
| 2671 |
@MemtagMode |
| 2672 |
public int getMemtagMode() { |
| 2673 |
return memtagMode; |
| 2674 |
} |
| 2675 |
|
| 2676 |
|
| 2677 |
|
| 2678 |
|
| 2679 |
|
| 2680 |
@NativeHeapZeroInitialized |
| 2681 |
public int getNativeHeapZeroInitialized() { |
| 2682 |
return nativeHeapZeroInitialized; |
| 2683 |
} |
| 2684 |
|
| 2685 |
|
| 2686 |
|
| 2687 |
|
| 2688 |
|
| 2689 |
|
| 2690 |
|
| 2691 |
@Nullable |
| 2692 |
public String getCustomApplicationClassNameForProcess(String processName) { |
| 2693 |
if (mAppClassNamesByProcess != null) { |
| 2694 |
String byProcess = mAppClassNamesByProcess.get(processName); |
| 2695 |
if (byProcess != null) { |
| 2696 |
return byProcess; |
| 2697 |
} |
| 2698 |
} |
| 2699 |
return className; |
| 2700 |
} |
| 2701 |
|
| 2702 |
public void setLocaleConfigRes(int value) { localeConfigRes = value; } |
| 2703 |
|
| 2704 |
|
| 2705 |
|
| 2706 |
|
| 2707 |
|
| 2708 |
|
| 2709 |
|
| 2710 |
public int getLocaleConfigRes() { |
| 2711 |
return localeConfigRes; |
| 2712 |
} |
| 2713 |
|
| 2714 |
|
| 2715 |
|
| 2716 |
|
| 2717 |
|
| 2718 |
|
| 2719 |
|
| 2720 |
|
| 2721 |
@NonNull |
| 2722 |
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) |
| 2723 |
public List<SharedLibraryInfo> getSharedLibraryInfos() { |
| 2724 |
if (sharedLibraryInfos == null) { |
| 2725 |
return Collections.EMPTY_LIST; |
| 2726 |
} |
| 2727 |
return sharedLibraryInfos; |
| 2728 |
} |
| 2729 |
|
| 2730 |
|
| 2731 |
|
| 2732 |
|
| 2733 |
|
| 2734 |
|
| 2735 |
@NonNull |
| 2736 |
public Set<String> getKnownActivityEmbeddingCerts() { |
| 2737 |
return mKnownActivityEmbeddingCerts == null ? Collections.emptySet() |
| 2738 |
: mKnownActivityEmbeddingCerts; |
| 2739 |
} |
| 2740 |
|
| 2741 |
|
| 2742 |
|
| 2743 |
|
| 2744 |
|
| 2745 |
|
| 2746 |
|
| 2747 |
public void setKnownActivityEmbeddingCerts(@NonNull Set<String> knownActivityEmbeddingCerts) { |
| 2748 |
|
| 2749 |
|
| 2750 |
mKnownActivityEmbeddingCerts = new ArraySet<>(); |
| 2751 |
for (String knownCert : knownActivityEmbeddingCerts) { |
| 2752 |
mKnownActivityEmbeddingCerts.add(knownCert.toUpperCase(Locale.US)); |
| 2753 |
} |
| 2754 |
} |
| 2755 |
|
| 2756 |
|
| 2757 |
|
| 2758 |
|
| 2759 |
|
| 2760 |
|
| 2761 |
|
| 2762 |
|
| 2763 |
|
| 2764 |
@TestApi |
| 2765 |
public void setEnableOnBackInvokedCallback(boolean isEnable) { |
| 2766 |
if (isEnable) { |
| 2767 |
privateFlagsExt |= PRIVATE_FLAG_EXT_ENABLE_ON_BACK_INVOKED_CALLBACK; |
| 2768 |
} else { |
| 2769 |
privateFlagsExt &= ~PRIVATE_FLAG_EXT_ENABLE_ON_BACK_INVOKED_CALLBACK; |
| 2770 |
} |
| 2771 |
} |
| 2772 |
} |