Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
07bfdf3e
Commit
07bfdf3e
authored
Dec 03, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow multiple progress notifications
parent
d510224e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
Const.java
app/src/full/java/com/topjohnwu/magisk/Const.java
+1
-1
PatchAPK.java
app/src/full/java/com/topjohnwu/magisk/asyncs/PatchAPK.java
+2
-2
ProgressNotification.java
...com/topjohnwu/magisk/components/ProgressNotification.java
+3
-3
No files found.
app/src/full/java/com/topjohnwu/magisk/Const.java
View file @
07bfdf3e
...
@@ -63,7 +63,7 @@ public class Const {
...
@@ -63,7 +63,7 @@ public class Const {
public
static
final
int
MAGISK_UPDATE_NOTIFICATION_ID
=
4
;
public
static
final
int
MAGISK_UPDATE_NOTIFICATION_ID
=
4
;
public
static
final
int
APK_UPDATE_NOTIFICATION_ID
=
5
;
public
static
final
int
APK_UPDATE_NOTIFICATION_ID
=
5
;
public
static
final
int
DTBO_NOTIFICATION_ID
=
7
;
public
static
final
int
DTBO_NOTIFICATION_ID
=
7
;
public
static
final
int
DOWNLOAD_PROGRESS
_ID
=
8
;
public
static
final
int
HIDE_MANAGER_NOTIFICATION
_ID
=
8
;
public
static
final
String
UPDATE_NOTIFICATION_CHANNEL
=
"update"
;
public
static
final
String
UPDATE_NOTIFICATION_CHANNEL
=
"update"
;
public
static
final
String
PROGRESS_NOTIFICATION_CHANNEL
=
"progress"
;
public
static
final
String
PROGRESS_NOTIFICATION_CHANNEL
=
"progress"
;
}
}
...
...
app/src/full/java/com/topjohnwu/magisk/asyncs/PatchAPK.java
View file @
07bfdf3e
...
@@ -133,9 +133,9 @@ public class PatchAPK {
...
@@ -133,9 +133,9 @@ public class PatchAPK {
NotificationCompat
.
Builder
progress
=
NotificationCompat
.
Builder
progress
=
Notifications
.
progress
(
mm
.
getString
(
R
.
string
.
hide_manager_title
));
Notifications
.
progress
(
mm
.
getString
(
R
.
string
.
hide_manager_title
));
NotificationManagerCompat
mgr
=
NotificationManagerCompat
.
from
(
mm
);
NotificationManagerCompat
mgr
=
NotificationManagerCompat
.
from
(
mm
);
mgr
.
notify
(
Const
.
ID
.
DOWNLOAD_PROGRESS
_ID
,
progress
.
build
());
mgr
.
notify
(
Const
.
ID
.
HIDE_MANAGER_NOTIFICATION
_ID
,
progress
.
build
());
boolean
b
=
patchAndHide
();
boolean
b
=
patchAndHide
();
mgr
.
cancel
(
Const
.
ID
.
DOWNLOAD_PROGRESS
_ID
);
mgr
.
cancel
(
Const
.
ID
.
HIDE_MANAGER_NOTIFICATION
_ID
);
if
(!
b
)
Utils
.
toast
(
R
.
string
.
hide_manager_fail_toast
,
Toast
.
LENGTH_LONG
);
if
(!
b
)
Utils
.
toast
(
R
.
string
.
hide_manager_fail_toast
,
Toast
.
LENGTH_LONG
);
});
});
}
}
...
...
app/src/full/java/com/topjohnwu/magisk/components/ProgressNotification.java
View file @
07bfdf3e
...
@@ -22,8 +22,8 @@ public class ProgressNotification implements DownloadProgressListener {
...
@@ -22,8 +22,8 @@ public class ProgressNotification implements DownloadProgressListener {
MagiskManager
mm
=
Data
.
MM
();
MagiskManager
mm
=
Data
.
MM
();
mgr
=
NotificationManagerCompat
.
from
(
mm
);
mgr
=
NotificationManagerCompat
.
from
(
mm
);
builder
=
Notifications
.
progress
(
title
);
builder
=
Notifications
.
progress
(
title
);
mgr
.
notify
(
Const
.
ID
.
DOWNLOAD_PROGRESS_ID
,
builder
.
build
());
prevTime
=
System
.
currentTimeMillis
();
prevTime
=
System
.
currentTimeMillis
();
update
();
Utils
.
toast
(
mm
.
getString
(
R
.
string
.
downloading_toast
,
title
),
Toast
.
LENGTH_SHORT
);
Utils
.
toast
(
mm
.
getString
(
R
.
string
.
downloading_toast
,
title
),
Toast
.
LENGTH_SHORT
);
}
}
...
@@ -44,7 +44,7 @@ public class ProgressNotification implements DownloadProgressListener {
...
@@ -44,7 +44,7 @@ public class ProgressNotification implements DownloadProgressListener {
}
}
public
void
update
()
{
public
void
update
()
{
mgr
.
notify
(
Const
.
ID
.
DOWNLOAD_PROGRESS_ID
,
builder
.
build
());
mgr
.
notify
(
hashCode
()
,
builder
.
build
());
}
}
public
void
dlDone
()
{
public
void
dlDone
()
{
...
@@ -64,6 +64,6 @@ public class ProgressNotification implements DownloadProgressListener {
...
@@ -64,6 +64,6 @@ public class ProgressNotification implements DownloadProgressListener {
}
}
public
void
dismiss
()
{
public
void
dismiss
()
{
mgr
.
cancel
(
Const
.
ID
.
DOWNLOAD_PROGRESS_ID
);
mgr
.
cancel
(
hashCode
()
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment