Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e6dc996b authored by Régis Décamps's avatar Régis Décamps
Browse files

Reuse String literals rather new instance in UriMatcher

Micro-optimization: Instead of using a new instance of "#" and "*", reuse the
String literals. This will save 18 bytes for each "*" and "#" used in Uri
matchers.

Also, use switch/case rather than if/else for string matching.

Finally, add test and move TestClass in same package.

Bug: 32502682
Change-Id: Id672138a2213f68e05cafb4e88ed3c1e61c735a4
Test: Unit test
source build/envsetup.sh
lunch aosp_x86-eng
m -j 8
emulator -system out/target/product/generic_x86/system-qemu.img
make FrameworkCoreTests
adb -e install out/target/product/generic_x86/testcases/FrameworksCoreTests/FrameworksCoreTests.apk
adb -e shell am instrument -w -r -e class android.content.UriMatcherTest  com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
parent 4caeadd6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment