summaryrefslogtreecommitdiff
path: root/libs/androidfw/FileStream.cpp
diff options
context:
space:
mode:
author Lee Shombert <shombert@google.com> 2023-03-01 16:13:32 -0800
committer Lee Shombert <shombert@google.com> 2023-03-03 09:52:18 -0800
commit00394fc0dcd0c535504759353e329c0c00c315c3 (patch)
treef2532e5b948aaf374601da9d4d98f4af80766a60 /libs/androidfw/FileStream.cpp
parentf2c0657709112b5233dd5bc6caba145180e3de73 (diff)
Add a scoped lock injection tool
Bug: 271576290 The lock injection tool now handles two types of lock injection: legacy and "scoped". The legacy behavior is changed: the request method used to be called immediately after the lock is taken. The new behavior is that the request method is called immediately before the lock is taken. Legacy behavior is changed, and is as follows: 1. The request method is called immediately before the lock is taken. 2. The release method is called immediately after the lock is released. The release method is NOT holding the lock when it is called. 3. The request and release methods are static and the signature of the functions is "()V". 4. Synchronized methods and blocks are supported. Scoped behavior is new, and is as follows: 1. The request method is called immediately after the lock is taken. 2. The release method is called immediately before the lock is released. 3. Both request and release methods are instance methods of the traced object and are called on the traced object (the target of synchronized()). The signature of the methods is "()V". 4. Synchronized blocks are supported. Synchronized methods are not supported. Scoped behavior is invoked on a data type with the new --scoped switch. The format of the switch is: --scoped <target-class>,<request-method>,<release-method>,<scoped> The <scoped> argument to the --scoped switch selects legacy (false) or scoped (true) behavior. The legacy command line arguments only select legacy behavior. The Android.bp file has been updated to create test artifacts. The test procedure described in TestMain.java has been updated. In addition, the unit test for this feature has been wrapped in a script. New tests have been added for the scoped lock. Test: the following: * run the lockedregioncodeinjection unit test * build an image and verify that the java byte code is properly updated for the new lock injection * build a complete Android image and verify no regressions Change-Id: I4fbfbf8873c385005cbf67a5b02aff204d145030
Diffstat (limited to 'libs/androidfw/FileStream.cpp')
0 files changed, 0 insertions, 0 deletions