android 9.0 恢复出厂设置后没有显示锁屏界面

问题描述:恢复出厂设置开机后有个白色界面闪现,并且没有显示锁屏界面
抓取恢复出厂设置开机log和正常开机的log对比

Line 20371: 08-12 01:29:10.946  1240  1240 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.android.settings/.CryptKeeper} from uid 0
Line 20747: 08-12 01:29:11.818  1240  2993 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.android.settings/.FallbackHome} from uid 0
Line 24471: 08-12 01:29:20.311  1240  2940 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.android.provision/.DefaultActivity} from uid 0
Line 25053: 08-12 01:29:21.736  1240  1348 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.android.launcher3/.Launcher} from uid 0
   		 ...
Line 20541: 08-12 01:29:11.357  2862  2862 D KeyguardUpdateMonitor: mDeviceProvisioned is:false
Line 20543: 08-12 01:29:11.372  2862  2862 D KeyguardUpdateMonitor: initMembers() - NumOfPhone=2
Line 20563: 08-12 01:29:11.433  2862  2862 V KeyguardUpdateMonitor: startListeningForFingerprint()
Line 20565: 08-12 01:29:11.453  2862  2862 D KeyguardUpdateMonitor: isDeviceProvisioned get DEVICE_PROVISIONED from db again !!   
  		 ...
Line 22197: 08-12 01:29:14.756  2862  2862 D KeyguardViewMediator: adjustStatusBarLocked: mShowing=false mOccluded=false isSecure=false force=false --> flags=0x0
Line 22254: 08-12 01:29:15.060  2862  3099 D KeyguardViewMediator: onStartedWakingUp, seq = 1
Line 22255: 08-12 01:29:15.061  2862  3099 D KeyguardViewMediator: notifyStartedWakingUp
Line 22256: 08-12 01:29:15.061  2862  3099 D KeyguardViewMediator: notifyScreenOn
Line 22257: 08-12 01:29:15.065  2862  3099 D KeyguardViewMediator: notifyScreenTurnedOn
Line 22258: 08-12 01:29:15.068  2862  3241 D KeyguardViewMediator: onBootCompleted() is called   
 		  ...
Line 22567: 08-12 01:29:16.515  2862  2862 D KeyguardViewMediator: onSystemReady
Line 22568: 08-12 01:29:16.516  2862  2862 D KeyguardViewMediator: lockedOrMissing is false, requireSim=false, antiTheftLocked=false
Line 22569: 08-12 01:29:16.516  2862  2862 D KeyguardUpdateMonitor: isDeviceProvisioned get DEVICE_PROVISIONED from db again !!
Line 22570: 08-12 01:29:16.517  2862  2862 D KeyguardViewMediator: doKeyguard: not showing because device isn't provisioned and the sim is not locked or missing   
  • 正常开机的log
Line 7555: 08-12 02:35:42.800  1043  1043 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.android.settings/.FallbackHome} from uid 0
Line 11588: 08-12 02:35:52.266  1043  1057 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.android.launcher3/.Launcher} from uid 0
		...
Line 7974: 08-12 02:35:44.063  1273  1273 D KeyguardUpdateMonitor: mDeviceProvisioned is:true
Line 7975: 08-12 02:35:44.068  1273  1273 D KeyguardUpdateMonitor: initMembers() - NumOfPhone=2
Line 7991: 08-12 02:35:44.103  1273  1273 V KeyguardUpdateMonitor: startListeningForFingerprint()
	   ...
Line 9906: 08-12 02:35:47.652  1273  1273 D KeyguardViewMediator: adjustStatusBarLocked: mShowing=true mOccluded=false isSecure=false force=false --> flags=0x1200000
Line 10011: 08-12 02:35:47.970  1273  1328 D KeyguardViewMediator: onStartedWakingUp, seq = 1
Line 10012: 08-12 02:35:47.970  1273  1328 D KeyguardViewMediator: notifyStartedWakingUp
Line 10013: 08-12 02:35:47.971  1273  1328 D KeyguardViewMediator: notifyScreenOn
Line 10014: 08-12 02:35:47.972  1273  1328 D KeyguardViewMediator: notifyScreenTurnedOn
Line 10015: 08-12 02:35:47.972  1273  1328 D KeyguardViewMediator: onBootCompleted() is called	   
	   ...
Line 10548: 08-12 02:35:49.575  1273  1273 D KeyguardViewMediator: onSystemReady
Line 10549: 08-12 02:35:49.576  1273  1273 D KeyguardViewMediator: lockedOrMissing is false, requireSim=false, antiTheftLocked=false
Line 10550: 08-12 02:35:49.583  1273  1273 D KeyguardViewMediator: doKeyguard: showing the lock screen
Line 10551: 08-12 02:35:49.583  1273  1273 D KeyguardViewMediator: showLocked	

可以看出,mDeviceProvisioned 的值不同,因此KeyguardViewMediator.java中的处理也不同。

  • 源码位置:SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
private void doKeyguardLocked(Bundle options) {
		...
	 if (!lockedOrMissing && shouldWaitForProvisioning() && !antiTheftLocked) {
         if (DEBUG) Log.d(TAG, "doKeyguard: not showing because device isn't provisioned"
                  + " and the sim is not locked or missing");
         return;
     }	
     	...
}
		...
private boolean shouldWaitForProvisioning() {
     return !mUpdateMonitor.isDeviceProvisioned() && !isSecure();
}
  • 源码位置:SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
public boolean isDeviceProvisioned() {
    if (mDeviceProvisioned == false) {
        Log.d(TAG, "isDeviceProvisioned get DEVICE_PROVISIONED from db again !!");
        return (0 != Settings.Global.getInt(
                mContext.getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 0));
    } else {
        return mDeviceProvisioned;
    }
}
		...
mDeviceProvisioned = isDeviceProvisionedInSettingsDb();
		...
private boolean isDeviceProvisionedInSettingsDb() {
    return Settings.Global.getInt(mContext.getContentResolver(),
               Settings.Global.DEVICE_PROVISIONED, 0) != 0;
}

DefaultActivity.java中

  Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
  Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1);
  只设置这两个属性后就finish了,没有最其他操作,闪现白色界面就是启动这个了

最后处理,去掉DefaultActivity.java所在应用,将这两个设置添加到FallbackHome.java中。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值