IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 移动开发 -> 闹钟场景识别 -> 正文阅读

[移动开发]闹钟场景识别

闹钟场景识别

闹钟可以包含如下wakelock特征:

  1. 闹钟音乐分类
  2. flags为屏幕亮度相关
  3. tag包含音频类型
  4. 锁屏场景中存在亮屏时长与持锁(持音频或屏幕亮度特征的锁)时长的差值为2秒内的场景,可以判定为闹钟场景之一

1. 闹钟音乐分类

package_name	category
com.caynax.hourlychime	CLOCK
com.gau.go.launcherex.gowidget.clockwidget	CLOCK
com.xmei.notify	CLOCK
com.dadawh.alarm	CLOCK
com.mdbs.emome.calendar	CLOCK
com.kaoyancalendar	CLOCK
com.calendar.example	CLOCK
com.updrv.lifecalendar	CLOCK
com.scliang.bqcalendar	CLOCK
me.iweek.wannianli	CLOCK
com.smartisan.calendar	CLOCK
net.daum.android.solcalendar	CLOCK
com.example.wannianli16	CLOCK
info.androidx.lovelycalenf	CLOCK
com.lgl.calendar	CLOCK
com.youloft.calendar.almanac	CLOCK
com.crossmo.calendar	CLOCK
com.yunxi.calendar	CLOCK
jp.co.johospace.jorte	CLOCK
com.android.wallcal	CLOCK
com.exuan.ecalendar	CLOCK
com.missu.girlscalendar	CLOCK
cc.etouch.ecalendar	CLOCK
com.anydo.cal	CLOCK
com.bdj.calendar	CLOCK
com.cloud.calendar	CLOCK
com.gau.go.launcherex.gowidget.calendarwidget	CLOCK
com.example.t	CLOCK
com.womanlog	CLOCK
com.tyzhzxl.hongbaozs	CLOCK
com.donhoo.yical	CLOCK
com.love.idiary	CLOCK
com.pdswp.su.smartcalendar	CLOCK
com.wapu.calendar.app	CLOCK
com.buestc.wallet	CLOCK
org.ifate	CLOCK
com.period.tracker.lite	CLOCK
com.belllife.praywheelclient	CLOCK
net.android.wzdworks.magicday	CLOCK
info.kfsoft.calendar	CLOCK
gucdxj.apps.chineselunar	CLOCK
com.changmi.calendar	CLOCK
com.missu.plq	CLOCK
jp.co.cybird.apps.lifestyle.cal	CLOCK
com.ttrl.calendar	CLOCK
com.haibin.calendarviewproject	CLOCK
com.qingxing.eventcalendarpro	CLOCK
com.gucdxj.trhrwehtr	CLOCK
se.catharsis.android.calendar	CLOCK
com.doudoubird.calendar	CLOCK
com.haoxin.ri	CLOCK
org.withouthat.acalendar	CLOCK
com.xm.calendarxx	CLOCK
com.android.qidian.calendar	CLOCK
info.androidx.lovelyfcalenf	CLOCK
com.ymnet.calendar	CLOCK
me.iweek.fsofs	CLOCK
com.swan.swan	CLOCK
android.daniel.app.calendar	CLOCK
cn.com.vxia.vxia	CLOCK
com.shengliulaohuangli	CLOCK
com.android.bclearservice	CLOCK
com.jixiang.rili	CLOCK
com.hdhd.wannianli	CLOCK
com.jianzhi.calendar	CLOCK
com.nfbazi.LiuyaoDuangua	CLOCK
com.nfbazi.xuankong	CLOCK
com.gyk.foli	CLOCK
com.atnote.yearcalendar.activity	CLOCK
com.cyberlabo.android.dball	CLOCK
info.androidx.ladycalenf	CLOCK
com.yunqi.calendar	CLOCK
com.seccalqs.calendar	CLOCK
info.androidx.memocalenf	CLOCK
com.peterweissapps.adventcalendar	CLOCK
com.jinks.memorandum.activity	CLOCK
com.droid27.transparentclockweather	CLOCK
com.shuwei.almanacui	CLOCK
com.julangling.xsgjz	CLOCK
com.xiaoyu.yfl	CLOCK
agc.iClock	CLOCK
com.alarmclock.xtreme	CLOCK
rubberbigpepper.TranslucentClock	CLOCK
com.tmsoft.ledclock	CLOCK
com.alarmclockultra.free	CLOCK
ru.org.amip.ClockSync	CLOCK
com.nextdev.alarm	CLOCK
ch.bitspin.timely	CLOCK
com.chung.clock_nac191	CLOCK
in.vineetsirohi.customwidget	CLOCK
factory.widgets.SenseClockDark	CLOCK
com.sportstracklive.stopwatch	CLOCK
org.ntpsync	CLOCK
com.smartisan.clock	CLOCK
com.wangxue123.android	CLOCK
com.zesto.clockf	CLOCK
com.maapiid.typoclock	CLOCK
com.tsf.shell.widget.alarm	CLOCK
com.th.android.widget.gTabsimiClock	CLOCK
com.malangstudio.alarmmon	CLOCK
com.pybeta.daymatter	CLOCK
com.using.checktime	CLOCK
org.coolcode.stopwatch	CLOCK
factory.widgets.HeroNight	CLOCK
com.pxlartificer.minu	CLOCK
com.aob.android.cd	CLOCK
com.th.android.widget.SiMiClock	CLOCK
com.tomatodo	CLOCK
com.gtp.nextlauncher.widget.worldclockwidget	CLOCK
com.drandxq.desktopclock	CLOCK
com.geekyouup.android.ustopwatch	CLOCK
com.ntsoft.android.flashlightclock	CLOCK
com.eri.widget.binaryclock	CLOCK
wan.util.barclock	CLOCK
com.andronicus.ledclock	CLOCK
nl.tvoverbeek.taiclock	CLOCK
com.why.project.watchwidget	CLOCK
com.runtastic.android.sleepbetter.lite	CLOCK
com.buykee.beautyclock	CLOCK
com.splunchy.android.alarmclock	CLOCK
kuba.livewall.astroclock	CLOCK
com.glgjing.baymax	CLOCK
com.clockliveart.clockwithseconds	CLOCK
wan.pclock	CLOCK
com.androbeings.glowing.clock.locker.blue.free	CLOCK
com.bojankogoj.giantclock	CLOCK
com.lixiangdong.LCDWatch.Pro	CLOCK
com.Night.Digital.ClockNewLWE	CLOCK
upper.duper.widget.weather	CLOCK
yco.dclock	CLOCK
com.the7art.waterclock	CLOCK
cn.menue.nightclock	CLOCK
net.imoya.android.voiceclock.k	CLOCK
com.uniqlo.wakeup	CLOCK
com.alarmclock.xtreme.free	CLOCK
com.droid27.d3flipclockweather	CLOCK
com.timerqssmart.clock	CLOCK
com.stockholm.meow	CLOCK
c.widget.clock.normal	CLOCK
com.david.deskclock	CLOCK
com.style_7.digitalclocklivewallpaper_7	CLOCK
com.willy.moonberg.read.a.clock	CLOCK
jp.co.REIRI.tokeinokeisan	CLOCK
com.vm.android.clockwork.black2.lite	CLOCK
umi.clock	CLOCK
webrecord.ch.ptc	CLOCK
com.suncammi4.live	CLOCK
com.manzy.flashnotification	CLOCK
com.csym.sleepdetector	CLOCK
com.mengmeng.clock	CLOCK
com.shwnl.calendar	CLOCK
nl.jsource.retroclock.android	CLOCK
com.bti.soundMeter	CLOCK
com.android.deskclock	CLOCK

