1
0
Fork 1

remove orphaned function (Christian Schneppe)

This commit is contained in:
12aw 2022-04-29 00:34:21 +02:00
parent 603b3c7cd9
commit 5bd2248e57
5 changed files with 11 additions and 19 deletions

View file

@ -1257,7 +1257,7 @@ public class NotificationService {
mBuilder.addAction(snoozeAction);
++addedActionsCount;
}
if (addedActionsCount < 3 && mXmppConnectionService.webViewAvailable()) {
if (addedActionsCount < 3) {
final Message firstLocationMessage = getFirstLocationMessage(messages);
if (firstLocationMessage != null) {
final PendingIntent pendingShowLocationIntent = createShowLocationIntent(firstLocationMessage);

View file

@ -5067,10 +5067,6 @@ public class XmppConnectionService extends Service {
}
}
public boolean webViewAvailable() {
return this.getPackageManager().hasSystemFeature("android.software.webview");
}
public void publishDisplayName(Account account) {
String displayName = account.getDisplayName();
final IqPacket request;

View file

@ -2118,11 +2118,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
intent.putExtra("ALTERNATIVE_CODEC", activity.xmppConnectionService.alternativeVoiceSettings());
break;
case ATTACHMENT_CHOICE_LOCATION:
if (activity.xmppConnectionService.webViewAvailable()) {
intent = new Intent(getActivity(), ShareLocationActivity.class);
} else {
ToastCompat.makeText(activity, R.string.webview_not_available, ToastCompat.LENGTH_LONG).show();
}
intent = GeoHelper.getFetchIntent(activity);
break;
}
final Context context = getActivity();

View file

@ -1446,16 +1446,12 @@ public class MessageAdapter extends ArrayAdapter<Message> {
}
private void showLocation(Message message) {
if (activity.xmppConnectionService.webViewAvailable()) {
for (Intent intent : GeoHelper.createGeoIntentsFromMessage(this.getContext(), message)) {
if (intent.resolveActivity(getContext().getPackageManager()) != null) {
getContext().startActivity(intent);
activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out);
return;
}
for (Intent intent : GeoHelper.createGeoIntentsFromMessage(this.getContext(), message)) {
if (intent.resolveActivity(getContext().getPackageManager()) != null) {
getContext().startActivity(intent);
activity.overridePendingTransition(R.animator.fade_in, R.animator.fade_out);
return;
}
} else {
ToastCompat.makeText(activity, R.string.webview_not_available, ToastCompat.LENGTH_LONG).show();
}
}

View file

@ -25,6 +25,7 @@ import eu.siacs.conversations.entities.Conversational;
import eu.siacs.conversations.entities.Message;
import eu.siacs.conversations.ui.SettingsActivity;
import eu.siacs.conversations.ui.ShowLocationActivity;
import eu.siacs.conversations.ui.ShareLocationActivity;
public class GeoHelper {
@ -76,6 +77,9 @@ public class GeoHelper {
}
return false;
}
public static Intent getFetchIntent(Context context) {
return new Intent(context, ShareLocationActivity.class);
}
private static GeoPoint parseGeoPoint(String body) throws IllegalArgumentException {
Matcher matcher = GEO_URI.matcher(body);