Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f41d1e0

Browse files
committed
Replaces tabs with spaces
1 parent dfccafe commit f41d1e0

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/com/alexbbb/uploadservice/UploadService.java

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public class UploadService extends IntentService {
3232

3333
private static final String SERVICE_NAME = UploadService.class.getName();
34-
private static final String TAG = "AndroidUploadService";
34+
private static final String TAG = "AndroidUploadService";
3535

3636
private static final int UPLOAD_NOTIFICATION_ID = 1234; // Something unique
3737
private static final int UPLOAD_NOTIFICATION_ID_DONE = 1235; // Something unique
@@ -59,9 +59,9 @@ public class UploadService extends IntentService {
5959
public static final String SERVER_RESPONSE_CODE = "serverResponseCode";
6060
public static final String SERVER_RESPONSE_MESSAGE = "serverResponseMessage";
6161

62-
private NotificationManager notificationManager;
62+
private NotificationManager notificationManager;
6363
private Builder notification;
64-
private PowerManager.WakeLock wakeLock;
64+
private PowerManager.WakeLock wakeLock;
6565
private UploadNotificationConfig notificationConfig;
6666
private int lastPublishedProgress;
6767

@@ -104,7 +104,8 @@ public UploadService() {
104104
@Override
105105
public void onCreate() {
106106
super.onCreate();
107-
notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
107+
108+
notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
108109
notification = new NotificationCompat.Builder(this);
109110
PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
110111
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
@@ -117,7 +118,7 @@ protected void onHandleIntent(Intent intent) {
117118

118119
if (ACTION_UPLOAD.equals(action)) {
119120
notificationConfig = intent.getParcelableExtra(PARAM_NOTIFICATION_CONFIG);
120-
final String uploadId = intent.getStringExtra(PARAM_ID);
121+
final String uploadId = intent.getStringExtra(PARAM_ID);
121122
final String url = intent.getStringExtra(PARAM_URL);
122123
final String method = intent.getStringExtra(PARAM_METHOD);
123124
final ArrayList<FileToUpload> files = intent.getParcelableArrayListExtra(PARAM_FILES);
@@ -132,15 +133,15 @@ protected void onHandleIntent(Intent intent) {
132133
} catch (Exception exception) {
133134
broadcastError(uploadId, exception);
134135
} finally {
135-
wakeLock.release();
136-
}
136+
wakeLock.release();
137+
}
137138
}
138139
}
139140
}
140141

141142
private void handleFileUpload(final String uploadId,
142-
final String url,
143-
final String method,
143+
final String url,
144+
final String method,
144145
final ArrayList<FileToUpload> filesToUpload,
145146
final ArrayList<NameValue> requestHeaders,
146147
final ArrayList<NameValue> requestParameters)
@@ -210,7 +211,7 @@ private byte[] getTrailerBytes(final String boundary)
210211
}
211212

212213
private HttpURLConnection getMultipartHttpURLConnection(final String url,
213-
final String method,
214+
final String method,
214215
final String boundary)
215216
throws IOException {
216217
final HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
@@ -384,25 +385,28 @@ private void updateNotificationProgress(final int progress) {
384385
}
385386

386387
private void updateNotificationCompleted() {
387-
stopForeground(notificationConfig.isAutoClearOnSuccess());
388+
stopForeground(notificationConfig.isAutoClearOnSuccess());
388389

389-
if (!notificationConfig.isAutoClearOnSuccess()) {
390+
if (!notificationConfig.isAutoClearOnSuccess()) {
390391
notification.setContentTitle(notificationConfig.getTitle())
391392
.setContentText(notificationConfig.getCompleted())
392393
.setSmallIcon(notificationConfig.getIconResourceID())
393394
.setProgress(0, 0, false)
394395
.setOngoing(false);
396+
395397
notificationManager.notify(UPLOAD_NOTIFICATION_ID_DONE, notification.build());
396398
}
397399
}
398400

399401
private void updateNotificationError() {
400-
stopForeground(false);
402+
stopForeground(false);
403+
401404
notification.setContentTitle(notificationConfig.getTitle())
402405
.setContentText(notificationConfig.getError())
403406
.setSmallIcon(notificationConfig.getIconResourceID())
404407
.setProgress(0, 0, false)
405408
.setOngoing(false);
409+
406410
notificationManager.notify(UPLOAD_NOTIFICATION_ID_DONE, notification.build());
407411
}
408412
}

0 commit comments

Comments
 (0)