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
49e43af6
Commit
49e43af6
authored
Mar 23, 2020
by
Baoxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复闪屏问题
parent
e63f89cc
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
124 additions
and
74 deletions
+124
-74
AndroidManifest.xml
Launcher3/AndroidManifest.xml
+40
-43
colors.xml
Launcher3/res/values/colors.xml
+1
-0
styles.xml
Launcher3/res/values/styles.xml
+29
-0
Launcher.java
Launcher3/src/com/android/launcher3/Launcher.java
+8
-1
PwdPinSetPwdActivity.java
.../android/launcher3/function/pwd/PwdPinSetPwdActivity.java
+2
-5
BlankActivity.java
...er3/src/com/android/launcher3/settings/BlankActivity.java
+14
-0
SwitchOutMdm.kt
...ain/java/com/secspace/lib/common/function/SwitchOutMdm.kt
+29
-24
privacypolicydialog_layout.xml
...common/src/main/res/layout/privacypolicydialog_layout.xml
+1
-1
No files found.
Launcher3/AndroidManifest.xml
View file @
49e43af6
...
@@ -46,19 +46,19 @@
...
@@ -46,19 +46,19 @@
android:largeHeap=
"@bool/config_largeHeap"
android:largeHeap=
"@bool/config_largeHeap"
android:restoreAnyVersion=
"true"
android:restoreAnyVersion=
"true"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
tools:replace=
"android:label"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
>
tools:replace=
"android:label"
>
<activity
<activity
android:name=
".function.shortcut.ExitShortcut"
android:name=
".function.shortcut.ExitShortcut"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:icon=
"@drawable/launcher_out"
android:icon=
"@drawable/launcher_out"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
<activity
<activity
android:name=
".function.shortcut.SettingShortcut"
android:name=
".function.shortcut.SettingShortcut"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:icon=
"@mipmap/ic_settings"
android:icon=
"@mipmap/ic_settings"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
<receiver
<receiver
android:name=
".settings.BootReceiver"
android:name=
".settings.BootReceiver"
android:enabled=
"true"
android:enabled=
"true"
...
@@ -68,48 +68,47 @@
...
@@ -68,48 +68,47 @@
android:enabled=
"true"
android:enabled=
"true"
android:exported=
"true"
/>
android:exported=
"true"
/>
<activity
android:name=
".function.setting.ChangePwdActivity"
<activity
android:name=
".function.setting.ChangePwdActivity"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
/>
android:theme=
"@style/SettingTheme"
/>
<service
<service
android:name=
".settings.wifi.WifiScanService"
android:name=
".settings.wifi.WifiScanService"
android:enabled=
"true"
android:enabled=
"true"
android:exported=
"true"
/>
android:exported=
"true"
/>
<activity
android:name=
".settings.wifi.WifiWhiteListActivity"
<activity
android:excludeFromRecents=
"true"
/>
android:name=
".settings.wifi.WifiWhiteListActivity"
android:excludeFromRecents=
"true"
/>
<activity
android:name=
".function.setting.SettingAdminActivity"
<activity
android:theme=
"@style/SettingTheme"
android:name=
".function.setting.SettingAdminActivity"
android:excludeFromRecents=
"true"
/>
<activity
android:name=
".function.setting.SettingActivity"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
/>
android:theme=
"@style/SettingTheme"
/>
<activity
<activity
android:name=
".function.setting.SettingAbout
Activity"
android:name=
".function.setting.Setting
Activity"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
/>
android:theme=
"@style/SettingTheme"
/>
<activity
<activity
android:name=
".function.setting.PrivacyPolicy
Activity"
android:name=
".function.setting.SettingAbout
Activity"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
/>
android:theme=
"@style/SettingTheme"
/>
<activity
<activity
android:name=
".function.setting.SettingPwd
Activity"
android:name=
".function.setting.PrivacyPolicy
Activity"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
/>
android:theme=
"@style/SettingTheme"
/>
<activity
<activity
android:name=
".function.setting.SettingBuy
Activity"
android:name=
".function.setting.SettingPwd
Activity"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:theme=
"@style/SettingTheme"
>
android:theme=
"@style/SettingTheme"
/>
<activity
</activity>
android:name=
".function.setting.SettingBuyActivity"
<activity
android:name=
".ManagerAuthActivity"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
android:theme=
"@style/SettingTheme"
></activity>
<activity
android:name=
".ManagerAuthActivity"
android:excludeFromRecents=
"true"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
<activity
<activity
android:name=
".function.setting.AppChooseActivity"
android:name=
".function.setting.AppChooseActivity"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
...
@@ -122,6 +121,7 @@
...
@@ -122,6 +121,7 @@
-->
-->
<activity
<activity
android:name=
".Launcher"
android:name=
".Launcher"
android:autoRemoveFromRecents=
"true"
android:clearTaskOnLaunch=
"true"
android:clearTaskOnLaunch=
"true"
android:configChanges=
"keyboard|keyboardHidden|navigation"
android:configChanges=
"keyboard|keyboardHidden|navigation"
android:enabled=
"true"
android:enabled=
"true"
...
@@ -131,9 +131,8 @@
...
@@ -131,9 +131,8 @@
android:screenOrientation=
"sensor"
android:screenOrientation=
"sensor"
android:stateNotNeeded=
"true"
android:stateNotNeeded=
"true"
android:taskAffinity=
""
android:taskAffinity=
""
android:autoRemoveFromRecents=
"true"
android:theme=
"@style/Launcher3Theme"
android:windowSoftInputMode=
"adjustPan|stateUnchanged"
android:windowSoftInputMode=
"adjustPan|stateUnchanged"
>
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
>
<intent-filter>
<intent-filter>
<!-- <action android:name="android.intent.action.MAIN" /> -->
<!-- <action android:name="android.intent.action.MAIN" /> -->
...
@@ -145,19 +144,17 @@
...
@@ -145,19 +144,17 @@
<action
android:name=
"android.start_launcher"
/>
<action
android:name=
"android.start_launcher"
/>
</intent-filter>
</intent-filter>
</activity>
<!-- The settings activity. When extending keep the intent filter present -->
</activity>
<!-- The settings activity. When extending keep the intent filter present -->
<activity
<activity
android:name=
".function.pwd.PwdPinSetPwdActivity"
android:name=
".function.pwd.PwdPinSetPwdActivity"
android:excludeFromRecents=
"true"
android:autoRemoveFromRecents=
"true"
android:autoRemoveFromRecents=
"true"
android:excludeFromRecents=
"true"
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
/>
<activity
<activity
android:name=
".SettingsActivity"
android:name=
".SettingsActivity"
android:autoRemoveFromRecents=
"true"
android:autoRemoveFromRecents=
"true"
android:label=
"@string/settings_button_text"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:label=
"@string/settings_button_text"
android:theme=
"@android:style/Theme.DeviceDefault.Settings"
>
android:theme=
"@android:style/Theme.DeviceDefault.Settings"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.APPLICATION_PREFERENCES"
/>
<action
android:name=
"android.intent.action.APPLICATION_PREFERENCES"
/>
...
@@ -179,10 +176,10 @@
...
@@ -179,10 +176,10 @@
<activity
<activity
android:name=
".settings.BlankActivity"
android:name=
".settings.BlankActivity"
android:launchMode=
"singleInstance"
android:autoRemoveFromRecents=
"true"
android:autoRemoveFromRecents=
"true"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:theme=
"@style/TransparentTheme"
>
android:launchMode=
"singleInstance"
android:theme=
"@style/NoTitleTranslucentTheme"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
Launcher3/res/values/colors.xml
View file @
49e43af6
...
@@ -55,4 +55,5 @@
...
@@ -55,4 +55,5 @@
<color
name=
"colorLine"
>
#dedede
</color>
<color
name=
"colorLine"
>
#dedede
</color>
<color
name=
"colorBackground"
>
#f6f6f6
</color>
<color
name=
"colorBackground"
>
#f6f6f6
</color>
<color
name=
"revBackground"
>
#2d80df
</color>
<color
name=
"revBackground"
>
#2d80df
</color>
<color
name=
"translate"
>
#00000000
</color>
</resources>
</resources>
Launcher3/res/values/styles.xml
View file @
49e43af6
...
@@ -169,4 +169,33 @@
...
@@ -169,4 +169,33 @@
<!-- 设置项右侧的开关 -->
<!-- 设置项右侧的开关 -->
<item
name=
"qmui_common_list_item_switch"
>
@drawable/switch_button
</item>
<item
name=
"qmui_common_list_item_switch"
>
@drawable/switch_button
</item>
</style>
</style>
<style
name=
"Launcher3Theme"
parent=
"Theme.AppCompat.Light.NoActionBar"
>
<!-- <item name="android:windowBackground">@android:color/transparent</item>-->
<item
name=
"android:windowContentOverlay"
>
@null
</item>
<item
name=
"android:windowAnimationStyle"
>
@style/Animation
</item>
</style>
<style
name=
"Animation"
>
<item
name=
"android:activityOpenEnterAnimation"
>
@null
</item>
<item
name=
"android:activityOpenExitAnimation"
>
@null
</item>
<item
name=
"android:activityCloseEnterAnimation"
>
@null
</item>
<item
name=
"android:activityCloseExitAnimation"
>
@null
</item>
<item
name=
"android:taskOpenEnterAnimation"
>
@null
</item>
<item
name=
"android:taskOpenExitAnimation"
>
@null
</item>
<item
name=
"android:taskCloseEnterAnimation"
>
@null
</item>
<item
name=
"android:taskCloseExitAnimation"
>
@null
</item>
<item
name=
"android:taskToFrontEnterAnimation"
>
@null
</item>
<item
name=
"android:taskToFrontExitAnimation"
>
@null
</item>
<item
name=
"android:taskToBackEnterAnimation"
>
@null
</item>
<item
name=
"android:taskToBackExitAnimation"
>
@null
</item>
</style>
<style
name=
"NoTitleTranslucentTheme"
parent=
"AppTheme"
>
<item
name=
"android:windowAnimationStyle"
>
@style/Animation
</item>
<item
name=
"android:windowNoTitle"
>
true
</item>
<item
name=
"android:windowBackground"
>
@color/translate
</item>
<item
name=
"android:windowIsTranslucent"
>
true
</item>
</style>
</resources>
</resources>
Launcher3/src/com/android/launcher3/Launcher.java
View file @
49e43af6
...
@@ -160,6 +160,7 @@ import com.secspace.lib.common.event.RefreshWorkSpaceEvent;
...
@@ -160,6 +160,7 @@ import com.secspace.lib.common.event.RefreshWorkSpaceEvent;
import
com.secspace.lib.common.function.ActivationHelper
;
import
com.secspace.lib.common.function.ActivationHelper
;
import
com.secspace.lib.common.function.DialogManager
;
import
com.secspace.lib.common.function.DialogManager
;
import
com.secspace.lib.common.function.WorkManager
;
import
com.secspace.lib.common.function.WorkManager
;
import
com.secspace.lib.common.update.CheckUpdateCore
;
import
com.secspace.lib.common.utils.ActivityHelper
;
import
com.secspace.lib.common.utils.ActivityHelper
;
import
com.secspace.lib.common.utils.DeviceUtil
;
import
com.secspace.lib.common.utils.DeviceUtil
;
import
com.secspace.lib.common.utils.DpmHelper
;
import
com.secspace.lib.common.utils.DpmHelper
;
...
@@ -425,7 +426,8 @@ public class Launcher extends BaseActivity
...
@@ -425,7 +426,8 @@ public class Launcher extends BaseActivity
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
))
{
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
))
{
EventBus
.
getDefault
().
register
(
this
);
EventBus
.
getDefault
().
register
(
this
);
}
}
ActivationHelper
.
INSTANCE
.
init
(
this
);
CheckUpdateCore
.
get
().
init
(
this
);
if
(
Prefs
.
isFirstInit
(
this
))
{
if
(
Prefs
.
isFirstInit
(
this
))
{
List
<
String
>
pkgs
=
new
ArrayList
<>();
List
<
String
>
pkgs
=
new
ArrayList
<>();
pkgs
.
add
(
getPackageName
());
pkgs
.
add
(
getPackageName
());
...
@@ -4562,4 +4564,9 @@ public class Launcher extends BaseActivity
...
@@ -4562,4 +4564,9 @@ public class Launcher extends BaseActivity
}
}
}
}
}
}
@Override
public
void
overridePendingTransition
(
int
enterAnim
,
int
exitAnim
)
{
super
.
overridePendingTransition
(
0
,
0
);
}
}
}
Launcher3/src/com/android/launcher3/function/pwd/PwdPinSetPwdActivity.java
View file @
49e43af6
...
@@ -17,16 +17,14 @@ import android.widget.Button;
...
@@ -17,16 +17,14 @@ import android.widget.Button;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.CompoundButton
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.android.launcher3.BaseActivity
;
import
com.android.launcher3.BaseActivity
;
import
com.android.launcher3.Launcher
;
import
com.android.launcher3.R
;
import
com.android.launcher3.R
;
import
com.android.launcher3.settings.BlankActivity
;
import
com.secspace.lib.common.utils.Prefs
;
import
com.secspace.lib.common.utils.Prefs
;
import
com.secspace.lib.common.utils.ToastUtil
;
import
com.secspace.lib.common.utils.ToastUtil
;
import
org.greenrobot.eventbus.EventBus
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
@@ -74,9 +72,8 @@ public class PwdPinSetPwdActivity extends BaseActivity implements View.OnClickLi
...
@@ -74,9 +72,8 @@ public class PwdPinSetPwdActivity extends BaseActivity implements View.OnClickLi
private
void
startLauncher
()
{
private
void
startLauncher
()
{
Intent
intent
=
new
Intent
();
Intent
intent
=
new
Intent
();
intent
.
setAction
(
"android.start_launcher"
);
intent
.
setPackage
(
this
.
getPackageName
());
intent
.
setPackage
(
this
.
getPackageName
());
intent
.
setClass
(
this
,
Launcher
.
class
);
intent
.
setClass
(
this
,
BlankActivity
.
class
);
startActivity
(
intent
);
startActivity
(
intent
);
finish
();
finish
();
}
}
...
...
Launcher3/src/com/android/launcher3/settings/BlankActivity.java
View file @
49e43af6
package
com
.
android
.
launcher3
.
settings
;
package
com
.
android
.
launcher3
.
settings
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.view.WindowManager
;
import
com.android.launcher3.function.pwd.PwdPinSetPwdActivity
;
import
com.android.launcher3.function.pwd.PwdPinSetPwdActivity
;
import
com.secspace.lib.common.base.BaseActivity
;
import
com.secspace.lib.common.base.BaseActivity
;
...
@@ -22,6 +25,12 @@ public class BlankActivity extends BaseActivity {
...
@@ -22,6 +25,12 @@ public class BlankActivity extends BaseActivity {
}
}
@Override
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
@Override
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
if
(!
Prefs
.
isPrivacyPolicyAccept
(
this
))
{
if
(!
Prefs
.
isPrivacyPolicyAccept
(
this
))
{
...
@@ -41,4 +50,9 @@ public class BlankActivity extends BaseActivity {
...
@@ -41,4 +50,9 @@ public class BlankActivity extends BaseActivity {
protected
void
onNewIntent
(
Intent
intent
)
{
protected
void
onNewIntent
(
Intent
intent
)
{
super
.
onNewIntent
(
intent
);
super
.
onNewIntent
(
intent
);
}
}
@Override
public
void
overridePendingTransition
(
int
enterAnim
,
int
exitAnim
)
{
super
.
overridePendingTransition
(
0
,
0
);
}
}
}
lib_common/src/main/java/com/secspace/lib/common/function/SwitchOutMdm.kt
View file @
49e43af6
...
@@ -25,29 +25,33 @@ object SwitchOutMdm: ISwitch() {
...
@@ -25,29 +25,33 @@ object SwitchOutMdm: ISwitch() {
private
var
context
:
Context
?
=
null
private
var
context
:
Context
?
=
null
private
val
TAG
=
"SwitchOutMdm"
private
val
TAG
=
"SwitchOutMdm"
fun
exit
(
context
:
Context
)
{
}
private
fun
removeDisallowedRunningApp
(){
private
fun
removeDisallowedRunningApp
(){
val
mdmFactoryManager
=
MdmFactoryManager
.
getInstance
()
val
mdmFactoryManager
=
MdmFactoryManager
.
getInstance
()
val
list
=
mdmFactoryManager
.
deviceApplicationManager
.
disallowedRunningApp
mdmFactoryManager
.
deviceApplicationManager
?.
let
{
mdmFactoryManager
.
deviceApplicationManager
.
removeDisallowedRunningApp
(
list
)
val
list
=
it
.
disallowedRunningApp
it
.
removeDisallowedRunningApp
(
list
)
Log
.
e
(
TAG
,
"remove:${list}"
)
Log
.
e
(
TAG
,
"remove:${list}"
)
}
}
}
private
fun
recover
()
{
private
fun
recover
(
context
:
Context
)
{
val
mdmFactoryManager
=
MdmFactoryManager
.
getInstance
()
val
mdmFactoryManager
=
MdmFactoryManager
.
getInstance
()
Prefs
.
setAutoStartSelf
(
context
,
false
)
Prefs
.
setAutoStartSelf
(
context
,
false
)
mdmFactoryManager
.
deviceApplicationManager
.
setApplicationEnabledSetting
(
"com.huawei.powergenie"
,
PackageManager
.
COMPONENT_ENABLED_STATE_ENABLED
,
1
)
mdmFactoryManager
.
deviceApplicationManager
?.
let
{
mdmFactoryManager
.
deviceRestrictionManager
.
isAdbDisabled
=
false
it
.
removePersistentApp
(
getPersistentList
(
context
))
mdmFactoryManager
.
deviceRestrictionManager
.
isUSBOtgDisabled
=
false
it
.
setApplicationEnabledSetting
(
"com.huawei.powergenie"
,
PackageManager
.
COMPONENT_ENABLED_STATE_ENABLED
,
1
)
mdmFactoryManager
.
deviceRestrictionManager
.
isUSBDataDisabled
=
false
}
mdmFactoryManager
.
deviceRestrictionManager
.
isExternalStorageDisabled
=
false
mdmFactoryManager
.
deviceRestrictionManager
?.
let
{
mdmFactoryManager
.
deviceRestrictionManager
.
isStatusBarExpandPanelDisabled
=
false
it
.
isAdbDisabled
=
false
it
.
isUSBOtgDisabled
=
false
mdmFactoryManager
.
deviceSettingsManager
.
isRestoreFactoryDisabled
=
false
it
.
isUSBDataDisabled
=
false
mdmFactoryManager
.
deviceSettingsManager
.
isSystemUpdateDisabled
=
false
it
.
isExternalStorageDisabled
=
false
it
.
isStatusBarExpandPanelDisabled
=
false
}
mdmFactoryManager
.
deviceSettingsManager
?.
let
{
it
.
isRestoreFactoryDisabled
=
false
it
.
isSystemUpdateDisabled
=
false
}
DisableCompat
.
enableComponent
(
context
,
COMPONENT_UPDATE_SYSTEM
)
DisableCompat
.
enableComponent
(
context
,
COMPONENT_UPDATE_SYSTEM
)
DisableCompat
.
enableComponent
(
context
,
EnterprisePrivacySettingsActivity
)
DisableCompat
.
enableComponent
(
context
,
EnterprisePrivacySettingsActivity
)
...
@@ -55,20 +59,21 @@ object SwitchOutMdm: ISwitch() {
...
@@ -55,20 +59,21 @@ object SwitchOutMdm: ISwitch() {
private
fun
clearProcesses
()
{
private
fun
clearProcesses
()
{
val
dam
=
MdmFactoryManager
.
getInstance
().
deviceApplicationManager
val
dam
=
MdmFactoryManager
.
getInstance
().
deviceApplicationManager
dam
?.
let
{
//clear task
//clear task
val
runningTasks
=
dam
.
getRunningTasks
(
1000
)
val
runningTasks
=
it
.
getRunningTasks
(
1000
)
if
(
runningTasks
!=
null
)
{
if
(
runningTasks
!=
null
)
{
for
(
task
in
runningTasks
)
{
for
(
task
in
runningTasks
)
{
val
pkg
=
task
.
baseActivity
.
packageName
val
pkg
=
task
.
baseActivity
.
packageName
if
(
pkg
==
context
?.
packageName
||
pkg
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
||
pkg
==
"com.android.systemui"
)
{
if
(
pkg
==
context
?.
packageName
||
pkg
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
||
pkg
==
"com.android.systemui"
)
{
continue
continue
}
}
dam
.
removeTask
(
task
.
id
)
it
.
removeTask
(
task
.
id
)
Log
.
d
(
TAG
,
"remove task "
+
task
.
baseActivity
.
packageName
)
Log
.
d
(
TAG
,
"remove task "
+
task
.
baseActivity
.
packageName
)
}
}
}
}
//clear processes
//clear processes
val
runningAppProcesses
=
dam
.
runningAppProcesses
val
runningAppProcesses
=
it
.
runningAppProcesses
val
packages
=
getAllPackages
(
PackageManager
.
MATCH_UNINSTALLED_PACKAGES
)
val
packages
=
getAllPackages
(
PackageManager
.
MATCH_UNINSTALLED_PACKAGES
)
if
(
runningAppProcesses
!=
null
)
{
if
(
runningAppProcesses
!=
null
)
{
for
(
processInfo
in
runningAppProcesses
)
{
for
(
processInfo
in
runningAppProcesses
)
{
...
@@ -79,12 +84,13 @@ object SwitchOutMdm: ISwitch() {
...
@@ -79,12 +84,13 @@ object SwitchOutMdm: ISwitch() {
if
(
processName
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
||
context
?.
packageName
==
processName
||
processName
==
"com.huawei.powergenie"
)
{
if
(
processName
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
||
context
?.
packageName
==
processName
||
processName
==
"com.huawei.powergenie"
)
{
continue
continue
}
}
dam
.
killApplicationProcess
(
processName
)
it
.
killApplicationProcess
(
processName
)
dam
.
forceStopPackage
(
processName
)
it
.
forceStopPackage
(
processName
)
Log
.
d
(
TAG
,
"kill $processName"
)
Log
.
d
(
TAG
,
"kill $processName"
)
}
}
}
}
}
}
}
private
fun
getAllPackages
(
flags
:
Int
):
List
<
String
>
{
private
fun
getAllPackages
(
flags
:
Int
):
List
<
String
>
{
val
packageInfos
=
getAllPackageInfo
(
flags
)
val
packageInfos
=
getAllPackageInfo
(
flags
)
...
@@ -111,14 +117,13 @@ object SwitchOutMdm: ISwitch() {
...
@@ -111,14 +117,13 @@ object SwitchOutMdm: ISwitch() {
if
(
context
?.
packageName
?.
let
{
name
.
contains
(
it
)
}
!!
||
name
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
)
{
if
(
context
?.
packageName
?.
let
{
name
.
contains
(
it
)
}
!!
||
name
==
PkgSecSpace
.
PACKAGENAME_MIDDLEWARE
)
{
continue
continue
}
}
MdmFactoryManager
.
getInstance
().
deviceApplicationManager
.
forceStopPackage
(
name
)
MdmFactoryManager
.
getInstance
().
deviceApplicationManager
?
.
forceStopPackage
(
name
)
}
}
}
}
override
suspend
fun
init
(
context
:
Context
)
{
override
suspend
fun
init
(
context
:
Context
)
{
this
.
context
=
context
this
.
context
=
context
MdmFactoryManager
.
getInstance
().
deviceApplicationManager
.
removePersistentApp
(
getPersistentList
(
context
))
recover
(
context
)
recover
()
MdmUtils
.
clearDefaultLauncher
(
context
)
MdmUtils
.
clearDefaultLauncher
(
context
)
removeDisallowedRunningApp
()
removeDisallowedRunningApp
()
clearProcesses
()
clearProcesses
()
...
...
lib_common/src/main/res/layout/privacypolicydialog_layout.xml
View file @
49e43af6
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<TextView
<TextView
android:id=
"@+id/title"
android:id=
"@+id/title"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
48dp
"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"5dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"10dp"
android:layout_marginBottom=
"10dp"
...
...
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