1、问题截图
2、secure start-up界面流程简述
packages\apps\Settings\src\com\android\settings\CryptKeeper.java
passwordEntryInit()
mPasswordEntry = (ImeAwareEditText) findViewById(R.id.passwordEntry);
这里就是那个pin码输入框对应的对象初始化。
mPasswordEntry.scheduleShowSoftInput();
这里是passwordEntryInit 初始化时调出输入框,这应该是第一次闪现的那一次调出输入框
3、点击输入pin 码框调出输入法代码
frameworks\base\core\java\android\widget\TextView.java
public boolean onTouchEvent(MotionEvent event) {
if (touchIsFinished && (isTextEditable() || textIsSelectable)) {
// Show the IME, except when selecting in read-only text.
final InputMethodManager imm = InputMethodManager.peekInstance();
viewClicked(imm);
if (isTextEditable() && mEditor.mShowSoftInputOnFocus && imm != null) {
imm.showSoftInput(this, 0);
}
现在出现点击pin 码框无法调出输入法界面,应该与这个位置条件不满足有关系。
4、看截图虚拟导航返回键是显示的
点击虚拟导航键事件SystemUI\src\com\android\systemui\statusbar\policy\KeyButtonView.java
KeyButtonView.onTouchEvent
KeyButtonView.sendEvent 会隐藏导航键及虚拟键盘
5、没设置那个secure starp-up 界面
08-01 03:14:41.829 1954 1954 D CryptKeeper: onCreate()
08-01 03:14:41.830 1954 1954 D CryptKeeper: Disabling component ComponentInfo{com.android.settings/com.android.settings.CryptKeeper}
08-01 03:14:45.165 1954 1954 D CryptKeeper: onDestroy()
6、分析
使用userdebug 版本
adb wait-for-device shell ps -A | findstr input
发现com.google.android.inputmethod.latin 在刚进入secure start-up 界面存在,一会儿不存在,界面输入法也消失了,过了一段时间com.google.android.inputmethod.latin出现了,点击也可以调出输入法界面,而且pid 也是变化的,由此可以知道是输入法被杀掉了。
08-01 03:30:24.494 978 1157 D: setComponentEnabledSetting:packageName = com.google.android.inputmethod.latin,className = com.google.android.apps.inputmethod.libs.framework.core.LauncherActivity,newState = 2
//被disable了
08-01 03:30:24.509 978 1027 I ActivityManager: Killing 1131:com.google.android.inputmethod.latin/u0a8 (adj 100): change com.google.android.inputmethod.latin
//这里说明输入法被杀掉了,由于ACTION_PACKAGE_CHANGED 广播。
对用堆栈:
frameworks\base\services\core\java\com\android\server\am\ActivityManagerService.java
broadcastIntentLocked( )=》
case Intent.ACTION_PACKAGE_REMOVED:
case Intent.ACTION_PACKAGE_CHANGED:
=》
final boolean killProcess =
!intent.getBooleanExtra(Intent.EXTRA_DONT_KILL_APP, false);
if (killProcess) {
killPackageProcessesLocked(ssp,UserHandle.getAppId( intent.getIntExtra(Intent.EXTRA_UID, -1)),
userId, ProcessList.INVALID_ADJ,
false, true, true, false, "change " + ssp);
}
=》removeProcessLocked=》
app.kill(reason, true);
=》
frameworks\base\services\core\java\com\android\server\am\ProcessRecord.java
void kill(String reason, boolean noisy) {
6、加log定位谁disable 了组件
versionCode=26720941 minSdk=27 targetSdk=27
versionName=7.2.9.197069278-lite_release-armeabi-v7a
disabledComponents:
com.google.android.apps.inputmethod.libs.framework.core.LauncherActivity
LatinImeGoogleGo.apk
7、输入法界面点击确认调用的函数CryptKeeper.java
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
new DecryptTask().execute(password);
}