Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
launcher
Overview
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
lihuaikun
launcher
Commits
4e12ceca
Commit
4e12ceca
authored
Aug 24, 2020
by
郑鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug
parent
e4b535bf
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
59 additions
and
24 deletions
+59
-24
build.gradle
Launcher3/build.gradle
+1
-1
Launcher.java
Launcher3/src/main/java/com/android/launcher3/Launcher.java
+7
-5
ListenerAppService.java
...m/android/launcher3/accessibility/ListenerAppService.java
+4
-4
PermissionOpenAccessiblityService.java
...her3/accessibility/PermissionOpenAccessiblityService.java
+9
-0
BaseAutoGetPermission.java
.../launcher3/auto_get_permission/BaseAutoGetPermission.java
+5
-0
LauncherManager.java
...n/java/com/android/launcher3/manager/LauncherManager.java
+13
-2
PermissionUtil.java
.../main/java/com/android/launcher3/util/PermissionUtil.java
+3
-3
PackageManageActivity.java
...ava/com/dankal/dankal_launcher/PackageManageActivity.java
+17
-9
No files found.
Launcher3/build.gradle
View file @
4e12ceca
...
@@ -103,7 +103,7 @@ ext {
...
@@ -103,7 +103,7 @@ ext {
GITHUB_REPO_PATH
=
"../../androidlibrary"
GITHUB_REPO_PATH
=
"../../androidlibrary"
PUBLISH_GROUP_ID
=
'cn.dankal.android'
PUBLISH_GROUP_ID
=
'cn.dankal.android'
PUBLISH_ARTIFACT_ID
=
'launcher'
PUBLISH_ARTIFACT_ID
=
'launcher'
PUBLISH_VERSION
=
'1.4.4.
6
'
PUBLISH_VERSION
=
'1.4.4.
8
'
}
}
uploadArchives
{
uploadArchives
{
...
...
Launcher3/src/main/java/com/android/launcher3/Launcher.java
View file @
4e12ceca
...
@@ -366,11 +366,13 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
...
@@ -366,11 +366,13 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
/* if (LauncherManager.mCustomDialog != null) {
/**
LauncherManager.mCustomDialog.dismiss();
* 停止悬浮窗
LauncherManager.mCustomDialog = null;
*/
Log.i("launch_debug_show", "Launcher_onCreate关闭了对话框");
if
(
LauncherManager
.
mKToast
!=
null
)
{
}*/
LauncherManager
.
mKToast
.
dismiss
();
LauncherManager
.
mKToast
=
null
;
}
TraceHelper
.
partitionSection
(
"Launcher-onCreate"
,
"super call"
);
TraceHelper
.
partitionSection
(
"Launcher-onCreate"
,
"super call"
);
...
...
Launcher3/src/main/java/com/android/launcher3/accessibility/ListenerAppService.java
View file @
4e12ceca
...
@@ -83,7 +83,7 @@ public class ListenerAppService extends Service {
...
@@ -83,7 +83,7 @@ public class ListenerAppService extends Service {
private
volatile
long
lastUseAppControlTimeStamp
;
private
volatile
long
lastUseAppControlTimeStamp
;
private
boolean
active
=
true
;
private
boolean
active
=
true
;
private
InnerRecevier
innerReceiver
;
private
InnerRecevier
innerReceiver
;
private
ExecutorService
executors
;
private
ExecutorService
executors
;
...
@@ -234,7 +234,7 @@ public class ListenerAppService extends Service {
...
@@ -234,7 +234,7 @@ public class ListenerAppService extends Service {
super
.
onDestroy
();
super
.
onDestroy
();
}
}
public
class
InnerRecevier
extends
BroadcastReceiver
{
public
class
InnerRecevier
extends
BroadcastReceiver
{
final
String
SYSTEM_DIALOG_REASON_KEY
=
"reason"
;
final
String
SYSTEM_DIALOG_REASON_KEY
=
"reason"
;
...
@@ -392,7 +392,7 @@ public class ListenerAppService extends Service {
...
@@ -392,7 +392,7 @@ public class ListenerAppService extends Service {
Log
.
i
(
"launch_debug_show"
,
"当前顶部包名"
+
topActivity
+
"****"
+
"当前应用包名"
+
context
.
getPackageName
());
Log
.
i
(
"launch_debug_show"
,
"当前顶部包名"
+
topActivity
+
"****"
+
"当前应用包名"
+
context
.
getPackageName
());
if
(
topActivity
.
equals
(
context
.
getPackageName
()))
{
if
(
topActivity
.
equals
(
context
.
getPackageName
())
||
"android"
.
equals
(
topActivity
)
)
{
return
-
1
;
return
-
1
;
}
}
...
@@ -426,7 +426,7 @@ public class ListenerAppService extends Service {
...
@@ -426,7 +426,7 @@ public class ListenerAppService extends Service {
if
(!
LauncherManager
.
getInstance
().
isInterceptSystemSetting
())
{
//不拦截设置
if
(!
LauncherManager
.
getInstance
().
isInterceptSystemSetting
())
{
//不拦截设置
return
-
1
;
return
-
1
;
}
}
if
(
SystemUtils
.
isVIVO
()){
if
(
SystemUtils
.
isVIVO
())
{
//toLauncherPage(context);
//toLauncherPage(context);
registerReceiver
(
innerReceiver
,
intentFilter
);
registerReceiver
(
innerReceiver
,
intentFilter
);
}
}
...
...
Launcher3/src/main/java/com/android/launcher3/accessibility/PermissionOpenAccessiblityService.java
View file @
4e12ceca
...
@@ -108,6 +108,15 @@ public class PermissionOpenAccessiblityService extends AccessibilityService {
...
@@ -108,6 +108,15 @@ public class PermissionOpenAccessiblityService extends AccessibilityService {
Logger
.
e
(
TAG
,
"onAccessibilityEvent "
+
event
.
toString
());
Logger
.
e
(
TAG
,
"onAccessibilityEvent "
+
event
.
toString
());
/* if (LauncherManager.getInstance().getExitState()) {
if (permissionGetter != null) {
KToast toast = permissionGetter.getToast();
if (toast != null) {
toast.dismiss();
}
}
}*/
AccessibilityNodeInfo
rowNode
=
getRootInActiveWindow
();
//获取当前屏幕所有节点
AccessibilityNodeInfo
rowNode
=
getRootInActiveWindow
();
//获取当前屏幕所有节点
if
(
rowNode
!=
null
)
{
if
(
rowNode
!=
null
)
{
...
...
Launcher3/src/main/java/com/android/launcher3/auto_get_permission/BaseAutoGetPermission.java
View file @
4e12ceca
...
@@ -82,10 +82,15 @@ public abstract class BaseAutoGetPermission {
...
@@ -82,10 +82,15 @@ public abstract class BaseAutoGetPermission {
toast
=
null
;
toast
=
null
;
}
}
toast
=
new
KToast
(
service
.
getApplicationContext
());
toast
=
new
KToast
(
service
.
getApplicationContext
());
LauncherManager
.
mKToast
=
toast
;
if
(!
SystemUtils
.
isVIVO
())
if
(!
SystemUtils
.
isVIVO
())
showToastLongTow
(
"辅助权限设置已开启,请根据提示点击,\n如无提示请等稍等 或 手动返回权限设置页面"
);
showToastLongTow
(
"辅助权限设置已开启,请根据提示点击,\n如无提示请等稍等 或 手动返回权限设置页面"
);
}
}
public
KToast
getToast
()
{
return
toast
;
}
private
boolean
isFinish
=
false
;
private
boolean
isFinish
=
false
;
public
int
step
;
public
int
step
;
...
...
Launcher3/src/main/java/com/android/launcher3/manager/LauncherManager.java
View file @
4e12ceca
...
@@ -39,6 +39,7 @@ import com.android.launcher3.model.TimeConfig;
...
@@ -39,6 +39,7 @@ import com.android.launcher3.model.TimeConfig;
import
com.android.launcher3.provider.DBManager
;
import
com.android.launcher3.provider.DBManager
;
import
com.android.launcher3.provider.ManagerAppProvider
;
import
com.android.launcher3.provider.ManagerAppProvider
;
import
com.android.launcher3.util.ActivityUtil
;
import
com.android.launcher3.util.ActivityUtil
;
import
com.android.launcher3.util.KToast
;
import
com.android.launcher3.util.Logger
;
import
com.android.launcher3.util.Logger
;
import
com.android.launcher3.util.PermissionUtil
;
import
com.android.launcher3.util.PermissionUtil
;
import
com.android.launcher3.util.Preconditions
;
import
com.android.launcher3.util.Preconditions
;
...
@@ -88,6 +89,8 @@ public class LauncherManager {
...
@@ -88,6 +89,8 @@ public class LauncherManager {
public
static
CustomDialog
mCustomDialog
;
public
static
CustomDialog
mCustomDialog
;
public
static
int
mStartSendCount
=
0
;
public
static
int
mStartSendCount
=
0
;
public
static
KToast
mKToast
;
private
final
LauncherProvider
.
ChangeListenerWrapper
mListenerWrapper
=
new
LauncherProvider
.
ChangeListenerWrapper
();
private
final
LauncherProvider
.
ChangeListenerWrapper
mListenerWrapper
=
new
LauncherProvider
.
ChangeListenerWrapper
();
private
Handler
mListenerHandler
;
private
Handler
mListenerHandler
;
...
@@ -764,6 +767,7 @@ public class LauncherManager {
...
@@ -764,6 +767,7 @@ public class LauncherManager {
* 判断以前设置的强制锁屏是否过期
* 判断以前设置的强制锁屏是否过期
*/
*/
public
synchronized
boolean
updateLockScreenDelay
()
{
public
synchronized
boolean
updateLockScreenDelay
()
{
Log
.
i
(
"lock_zzzzzzzz"
,
"1"
);
// 退出管制
// 退出管制
if
(
getExitState
())
{
if
(
getExitState
())
{
unlockScreen
();
unlockScreen
();
...
@@ -773,24 +777,29 @@ public class LauncherManager {
...
@@ -773,24 +777,29 @@ public class LauncherManager {
return
true
;
return
true
;
}
}
if
(
timeModeManager
.
getLockScreenType
()
==
ColumnDef
.
LockScreen
.
MODE_FORCE_LOCK
||
timeModeManager
.
getLockScreenType
()
==
ColumnDef
.
LockScreen
.
MODE_REST
)
{
if
(
timeModeManager
.
getLockScreenType
()
==
ColumnDef
.
LockScreen
.
MODE_FORCE_LOCK
||
timeModeManager
.
getLockScreenType
()
==
ColumnDef
.
LockScreen
.
MODE_REST
)
{
Log
.
i
(
"lock_zzzzzzzz"
,
"2"
);
//判断之前是否有忽略工作模式去锁屏
//判断之前是否有忽略工作模式去锁屏
long
endTime
=
timeModeManager
.
getLockScreenEndTime
();
long
endTime
=
timeModeManager
.
getLockScreenEndTime
();
Logger
.
e
(
TAG
,
"updateLockScreen\t"
+
endTime
+
"\t"
+
System
.
currentTimeMillis
());
Logger
.
e
(
TAG
,
"updateLockScreen\t"
+
endTime
+
"\t"
+
System
.
currentTimeMillis
());
if
(
endTime
==
0
||
endTime
>
System
.
currentTimeMillis
())
{
if
(
endTime
==
0
||
endTime
>
System
.
currentTimeMillis
())
{
// 无限期已家长端临时设定的模式执行锁屏
// 无限期已家长端临时设定的模式执行锁屏
Log
.
i
(
"lock_zzzzzzzz"
,
"3"
);
// if (lockScreenMode != timeModeManager.getLockScreenType()) {
// if (lockScreenMode != timeModeManager.getLockScreenType()) {
lockScreen
(
getContext
(),
ColumnDef
.
LockScreen
.
MODE_FORCE_LOCK
);
lockScreen
(
getContext
(),
ColumnDef
.
LockScreen
.
MODE_FORCE_LOCK
);
return
true
;
return
true
;
// }
// }
}
else
if
(
endTime
<
System
.
currentTimeMillis
())
{
}
else
if
(
endTime
<
System
.
currentTimeMillis
())
{
Log
.
i
(
"lock_zzzzzzzz"
,
"4"
);
// 非家长端强制锁定状态或者锁定时间到期 恢复当前工作模式下的锁屏方式
// 非家长端强制锁定状态或者锁定时间到期 恢复当前工作模式下的锁屏方式
Logger
.
e
(
TAG
,
lockScreenMode
+
"\t"
+
timeModeManager
.
getCurrentScreenModel
());
Logger
.
e
(
TAG
,
lockScreenMode
+
"\t"
+
timeModeManager
.
getCurrentScreenModel
());
if
(
timeModeManager
.
getCurrentScreenModel
()
!=
ColumnDef
.
LockScreen
.
MODE_NORMAL
&&
timeModeManager
.
getCurrentScreenModel
()
!=
ColumnDef
.
LockScreen
.
MODE_UNLOCK
)
{
if
(
timeModeManager
.
getCurrentScreenModel
()
!=
ColumnDef
.
LockScreen
.
MODE_NORMAL
&&
timeModeManager
.
getCurrentScreenModel
()
!=
ColumnDef
.
LockScreen
.
MODE_UNLOCK
)
{
Logger
.
e
(
TAG
,
"lockScreen"
);
Logger
.
e
(
TAG
,
"lockScreen"
);
lockScreen
(
getContext
(),
timeModeManager
.
getCurrentScreenModel
());
lockScreen
(
getContext
(),
timeModeManager
.
getCurrentScreenModel
());
Log
.
i
(
"lock_zzzzzzzz"
,
"5"
);
return
true
;
return
true
;
}
else
{
}
else
{
unlockScreen
();
unlockScreen
();
...
@@ -799,6 +808,8 @@ public class LauncherManager {
...
@@ -799,6 +808,8 @@ public class LauncherManager {
}
}
}
else
{
}
else
{
Log
.
i
(
"lock_zzzzzzzz"
,
"6"
);
// //判断工作模式去锁屏
// //判断工作模式去锁屏
Logger
.
e
(
TAG
,
"inTimeRegionTolockScreen"
);
Logger
.
e
(
TAG
,
"inTimeRegionTolockScreen"
);
if
(!
timeModeManager
.
inTimeRegionTolockScreen
())
{
if
(!
timeModeManager
.
inTimeRegionTolockScreen
())
{
...
@@ -926,7 +937,7 @@ public class LauncherManager {
...
@@ -926,7 +937,7 @@ public class LauncherManager {
intent
.
setComponent
(
cn
);
intent
.
setComponent
(
cn
);
Uri
uri
=
Uri
.
parse
(
"cn.dankal.bzshchild.ui.SplashActivity"
);
Uri
uri
=
Uri
.
parse
(
"cn.dankal.bzshchild.ui.SplashActivity"
);
/*
ComponentName cn = new ComponentName("com.dankal.dankal_launcher", "com.dankal.dankal_launcher.PackageManageActivity");
/*
ComponentName cn = new ComponentName("com.dankal.dankal_launcher", "com.dankal.dankal_launcher.PackageManageActivity");
intent.setComponent(cn);
intent.setComponent(cn);
Uri uri = Uri.parse("com.dankal.dankal_launcher.PackageManageActivity");*/
Uri uri = Uri.parse("com.dankal.dankal_launcher.PackageManageActivity");*/
...
...
Launcher3/src/main/java/com/android/launcher3/util/PermissionUtil.java
View file @
4e12ceca
...
@@ -364,8 +364,8 @@ public class PermissionUtil {
...
@@ -364,8 +364,8 @@ public class PermissionUtil {
boolean
enableAdb
=
(
Settings
.
Secure
.
getInt
(
context
.
getContentResolver
(),
Settings
.
Secure
.
ADB_ENABLED
,
0
)
>
0
);
boolean
enableAdb
=
(
Settings
.
Secure
.
getInt
(
context
.
getContentResolver
(),
Settings
.
Secure
.
ADB_ENABLED
,
0
)
>
0
);
Logger
.
e
(
TAG
,
"enAbleADB\t"
+
enableAdb
);
Logger
.
e
(
TAG
,
"enAbleADB\t"
+
enableAdb
);
return
enableAdb
;
//
return enableAdb;
//
return false;
return
false
;
}
}
...
@@ -584,7 +584,7 @@ public class PermissionUtil {
...
@@ -584,7 +584,7 @@ public class PermissionUtil {
return
true
;
return
true
;
}
}
}
}
return
isDefault
||
SystemUtils
.
isMIUI
()
||
SystemUtils
.
isOPPO
()
||
SystemUtils
.
isHW
()
||
SystemUtils
.
isVIVO
();
return
isDefault
||
SystemUtils
.
isMIUI
()
||
SystemUtils
.
isOPPO
()
||
SystemUtils
.
isHW
()
||
SystemUtils
.
isVIVO
()
||
SystemUtils
.
isSAMSUNG
()
;
}
}
/**
/**
...
...
app/src/main/java/com/dankal/dankal_launcher/PackageManageActivity.java
View file @
4e12ceca
...
@@ -191,8 +191,8 @@ public class PackageManageActivity extends Activity {
...
@@ -191,8 +191,8 @@ public class PackageManageActivity extends Activity {
tvRemove
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
tvRemove
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
ManagementInfo
managementInfo
=
new
ManagementInfo
();
//
//
com.huawei.appmarket
// managementInfo.setUseEndTimeStamp(30);
// managementInfo.setUseEndTimeStamp(30);
//
//
// managementInfo.setPackageName("com.cubic.autohome");
// managementInfo.setPackageName("com.cubic.autohome");
...
@@ -201,15 +201,23 @@ public class PackageManageActivity extends Activity {
...
@@ -201,15 +201,23 @@ public class PackageManageActivity extends Activity {
//
//
// LauncherManager.getInstance().addPackageInfo(managementInfo);
// LauncherManager.getInstance().addPackageInfo(managementInfo);
ManagementInfo
managementInfo
=
new
ManagementInfo
();
managementInfo
.
setUseEndTimeStamp
(
3600
);
managementInfo
.
setUseEndTimeStamp
(
3600
);
managementInfo
.
setPackageName
(
"cn.dankal.www.tudigong_partner"
);
managementInfo
.
setPackageName
(
"com.tencent.android.qqdownloader"
);
managementInfo
.
setLock
(
ColumnDef
.
LockApp
.
UNLOCKED
);
managementInfo
.
setLock
(
ColumnDef
.
LockApp
.
UNLOCKED
);
managementInfo
.
setUseType
(
ColumnDef
.
AppUseType
.
SAFE_TYPE
);
managementInfo
.
setUseType
(
ColumnDef
.
AppUseType
.
SAFE_TYPE
);
LauncherManager
.
getInstance
().
addPackageInfo
(
managementInfo
);
LauncherManager
.
getInstance
().
addPackageInfo
(
managementInfo
);
handler
.
sendEmptyMessageDelayed
(
1
,
500
);
handler
.
sendEmptyMessageDelayed
(
1
,
500
);
ManagementInfo
managementInfo2
=
new
ManagementInfo
();
managementInfo2
.
setUseEndTimeStamp
(
3600
);
managementInfo2
.
setPackageName
(
"com.huawei.appmarket"
);
managementInfo2
.
setLock
(
ColumnDef
.
LockApp
.
UNLOCKED
);
managementInfo2
.
setUseType
(
ColumnDef
.
AppUseType
.
SAFE_TYPE
);
LauncherManager
.
getInstance
().
addPackageInfo
(
managementInfo2
);
handler
.
sendEmptyMessageDelayed
(
1
,
500
);
// Logger.e(TAG, "before\t" + LauncherManager.getInstance().getManageAppInfo("com.tencent.mm").toString());
// Logger.e(TAG, "before\t" + LauncherManager.getInstance().getManageAppInfo("com.tencent.mm").toString());
...
@@ -321,13 +329,13 @@ public class PackageManageActivity extends Activity {
...
@@ -321,13 +329,13 @@ public class PackageManageActivity extends Activity {
List
<
Long
>
regions
=
new
ArrayList
<>();
List
<
Long
>
regions
=
new
ArrayList
<>();
regions
.
add
(
Long
.
valueOf
(
0
*
3600
));
regions
.
add
(
Long
.
valueOf
(
0
*
3600
));
regions
.
add
(
Long
.
valueOf
(
1
3
*
3600
));
regions
.
add
(
Long
.
valueOf
(
1
2
*
3600
));
regions
.
add
(
Long
.
valueOf
(
14
*
3600
));
regions
.
add
(
Long
.
valueOf
(
14
*
3600
));
regions
.
add
(
Long
.
valueOf
(
15
*
3600
));
regions
.
add
(
Long
.
valueOf
(
15
*
3600
+
(
12
*
60
)
));
regions
.
add
(
Long
.
valueOf
(
1
5
*
3600
));
regions
.
add
(
Long
.
valueOf
(
1
6
*
3600
));
regions
.
add
(
Long
.
valueOf
(
24
*
3600
));
regions
.
add
(
Long
.
valueOf
(
19
*
3600
));
TimeConfig
config
=
new
TimeConfig
.
Builder
(
ColumnDef
.
TimeManager
.
WORK_DAY
)
TimeConfig
config
=
new
TimeConfig
.
Builder
(
ColumnDef
.
TimeManager
.
WORK_DAY
)
.
lockScreenMode
(
ColumnDef
.
LockScreen
.
MODE_REST
)
.
lockScreenMode
(
ColumnDef
.
LockScreen
.
MODE_REST
)
...
...
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