Settings: Change kernel preference behavior

Before you could only click once to see the full kernel version and if
you wanted it to go back to the short version, you had to exit the fragment.

Now you can click between the two (short and long).

Change-Id: I6f89d6b145d5cc7b9cca6febc3651904b98da80c
Signed-off-by: Joey Huab <joey@evolution-x.org>
This commit is contained in:
Alex
2018-07-05 16:54:29 -05:00
committed by Joey
parent 1c07f1725a
commit ce4586c514

View File

@@ -34,6 +34,7 @@ public class KernelVersionPreferenceController extends BasePreferenceController
private static final String KEY_KERNEL_VERSION = "kernel_version";
private static final String FILENAME_PROC_VERSION = "/proc/version";
private static final String LOG_TAG = "KernelVersionPreferenceController";
private boolean fullKernelVersion = false;
public KernelVersionPreferenceController(Context context, String preferenceKey) {
super(context, preferenceKey);
@@ -59,7 +60,13 @@ public class KernelVersionPreferenceController extends BasePreferenceController
if (!TextUtils.equals(preference.getKey(), KEY_KERNEL_VERSION)) {
return false;
}
if(fullKernelVersion) {
preference.setSummary(DeviceInfoUtils.getFormattedKernelVersion(mContext));
fullKernelVersion = false;
} else {
preference.setSummary(getFullKernelVersion());
fullKernelVersion = true;
}
return false;
}