2. flags为屏幕亮度相关

    /**
     * PARTIAL_WAKE_LOCK = 0x00000001
     * SCREEN_DIM_WAKE_LOCK = 0x00000006
     * SCREEN_BRIGHT_WAKE_LOCK = 0x0000000a
     * FULL_WAKE_LOCK = 0x0000001a
     * PROXIMITY_SCREEN_OFF_WAKE_LOCK = 0x00000020
     * DOZE_WAKE_LOCK = 0x00000040
     * DRAW_WAKE_LOCK = 0x00000080
     * ACQUIRE_CAUSES_WAKEUP = 0x10000000
     * ON_AFTER_RELEASE = 0x20000000
     */
    private boolean isWindowBrightFlag(int flag) {
        if(0x2000000A == flag || 0x3000001A == flag || 0x10000001 == flag || 0x1000001A == flag || 0x1000000A == flag || 0x1000001 == flag) {
            return true;
        } else {
            return false;
        }
    }

3. tag包含音频类型

    /**
     * 处理Audio的持锁事件
     */
    private void handleAudioWakeLockAcquired(int flags, String tag, int uid, int pid) {
        HashMap hashMap;
        if ("AudioMix".equals(tag)) {
            hashMap = mActiveAudioMixWL;
            synchronized (hashMap) {
                mActiveAudioMixWL.put(uid, pid);
            }
        } else if ("AudioIn".equals(tag)) {
            hashMap = mActiveAudioInWL;
            synchronized (hashMap) {
                mActiveAudioInWL.put(uid, pid);
            }
        }
    }

