dubai: camera: Disable N78 5G NSA band too

Per user report.

Change-Id: I8c47711299bae06638ca12adef06ea1ceef9f79e
This commit is contained in:
Adithya R 2023-10-02 08:27:25 +05:30 committed by Marc Bourgoin
parent b9046bddf1
commit 9b139ed94d
2 changed files with 11 additions and 9 deletions

View file

@ -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);
}
}

View file

@ -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