Initial commit for Android 10, syncing up to v201
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
From 014a893a2872fb067c83a866d39ef1c4da70aaff Mon Sep 17 00:00:00 2001
|
||||
From: Artem Borisov <dedsa2002@gmail.com>
|
||||
Date: Wed, 19 Sep 2018 17:02:06 +0300
|
||||
Subject: [PATCH 1/3] Telephony: Support muting by RIL command
|
||||
|
||||
While almost everyone already moved to AudioManager years ago,
|
||||
some OEMs (cough Huawei) still use RIL for muting and don't
|
||||
promote the necessary calls in their audio HAL.
|
||||
Let's handle these odd cases too when it's necessary.
|
||||
|
||||
Change-Id: Id916dec2574d6e57b6f809fbaf2b0959c0cc7256
|
||||
---
|
||||
src/com/android/services/telephony/TelephonyConnection.java | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
|
||||
index 7bb6b7d55..18e078fe3 100644
|
||||
--- a/src/com/android/services/telephony/TelephonyConnection.java
|
||||
+++ b/src/com/android/services/telephony/TelephonyConnection.java
|
||||
@@ -25,6 +25,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.PersistableBundle;
|
||||
+import android.os.SystemProperties;
|
||||
import android.telecom.CallAudioState;
|
||||
import android.telecom.ConferenceParticipant;
|
||||
import android.telecom.Connection;
|
||||
@@ -736,6 +737,10 @@ abstract class TelephonyConnection extends Connection implements Holdable {
|
||||
// TODO: update TTY mode.
|
||||
if (getPhone() != null) {
|
||||
getPhone().setEchoSuppressionEnabled();
|
||||
+
|
||||
+ if (SystemProperties.getBoolean("persist.sys.radio.huawei", false)) {
|
||||
+ getPhone().setMute(audioState.isMuted());
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
From 7c9e1ac4204748173e182c353f2c5b5c45ac1cdb Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 6 May 2019 20:25:34 +0200
|
||||
Subject: [PATCH 2/3] Fixes crash when selecting network
|
||||
|
||||
Cf https://github.com/phhusson/treble_experimentations/issues/486
|
||||
---
|
||||
src/com/android/phone/NetworkQueryService.java | 14 +++++++++++---
|
||||
1 file changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/com/android/phone/NetworkQueryService.java b/src/com/android/phone/NetworkQueryService.java
|
||||
index e67582fa3..c622713e8 100644
|
||||
--- a/src/com/android/phone/NetworkQueryService.java
|
||||
+++ b/src/com/android/phone/NetworkQueryService.java
|
||||
@@ -43,6 +43,8 @@ import com.android.settingslib.utils.ThreadUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
+import java.util.regex.Matcher;
|
||||
+import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Service code used to assist in querying the network for service
|
||||
@@ -377,14 +379,20 @@ public class NetworkQueryService extends Service {
|
||||
*/
|
||||
private List<CellInfo> getCellInfoList(List<OperatorInfo> operatorInfoList) {
|
||||
List<CellInfo> cellInfoList = new ArrayList<>();
|
||||
+ Pattern p = Pattern.compile("^([0-9]{5,6}).*");
|
||||
for (OperatorInfo oi: operatorInfoList) {
|
||||
String operatorNumeric = oi.getOperatorNumeric();
|
||||
String mcc = null;
|
||||
String mnc = null;
|
||||
log("operatorNumeric: " + operatorNumeric);
|
||||
- if (operatorNumeric != null && operatorNumeric.matches("^[0-9]{5,6}$")) {
|
||||
- mcc = operatorNumeric.substring(0, 3);
|
||||
- mnc = operatorNumeric.substring(3);
|
||||
+ if (operatorNumeric != null) {
|
||||
+ Matcher m = p.matcher(operatorNumeric);
|
||||
+ if (m.matches()) {
|
||||
+ mcc = m.group(1).substring(0, 3);
|
||||
+ mnc = m.group(1).substring(3);
|
||||
+ } else {
|
||||
+ Log.e(LOG_TAG, "Failed to parse operatorNumeric!");
|
||||
+ }
|
||||
}
|
||||
CellIdentityGsm cig = new CellIdentityGsm(
|
||||
Integer.MAX_VALUE /* lac */,
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 0c7e103fd7c8d50322057a1f0fe852de9df0a029 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 20 May 2019 23:45:56 +0200
|
||||
Subject: [PATCH 3/3] Fail gracefully in mobile settings
|
||||
|
||||
---
|
||||
src/com/android/phone/DataUsagePreference.java | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/com/android/phone/DataUsagePreference.java b/src/com/android/phone/DataUsagePreference.java
|
||||
index b6b26e2b8..ebd446dfa 100644
|
||||
--- a/src/com/android/phone/DataUsagePreference.java
|
||||
+++ b/src/com/android/phone/DataUsagePreference.java
|
||||
@@ -54,8 +54,12 @@ public class DataUsagePreference extends Preference {
|
||||
DataUsageController controller = new DataUsageController(activity);
|
||||
|
||||
DataUsageController.DataUsageInfo usageInfo = controller.getDataUsageInfo(mTemplate);
|
||||
- setSummary(activity.getString(R.string.data_usage_template,
|
||||
- Formatter.formatFileSize(activity, usageInfo.usageLevel), usageInfo.period));
|
||||
+ if(usageInfo != null) {
|
||||
+ setSummary(activity.getString(R.string.data_usage_template,
|
||||
+ Formatter.formatFileSize(activity, usageInfo.usageLevel), usageInfo.period));
|
||||
+ } else {
|
||||
+ setSummary(activity.getString(R.string.data_usage_title));
|
||||
+ }
|
||||
setIntent(getIntent());
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
Reference in New Issue
Block a user