4. 锁屏场景下持锁与亮屏的关系

锁屏场景中存在亮屏时长与持锁(持音频或屏幕亮度特征的锁)时长的差值为2秒内的场景,可以判定为闹钟场景之一

        private void clockAppIdentify() {
            if (Math.max(Math.max(mWbFlagTime, mAoTagTime), mScrOnTime) - Math.min(Math.min(mWbFlagTime, mAoTagTime), mScrOnTime) < 2000
                    && mIDeviceState.isKeyguardPresent()) {
                ArrayList<String> pkgList = mIAppManager.getPkgNameByUid(mContext, mUid);
                ArrayList<String> pkgScreenLockList = null;
                String frontPkg = mIScenario.getFrontPkg();
                if (frontPkg == null || !frontPkg.equals(mFrontPkgWhenScreenOff)) {
                    for (String pkgName : pkgList) {
                        for (String skipPkg : mFilterNotClocks) {
                            if (pkgName != null && pkgName.startsWith(skipPkg)) {
                                Log.i("DeviceMonitor", "not clock app:" + pkgName);
                                return;
                            }
                        }
                        if (pkgName == null || frontPkg == null || pkgName.startsWith(frontPkg)) {
                            if (pkgScreenLockList == null) {
                                pkgScreenLockList = mIAppType.getAppsByType(9);
                            }
                            if (pkgScreenLockList != null && pkgScreenLockList.contains(pkgName)) {
                                Log.i("DeviceMonitor", "not clock app, it is screen lock:" + pkgName);
                                mFilterNotClocks.add(pkgName);
                            } else if (mIAppType.getAppType(pkgName) == 11) {
                                Log.i("DeviceMonitor", "not clock app, it is im app:" + pkgName);
                                mFilterNotClocks.add(pkgName);
                            } else {
                                int appType = mIAppType.getAppType(pkgName);
                                if (appType != -1) {
                                    Log.i("DeviceMonitor", pkgName + " not unknown app,it has been set type as:" + appType);
                                } else {
                                    Message msg = mHandler.obtainMessage(200);
                                    msg.obj = pkgName;
                                    mHandler.sendMessageDelayed(msg, 3000);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
  移动开发 最新文章
Vue3装载axios和element-ui
android adb cmd
【xcode】Xcode常用快捷键与技巧
Android开发中的线程池使用
Java 和 Android 的 Base64
Android 测试文字编码格式
微信小程序支付
安卓权限记录
知乎之自动养号
【Android Jetpack】DataStore
上一篇文章      下一篇文章      查看所有文章
加:2022-04-23 10:58:30  更:2022-04-23 10:58:48 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/24 23:23:03-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码