refactor for clarity; add back passing of targetDensity paramter for testing purposes; switch order of check so we don't do scale up unless actually necessary
refactor for clarity; add back passing of targetDensity paramter for testing purposes; switch order of check so we don't do scale up unless actually necessary

dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android