Remove Google Maps installed check from navigation
This commit is contained in:
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
<queries>
|
<queries>
|
||||||
<package android:name="com.nextcloud.client" />
|
<package android:name="com.nextcloud.client" />
|
||||||
<!-- To see if google maps is installed, as it needs a specific intent Uri) -->
|
|
||||||
<package android:name="com.google.android.apps.maps" />
|
|
||||||
</queries>
|
</queries>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package it.danieleverducci.nextcloudmaps.utils;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import it.danieleverducci.nextcloudmaps.R;
|
import it.danieleverducci.nextcloudmaps.R;
|
||||||
@@ -25,18 +24,9 @@ public class IntentGenerator {
|
|||||||
Intent i = new Intent();
|
Intent i = new Intent();
|
||||||
i.setAction(Intent.ACTION_VIEW);
|
i.setAction(Intent.ACTION_VIEW);
|
||||||
i.setData(
|
i.setData(
|
||||||
SettingsManager.isUseGoogleMaps(context) && isGoogleMapsInstalled(context)
|
SettingsManager.isUseGoogleMaps(context)
|
||||||
? item.getGmapsUri() : item.getGeoUri()
|
? item.getGmapsUri() : item.getGeoUri()
|
||||||
);
|
);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isGoogleMapsInstalled(Context context) {
|
|
||||||
try {
|
|
||||||
context.getPackageManager().getApplicationInfo("com.google.android.apps.maps", 0);
|
|
||||||
return true;
|
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user