Android8.0 开机后,进入锁屏界面会闪黑一下解决

After the phone power on , the screen will be black about 1s,then appear lockscreen
开机后,进入锁屏界面会闪黑一下,谷歌机器没有出现这个问题


1、此问题需要AMS/WMS的log才能继续分析,需按照如下方式打开AMS/WMS的debug开关:
adb shell dumpsys activity log x on
adb shell dumpsys window -d enable a
此命令只对当前次开机有效,关机或者重启失效,需要重新执行。
如果不能执行AMS/WMS的debug命令,请将ActivityManagerDebugConfig.java和WindowManagerDebugConfig.java的DEBUG_XXXX以及SHOW_XXXX全部设置成true,然后build。

2、录制视频请参考以下的方式录制:
adb shell screenrecord --bugreport /sdcard/filename.mp4
adb pull /sdcard/filename.mp4

3.请先按照第2步的方法修改代码,若还是复现,则按照第1步的方法打开debug开关
1).将Wallpaper相关的debug开关打开,将DEBUG设置为true
/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/ImageWallpaper.java
/frameworks/base/core/java/android/service/wallpaper/WallpaperService.java
/frameworks/base/core/java/com/android/internal/view/BaseSurfaceHolder.java
/frameworks/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java

如何打开WMS debug开关请参考:[FAQ18375]分析windowManagerService相关的问题,需要提交哪些log给MTK?
访问FAQ的网站是http://online.mediatek.inc/_layouts/15/mol/ui/ext/home.aspx2).请贵司将如下方法的异步改为同步进行测试(目的是将异步改为同步,如果编译过程中出现异常,还请贵司看一下源代码修改一下)

/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/ImageWallpaper.java
private void loadWallpaper(boolean needsDraw, boolean needsReset) {
    mNeedsDrawAfterLoadingWallpaper |= needsDraw;
    if(!loadWallpaperPending){
        loadWallpaperPending = true;
        mBackground = null;
        mBackgroundWidth = -1;
        mBackgroundHeight = -1;
        Bitmap bt = null;
        Throwable exception = null;
        try {
        if (needsReset) {
            mWallpaperManager.forgetLoadedWallpaper();
        }
        bt = mWallpaperManager.getBitmap();
        } catch (RuntimeException | OutOfMemoryError e) {
            exception = e;
        }
        if (exception != null) {
        // Note that if we do fail at this, and the default wallpaper can't
        // be loaded, we will go into a cycle. Don't do a build where the
        // default wallpaper can't be loaded.
        Log.w(TAG, "Unable to load wallpaper!", exception);
        try {
            mWallpaperManager.clear();
        } catch (IOException ex) {
            // now we're really screwed.
            Log.w(TAG, "Unable reset to default wallpaper!", ex);
        }
        try {
            bt = mWallpaperManager.getBitmap();
        } catch (RuntimeException | OutOfMemoryError e) {
            Log.w(TAG, "Unable to load default wallpaper!", e);
        }
    }
    if (bt != null) {
        mBackground = bt;
        mBackgroundWidth = mBackground.getWidth();
        mBackgroundHeight = mBackground.getHeight();
    }
    loadWallpaperPending = false;

    if (DEBUG) {
        Log.d(TAG, "Wallpaper loaded: " + mBackground);
    }
    updateSurfaceSize(getSurfaceHolder(), getDefaultDisplayInfo(),
    false /* forDraw */);
    if (needsDraw) {
        drawFrame();
    }
    }else{
        if (DEBUG) {
            Log.d(TAG, "Skipping loadWallpaper, already in flight ");
        }
        return;
    }
}

希望对你有所帮助~

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值