2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-09-02 07:05:09 +00:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Albert Vaca Cintora
db3f8f7f74 Release 1.19.1 2022-01-24 01:56:10 +01:00
Albert Vaca Cintora
60ecec9751 Bump dependencies 2022-01-24 01:56:10 +01:00
Albert Vaca Cintora
6cf0ef79b2 Small tweaks suggested by static code analyzer 2022-01-24 01:56:10 +01:00
Albert Vaca Cintora
2d55f282a8 Hopefully fix some NPE crashes 2022-01-24 01:56:10 +01:00
Albert Vaca Cintora
5ef7154d5e Fix mpris control crashing (NPE) in landscape mode 2022-01-24 01:56:10 +01:00
l10n daemon script
1c137d5ca8 GIT_SILENT made messages (after extraction) 2022-01-24 00:42:50 +00:00
22 changed files with 37 additions and 89 deletions

View File

@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.kde.kdeconnect_tp"
android:versionCode="11900"
android:versionName="1.19">
android:versionCode="11910"
android:versionName="1.19.1">
<supports-screens
android:anyDensity="true"
@@ -405,7 +405,7 @@
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
<service android:name="org.kde.kdeconnect.Plugins.RunCommandPlugin.RunCommandControlsProviderService" android:label="@string/kde_connect"
android:permission="android.permission.BIND_CONTROLS">
<intent-filter>

View File

