summaryrefslogtreecommitdiff
path: root/core/java/android/os/Process.java
Commit message (Collapse)AuthorAgeFilesLines
* os: Process: Fix wrong code in isThreadInProcessleo zhang2023-05-051-2/+2
| | | | | | rename the "tid" and "pid" variables that had the names inverted. Change-Id: I572497a0350c50b61674d46d45dfbcad66cd130f
* Merge "Define SDK_SANDBOX_VIRTUAL_UID" into tm-devDmitri Plotnikov2022-03-081-0/+8
|\
| * Define SDK_SANDBOX_VIRTUAL_UIDDmitri Plotnikov2022-03-071-0/+8
| | | | | | | | | | | | | | Bug: 219080829 Bug: 219077358 Test: N/A - this is a constant definition Change-Id: I64861513962a384f1a46a736e429e71d6d22cbed
* | Rename sdkSandboxToAppUid to getAppUidForSdkSandboxUidGavin Corkery2022-03-081-1/+1
|/ | | | | | Test: Build Bug: 223185146 Change-Id: Ie3531d6606b18359497bfb7d6c5fef7e3078f29f
* Add some Process APIs to test_currentGavin Corkery2022-03-031-37/+39
| | | | | | | | | | | In order to test MODULE_LIBRARIES System APIs, the @TestApi annotation needs to be explicitly added. Also adds some whitespace changes which were autogenerated when updating the APIs. Also renames Process.toAppUid(). Test: atest ProcessTest Bug: 218723058 Change-Id: I49bee200c267550b9616ad0b43022126d2d7cc4b
* Rename SupplementalProcess to SdkSandboxNikita Ioffe2022-02-281-18/+18
| | | | | | | | | Bug: 218314884 Bug: 220320098 Test: presubmit Test: atest PackageManagerShellCommandTest Test: atest SdkSandboxPermissionTest Change-Id: I9fb98e0caee75bdaaa35d11d174004505f236799
* Add Process.toSupplementalUid to @TestApiNikita Ioffe2022-02-091-0/+1
| | | | | | Bug: 217545341 Test: m Change-Id: Ief1029cb03c4b7e5746436a97eb5a1a69a170b60
* Add a new UID range for supplemental processes.Martijn Coenen2022-01-211-0/+60
| | | | | | | | | | | | | | | These are processes that are spawned alongside regular app processes. They have their own UID range, such that they can be properly isolated from applications. Add some APIs in Process that allows the system and mainline modules to verify that a particular UID belongs to a supplemental process, and to map between the supplemental process and the corresponding app process. Bug: 215012578 Test: N/A Change-Id: I02aaaa1c2bcf9d141ddc97747eb6d7edd52d7b92
* Merge "Making Process.NFC_UID SystemApi for modules" am: 06580338e6 am: ↵Etienne Ruffieux2022-01-211-0/+1
|\ | | | | | | | | | | | | | | d086e8ee72 am: 0fcd2ed905 am: 26f9b5d78b Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1945288 Change-Id: Ia7695f25f9bec9cd61c1743888cb8c8dd3b8ee04
| * Making Process.NFC_UID SystemApi for modulesEtienne Ruffieux2022-01-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | In order for Bluetooth to be a mainline module, we need to remove all hidden APIs calls from and to it. NFC_UID is used inside BluetoothManagerService so we need to be able to access it. Tag: #feature Test: make Bug: 211851706 Change-Id: Ie778c4467f5db1efa1f759c405373cc3e34747ca
* | Improve the javadoc for the new Process APIs.Makoto Onuki2021-11-171-7/+18
| | | | | | | | | | | | Fix: 206696542 Test: treehugger Change-Id: Iab420163f7970d2c5036e997f567812bf31fca22
* | Add new APIs to android.os.ProcessMakoto Onuki2021-11-151-5/+72
|/ | | | | | | | | | | - APIs the get the current process name - APIs to get the process start "request" time Fix: 205629074 Fix: 205337677 Test: atest CtsProcessTest Change-Id: Id284fa169eb303011cdade6c3ab96e7026654612
* Freezer: fix exception when parsing /proc/locksLi Li2021-07-291-42/+0
| | | | | | | | | | | | | The original code is based on /proc/locks manpage. Unfortunately, that manpage is never correctly updated to include the new field for blocked locks. The new code detects the extra field. As StringTokenizer is too heavy, ProcFileReader is used for better performance. Bug: 194756340 Test: FrameworksUtilTests com.android.internal.util.ProcFileReaderTest Test: FrameworksCoreTests com.android.internal.os.ProcLocksReaderTest Test: No /proc/locks parsing exception with blocked locks Change-Id: I4c9763f9d3091f7d84d2e4b672d7e5cb78b33f59
* Add a UWB subsystem uidRoshan Pius2021-05-111-0/+6
| | | | | | | | | Bug: 186788640 Bug: 187766150 Test: Compiles Change-Id: I6b67c2f7243c50c83cb159c50519a318892f6941 Merged-In: I6b67c2f7243c50c83cb159c50519a318892f6941 (cherry picked from commit 3d8a9d18a7b1fb992451ccdbd72bd2e107bc749e)
* Merge changes from topic "update_NFCC_Always_on" am: 7b7b809587 am: ↵George Chang2021-03-301-0/+1
|\ | | | | | | | | | | | | | | 6a6d92ff09 am: f5dcd90370 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1655107 Change-Id: I57b2db68bb05750718298d776ba2d365bea44a8b
| * Merge changes from topic "update_NFCC_Always_on" am: 7b7b809587 am: 6a6d92ff09George Chang2021-03-301-0/+1
| |\ | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1655107 Change-Id: Ie96dfbcd9e37a1e76faa2efbea2fc146a42e82f9
| | * Make NFC_UID TestApiGeorge Chang2021-03-281-0/+1
| | | | | | | | | | | | | | | | | | | | | Bug: 182979907 Test: atest android.permission.cts.NfcPermissionTest Test: atest android.net.wifi.cts.WifiManagerTest Change-Id: Id007984bcd03b5892bd774673c8c0ab836032fc9
* | | Merge "Fix MANAGE_EXTERNAL_STORAGE permission gid mapping" into sc-devZimuzo Ezeozue2021-03-181-0/+6
|\ \ \
| * | | Fix MANAGE_EXTERNAL_STORAGE permission gid mappingZim2021-03-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Android R, we introduced a platform.xml based mapping. Unfortunately, it only worked for signature|preinstalled apps. To support apps granted the appop (via special app access permissions), we now check the permission and appop grant state explicitly and grant the app the external_storage gid appropriately Test: Manual Bug: 165515144 Change-Id: Ib91e1b3a7e54ac2c83fb1d94446bed06fd44bcf6
* | | | Merge "Expose VPN_UID" am: 58f7a60187 am: 8710bc1755 am: a7913a0656Jeff Sharkey2021-03-171-0/+4
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625699 Change-Id: I4899b2fe5733d24797d33a48069f15a9d4686bb5
| * | Merge "Expose VPN_UID" am: 58f7a60187 am: 8710bc1755Jeff Sharkey2021-03-171-0/+4
| |\| | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625699 Change-Id: Idb15fe2671eac19159cc7f58319cdff7d4663bee
| | * Expose VPN_UIDlucaslin2021-03-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConnectivityService will be a part of mainline module, so it cannot access hidden API. Expose VPN_UID for ConnectivityService to access. Bug: 170598012 Test: m Change-Id: I9f74fb97ba27e5feacf1820cf75e28ad73516d7d
| | * Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855Xin Li2020-12-021-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | Bug: 172690556 Merged-In: I78222391b83a4add8e964340ec08bb8a1306e1c6 Change-Id: I28bbf40820674675ccf765c912aa8140d3f74ab2
| | * | Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-11-041-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
| * | | Merge "Adds caller check to getAllPackages()" into rvc-qpr-dev am: ec4ba204d8Patrick Baumann2021-03-021-0/+6
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13617976 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Iceb77ee1f663833202421151654151893b68ea72
| | * | | Adds caller check to getAllPackages()yawanng2021-02-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enforces that only system, root or shell may call getAllPackages(), a hidden API that shares all package names regardless of user, instant app or package visibility rules. The only exception is the uid of iorapd. iorapd needs the package info to prefetch the right data. Bug: 179618216 Bug: 174661955 Test: run iorapd and check it works well. Change-Id: I77460ae19a4d41151577646441f11e2eddbb741a (cherry picked from commit 8124efd57b50056d22e1b63c32c366ebdf049598)
| * | | | freezer: handle exception in locks file format am: 911519f25aMarco Ballesio2021-02-091-3/+8
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13534713 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: If3c8c1c8097f34cc83ae5d5728b40a91d23257ce
| | * | | freezer: handle exception in locks file formatMarco Ballesio2021-02-091-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Safeguard /proc/locks processing from wrongly formatted /proc/locks files Bug: 179171387 Test: could not reproduce the issue, but verified that no crashes occurred in a prolonged test (4hrs+) Change-Id: Ia8a12903f2e520e51780c8b05876aa1c9083e92b (cherry picked from commit fb4f4073f6eae95d236687a857e64acf262fa215)
| * | | | ActivityManager: don't freeze processes holding file locks am: 80a05232a0Marco Ballesio2021-01-211-0/+38
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13376527 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I393a094a76fe2ffff831a1f34f0c5b39725cd137
| | * | | ActivityManager: don't freeze processes holding file locksMarco Ballesio2021-01-201-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a temporary measure waiting for the more robust b/176927978 to be implemented, query the file lock status of processes prior freezing them, and skip freeze if any locks are held. Test: verified form the logs that processes holding file locks are not frozen Bug: 176928302 Change-Id: Ib7e1715effb63c1b304ce22a9451294fd9f7b10d Merged-In: Ib7e1715effb63c1b304ce22a9451294fd9f7b10d
| * | | | Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-11-021-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Merged-In: I8285daa8530260251ecad6f3f38f98e263629ca7 Change-Id: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
* | | | | Starting window performance tuning.(8/N)wilsonshih2021-03-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create splashscreen thread with priority -10 in shell for starting window controller, the definition is moved from AMS#TOP_APP_PRIORITY_BOOST to Process#THREAD_PRIORITY_TOP_APP_BOOST. Create and set SplashScreenView object on the starting window after the first simple view on the starting window drawn, in this way the transition can be prepare early than wait the actually view was draw, which can save some time. Bug: 73289295 Bug: 131311659 Test: atest StartingSurfaceDrawerTests ShellTaskOrganizerTests Test: atest SplashscreenTests Change-Id: Ibb430a66d6b329e74d62de047fbf37205cb66a96
* | | | | Adds caller check to getAllPackages()yawanng2021-02-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enforces that only system, root or shell may call getAllPackages(), a hidden API that shares all package names regardless of user, instant app or package visibility rules. The only exception is the uid of iorapd. iorapd needs the package info to prefetch the right data. Bug: 179618216 Bug: 174661955 Test: run iorapd and check it works well. Change-Id: I77460ae19a4d41151577646441f11e2eddbb741a Merged-In: I77460ae19a4d41151577646441f11e2eddbb741a (cherry picked from commit 8124efd57b50056d22e1b63c32c366ebdf049598)
* | | | | ActivityManager: create process group in behalf of app zygoteMarco Ballesio2021-02-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | app zygotes don't run under system pid/gid, so they can't create groups for processes they spawn. Use system_server to create the correct process groups Bug: 168907513 Bug: 62435375 Test: verified that webview processes are migrated to their own groups Change-Id: Ifb912b42bca4d7670e6bb15510484296b772bb86
* | | | | freezer: handle exception in locks file formatMarco Ballesio2021-02-081-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Safeguard /proc/locks processing from wrongly formatted /proc/locks files Bug: 179171387 Test: could not reproduce the issue, but verified that no crashes occurred in a prolonged test (4hrs+) Change-Id: Ia8a12903f2e520e51780c8b05876aa1c9083e92b
* | | | | ActivityManager: don't freeze processes holding file locksMarco Ballesio2021-01-071-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a temporary measure waiting for the more robust b/176927978 to be implemented, query the file lock status of processes prior freezing them, and skip freeze if any locks are held. Test: verified form the logs that processes holding file locks are not frozen Bug: 176928302 Change-Id: Ib7e1715effb63c1b304ce22a9451294fd9f7b10d
* | | | | Merge "Add trackingBug to Process.myPpid." am: 081f27d84e am: bd6e1033fb am: ↵Treehugger Robot2020-10-291-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3c8ef9d1d4 am: eb33a02f6a Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1478641 Change-Id: Idcecc766ac5fce8278c83d4ba9c4d969ee480faf
| * | | | Merge "Add trackingBug to Process.myPpid." am: 081f27d84e am: bd6e1033fb am: ↵Treehugger Robot2020-10-291-1/+1
| |\ \ \ \ | | | |/ / | | |/| / | | |_|/ | |/| | | | | | | | | | | | | | 3c8ef9d1d4 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1478641 Change-Id: I1bf8dc971b9484453447aae44e508b6ccbfe526b
| | * | Add trackingBug to Process.myPpid.Mathew Inwood2020-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | Bug: 171962076 Change-Id: Id2e731f471199a368b5a22046e0899d7b37f7337
* | | | Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* | | | Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* | | | Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* | | | Merge "Revert "Refine documentation for Process.setThreadPriority"" am: ↵Rick Yiu2020-10-021-4/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fe6160ab9c am: 1cb565ec3c am: 017adb4085 am: 765dbc6b67 am: ac2eaa1729 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440031 Change-Id: I681c550a8e3ae87db449fd434c95f46c55ea3cb6
| * | | Merge "Revert "Refine documentation for Process.setThreadPriority"" am: ↵Rick Yiu2020-10-021-4/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fe6160ab9c am: 1cb565ec3c am: 017adb4085 am: 765dbc6b67 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440031 Change-Id: If918ed3b7a64bd8e9e3421d4cee2dc82d08117eb
| | * | Revert "Refine documentation for Process.setThreadPriority"Rick Yiu2020-09-271-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c3648a82f108d95fe61174e468085826e9f6a2af. Reason for revert: will cause lock contention Bug: 139521784 Test: build pass Change-Id: Ic10951493ec8dda4e5a5adcbd1c3cb3be3b64782
* | | | Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: ↵Jeff Sharkey2020-09-151-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 741c0a78cc am: da7478b570 am: 487d394296 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195 Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
| * | | Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: ↵Jeff Sharkey2020-09-151-1/+1
| |\| | | | |/ | |/| | | | | | | | | | | | | | | | 741c0a78cc am: da7478b570 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195 Change-Id: I79488866c538bf9e76d0a6429e30262978f6fdab
| | * Update language to comply with Android's inclusive language guidanceJeff Sharkey2020-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | See https://source.android.com/setup/contribute/respectful-code for reference Test: none Bug: 168334533 Exempt-From-Owner-Approval: docs updates Change-Id: I53003332717baf57dc088b2f6b969cdb1863f65e
| * | freezer: switch to cgroup v2 freezerMarco Ballesio2020-08-271-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | cgroup v2 freezer has a single hierarchy and is mounted under /sys/fs/cgroup. Proper v2 freezer support in a system can be checked by verifying that the file "cgroup.freeze" is present in a freezer subgroup. Bug: 154548692 Test: manually verified that processes are frozen and unfrozen Change-Id: Ib966a957490ec986eb14aba6492832c96e147896 Merged-In: Ib966a957490ec986eb14aba6492832c96e147896
* | Track the child processes that are forked by app processesJing Ji2020-09-141-23/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apps could use Runtime.exec() to spawn child process and framework will have no idea about its lifecycle. Now track those processes whenever we find them - currently during the cpu stats sampling they could be spotted. If it's consuming too much CPU while its parent app process are also in the background, kill it. By default we allow up to 32 such processes; the process with the worst oom adj score of their parents will be killed if there are too many of them. Bug: 160548789 Bug: 157089413 Test: atest AppChildProcessTest Test: atest CtsAppTestCases:ActivityManagerTest Change-Id: I95b20a1f36ccd43d09027201d14872305b169d8d