Commit c3ee2110 by lihuaikun

.

parent 1b5ee325
......@@ -104,7 +104,7 @@ ext {
GITHUB_REPO_PATH = "../../androidlibrary"
PUBLISH_GROUP_ID = 'cn.dankal.android'
PUBLISH_ARTIFACT_ID = 'launcher'
PUBLISH_VERSION = '1.3.7'
PUBLISH_VERSION = '1.3.8'
}
uploadArchives {
......
......@@ -57,6 +57,7 @@
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="signatureOrSystem" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
......
......@@ -57,6 +57,7 @@
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="signatureOrSystem" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
......
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="dankal_launcher" module="Launcher3" revision="unspecified" status="integration" publication="20200423101513"/>
<info organisation="dankal_launcher" module="Launcher3" revision="unspecified" status="integration" publication="20200423155205"/>
<configurations>
<conf name="_internal_aapt2_binary" visibility="private" transitive="false"/>
<conf name="androidApis" visibility="public"/>
......
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cn.dankal.android</groupId>
<artifactId>launcher</artifactId>
<version>1.3.6</version>
<version>1.3.8</version>
<packaging>aar</packaging>
<dependencies>
<dependency>
......
......@@ -164,7 +164,7 @@ public class FastBitmapDrawable extends Drawable {
float radius = bounds.width() / 6;
RectF rectF = new RectF(bounds);
canvas.drawRoundRect(rectF, radius, radius, mBackgroundPaint);
// canvas.drawRoundRect(rectF, radius, radius, mBackgroundPaint);
//
canvas.drawBitmap(mBitmap, null, bounds, mPaint);
......
......@@ -3343,7 +3343,7 @@ public class PermissionOpenAccessiblityService extends AccessibilityService {
@Override
public void run() {
Logger.e(TAG, "showToastLong\t" + msg);
toast.setText("倍知守护提醒您 : " + msg);
toast.setText("倍知守护提醒您 : \n" + msg);
toast.show();
}
});
......
......@@ -95,6 +95,9 @@ public class LauncherManager {
private LockScreenInterface floatWindowHandle;
private static boolean DEBUG_MODEL = false;
/**
* 初始化方法 (必须!)
*
......@@ -105,6 +108,14 @@ public class LauncherManager {
}
/**
* 设置Debug模式 正式版需关闭
* @param debugModel
*/
public static void setDebugModel(boolean debugModel) {
DEBUG_MODEL = debugModel;
}
/**
* @param application
* @param settingActivity 拦截系统设置后跳转到页面
*/
......@@ -611,7 +622,7 @@ public class LauncherManager {
} else {
Logger.e(TAG, "lockScreen activity");
if (!ConfigManager.getInstance().isLockScreen()){
if (!ConfigManager.getInstance().isLockScreen()) {
Intent intent = new Intent(context, LockScreenActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
......@@ -725,18 +736,18 @@ public class LauncherManager {
*/
public synchronized boolean updateLockScreenDelay() {
// 退出管制
if (getExitState()){
if (getExitState()) {
unlockScreen();
return false;
}
if (ConfigManager.getInstance().isLockScreen()&&lockScreenMode== ColumnDef.LockScreen.MODE_NORMAL){
if (ConfigManager.getInstance().isLockScreen() && lockScreenMode == ColumnDef.LockScreen.MODE_NORMAL) {
return true;
}
if (timeModeManager.getLockScreenType() == ColumnDef.LockScreen.MODE_FORCE_LOCK || timeModeManager.getLockScreenType() == ColumnDef.LockScreen.MODE_REST) {
//判断之前是否有忽略工作模式去锁屏
long endTime = timeModeManager.getLockScreenEndTime();
Logger.e(TAG, "updateLockScreen\t" + endTime + "\t" + System.currentTimeMillis());
if (endTime == 0||endTime>System.currentTimeMillis()) {
if (endTime == 0 || endTime > System.currentTimeMillis()) {
// 无限期已家长端临时设定的模式执行锁屏
// if (lockScreenMode != timeModeManager.getLockScreenType()) {
......
......@@ -124,12 +124,6 @@ public class TimeModeManager {
return -1;
}
// 判断金币是否充足
if (LauncherManager.getInstance().getCoinNum() <= 0) {
return -4;
}
if (info.getUseType() == ColumnDef.AppUseType.SAFE_TYPE || info.getUseType() == ColumnDef.AppUseType.LEARN_TYPE) {
return 0;
......@@ -147,6 +141,12 @@ public class TimeModeManager {
if (info.getLock() != ColumnDef.LockApp.LOCKED) {
if (includeTimeRegion(config.getRegionList())) {
// 判断金币是否充足
if (LauncherManager.getInstance().getCoinNum() <= 0) {
return -4;
}
long canUseTime = 0;
// 获取某个应用类别下的使用时间
......
......@@ -108,11 +108,10 @@ public class ItemClickHandler {
LauncherManager.getInstance().backLauncherHome(v.getContext(), Constants.DIALOG_TYPE_APP_UNCLASS);
return;
} else {
// if (!LauncherManager.getInstance().isHasMoney()&&)
int type=LauncherManager.getInstance().canUse(packageName);
if (type<0) {
switch (type){
int type = LauncherManager.getInstance().canUse(packageName);
if (type < 0) {
switch (type) {
case -3:
LauncherManager.getInstance().backLauncherHome(v.getContext(), Constants.DIALOG_TYPE_SOME_CLASS_TIME_OUT);
break;
......
......@@ -89,7 +89,11 @@ public class PermissionUtil {
public static boolean hasPermission(Context context) {
return hasOverLayerPermission(context);
if (hasPermissionBelowMarshmallow(context, 24)) {
return hasOverLayerPermission(context);
} else {
return false;
}
}
......
......@@ -160,13 +160,13 @@ public class PackageManageActivity extends Activity {
managementInfo.setUseEndTimeStamp(3600);
managementInfo.setPackageName("com.tencent.mobileqq");
managementInfo.setPackageName("com.tencent.mm");
managementInfo.setLock(ColumnDef.LockApp.DEADLINE);
managementInfo.setUseType(ColumnDef.AppUseType.LEARN_TYPE);
managementInfo.setUseType(ColumnDef.AppUseType.GAME_LOCK_TYPE);
LauncherManager.getInstance().addPackageInfo(managementInfo);
handler.sendEmptyMessageDelayed(1, 5000);
Logger.e(TAG, "before\t" + LauncherManager.getInstance().getManageAppInfo("com.tencent.mobileqq").toString());
handler.sendEmptyMessageDelayed(1, 500);
Logger.e(TAG, "before\t" + LauncherManager.getInstance().getManageAppInfo("com.tencent.mm").toString());
}
......@@ -214,25 +214,25 @@ public class PackageManageActivity extends Activity {
// int week = calendar.get(Calendar.DAY_OF_WEEK);
//
// Logger.e(TAG, week + "\t" + (calendar.getFirstDayOfWeek() == Calendar.SUNDAY));
// List<Long> regions = new ArrayList<>();
//
// regions.add(Long.valueOf(9 * 3600));
// regions.add(Long.valueOf(10 * 3600));
//
// regions.add(Long.valueOf(17 * 3600));
// regions.add(Long.valueOf(17 * 3600));
//
// regions.add(Long.valueOf(15 * 3600));
// regions.add(Long.valueOf(17 * 3600));
//
// TimeConfig config = new TimeConfig.Builder(ColumnDef.TimeManager.WORK_DAY)
// .lockScreenMode(ColumnDef.LockScreen.MODE_REST)
// .addUseRegion(regions)
// .addAppTypeConfig(ColumnDef.AppUseType.GAME_LOCK_TYPE, 46800)
// .build();
List<Long> regions = new ArrayList<>();
regions.add(Long.valueOf(11 * 3600));
regions.add(Long.valueOf(12 * 3600));
regions.add(Long.valueOf(13 * 3600));
regions.add(Long.valueOf(14 * 3600));
regions.add(Long.valueOf(15 * 3600));
regions.add(Long.valueOf(17 * 3600));
TimeConfig config = new TimeConfig.Builder(ColumnDef.TimeManager.WORK_DAY)
.lockScreenMode(ColumnDef.LockScreen.MODE_REST)
.addUseRegion(regions)
.addAppTypeConfig(ColumnDef.AppUseType.GAME_LOCK_TYPE, 46800)
.build();
//
// LauncherManager.getInstance().addWorkMode(config);
// LauncherManager.getInstance().setCurrentWorkMode(ColumnDef.TimeManager.WORK_DAY);
LauncherManager.getInstance().addWorkMode(config);
LauncherManager.getInstance().setCurrentWorkMode(ColumnDef.TimeManager.WORK_DAY);
// handler.sendEmptyMessageDelayed(0, 15000);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment