summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjhenrique09 <jhenrique09.mcz@hotmail.com>2018-08-16 17:14:30 -0400
committeralk3pInjection <webmaster@raspii.tech>2022-05-02 09:56:20 +0800
commitbc14dfdb2397ef583213a319a7ef8fd8f9c8b286 (patch)
tree8e92c2acae6edc2ee4f84152f53072145650520e
parentb6f6fd1e59bf8b59e3eb35a4ad693ae66679b082 (diff)
BasebandVersionDialogController: Trim duplicated baseband if needed
Change-Id: Ife1cf4982672e7f5f3c631d80cdeac6350585938
-rw-r--r--src/com/android/settings/deviceinfo/firmwareversion/BasebandFormatter.java29
-rw-r--r--src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceController.java5
2 files changed, 32 insertions, 2 deletions
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/BasebandFormatter.java b/src/com/android/settings/deviceinfo/firmwareversion/BasebandFormatter.java
new file mode 100644
index 0000000000..9dca245d5f
--- /dev/null
+++ b/src/com/android/settings/deviceinfo/firmwareversion/BasebandFormatter.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2019 The PixelExperience Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.deviceinfo.firmwareversion;
+
+public class BasebandFormatter {
+ public static String getFormattedBaseband(String baseband){
+ if (baseband.contains(",")) {
+ String[] splitBaseband = baseband.split(",");
+ if (splitBaseband.length > 1 && splitBaseband[0].equals(splitBaseband[1])) {
+ baseband = splitBaseband[0];
+ }
+ }
+ return baseband;
+ }
+}
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceController.java b/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceController.java
index 1507ddc80b..bb0a8454e4 100644
--- a/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/firmwareversion/BasebandVersionPreferenceController.java
@@ -53,7 +53,8 @@ public class BasebandVersionPreferenceController extends BasePreferenceControlle
}
}
}
- return SystemProperties.get(BASEBAND_PROPERTY,
- mContext.getString(R.string.device_info_default));
+ return BasebandFormatter.getFormattedBaseband(
+ SystemProperties.get(BASEBAND_PROPERTY,
+ mContext.getString(R.string.device_info_default)));
}
}