1 package net
.client
.by
.lock
.task
;
3 import android
.app
.NotificationManager
;
4 import android
.app
.PendingIntent
;
5 import android
.content
.Context
;
6 import android
.content
.Intent
;
7 import android
.os
.Process
;
8 import android
.support
.v4
.app
.ap
;
9 import java
.io
.IOException
;
10 import net
.client
.by
.lock
.b
.d
;
11 import net
.client
.by
.lock
.b
.e
;
12 import net
.client
.by
.lock
.b
.i
;
13 import net
.client
.by
.lock
.b
.j
;
14 import net
.client
.by
.lock
.gui
.a
.a
;
15 import net
.client
.by
.lock
.service
.BackgroundService
;
17 /* compiled from: MyApp */
18 public abstract class FileTask
extends a
implements j
{
19 private static final String TAG
= "FileTask";
23 private NotificationManager mNM
;
24 private int mNotificationId
;
26 public FileTask(Context context
, Object obj
) {
28 this.ftBubble
= ((d
) obj
).A();
31 public i
getProgressController() {
32 if (this.ftis
== null) {
38 @Override // net.client.by.lock.task.a
39 public boolean cancelTask(boolean z
) {
40 boolean cancelTask
= super.cancelTask(z
);
41 if (z
&& this.ftis
!= null) {
44 } catch (IOException e
) {
45 net
.client
.by
.lock
.f
.j
.a(TAG
, e
);
51 /* access modifiers changed from: protected */
52 @Override // net.client.by.lock.task.a
53 public void onCancel() {
54 this.mNM
.cancel(this.mNotificationId
);
57 /* access modifiers changed from: protected */
58 @Override // net.client.by.lock.task.a, net.client.by.lock.task.a, android.os.AsyncTask
59 public Object
[] doInBackground(Object
... objArr
) {
60 this.mNotificationId
= (int) System
.currentTimeMillis();
61 this.mNM
= (NotificationManager
) BackgroundService
.a().getSystemService("notification");
63 if (!(this instanceof FileTask
)) {
64 Process
.setThreadPriority(-8);
67 return genericOnSuccess(call());
68 } catch (Exception e
) {
72 return genericOnException(e
);
76 /* access modifiers changed from: protected */
77 public void onProgressUpdate(Integer
... numArr
) {
78 this.ftBubble
.b(numArr
[0].intValue());
81 @Override // net.client.by.lock.b.j
82 public void updateProgress(int i
) {
83 publishProgress(new Integer
[]{Integer
.valueOf(i
)});
86 public void initProgress() {
89 public void finalizeProgress() {
93 /* access modifiers changed from: protected */
94 @Override // net.client.by.lock.task.a
95 public Object
[] genericOnException(Throwable th
) {
97 ((d
) this.startupParameter
).a(th
);
98 this.mBuilder
= new ap(this.ctx
).a(false).c(true).a(17301504).a(((d
) this.startupParameter
).e()).a(PendingIntent
.getBroadcast(BackgroundService
.a(), 0, new Intent(), 134217728)).b("Some kind of error occured").c("Error");
99 this.mNM
.notify(this.mNotificationId
, this.mBuilder
.a());
100 this.mNM
.cancel(this.mNotificationId
);
101 return onException(th
);
104 /* access modifiers changed from: protected */
105 @Override // net.client.by.lock.task.a
106 public void onPostExecute(Object
[] objArr
) {
108 super.onPostExecute(objArr
);
109 ap c
= new ap(this.ctx
).c(true).a(((d
) this.startupParameter
).e()).a(false).c(String
.valueOf(((d
) this.startupParameter
).e()) + " is " + (this instanceof SendFileTask ?
"uploaded" : "downloaded"));
110 if (this instanceof SendFileTask
) {
115 this.mBuilder
= c
.a(i
).b(this instanceof SendFileTask ?
"Uploaded" : "Downloaded").a(PendingIntent
.getBroadcast(BackgroundService
.a(), 0, new Intent(), 134217728));
116 this.mNM
.notify(this.mNotificationId
, this.mBuilder
.a());
117 this.mNM
.cancel(this.mNotificationId
);
118 if (this.ftBubble
!= null) {