@@ -138,7 +138,7 @@ Provider<String> gitHashProvider = project.provider {
}
ext {
coroutines_version = '1.5.0'
coroutines_version = '1.6.0'
}
dependencies {

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
tools:context="org.kde.kdeconnect.Plugins.MprisPlugin.MprisActivity">
<include layout="@layout/toolbar" android:id="@+id/toolbar_layout" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingBottom="25dp"
android:paddingLeft="25dp"
android:paddingRight="25dp"
android:paddingTop="25dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<ImageView
android:id="@+id/album_art"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginRight="25dp"
android:layout_marginEnd="25dp"
android:layout_weight="1"
android:contentDescription="@string/mpris_coverart_description"
android:scaleType="fitCenter" />
<include
layout="@layout/mpris_control"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -377,6 +377,10 @@
<string name="konqi">Konqi</string>
<string name="rise_up">Levantar</string>
<string name="rise_down">Bajar</string>
<string name="click_here_to_type">Pulse para escribir</string>
<string name="clear_compose">Borrar</string>
<string name="send_compose">Enviar</string>
<string name="open_compose_send">Componer texto</string>
<string name="app_description">Aplicación multi-plataforma que permite a sus dispositivos comunicarse (por ejemplo entre su teléfono y su equipo)</string>
<string name="about_kde_about">&lt;h1&gt;Acerca de&lt;/h1&gt; &lt;p&gt;KDE es una comunidad global de ingenieros software, artistas, escritores, traductores y creadores que siguen el desarrollo de &lt;a href=https://www.gnu.org/philosophy/free-sw.html&gt;Software Libre&lt;/a&gt;. KDE produce el entorno de escritorio Plasma, cientos de aplicaciones y todas las librerías en las que se basan.&lt;/p&gt; &lt;p&gt;KDE es una empresa colaborativa: no hay una entidad única que controla sus productos o su dirección. En su lugar, trabajamos de manera conjunta para conseguir la meta común de construir el mejor software libre posible. Todo el mundo es bienvenido a &lt;a href=https://community.kde.org/Get_Involved&gt;unirse y contribuir&lt;/a&gt; a KDE, incluido usted.&lt;/p&gt; Visite &lt;a href=https://www.kde.org/&gt;https://www.kde.org/&lt;/a&gt; para más información sobre la comunidad KDE y el software que creamos.</string>
<string name="about_kde_report_bugs_or_wishes">&lt;h1&gt;Reporte errores o deseos&lt;/h1&gt; &lt;p&gt;El software siempre puede ser mejorado y el equipo de KDE está preparado para ello. Sin embargo, usted - el usuario - debe comunicarnos cuando algo no funciona como es esperado o que puede ser mejorado. &lt;/p&gt; &lt;p&gt; KDE tiene un sistema de traqueo de errores. Visite &lt;a href=https://bugs.kde.org/&gt;https://bugs.kde.org/&lt;/a&gt; o use el botón «Informar de fallo» en la ventana «Acerca de» para reportar errores.&lt;/p&gt; Si tiene una sugerencia de mejora entonces use el sistema de traqueo de errores para registrar su sugerencia. Asegúrese de que usa la severidad «Lista de deseos».</string>
@@ -394,4 +398,5 @@
<string name="saikrishna_arcot_task">Soporte para usar el teclado en el complemento de entrada remota, arreglos y mejoras generales</string>
<string name="everyone_else">Todos los demás que han contribuido a KDE Connect a lo largo de su historia</string>
<string name="send_clipboard">Enviar al portapapeles</string>
<string name="tap_to_execute">Pulse para ejecutar</string>
</resources>

View File

@@ -281,7 +281,7 @@ public class BluetoothLinkProvider extends BaseLinkProvider {
@TargetApi(value = Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(BluetoothDevice.ACTION_UUID)) {
if (BluetoothDevice.ACTION_UUID.equals(action)) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
Parcelable[] activeUuids = intent.getParcelableArrayExtra(BluetoothDevice.EXTRA_UUID);

View File

@@ -395,7 +395,7 @@ public class TelephonyHelper {
}
}
private ApnSetting() {};
private ApnSetting() {}
public Uri getMmsc() {
return mmscUri;

View File

@@ -15,7 +15,7 @@ public class ASUUtils {
* Implementation of SignalStrength.toLevel usable from API Level 7+
*/
public static int signalStrengthToLevel(SignalStrength signalStrength) {
int level = 0;
int level;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
level = signalStrength.getLevel();
} else {

View File

@@ -229,7 +229,7 @@ public class ConnectivityReportPlugin extends Plugin {
@Override
public boolean onPacketReceived(NetworkPacket np) {
if (np.getType() == PACKET_TYPE_CONNECTIVITY_REPORT_REQUEST) {
if (PACKET_TYPE_CONNECTIVITY_REPORT_REQUEST.equals(np.getType())) {
Log.i("ConnectivityReport", "Requested");
serializeSignalStrengths();
device.sendPacket(connectivityInfo);

View File

@@ -55,7 +55,6 @@ public class FindMyPhonePlugin extends Plugin {
case Tablet:
return context.getString(R.string.findmyphone_title_tablet);
case Phone:
return context.getString(R.string.findmyphone_title);
default:
return context.getString(R.string.findmyphone_title);
}

View File

@@ -152,6 +152,7 @@ public class PointerAccelerationProfileFactory {
public static PointerAccelerationProfile getProfileWithName(String name) {
switch (name) {
case "noacceleration":
default:
return new DefaultProfile();
case "weaker":
return new PolynomialProfile(0.25f);
@@ -163,8 +164,6 @@ public class PointerAccelerationProfileFactory {
return new PolynomialProfile(1.5f);
case "stronger":
return new PolynomialProfile(2.0f);
default:
return new DefaultProfile();
}
}
}

View File

@@ -77,9 +77,7 @@ public class MprisActivity extends AppCompatActivity {
TabLayoutMediator tabLayoutMediator = new TabLayoutMediator(
activityMprisBinding.mprisTabs,
activityMprisBinding.mprisPager,
(tab, position) -> {
tab.setText(mprisPagerAdapter.getTitle(position));
}
(tab, position) -> tab.setText(mprisPagerAdapter.getTitle(position))
);
activityMprisBinding.mprisTabs.getSelectedTabPosition();

View File

@@ -427,11 +427,7 @@ public class MprisMediaSession implements SharedPreferences.OnSharedPreferenceCh
mediaSession.setPlaybackState(playbackState.build());
//Only allow deletion if no music is notificationPlayer
if (notificationPlayer.isPlaying()) {
notification.setOngoing(true);
} else {
notification.setOngoing(false);
}
notification.setOngoing(notificationPlayer.isPlaying());
//Use the MediaStyle notification, so it feels like other media players. That also allows adding actions
MediaStyle mediaStyle = new MediaStyle();

View File

@@ -80,7 +80,7 @@ public class MprisPlugin extends Plugin {
}
boolean isSpotify() {
return getPlayer().toLowerCase().equals("spotify");
return getPlayer().equalsIgnoreCase("spotify");
}
public String getLoopStatus() {

View File

@@ -117,8 +117,8 @@ public class RemoteKeyboardPlugin extends Plugin implements SharedPreferences.On
PreferenceManager.getDefaultSharedPreferences(context).registerOnSharedPreferenceChangeListener(this);
final boolean editingOnly = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(context.getString(R.string.remotekeyboard_editing_only), true);
if (RemoteKeyboardService.instance != null)
notifyKeyboardState(editingOnly ? RemoteKeyboardService.instance.visible : true);
final boolean visible = RemoteKeyboardService.instance != null && RemoteKeyboardService.instance.visible;
notifyKeyboardState(!editingOnly || visible);
return true;
}
@@ -414,7 +414,8 @@ public class RemoteKeyboardPlugin extends Plugin implements SharedPreferences.On
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals(context.getString(R.string.remotekeyboard_editing_only))) {
final boolean editingOnly = sharedPreferences.getBoolean(context.getString(R.string.remotekeyboard_editing_only), true);
notifyKeyboardState(editingOnly ? RemoteKeyboardService.instance.visible : true);
final boolean visible = RemoteKeyboardService.instance != null && RemoteKeyboardService.instance.visible;
notifyKeyboardState(!editingOnly || visible);
}
}
}

View File

@@ -140,7 +140,9 @@ class RunCommandControlsProviderService : ControlsProviderService() {
private fun getAllCommandsList(): List<CommandEntryWithDevice> {
val commandList = mutableListOf<CommandEntryWithDevice>()
for (device in BackgroundService.getInstance().devices.values) {
val service = BackgroundService.getInstance() ?: return commandList
for (device in service.devices.values) {
if (!device.isReachable) {
commandList.addAll(getSavedCommandsList(device))
continue

View File

@@ -511,7 +511,7 @@ public class SMSPlugin extends Plugin {
private boolean handleRequestSingleConversation(NetworkPacket packet) {
SMSHelper.ThreadID threadID = new SMSHelper.ThreadID(packet.getLong("threadID"));
Long rangeStartTimestamp = packet.getLong("rangeStartTimestamp", -1);
long rangeStartTimestamp = packet.getLong("rangeStartTimestamp", -1);
Long numberToGet = packet.getLong("numberToRequest", -1);
if (numberToGet < 0) {

View File

@@ -99,7 +99,7 @@ public class AndroidSafFileSystemView implements FileSystemView {
String treeDocumentId = DocumentsContract.getTreeDocumentId(treeUri);
File nameWithoutRootFile = new File(nameWithoutRoot);
String parentSuffix = nameWithoutRootFile.getParent();
String parentDocumentId = treeDocumentId + (parentSuffix.equals("/") ? "" : parentSuffix);
String parentDocumentId = treeDocumentId + ("/".equals(parentSuffix) ? "" : parentSuffix);
Uri parentUri = DocumentsContract.buildDocumentUriUsingTree(treeUri, parentDocumentId);

View File

@@ -277,7 +277,7 @@ public class StoragePreferenceDialogFragment extends PreferenceDialogFragmentCom
}
}
private class FileSeparatorCharFilter implements InputFilter {
private static class FileSeparatorCharFilter implements InputFilter {
//TODO: Add more chars to refuse?
//https://www.cyberciti.biz/faq/linuxunix-rules-for-naming-file-and-directory-names/
String notAllowed = "/\\><|:&?*";

View File

@@ -214,7 +214,7 @@ public class CustomDevicesActivity extends AppCompatActivity implements CustomDe
}
}
private class DeletedCustomDevice {
private static class DeletedCustomDevice {
@NonNull String hostnameOrIP;
int position;

View File

@@ -8,7 +8,6 @@ package org.kde.kdeconnect.UserInterface;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
@@ -24,22 +23,16 @@ import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import com.klinker.android.send_message.Utils;
import org.kde.kdeconnect.BackgroundService;
import org.kde.kdeconnect.Device;
import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper;
import org.kde.kdeconnect.Helpers.TelephonyHelper;
import org.kde.kdeconnect.NetworkPacket;
import org.kde.kdeconnect.Plugins.BatteryPlugin.BatteryPlugin;
import org.kde.kdeconnect.Plugins.BatteryPlugin.DeviceBatteryInfo;
import org.kde.kdeconnect.Plugins.Plugin;
import org.kde.kdeconnect.Plugins.SMSPlugin.SMSPlugin;
import org.kde.kdeconnect.UserInterface.List.FailedPluginListItem;
import org.kde.kdeconnect.UserInterface.List.ListAdapter;
import org.kde.kdeconnect.UserInterface.List.PluginItem;
import org.kde.kdeconnect.UserInterface.List.PluginListHeaderItem;
import org.kde.kdeconnect.UserInterface.List.SetDefaultAppPluginListItem;
import org.kde.kdeconnect_tp.R;
import org.kde.kdeconnect_tp.databinding.ActivityDeviceBinding;
import org.kde.kdeconnect_tp.databinding.ViewPairErrorBinding;
@@ -48,7 +41,6 @@ import org.kde.kdeconnect_tp.databinding.ViewPairRequestBinding;
import java.util.ArrayList;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
@@ -277,7 +269,7 @@ public class DeviceFragment extends Fragment {
}
private void refreshUI() {
if (device == null || binding == null || binding.getRoot() == null) {
if (device == null || binding == null) {
return;
}
@@ -366,7 +358,7 @@ public class DeviceFragment extends Fragment {
@Override
public void pairingFailed(final String error) {
mActivity.runOnUiThread(() -> {
if (binding == null || binding.getRoot() == null) return;
if (binding == null) return;
binding.pairMessage.setText(error);
binding.pairVerification.setText("");
binding.pairVerification.setVisibility(View.GONE);
@@ -380,7 +372,7 @@ public class DeviceFragment extends Fragment {
@Override
public void unpaired() {
mActivity.runOnUiThread(() -> {
if (binding == null || binding.getRoot() == null) return;
if (binding == null) return;
binding.pairMessage.setText(R.string.device_not_paired);
binding.pairVerification.setVisibility(View.GONE);
binding.pairProgress.setVisibility(View.GONE);

View File

@@ -17,24 +17,19 @@ import org.kde.kdeconnect.Plugins.Plugin;
import org.kde.kdeconnect_tp.R;
import org.kde.kdeconnect_tp.databinding.ListItemWithIconEntryBinding;
public class PluginItem implements ListAdapter.Item {
private final Plugin plugin;
public class PluginItem extends EntryItemWithIcon {
private final View.OnClickListener clickListener;
public PluginItem(Plugin p, View.OnClickListener clickListener) {
this.plugin = p;
super(p.getActionName(), p.getIcon());
this.clickListener = clickListener;
}
@NonNull
@Override
public View inflateView(@NonNull LayoutInflater layoutInflater) {
final ListItemWithIconEntryBinding binding = ListItemWithIconEntryBinding.inflate(layoutInflater);
binding.listItemEntryTitle.setText(plugin.getActionName());
binding.listItemEntryIcon.setImageDrawable(plugin.getIcon());
binding.getRoot().setOnClickListener(clickListener);
return binding.getRoot();
final View root = super.inflateView(layoutInflater);
root.setOnClickListener(clickListener);
return root;
}
}

View File

@@ -77,8 +77,8 @@ public class MainActivity extends AppCompatActivity implements SharedPreferences
@Override
protected void onCreate(Bundle savedInstanceState) {
ThemeUtil.setUserPreferredTheme(this);
super.onCreate(savedInstanceState);
ThemeUtil.setUserPreferredTheme(this); // Workaround: If the activity starts in landscape orientation and we call this before super.onCreate, the PluginItem entries appears with white on white background
final ActivityMainBinding binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());