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
4b49331d
Commit
4b49331d
authored
Sep 23, 2016
by
d8ahazard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I think...that...might be it?
parent
f9513ca8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
19 deletions
+11
-19
TileServiceCompat.java
...java/com/topjohnwu/magisk/services/TileServiceCompat.java
+10
-18
Utils.java
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
+1
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/services/TileServiceCompat.java
View file @
4b49331d
...
@@ -41,12 +41,15 @@ public class TileServiceCompat extends Service {
...
@@ -41,12 +41,15 @@ public class TileServiceCompat extends Service {
@Override
@Override
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
root
=
Utils
.
rootEnabled
();
updateRoots
();
autoRoot
=
Utils
.
autoToggleEnabled
(
getApplicationContext
());
updateTile
();
updateTile
();
return
super
.
onStartCommand
(
intent
,
flags
,
startId
);
return
super
.
onStartCommand
(
intent
,
flags
,
startId
);
}
}
private
void
updateRoots
()
{
root
=
Utils
.
rootEnabled
();
autoRoot
=
Utils
.
autoToggleEnabled
(
getApplicationContext
());
}
private
void
registerClickTileReceiver
()
{
private
void
registerClickTileReceiver
()
{
...
@@ -70,26 +73,15 @@ public class TileServiceCompat extends Service {
...
@@ -70,26 +73,15 @@ public class TileServiceCompat extends Service {
private
void
onSimpleClick
()
{
private
void
onSimpleClick
()
{
updateRoots
();
updateTile
();
Utils
.
toggleRoot
(!
root
);
Utils
.
toggleRoot
(!
root
);
}
}
private
void
onLongClick
()
{
private
void
onLongClick
()
{
Intent
it
=
new
Intent
(
Intent
.
ACTION_CLOSE_SYSTEM_DIALOGS
);
updateRoots
();
sendBroadcast
(
it
);
updateTile
();
Utils
.
toggleAutoRoot
(!
Utils
.
autoToggleEnabled
(
getApplicationContext
()),
getApplicationContext
());
Utils
.
toggleAutoRoot
(!
autoRoot
,
getApplicationContext
());
}
public
static
boolean
openApp
(
Context
context
,
String
packageName
)
{
PackageManager
manager
=
context
.
getPackageManager
();
Intent
i
=
manager
.
getLaunchIntentForPackage
(
packageName
);
if
(
i
==
null
)
{
return
false
;
//throw new PackageManager.NameNotFoundException();
}
i
.
addCategory
(
Intent
.
CATEGORY_LAUNCHER
);
i
.
addFlags
(
Intent
.
FLAG_ACTIVITY_SINGLE_TOP
);
context
.
startActivity
(
i
);
return
true
;
}
}
private
void
updateTile
()
{
private
void
updateTile
()
{
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
View file @
4b49331d
...
@@ -287,7 +287,7 @@ public class Utils {
...
@@ -287,7 +287,7 @@ public class Utils {
}
}
}
}
tiles
.
add
(
tiles
.
size
()
+
1
,
qsTileId
);
tiles
.
add
(
Math
.
round
(
tiles
.
size
()/
2
)
,
qsTileId
);
String
newTiles
=
TextUtils
.
join
(
","
,
tiles
);
String
newTiles
=
TextUtils
.
join
(
","
,
tiles
);
Logger
.
dh
(
"Utils: NewtilesString is "
+
newTiles
);
Logger
.
dh
(
"Utils: NewtilesString is "
+
newTiles
);
Shell
.
su
(
"settings put secure sysui_qs_tiles \""
+
newTiles
+
"\""
);
Shell
.
su
(
"settings put secure sysui_qs_tiles \""
+
newTiles
+
"\""
);
...
...
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