Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbb2dd96 authored by Amit Mahajan's avatar Amit Mahajan Committed by Michele Berionne
Browse files

Change size of LocalLog to powers of 2.

LocalLog uses ArrayDeque which allocates memory in powers of 2.
So for example for size 10 it allocates 16.

Test: none
Bug: 162182393
Change-Id: I42679c3c096a1b6ee26d3e7817974eff09fcdf49
Merged-In: I42679c3c096a1b6ee26d3e7817974eff09fcdf49
(cherry picked from commit 1dad5967)
parent 9a11271e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -73,9 +73,9 @@ public class CarrierActionAgent extends Handler {
    private RegistrantList mRadioEnableRegistrants = new RegistrantList();
    private RegistrantList mDefaultNetworkReportRegistrants = new RegistrantList();
    /** local log for carrier actions */
    private LocalLog mMeteredApnEnabledLog = new LocalLog(10);
    private LocalLog mRadioEnabledLog = new LocalLog(10);
    private LocalLog mReportDefaultNetworkStatusLog = new LocalLog(10);
    private LocalLog mMeteredApnEnabledLog = new LocalLog(8);
    private LocalLog mRadioEnabledLog = new LocalLog(8);
    private LocalLog mReportDefaultNetworkStatusLog = new LocalLog(8);
    /** carrier actions */
    private Boolean mCarrierActionOnMeteredApnEnabled = true;
    private Boolean mCarrierActionOnRadioEnabled = true;
+1 −1
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ public class CarrierPrivilegesTracker extends Handler {
        mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
        mTelephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
        mPhone = phone;
        mLocalLog = new LocalLog(100);
        mLocalLog = new LocalLog(64);

        IntentFilter certFilter = new IntentFilter();
        certFilter.addAction(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ public class CarrierResolver extends Handler {
    private Context mContext;
    private Phone mPhone;
    private IccRecords mIccRecords;
    private final LocalLog mCarrierIdLocalLog = new LocalLog(20);
    private final LocalLog mCarrierIdLocalLog = new LocalLog(16);
    private final TelephonyManager mTelephonyMgr;

    private final ContentObserver mContentObserver = new ContentObserver(this) {
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public class CarrierSignalAgent extends Handler {
    private static final Map<String, String> COMPAT_ACTION_TO_NEW_MAP = NEW_ACTION_TO_COMPAT_MAP
            .entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey));

    private final LocalLog mErrorLocalLog = new LocalLog(20);
    private final LocalLog mErrorLocalLog = new LocalLog(16);

    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
        public void onReceive(Context context, Intent intent) {
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ public class CellBroadcastServiceManager {
    private Phone mPhone;
    private Context mContext;

    private final LocalLog mLocalLog = new LocalLog(100);
    private final LocalLog mLocalLog = new LocalLog(64);

    /** New SMS cell broadcast received as an AsyncResult. */
    private static final int EVENT_NEW_GSM_SMS_CB = 0;
Loading