Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MobileManager
Project
Overview
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
Wang Xu
MobileManager
Commits
45dd7ec8
Commit
45dd7ec8
authored
Mar 20, 2020
by
Baoxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: emui10 隐藏中间件图标
parent
22d3c9a3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
SwitchInMdm.kt
...main/java/com/secspace/lib/common/function/SwitchInMdm.kt
+10
-1
Settings.kt
...n/src/main/java/com/secspace/lib/common/utils/Settings.kt
+16
-0
SettingsUtil.java
...main/java/com/secspace/lib/common/utils/SettingsUtil.java
+1
-1
No files found.
lib_common/src/main/java/com/secspace/lib/common/function/SwitchInMdm.kt
View file @
45dd7ec8
...
...
@@ -6,6 +6,7 @@ import android.content.pm.ApplicationInfo
import
android.content.pm.PackageInfo
import
android.content.pm.PackageManager
import
android.content.pm.ResolveInfo
import
android.os.Build.VERSION_CODES
import
android.util.Log
import
com.secspace.lib.common.env.Packages.PkgSecSpace
import
com.secspace.lib.common.utils.*
...
...
@@ -22,6 +23,8 @@ object SwitchInMdm {
private
val
TAG
=
"SwitchInMdm"
fun
init
(
context
:
Context
)
{
this
.
context
=
context
MdmUtils
.
setDefaultLauncher
(
context
)
val
mdmFactoryManager
=
DpmHelper
.
getInstance
(
context
).
getmMdmFactoryManager
()
mdmFactoryManager
.
deviceApplicationManager
.
addDisabledDeactivateMdmPackages
(
getPersistentList
(
context
))
mdmFactoryManager
.
deviceApplicationManager
.
addDisallowedUninstallPackages
(
getPersistentList
(
context
))
...
...
@@ -37,7 +40,13 @@ object SwitchInMdm {
clearTasks
(
context
)
killBackgroundApplication
()
isCoverInstall
()
MdmUtils
.
setDefaultLauncher
(
context
)
hiddenPkgIcon
(
context
)
}
private
fun
hiddenPkgIcon
(
context
:
Context
){
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
VERSION_CODES
.
P
)
Settings
.
hiddenPkgIcon
(
context
)
}
private
fun
clearTasks
(
context
:
Context
)
{
...
...
lib_common/src/main/java/com/secspace/lib/common/utils/Settings.kt
0 → 100644
View file @
45dd7ec8
package
com.secspace.lib.common.utils
import
android.content.Context
import
android.provider.Settings
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.GlobalScope
import
kotlinx.coroutines.launch
object
Settings
{
fun
hiddenPkgIcon
(
ctx
:
Context
?)
{
GlobalScope
.
launch
(
Dispatchers
.
IO
)
{
Settings
.
Global
.
putInt
(
ctx
?.
contentResolver
,
"show_hidden_icon_apps_enabled"
,
0
)
}
}
}
\ No newline at end of file
lib_common/src/main/java/com/secspace/lib/common/utils/SettingsUtil.java
View file @
45dd7ec8
...
...
@@ -220,7 +220,7 @@ public class SettingsUtil {
public
static
void
screenOn
(
Context
context
)
{
PowerManager
mPowerManager
=
(
PowerManager
)
context
.
getSystemService
(
Context
.
POWER_SERVICE
);
if
(
mPowerManager
!=
null
)
{
PowerManager
.
WakeLock
mWakeLock
=
mPowerManager
.
newWakeLock
(
PowerManager
.
SCREEN_BRIGHT_WAKE_LOCK
@SuppressLint
(
"InvalidWakeLockTag"
)
PowerManager
.
WakeLock
mWakeLock
=
mPowerManager
.
newWakeLock
(
PowerManager
.
SCREEN_BRIGHT_WAKE_LOCK
|
PowerManager
.
ACQUIRE_CAUSES_WAKEUP
,
"tag"
);
mWakeLock
.
acquire
(
10
*
60
*
1000L
/*10 minutes*/
);
mWakeLock
.
release
();
...
...
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