Skip to content

Commit 9926501

Browse files
committed
Tidying
1 parent 8210a85 commit 9926501

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

src/main/java/org/microbit/android/partialflashing/PartialFlashingBaseService.java

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import android.bluetooth.BluetoothGattService;
1313
import android.bluetooth.BluetoothManager;
1414
import android.bluetooth.BluetoothProfile;
15-
import android.bluetooth.BluetoothStatusCodes;
1615
import android.content.BroadcastReceiver;
1716
import android.content.Context;
1817
import android.content.Intent;
@@ -28,7 +27,6 @@
2827
import java.io.IOException;
2928
import java.lang.reflect.Method;
3029
import java.util.Arrays;
31-
import java.util.List;
3230
import java.util.UUID;
3331

3432
/**
@@ -70,7 +68,6 @@ public PartialFlashingBaseService() {
7068

7169
/* Receive updates on user interaction */
7270
private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
73-
7471
@Override
7572
public void onReceive(Context context, final Intent intent) {
7673
logi( "Received Broadcast: " + intent.toString());
@@ -106,36 +103,27 @@ public void onDestroy() {
106103
}
107104

108105
private void sendProgressBroadcast(final int progress) {
109-
110106
logi( "Sending progress broadcast: " + progress + "%");
111-
112107
final Intent broadcast = new Intent(BROADCAST_PROGRESS);
113108
broadcast.putExtra(EXTRA_PROGRESS, progress);
114-
115109
LocalBroadcastManager.getInstance(this).sendBroadcast(broadcast);
116110
}
117111

118112
private void sendProgressBroadcastStart() {
119-
120113
logi( "Sending progress broadcast start");
121-
122114
final Intent broadcast = new Intent(BROADCAST_START);
123-
124115
LocalBroadcastManager.getInstance(this).sendBroadcast(broadcast);
125116
}
126117

127118
private void sendProgressBroadcastComplete() {
128-
129119
logi( "Sending progress broadcast complete");
130-
131120
final Intent broadcast = new Intent(BROADCAST_COMPLETE);
132-
133121
LocalBroadcastManager.getInstance(this).sendBroadcast(broadcast);
134122
}
135123

136124
@Override
137125
protected void onHandleIntent(@Nullable Intent intent) {
138-
logi("onHandleIntent");
126+
logi( "onHandleIntent");
139127

140128
final String filePath = intent.getStringExtra("filepath");
141129
final String deviceAddress = intent.getStringExtra("deviceAddress");
@@ -193,10 +181,8 @@ protected boolean isDebug() {
193181

194182
private BluetoothManager mBluetoothManager;
195183
private BluetoothAdapter mBluetoothAdapter;
196-
private String mBluetoothDeviceAddress;
197184
private BluetoothGatt mBluetoothGatt = null;
198185
private int mConnectionState = STATE_DISCONNECTED;
199-
private BluetoothDevice device;
200186
private boolean descriptorWriteSuccess = false;
201187
BluetoothGattDescriptor descriptorRead = null;
202188
boolean descriptorReadSuccess = false;
@@ -215,10 +201,6 @@ protected boolean isDebug() {
215201

216202
private byte packetState = PACKET_STATE_WAITING;
217203

218-
// Used to lock the program state while we wait for a Bluetooth operation to complete
219-
private static final boolean BLE_WAITING = false;
220-
private static final boolean BLE_READY = true;
221-
222204
private static final int STATE_DISCONNECTED = 0;
223205
private static final int STATE_CONNECTING = 1;
224206
private static final int STATE_CONNECTED = 2;
@@ -245,17 +227,13 @@ protected boolean isDebug() {
245227
// Partial Flashing Commands
246228
private static final byte REGION_INFO_COMMAND = 0x0;
247229
private static final byte FLASH_COMMAND = 0x1;
248-
Boolean notificationReceived;
249-
250-
// Regions
251-
String[] regions = {"SoftDevice", "DAL", "MakeCode"};
252230

253231
// Microbit Type
254232
private final int MICROBIT_V1 = 1;
255233
private final int MICROBIT_V2 = 2;
256234
int hardwareType = MICROBIT_V1;
257235

258-
// Partial Flashing Return Vals
236+
// Partial Flashing Return Values
259237
private static final int PF_SUCCESS = 0x0;
260238
private static final int PF_ATTEMPT_DFU = 0x1;
261239
private static final int PF_FAILED = 0x2;

0 commit comments

Comments
 (0)