chore(android): address review comments

This commit is contained in:
Marc Durdin 2021-06-08 19:52:42 +10:00
parent d0edd5175f
commit cc6580779b
3 changed files with 10 additions and 9 deletions

View file

@ -55,7 +55,7 @@ android {
buildTypes {
debug {
// applicationIdSuffix ".debug"
applicationIdSuffix ".debug"
pseudoLocalesEnabled true
debuggable true
}

View file

@ -136,7 +136,8 @@ public class CheckInstallReferrer {
String packageId = referrerUri.getQueryParameter("package");
String bcp47 = referrerUri.getQueryParameter("bcp47");
Log.i(TAG, KMString.format("source=%s package=%s bcp47=%s", new Object[]{source, packageId, bcp47}));
KMLog.LogInfo(TAG, KMString.format("Install referrer details from Google Play: %s source=%s package=%s bcp47=%s",
new Object[]{urlReferrer, source, packageId, bcp47}));
// We use the 'source' parameter as a basic sanity check as anything could be passed in referrer
if(source == null || !source.equals("keyman")) return;

View file

@ -473,13 +473,6 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene
resizeTextView(false);
}
/**
* Parse the URI data to determine the filename and URL for the .kmp keyboard package.
* If URL is valid, download the kmp.
* @param packageUri URI to download the package.
* TODO: only ever pass packageId and bcp47 from callers, as KMPLink should be responsible for
* URL parsing, not this function.
*/
public void downloadKMP(String packageId, String bcp47) {
Uri downloadUri = bcp47 == null ?
Uri.parse(KMString.format("https://keyman.com/go/package/download/%s", new Object[]{packageId})) :
@ -487,6 +480,13 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene
downloadKMP(downloadUri);
}
/**
* Parse the URI data to determine the filename and URL for the .kmp keyboard package.
* If URL is valid, download the kmp.
* @param packageUri URI to download the package.
* TODO: only ever pass packageId and bcp47 from callers, as KMPLink should be responsible for
* URL parsing, not this function.
*/
public void downloadKMP(Uri packageUri) {
if (packageUri == null) {
KMLog.LogError(TAG,"null uri passed to downloadKmp");