New issue
Advanced search Search tips

Issue 710081 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 746757
Owner: ----
Closed: Nov 2017
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocked on:
issue 746757



Sign in to add a comment

Investigate moving getResources().getString() -> PakFile.getString()

Project Member Reported by agrieve@chromium.org, Apr 10 2017

Issue description

Strings take up more room within .arsc files compared to .pak files. When accessing the strings from java only via getResources.getString(R.ID_FOO), we could save space by using a .pak file here instead and accessing via PakFile.getString(PakIds.IDS_FOO).

Pak files are super simple, and so using JNI wouldn't be necessary here. We can write the logic in java to extract a string given an idea (it's just a binary search on an mmapped file).

Before doing this, we should first answer: 
* How many strings are accessed only by getString(r.FOO), and never via xml resources

Other subtleties here:
1. We extract .pak on start-up, so would need to block on the file being extracted.
2. Our pak file whitelist strips out resources not used in C++. This would need to be enhanced to account for java-only uses.
 
Labels: -binary-size Performance-Size
Related bug about strings that could be removed from .arsc if made available:  bug 719409 
Blockedon: 746757
Mergedinto: 746757
Status: Duplicate (was: Available)

Sign in to add a comment