From 9b139ed94d1df660b578c5c09eaf66aac72cb8bb Mon Sep 17 00:00:00 2001 From: Adithya R Date: Mon, 2 Oct 2023 08:27:25 +0530 Subject: [PATCH] dubai: camera: Disable N78 5G NSA band too Per user report. Change-Id: I8c47711299bae06638ca12adef06ea1ceef9f79e --- .../dubaicameraservice/DubaiCameraService.java | 14 +++++++------- .../arrow/dubaicameraservice/QcRilMsgUtils.java | 6 ++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/camera/src/com/arrow/dubaicameraservice/DubaiCameraService.java b/camera/src/com/arrow/dubaicameraservice/DubaiCameraService.java index be94862..63c2790 100644 --- a/camera/src/com/arrow/dubaicameraservice/DubaiCameraService.java +++ b/camera/src/com/arrow/dubaicameraservice/DubaiCameraService.java @@ -32,7 +32,7 @@ public class DubaiCameraService extends Service { private static final String TAG = "DubaiCameraService"; private static final String FRONT_CAMERA_ID = "1"; - private static final int OFFENDING_NR_SA_BAND = 78; + private static final int OFFENDING_NR_BAND = 78; private CameraManager mCameraManager; private SubscriptionManager mSubManager; @@ -141,13 +141,13 @@ public class DubaiCameraService extends Service { dlog("update5gState: Invalid subid or no active subs!"); return; } - if (mQcRilMsgUtils.setNrSaBandEnabled(mSubManager.getPhoneId(mDefaultDataSubId), - OFFENDING_NR_SA_BAND, !mIsFrontCamInUse)) { - Log.i(TAG, (mIsFrontCamInUse ? "Disabled" : "Enabled") + " NR SA band " - + OFFENDING_NR_SA_BAND + " for subId " + mDefaultDataSubId); + if (mQcRilMsgUtils.setNrBandEnabled(mSubManager.getPhoneId(mDefaultDataSubId), + OFFENDING_NR_BAND, !mIsFrontCamInUse)) { + Log.i(TAG, (mIsFrontCamInUse ? "Disabled" : "Enabled") + " NR band " + + OFFENDING_NR_BAND + " for subId " + mDefaultDataSubId); } else { - Log.e(TAG, "Failed to " + (mIsFrontCamInUse ? "disable" : "enable") + " NR SA band " - + OFFENDING_NR_SA_BAND + " for subId " + mDefaultDataSubId); + Log.e(TAG, "Failed to " + (mIsFrontCamInUse ? "disable" : "enable") + " NR band " + + OFFENDING_NR_BAND + " for subId " + mDefaultDataSubId); } } diff --git a/camera/src/com/arrow/dubaicameraservice/QcRilMsgUtils.java b/camera/src/com/arrow/dubaicameraservice/QcRilMsgUtils.java index c61594c..0db509c 100644 --- a/camera/src/com/arrow/dubaicameraservice/QcRilMsgUtils.java +++ b/camera/src/com/arrow/dubaicameraservice/QcRilMsgUtils.java @@ -56,7 +56,7 @@ public class QcRilMsgUtils { } /* TODO: split this function */ - protected boolean setNrSaBandEnabled(int phoneId, int band, boolean enabled) { + protected boolean setNrBandEnabled(int phoneId, int band, boolean enabled) { if (mService == null) { Log.e(TAG, "setNrSaBandEnabled: mService is null!"); return false; @@ -91,7 +91,7 @@ public class QcRilMsgUtils { } long[] nrNsaConfigs = new long[NR_CONFIG_LENGTH]; for (int i = 0; i < NR_CONFIG_LENGTH; i++) { - nrSaConfigs[i] = buf.getLong(); + nrNsaConfigs[i] = buf.getLong(); } // modify band config @@ -99,8 +99,10 @@ public class QcRilMsgUtils { int col = (band - 1) % 64; if (enabled) { nrSaConfigs[row] |= (1 << col); + nrNsaConfigs[row] |= (1 << col); } else { nrSaConfigs[row] &= ~(1 << col); + nrNsaConfigs[row] &= ~(1 << col); } // set band config