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
44b969e0
Commit
44b969e0
authored
Dec 29, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor notification changes
parent
176e4704
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
11 deletions
+7
-11
Notifications.java
...l/java/com/topjohnwu/magisk/components/Notifications.java
+2
-3
ProgressNotification.java
...com/topjohnwu/magisk/components/ProgressNotification.java
+5
-7
DownloadModuleService.java
.../com/topjohnwu/magisk/services/DownloadModuleService.java
+0
-1
No files found.
app/src/full/java/com/topjohnwu/magisk/components/Notifications.java
View file @
44b969e0
...
...
@@ -22,6 +22,8 @@ import androidx.core.app.TaskStackBuilder;
public
class
Notifications
{
public
static
NotificationManagerCompat
mgr
=
NotificationManagerCompat
.
from
(
App
.
self
);
public
static
void
setup
(
Context
c
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
NotificationManager
mgr
=
c
.
getSystemService
(
NotificationManager
.
class
);
...
...
@@ -55,7 +57,6 @@ public class Notifications {
.
setAutoCancel
(
true
)
.
setContentIntent
(
pendingIntent
);
NotificationManagerCompat
mgr
=
NotificationManagerCompat
.
from
(
app
);
mgr
.
notify
(
Const
.
ID
.
MAGISK_UPDATE_NOTIFICATION_ID
,
builder
.
build
());
}
...
...
@@ -79,7 +80,6 @@ public class Notifications {
.
setAutoCancel
(
true
)
.
setContentIntent
(
pendingIntent
);
NotificationManagerCompat
mgr
=
NotificationManagerCompat
.
from
(
app
);
mgr
.
notify
(
Const
.
ID
.
APK_UPDATE_NOTIFICATION_ID
,
builder
.
build
());
}
...
...
@@ -98,7 +98,6 @@ public class Notifications {
.
setVibrate
(
new
long
[]{
0
,
100
,
100
,
100
})
.
addAction
(
R
.
drawable
.
ic_refresh
,
app
.
getString
(
R
.
string
.
reboot
),
pendingIntent
);
NotificationManagerCompat
mgr
=
NotificationManagerCompat
.
from
(
app
);
mgr
.
notify
(
Const
.
ID
.
DTBO_NOTIFICATION_ID
,
builder
.
build
());
}
...
...
app/src/full/java/com/topjohnwu/magisk/components/ProgressNotification.java
View file @
44b969e0
...
...
@@ -9,16 +9,14 @@ import com.topjohnwu.magisk.R;
import
com.topjohnwu.net.DownloadProgressListener
;
import
androidx.core.app.NotificationCompat
;
import
androidx.core.app.NotificationManagerCompat
;
public
class
ProgressNotification
implements
DownloadProgressListener
{
private
NotificationManagerCompat
mgr
;
private
NotificationCompat
.
Builder
builder
;
private
Notification
notification
;
private
long
prevTime
;
public
ProgressNotification
(
String
title
)
{
mgr
=
NotificationManagerCompat
.
from
(
App
.
self
);
builder
=
Notifications
.
progress
(
title
);
prevTime
=
System
.
currentTimeMillis
();
update
();
...
...
@@ -47,13 +45,13 @@ public class ProgressNotification implements DownloadProgressListener {
public
void
update
()
{
notification
=
builder
.
build
();
mgr
.
notify
(
hashCode
(),
notification
);
Notifications
.
mgr
.
notify
(
hashCode
(),
notification
);
}
private
void
lastUpdate
()
{
notification
=
builder
.
build
();
mgr
.
cancel
(
hashCode
());
mgr
.
notify
(
notification
.
hashCode
(),
notification
);
Notifications
.
mgr
.
cancel
(
hashCode
());
Notifications
.
mgr
.
notify
(
notification
.
hashCode
(),
notification
);
}
public
void
dlDone
()
{
...
...
@@ -73,6 +71,6 @@ public class ProgressNotification implements DownloadProgressListener {
}
public
void
dismiss
()
{
mgr
.
cancel
(
hashCode
());
Notifications
.
mgr
.
cancel
(
hashCode
());
}
}
app/src/full/java/com/topjohnwu/magisk/services/DownloadModuleService.java
View file @
44b969e0
...
...
@@ -72,7 +72,6 @@ public class DownloadModuleService extends Service {
.
putExtra
(
Const
.
Key
.
FLASH_ACTION
,
Const
.
Value
.
FLASH_ZIP
);
startActivity
(
intent
);
}
else
{
progress
.
getNotificationBuilder
().
setContentTitle
(
output
.
getName
());
progress
.
dlDone
();
}
}
catch
(
Exception
e
)
{
...
...
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