summaryrefslogtreecommitdiff
path: root/core/java/android/os/SystemProperties.java
Commit message (Collapse)AuthorAgeFilesLines
* setProperty check for byte limitLing Ma2022-03-251-2/+3
| | | | | | Test: manual Bug: 210502588 Change-Id: I75a1e5bbd79814429dfac5b0b6449efd72176c2c
* Read-only properties can have values of arbitrary lengthJerome Gaillard2022-03-221-2/+3
| | | | | | | Read-only properties are defined by having a key starting with "ro.". Bug: 226123443 Change-Id: Ic91e0b7d57e614b620e5147f96356ffd7154daa2
* Derestrict PROP_NAME_MAX.Mathew Inwood2020-11-091-1/+1
| | | | | | | Turns out it is used afterall. Change-Id: I1ba83a151b0ca6ba708b03b46106dfb29d8b592f Fixes: 172649311
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-11-041-2/+2
| | | | | | | | | | | 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
* Remove @TestApi from @SystemApi symbolsAnton Hansson2020-10-191-7/+0
| | | | | | | | | | | | | | I ran these commands: cd frameworks/base grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \ 's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs' grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \ 's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs' Bug: 171179806 Test: m checkapi Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789 Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I534e3fd1305e2f4af076986770033478448a665c
* Merge changes from topic "property-handle" am: 54543bb423 am: 1077797c14Daniel Colascione2019-11-201-13/+99
|\ | | | | | | | | | | am: d5e5232632 Change-Id: I23a5fe95b271a50d60546231a9facf59440bb2dd
| * Add new SystemProperties.Handle interfaceDaniel Colascione2019-11-191-1/+68
| | | | | | | | | | | | | | | | | | | | | | This new interface allows Java code to look up property values without paying for the name->prop_info mapping and, in the case of looking up scalars, without doing any allocation. Bug: 140788621 Test: added tests Test: atest FrameworksCoreSystemPropertiesTests Change-Id: I46d12f62499e9e124fe9add588376d724b364d5d
| * Reimplement android.os.SystemProperties in terms of libc facilitiesDaniel Colascione2019-11-191-13/+32
| | | | | | | | | | | | | | | | | | | | A subsequent CL will implement a new prop_info based properties API on top of this CL. Test: boots Test: atest FrameworksCoreSystemPropertiesTests Bug: 140788621 Change-Id: Id8dd02fff7b1c0815a27ab1dfdde1700447a414c
| * Add @UnsupportedAppUsage annotations for max-p.Artur Satayev2019-11-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | See go/UnsupportedAppUsage for more details. These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code. Bug: 137350495 Test: m Change-Id: I5aa29a49b193db47aaee4d3a756c17f48cc9f0b1 Merged-In: I5aa29a49b193db47aaee4d3a756c17f48cc9f0b1
* | Add @TestApi to SystemApis in SystemPropertiesSasha Kuznetsov2019-10-301-0/+2
| | | | | | | | | | | | | | Test: build and flash Android Bug: 143620678 This is needed because these APIs are used by CTS tests.
* | Merge "Add documentation for *.sysprop" am: 1ae4c5b781 am: 912fabb3e3 am: ↵Jiyong Park2019-09-241-0/+7
|\| | | | | | | | | | | | | | | b5856c3829 am: 0b08ec7040 Change-Id: I7bd95a88ea4873e7ac65c145f11b16a4d2417fb5
| * Merge "Add documentation for *.sysprop"Treehugger Robot2019-09-251-0/+7
| |\
| | * Add documentation for *.syspropJiyong Park2019-09-241-0/+7
| | | | | | | | | | | | | | | | | | Bug: 141246285 Test: N/A Change-Id: Ia90dd8fc75a9caa3b90c4e3adfb1252a5b1c19c4
* | | Merge "Document that SystemProperties.set() can throw RuntimeException" am: ↵Tom Cherry2019-09-191-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | 6265eea819 am: 14a2b65e4e am: f5269ed927 am: 1a8cd03fbc Change-Id: I05c785b6f4d653c6f7911765bd2e2b9043488f1a
| * | Document that SystemProperties.set() can throw RuntimeExceptionTom Cherry2019-09-191-0/+2
| |/ | | | | | | | | | | Bug: 140148206 Test: n/a Change-Id: I32df2ed4979edcc0d9abc46830ebd3defc431c57
| * Fix StrictModeTest#testNonSdkApiUsageHoward Chen2019-05-281-0/+1
| | | | | | | | | | | | | | | | | | Test: atest android.os.cts.StrictModeTest#testNonSdkApiUsage Bug: 131923046 Bug: 129892635 Merged-In: I6759339000eb239112c0c83ce1131f34164ee0cf Change-Id: I6759339000eb239112c0c83ce1131f34164ee0cf
* | Add @UnsupportedAppUsage annotations for max-p.Artur Satayev2019-08-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | See go/UnsupportedAppUsage for more details. These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 137350495 Test: m Change-Id: I5aa29a49b193db47aaee4d3a756c17f48cc9f0b1
* | Fix StrictModeTest#testNonSdkApiUsageHoward Chen2019-05-241-0/+1
| | | | | | | | | | | | | | | | Test: atest android.os.cts.StrictModeTest#testNonSdkApiUsage Bug: 131923046 Bug: 129892635 Change-Id: I6759339000eb239112c0c83ce1131f34164ee0cf
* | Add removeCallback for System change callbackslindatseng2019-04-101-0/+15
|/ | | | | | | | | | | This CL is to fix the development options settings are not listening to the system properties changes. Also add removeChangeCallback in SystemProperties to remove the callback when the view is destroyed to avoid memory leak. Test: Manual/Visual inspection Bug: 127761520 Change-Id: I40178297fcd8b6a6d645f4b33660cdc95c529cef
* Add @UnsupportedAppUsage annotationsAndrei Onea2019-03-151-0/+9
| | | | | | | | | | | | | | | | For packages: android.os This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I4ece0a3f37f88fc2508cb965092aed7cabc61819
* Local and remote isolated storage feature flags.Jeff Sharkey2018-12-151-1/+27
| | | | | | | | | | | | | | | | | | | Moving forward as we start enabling isolated storage in various dogfood groups, we'll need to maintain separate values for the feature flag for both "local" and "remote" opinions. Any strongly expressed local opinion will always take precidence over any remote opinion. Any changes to these feature flags means that we need to invalidate any PackageManager parsed APKs, since PackageParser changes it's output depending on the flag state. Since other feature flags are likely to need this type of invalidation in the future, define the PackageManager cache using a SHA-1 hash of a collection of values that should invalidate the cache. Bug: 112545973 Test: atest android.os.SystemPropertiesTest Change-Id: Ifafcdf15e40e694eb4126e06981aeb82df51da33
* Clear calling identity before calling SysProp callbacksMakoto Onuki2018-10-021-6/+11
| | | | | | Test: boot, run any "setprop" on adb shell Change-Id: I4aa16b60bfad9dfe3a64fa5a629caf83dce1c8bd Fixes: 117105159
* Get android.os tests running against real APIs.Jeff Sharkey2018-06-291-0/+1
| | | | | | | | | Combination of moving to existing public API, tagging things as @TestApi, and bringing utility methods into tests. Bug: 13282254 Test: atest cts/tests/tests/os/ Change-Id: Ifd24c0d048d200e8595e194890cc1dc53ddc2b3e
* Expose TestAPIs needed by GtsOsTestCasesPhilip P. Moltmann2018-04-061-0/+3
| | | | | | Test: atest GtsOsTestCases on pi-dev:taimen and oc-mr1:sailfish Bug: 77497338 Change-Id: I5de976991a857bfbed2faa943822af542601fa8b
* Frameworks: Handle exceptions in SystemProperties callbacksAndreas Gampe2018-03-191-1/+6
| | | | | | | | | | | | When notifying callbacks, catch thrown exceptions. (cherry picked from commit 7074e6fd4c6289e016666bb21e7eee2f78219141) Bug: 73058952 Test: m Test: atest SystemPropertiesTest Merged-In: I1c61e11b833e8ddd30d80b9859b20a9fb3185a33 Change-Id: I1c61e11b833e8ddd30d80b9859b20a9fb3185a33
* Add SystemApi in SystemProperties for vendor apksSundong Ahn2018-01-231-1/+21
| | | | | | | | | | | | | | The Apis in SystemProperties are needed for building ims.apk with LOCAL_SDK_VERSION := system_current. So @SystemApi is added to SystemProperties class and methods which are used by vendor apks (i.e. ims.apk) Bug: 67726847 Test: 1. build & boot on taimen 2. LOCAL_SDK_VERSION:=system_current in ims.apk && build ims.apk && check error count and android_system_stubs_current_intermediates. Change-Id: I178f8d9b0b1f6bb1455ceec919805c4cc549cb32
* Allow ro. properties to have arbitrary lengthsTom Cherry2017-10-181-1/+1
| | | | | | | Bug: 23102347 Bug: 34954705 Test: build Change-Id: I99b074633c60e95cdd2284bf8a708b9187c1e310
* Frameworks: Remove warning for SystemProperties.getTom Cherry2017-10-171-6/+0
| | | | | | | | | | | We now disallow non-UTF8 property values directly in property_service, so there is no need for this warning. This partially reverts 33aea8d40e6cc99f7968a6c6605a81a4587b85e7. Bug: 63177684 Test: make Change-Id: I61f49f635c6095013f55b906e00925a8cbd1ea8c
* Frameworks: Clean up SystemPropertiesAndreas Gampe2017-08-301-27/+36
| | | | | | | | | | | | | | | | | | Clean up SystemProperties.java. Add annotations. Clean up SystemProperties.cpp. Refactor for proper C++11. Make sure C-string key construction is properly reused. Use android::base functionality for actual reading. Fix the test script to refer to the right location. Add some test coverage. (cherry picked from commit 2e6b9cb56320a86f0c33da890f667e5c76c8285d) Test: m Test: frameworks/base/core/tests/systemproperties/run_core_systemproperties_test.sh --rebuild Merged-In: I490577370da985f600fb1117e3c818d3f68bad5f Change-Id: I490577370da985f600fb1117e3c818d3f68bad5f
* Frameworks: Add warning to SystemProperties.getAndreas Gampe2017-08-301-4/+13
| | | | | | | | | | | | Add a warning that calling get() is unsafe when the system property may not contain a valid UTF-encoded string. (cherry picked from commit 6bf1cff1dd8cad0d2c6eb4f2cef28a97270e46b2) Bug: 63177684 Test: m Merged-In: I68e3096d770a32fe204be5c130a3ada9d3db7c0b Change-Id: I68e3096d770a32fe204be5c130a3ada9d3db7c0b
* Merge "Restore SystemProperties.PROP_NAME_MAX to keep Kindle running." am: ↵Elliott Hughes2017-03-161-0/+6
|\ | | | | | | | | | | | | | | ef9c425416 am: 40c4210f8f am: 5c8e3edf48 Change-Id: I4fbdbbb12b7854fcca22de2790c14d315ef44c53
| * Restore SystemProperties.PROP_NAME_MAX to keep Kindle running.Elliott Hughes2017-03-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The limit has been lifted in O, but without this constant, Kindle crashes here: Caused by: java.lang.NoSuchFieldException: PROP_NAME_MAX at java.lang.Class.getField(Class.java:1607) at com.amazon.android.webkit.AmazonWebKitFactories$Implementation.<clinit>(AmazonWebKitFactories.java:59) The code seems to want to truncate a system property name to avoid the exception that SystemProperty.get threw if passed a name that was too long. Bug: http://b/36095274 Test: select a word in Kindle Change-Id: Id1881a8a7c6386400a1024beb0d1b741bdaefba7
| * Remove the name length limit for system properties.Elliott Hughes2017-03-021-25/+0
| | | | | | | | | | | | | | Bug: http://b/33926793 Test: builds Change-Id: Ib89b66b7abebc9a28961a0c9032b99947e3db0d6 Merged-In: Ib89b66b7abebc9a28961a0c9032b99947e3db0d6
| * Fix a bunch of repeated reads of a ro.* propertyJohn Reck2017-01-271-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | SystemProperties.get() is not particularly fast, especially if a string is returned. Since ro.* values are unable to be changed, there's no need to continously re-query them. Cache the value at static init time to trivially fix this. Test: refactoring CL. Change-Id: Iccb021d3cb2ba3a4a1d0048ddec6811bb7409eec (cherry picked from commit aa67f684ff43c81e3280c846245ec6ebe907787e)
* | Remove the name length limit for system properties.Elliott Hughes2017-03-011-30/+0
| | | | | | | | | | | | Bug: http://b/33926793 Test: builds Change-Id: Ib89b66b7abebc9a28961a0c9032b99947e3db0d6
* | Includes key/value on exception thrown when they're too large.Felipe Leme2016-12-151-8/+17
| | | | | | | | | | | | | | Bug: 33662416 Test: manual verification Change-Id: I11436a8454cef5f63b0fb58919f2f02de6234f6b
* | Merge "Add SystemProperties.reportSyspropChanged()." am: 45c0c6939f am: ↵Martijn Coenen2016-11-221-0/+8
|\| | | | | | | | | | | | | | | 8c05ff96fb am: 201cf4fb27 am: d42b1d01ca Change-Id: I05410af5c0e9fe0807d6198aa5c6bdc2eb745ff8
| * Add SystemProperties.reportSyspropChanged().Martijn Coenen2016-11-211-0/+8
| | | | | | | | | | | | | | | | | | To support notifying libutils of system property changes. Bug: 31262344 Test: builds Change-Id: Iea77532eaa84d00f7d640edd1e3a1da66afdadc5
* | Fix a bunch of repeated reads of a ro.* propertyJohn Reck2016-09-211-2/+46
|/ | | | | | | | | | | SystemProperties.get() is not particularly fast, especially if a string is returned. Since ro.* values are unable to be changed, there's no need to continously re-query them. Cache the value at static init time to trivially fix this. Test: refactoring CL. Change-Id: Iccb021d3cb2ba3a4a1d0048ddec6811bb7409eec
* Remove unused imports from frameworks/base.John Spurlock2013-11-201-2/+0
| | | | Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
* Add callback hack to find out when to load system properties.Dianne Hackborn2012-05-091-0/+29
| | | | | | | | Use this to reload the trace and layout bounds properties. This is ONLY for debugging. Change-Id: I1c4bdb52c823520c352c5bac45fa9ee31160793c
* Option to enable StrictMode flashing on userdebug builds.Brad Fitzpatrick2010-11-241-1/+1
| | | | Change-Id: Ifc8e733ea0e0f6bda234a18ad84bcd230879e802
* SystemProperties: eliminate unnecessary string allocation.Mike Lockwood2009-08-121-28/+12
| | | | | | getInt(), getLong() and getBoolean() no longer allocate a temporary String object. Signed-off-by: Mike Lockwood <lockwood@android.com>
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+143
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-143/+0
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+143