开发者选项 选择日志级别 这个是个小米miui特有的选项,aosp里搜了下好像没有
"Developer options" "Select log level"
https://github.com/ingbrzy/Xiaomi.eu-MIUIv10-XML-Compare/blob/master/sakura/Settings.apk/res/values/strings.xml
https://github.com/ingbrzy/Xiaomi.eu-MIUIv11-XML-Compare/blob/master/davinci_stable/Settings.apk/res/values/arrays.xml
<string-array name="select_logd_system_levels">
<item>Off</item>
<item>Error</item>
<item>Warn</item>
<item>Info</item>
<item>Debug</item>
<item>Verbose</item>
</string-array>
<!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->
<string name="select_logd_size_dialog_title">Select Logger sizes per log buffer</string>
https://www.apkmirror.com/apk/xiaomi-inc/settings-3/settings-3-10-release/settings-10-3-android-apk-download/
用mt逆向分析了一下设置apk
//
// Decompiled by Jadx - 706ms
//
package com.android.settings.development;
import android.content.Context;
import android.os.SystemProperties;
import android.text.TextUtils;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import com.android.settingslib.development.d;
import com.android.settingslib.miuisettings.preference.miuix.DropDownPreference;
import miui.os.Build;
public class Ma extends d implements Preference.b {
private DropDownPreference TEc;
public Ma(Context context) {
super(context);
}
private void Ta(Object obj) {
if (obj == null) {
return;
}
String str = SystemProperties.get("persist.logd.limit", "");
String obj2 = obj.toString();
if (TextUtils.equals(str, obj2)) {
return;
}
SystemProperties.set("persist.logd.limit", obj2);
SystemProperties.set("ctl.start", "logd-reinit");
tAa();
}
private void tAa() {
if (this.TEc != null) {
String str = SystemProperties.get("persist.logd.limit", "");
if (TextUtils.isEmpty(str)) {
str = Build.IS_STABLE_VERSION ? "Warn" : "Info";
}
this.TEc.setValue(str);
this.TEc.setSummary(str);
this.TEc.setOnPreferenceChangeListener(this);
}
}
public void displayPreference(PreferenceScreen preferenceScreen) {
super.displayPreference(preferenceScreen);
this.TEc = preferenceScreen.findPreference("select_logd_system_level");
}
public String getPreferenceKey() {
return "select_logd_system_level";
}
public boolean onPreferenceChange(Preference preference, Object obj) {
Ta(obj);
return true;
}
public void updateState(Preference preference) {
super/*com.android.settingslib.d.a*/.updateState(preference);
tAa();
}
}
看代码大概意思就是设置了persist.logd.limit这个东西。但是我搜了搜没搜到什么关于这个的结果。
(根据一些搜索结果推测,这可能是小米特有的一个prop)
https://android.googlesource.com/platform/system/core/+/brillo-m8-dev/logd/README.property