Closed Bug 984028 Opened 10 years ago Closed 10 years ago

Some apps (APKs) under Applications have default android icon for some resolutions

Categories

(Firefox for Android Graveyard :: Web Apps (PWAs), defect, P1)

ARM
Android
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ozten, Unassigned)

References

Details

+++ This bug was initially created as a clone of Bug #982814 +++

I'm not entirely sure of STR yet.


    export ENDPOINT=http://localhost:8080
    export APP=Pacman
    export MANI=http://pacman.platzh1rsch.ch/pacman-canvas.webapp
    echo $APP
    curl -v -k "${ENDPOINT}/application.apk?manifestUrl=${MANI}" -o ${APP}.apk
    java -jar lib/ext/apktool.jar d -f ${APP}.apk ${APP}
    jarsigner -verify -verbose ${APP}.apk

Does not reproduce this issue.
I mispoke in Comment#0 as I was stepping through without doing a complete build.

STR

1) curl -v -k "${ENDPOINT}/application.apk?manifestUrl=${MANI}" -o ${APP}.apk

2) unzip Pacman.apk

Actual
Generic Icon
res/drawable-hdpi/ic_launcher.png
res/drawable-mdpi/ic_launcher.png

Pacman Icon
res/drawable-xdpi/ic_launcher.png

Expected
All Icons are Pacman Icon

My hunch is the build script needs to be tweaked, per Bug#982814 Comment#12
Flags: needinfo?(mhaigh)
Flags: needinfo?(jhugman)
There is an android icon resizing library, but it isn't being used in our code (except from unit tests)

I suck and didn't get feedback from jhugman or myk here:
https://github.com/mozilla/apk-factory-service/issues/9

Looks like the default Android Icons are coming from the apk-factory-library project
https://github.com/mozilla/apk-factory-library/tree/master/res

I could use some help or guidance:
* Do we remove these extra sizes per mhaigh
* Shall we hook up android-icon
* What is the algorithm for making sure default Android images don't show up in the final apk
In bug 982814, comment 12, mhaigh says:

> Note:  we don't actually need to generate icons for all resolutions.  We need only supply XHDPI and
> HDPI assets and the system will scale down as needed.  The downside of this is that there is extra CPU
> overhead required, although not a lot (converting from xhdpi [96x96] to ldpi [36x36] is hardly capable
> of taxing even the most basic android device).

Later yesterday we had a conversation in which he noted that we only need XHDPI assets for auto-scaling on Android 2.3+.  Unfortunately, Fennec supports 2.2, so we still need both XHDPI and HDPI assets.


(In reply to Austin King [:ozten] from comment #2)
> I could use some help or guidance:

Also cc:ing mfinkle and wesj, who may be able to provide guidance here.


Any chance you can provide a link to the android-icon scaling libary you mention?
The docs suggest that this is the algorithm for resource selection: https://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch

If the icon is corrupted, or the resource finding algorithm can't find anything, then we get the default android icon. 

To make sure we don't get into the algorithm can't find anything situation: at a minimum, put icons (as previously suggested) in drawable-xhdpi, drawable-hdpi and drawable (i.e. no suffix).

I would prefer to use the closest sized icons provided by the developer, and let Android do the scaling on the device. This has two effects: 

 1. less complexity on the server side, 
 2. the developer may have provided a different design based upon icon size.

Of course, all this reduced complexity on the server is completely needed for icons not in png format.

If we can detect image corruption, we should replace it with our own default icon.
Flags: needinfo?(jhugman)
Android Apps that may be helpful here: 

 * What's My Size?
 * CPU-Z
I think I've got a fix.

Algorithm:

1) Look at all icons provided by OWA
2) Sort sizes in reverse order
3) Set mdpi, hdpi, xhdpi all to this largest size
4) Figure out minimal # of icons to download
5) For each icon download and then optimize into target resolutions

Fixed in https://github.com/mozilla/apk-factory-service/pull/61

Fix should be on dev in a few minutes
https://apk-controller.dev.mozaws.net/application.apk
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Flags: needinfo?(mhaigh)
Depends on: 984451
Messageme has the appropriate icon now but the app Minimalist still gets the default android icon during install.

Reopening for investigation.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Icons were 404. Get Kevin to update his manifest.

There are some stability issues with the apk-signer in stage, but that is unrelated.
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.