Remove Google Maps installed check from navigation
This commit is contained in:
@@ -25,8 +25,6 @@
|
||||
|
||||
<queries>
|
||||
<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>
|
||||
|
||||
<application
|
||||
|
||||
@@ -2,7 +2,6 @@ package it.danieleverducci.nextcloudmaps.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.util.Log;
|
||||
|
||||
import it.danieleverducci.nextcloudmaps.R;
|
||||
@@ -25,18 +24,9 @@ public class IntentGenerator {
|
||||
Intent i = new Intent();
|
||||
i.setAction(Intent.ACTION_VIEW);
|
||||
i.setData(
|
||||
SettingsManager.isUseGoogleMaps(context) && isGoogleMapsInstalled(context)
|
||||
SettingsManager.isUseGoogleMaps(context)
|
||||
? item.getGmapsUri() : item.getGeoUri()
|
||||
);
|
||||
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