Commit Graph

6 Commits

Author SHA1 Message Date
Bernie Innocenti
58cf8e3ffa Add explicit Result::ok() checks where needed
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests
Exempt-From-Owner-Approval: mechanical mass refactoring
Change-Id: I3117833c51cdb333cccdfd159d1582f2adef77db
2020-12-21 15:50:57 +00:00
Ryan Mitchell
80094e39f9 Revert^2 "libandroidfw hardening for IncFs"
55ef6167a2

Change-Id: I02d4890d181655dfd0a14c188468db512559d27b
Merged-In: I02d4890d181655dfd0a14c188468db512559d27b
2020-12-08 16:58:12 +00:00
Ryan Mitchell
741e96ff07 Fix GetResourceName for shared libraries
GetResourceName used GetPAckageById which only works when the compile
time package id is eqal to the runtime package id. This change resolves
resource names correctly using the ruuntime package id.

Bug: 79666085
Test: libandroidfw_tests
Change-Id: Ic60cb2416329c5cb34e925991cd689ca7574b483
2019-01-24 15:45:43 -08:00
Winson
2f3669b767 Add function to return path for last resolved resource
After an AssetManager.FindEntry call is made, either directly or from any of the resource entry calls, a stack of the steps taken to resolve the resource is saved. Those steps can be retrieved as a log later on by calling AssetManager.GetLastResourceResolution, which returns a formatted string of the resource ID/name and path taken, including the configs and package names of each step.

Logging and the saving of the steps to memory can be enabled/disabled with the @hide .setResourceResolutionLoggingEnabled() method on AssetManager.

Bug: 122374289

Test: cases for single and multi ApkAssets loaded
Test: case for no resolution made
Test: made test app to display log on device
Test: added debugging call to source and ran through on-device apps

Change-Id: I6a32b8d4020c3f8510032ff7f431510089fff43f
2019-01-14 14:52:00 -08:00
Svet Ganov
3f08542208 Fix resource by name lookup
Test: added: '@' cases to ResourceUtilsTest
      pass: ./out/host/darwin-x86/nativetest/libandroidfw_tests/libandroidfw_tests
      pass: ./out/host/darwin-x86/nativetest/aapt2_tests/aapt2_tests
      pass: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases
                -t android.appsecurity.cts.PermissionsHostTest

Bug: 74612500

Change-Id: I144e4ca1b63b9cce71052fc02089bb6092739889
2018-03-22 20:59:05 -07:00
Adam Lesinski
929d6517df AssetManager2: Add GetResourceId
Add ability to lookup a resource by name.

Test: make libandroidfw_tests
Change-Id: I262ba5ce4c9892458226fbdb44cf21f9877fb92d
2017-02-08 06:04:52 -08:00