Commit 4e12ceca by 郑鹏

修复bug

parent e4b535bf
......@@ -103,7 +103,7 @@ ext {
GITHUB_REPO_PATH = "../../androidlibrary"
PUBLISH_GROUP_ID = 'cn.dankal.android'
PUBLISH_ARTIFACT_ID = 'launcher'
PUBLISH_VERSION = '1.4.4.6'
PUBLISH_VERSION = '1.4.4.8'
}
uploadArchives {
......
......@@ -366,11 +366,13 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
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");
......
......@@ -83,7 +83,7 @@ public class ListenerAppService extends Service {
private volatile long lastUseAppControlTimeStamp;
private boolean active = true;
private boolean active = true;
private InnerRecevier innerReceiver;
private ExecutorService executors;
......@@ -234,7 +234,7 @@ public class ListenerAppService extends Service {
super.onDestroy();
}
public class InnerRecevier extends BroadcastReceiver {
public class InnerRecevier extends BroadcastReceiver {
final String SYSTEM_DIALOG_REASON_KEY = "reason";
......@@ -392,7 +392,7 @@ public class ListenerAppService extends Service {
Log.i("launch_debug_show", "当前顶部包名" + topActivity + "****" + "当前应用包名" + context.getPackageName());
if (topActivity.equals(context.getPackageName())) {
if (topActivity.equals(context.getPackageName()) || "android".equals(topActivity)) {
return -1;
}
......@@ -426,7 +426,7 @@ public class ListenerAppService extends Service {
if (!LauncherManager.getInstance().isInterceptSystemSetting()) {//不拦截设置
return -1;
}
if (SystemUtils.isVIVO()){
if (SystemUtils.isVIVO()) {
//toLauncherPage(context);
registerReceiver(innerReceiver, intentFilter);
}
......
......@@ -108,6 +108,15 @@ public class PermissionOpenAccessiblityService extends AccessibilityService {
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();//获取当前屏幕所有节点
if (rowNode != null) {
......
......@@ -82,10 +82,15 @@ public abstract class BaseAutoGetPermission {
toast = null;
}
toast = new KToast(service.getApplicationContext());
LauncherManager.mKToast = toast;
if (!SystemUtils.isVIVO())
showToastLongTow("辅助权限设置已开启,请根据提示点击,\n如无提示请等稍等 或 手动返回权限设置页面");
}
public KToast getToast() {
return toast;
}
private boolean isFinish = false;
public int step;
......
......@@ -39,6 +39,7 @@ import com.android.launcher3.model.TimeConfig;
import com.android.launcher3.provider.DBManager;
import com.android.launcher3.provider.ManagerAppProvider;
import com.android.launcher3.util.ActivityUtil;
import com.android.launcher3.util.KToast;
import com.android.launcher3.util.Logger;
import com.android.launcher3.util.PermissionUtil;
import com.android.launcher3.util.Preconditions;
......@@ -88,6 +89,8 @@ public class LauncherManager {
public static CustomDialog mCustomDialog;
public static int mStartSendCount = 0;
public static KToast mKToast;
private final LauncherProvider.ChangeListenerWrapper mListenerWrapper = new LauncherProvider.ChangeListenerWrapper();
private Handler mListenerHandler;
......@@ -764,6 +767,7 @@ public class LauncherManager {
* 判断以前设置的强制锁屏是否过期
*/
public synchronized boolean updateLockScreenDelay() {
Log.i("lock_zzzzzzzz","1");
// 退出管制
if (getExitState()) {
unlockScreen();
......@@ -773,24 +777,29 @@ public class LauncherManager {
return true;
}
if (timeModeManager.getLockScreenType() == ColumnDef.LockScreen.MODE_FORCE_LOCK || timeModeManager.getLockScreenType() == ColumnDef.LockScreen.MODE_REST) {
Log.i("lock_zzzzzzzz","2");
//判断之前是否有忽略工作模式去锁屏
long endTime = timeModeManager.getLockScreenEndTime();
Logger.e(TAG, "updateLockScreen\t" + endTime + "\t" + System.currentTimeMillis());
if (endTime == 0 || endTime > System.currentTimeMillis()) {
// 无限期已家长端临时设定的模式执行锁屏
Log.i("lock_zzzzzzzz","3");
// if (lockScreenMode != timeModeManager.getLockScreenType()) {
lockScreen(getContext(), ColumnDef.LockScreen.MODE_FORCE_LOCK);
return true;
// }
} else if (endTime < System.currentTimeMillis()) {
Log.i("lock_zzzzzzzz","4");
// 非家长端强制锁定状态或者锁定时间到期 恢复当前工作模式下的锁屏方式
Logger.e(TAG, lockScreenMode + "\t" + timeModeManager.getCurrentScreenModel());
if (timeModeManager.getCurrentScreenModel() != ColumnDef.LockScreen.MODE_NORMAL && timeModeManager.getCurrentScreenModel() != ColumnDef.LockScreen.MODE_UNLOCK) {
Logger.e(TAG, "lockScreen");
lockScreen(getContext(), timeModeManager.getCurrentScreenModel());
Log.i("lock_zzzzzzzz","5");
return true;
} else {
unlockScreen();
......@@ -799,6 +808,8 @@ public class LauncherManager {
}
} else {
Log.i("lock_zzzzzzzz","6");
// //判断工作模式去锁屏
Logger.e(TAG, "inTimeRegionTolockScreen");
if (!timeModeManager.inTimeRegionTolockScreen()) {
......@@ -926,7 +937,7 @@ public class LauncherManager {
intent.setComponent(cn);
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);
Uri uri = Uri.parse("com.dankal.dankal_launcher.PackageManageActivity");*/
......
......@@ -364,8 +364,8 @@ public class PermissionUtil {
boolean enableAdb = (Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.ADB_ENABLED, 0) > 0);
Logger.e(TAG, "enAbleADB\t" + enableAdb);
return enableAdb;
//return false;
//return enableAdb;
return false;
}
......@@ -584,7 +584,7 @@ public class PermissionUtil {
return true;
}
}
return isDefault || SystemUtils.isMIUI() || SystemUtils.isOPPO() || SystemUtils.isHW() || SystemUtils.isVIVO();
return isDefault || SystemUtils.isMIUI() || SystemUtils.isOPPO() || SystemUtils.isHW() || SystemUtils.isVIVO() || SystemUtils.isSAMSUNG();
}
/**
......
......@@ -191,8 +191,8 @@ public class PackageManageActivity extends Activity {
tvRemove.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ManagementInfo managementInfo = new ManagementInfo();
//
// com.huawei.appmarket
// managementInfo.setUseEndTimeStamp(30);
//
// managementInfo.setPackageName("com.cubic.autohome");
......@@ -201,15 +201,23 @@ public class PackageManageActivity extends Activity {
//
// LauncherManager.getInstance().addPackageInfo(managementInfo);
ManagementInfo managementInfo = new ManagementInfo();
managementInfo.setUseEndTimeStamp(3600);
managementInfo.setPackageName("com.tencent.android.qqdownloader");
managementInfo.setPackageName("cn.dankal.www.tudigong_partner");
managementInfo.setLock(ColumnDef.LockApp.UNLOCKED);
managementInfo.setUseType(ColumnDef.AppUseType.SAFE_TYPE);
LauncherManager.getInstance().addPackageInfo(managementInfo);
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());
......@@ -321,13 +329,13 @@ public class PackageManageActivity extends Activity {
List<Long> regions = new ArrayList<>();
regions.add(Long.valueOf(0 * 3600));
regions.add(Long.valueOf(13 * 3600));
regions.add(Long.valueOf(12 * 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(15 * 3600));
regions.add(Long.valueOf(24 * 3600));
regions.add(Long.valueOf(16 * 3600));
regions.add(Long.valueOf(19 * 3600 ));
TimeConfig config = new TimeConfig.Builder(ColumnDef.TimeManager.WORK_DAY)
.lockScreenMode(ColumnDef.LockScreen.MODE_REST)
......
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