mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-02 07:05:09 +00:00
Inline fields
This commit is contained in:
@@ -39,7 +39,6 @@ class UploadNotification {
|
|||||||
private NotificationCompat.Builder builder;
|
private NotificationCompat.Builder builder;
|
||||||
private final int notificationId;
|
private final int notificationId;
|
||||||
private final Device device;
|
private final Device device;
|
||||||
private long currentJobId;
|
|
||||||
|
|
||||||
UploadNotification(Device device) {
|
UploadNotification(Device device) {
|
||||||
this.device = device;
|
this.device = device;
|
||||||
@@ -56,7 +55,6 @@ class UploadNotification {
|
|||||||
void addCancelAction(long jobId) {
|
void addCancelAction(long jobId) {
|
||||||
builder.mActions.clear();
|
builder.mActions.clear();
|
||||||
|
|
||||||
currentJobId = jobId;
|
|
||||||
Intent cancelIntent = new Intent(device.getContext(), ShareBroadcastReceiver.class);
|
Intent cancelIntent = new Intent(device.getContext(), ShareBroadcastReceiver.class);
|
||||||
cancelIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
cancelIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
||||||
cancelIntent.setAction(SharePlugin.ACTION_CANCEL_SHARE);
|
cancelIntent.setAction(SharePlugin.ACTION_CANCEL_SHARE);
|
||||||
|
@@ -43,7 +43,6 @@ import butterknife.ButterKnife;
|
|||||||
|
|
||||||
public class CustomDevicesAdapter extends RecyclerView.Adapter<CustomDevicesAdapter.ViewHolder> {
|
public class CustomDevicesAdapter extends RecyclerView.Adapter<CustomDevicesAdapter.ViewHolder> {
|
||||||
private ArrayList<String> customDevices;
|
private ArrayList<String> customDevices;
|
||||||
private RecyclerView recyclerView;
|
|
||||||
private final Callback callback;
|
private final Callback callback;
|
||||||
|
|
||||||
CustomDevicesAdapter(@NonNull Callback callback) {
|
CustomDevicesAdapter(@NonNull Callback callback) {
|
||||||
@@ -62,7 +61,6 @@ public class CustomDevicesAdapter extends RecyclerView.Adapter<CustomDevicesAdap
|
|||||||
public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
|
public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
|
||||||
super.onAttachedToRecyclerView(recyclerView);
|
super.onAttachedToRecyclerView(recyclerView);
|
||||||
|
|
||||||
this.recyclerView = recyclerView;
|
|
||||||
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(
|
ItemTouchHelper itemTouchHelper = new ItemTouchHelper(
|
||||||
new ItemTouchHelperCallback(adapterPos -> callback.onCustomDeviceDismissed(customDevices.get(adapterPos))));
|
new ItemTouchHelperCallback(adapterPos -> callback.onCustomDeviceDismissed(customDevices.get(adapterPos))));
|
||||||
itemTouchHelper.attachToRecyclerView(recyclerView);
|
itemTouchHelper.attachToRecyclerView(recyclerView);
|
||||||
|
@@ -54,7 +54,6 @@ public class LanLinkTest {
|
|||||||
private LanLink badLanLink;
|
private LanLink badLanLink;
|
||||||
private LanLink goodLanLink;
|
private LanLink goodLanLink;
|
||||||
|
|
||||||
private OutputStream badOutputStream;
|
|
||||||
private OutputStream goodOutputStream;
|
private OutputStream goodOutputStream;
|
||||||
|
|
||||||
private Device.SendPacketStatusCallback callback;
|
private Device.SendPacketStatusCallback callback;
|
||||||
@@ -69,7 +68,7 @@ public class LanLinkTest {
|
|||||||
callback = Mockito.mock(Device.SendPacketStatusCallback.class);
|
callback = Mockito.mock(Device.SendPacketStatusCallback.class);
|
||||||
|
|
||||||
goodOutputStream = Mockito.mock(OutputStream.class);
|
goodOutputStream = Mockito.mock(OutputStream.class);
|
||||||
badOutputStream = Mockito.mock(OutputStream.class);
|
OutputStream badOutputStream = Mockito.mock(OutputStream.class);
|
||||||
Mockito.doThrow(new IOException("AAA")).when(badOutputStream).write(Mockito.any(byte[].class));
|
Mockito.doThrow(new IOException("AAA")).when(badOutputStream).write(Mockito.any(byte[].class));
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user