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

Commit b4d309e6 authored by Youngtae Cha's avatar Youngtae Cha Committed by Android (Google) Code Review
Browse files

Merge "Support satellite config version for metrics" into main

parents d59b5d8e bf9b2877
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -727,6 +727,7 @@ message SatelliteController {
    optional int32 count_of_p2p_sms_available_notification_shown = 34;
    optional int32 count_of_p2p_sms_available_notification_removed = 35;
    optional bool is_ntn_only_carrier = 36;
    optional int32 version_of_satellite_access_config = 37;
}

message SatelliteSession {
+2 −1
Original line number Diff line number Diff line
@@ -1484,7 +1484,8 @@ public class MetricsCollector implements StatsManager.StatsPullAtomCallback {
                satelliteController.countOfFailedLocationQueries,
                satelliteController.countOfP2PSmsAvailableNotificationShown,
                satelliteController.countOfP2PSmsAvailableNotificationRemoved,
                satelliteController.isNtnOnlyCarrier);
                satelliteController.isNtnOnlyCarrier,
                satelliteController.versionOfSatelliteAccessConfig);
    }

    private static StatsEvent buildStatsEvent(SatelliteSession satelliteSession) {
+1 −0
Original line number Diff line number Diff line
@@ -785,6 +785,7 @@ public class PersistAtomsStorage {
            existingStats.countOfP2PSmsAvailableNotificationRemoved
                    += stats.countOfP2PSmsAvailableNotificationRemoved;
            // Does not update isNtnOnlyCarrier due to it is a dimension field.
            existingStats.versionOfSatelliteAccessConfig = stats.versionOfSatelliteAccessConfig;
        } else {
            mAtoms.satelliteController = insertAtRandomPlace(mAtoms.satelliteController, stats,
                    mMaxNumSatelliteStats);
+23 −2
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ public class SatelliteStats {
        private final int mCountOfP2PSmsAvailableNotificationShown;
        private final int mCountOfP2PSmsAvailableNotificationRemoved;
        private static boolean sIsNtnOnlyCarrier;
        private static int sVersionOfSatelliteAccessConfig;

        private SatelliteControllerParams(Builder builder) {
            this.mCountOfSatelliteServiceEnablementsSuccess =
@@ -170,10 +171,15 @@ public class SatelliteStats {
            this.mCountOfP2PSmsAvailableNotificationRemoved =
                    builder.mCountOfP2PSmsAvailableNotificationRemoved;

            // Carrier ID value should be updated only when it is meaningful.
            // Ntn only carrier value should be updated only when it is meaningful.
            if (builder.mIsNtnOnlyCarrier.isPresent()) {
                this.sIsNtnOnlyCarrier = builder.mIsNtnOnlyCarrier.get();
            }
            // version satellite access config value should be updated only when it is meaningful.
            if (builder.mVersionOfSatelliteAccessConfig.isPresent()) {
                this.sVersionOfSatelliteAccessConfig =
                        builder.mVersionOfSatelliteAccessConfig.get();
            }
        }

        public int getCountOfSatelliteServiceEnablementsSuccess() {
@@ -320,6 +326,10 @@ public class SatelliteStats {
            return sIsNtnOnlyCarrier;
        }

        public static int getVersionSatelliteAccessConfig() {
            return sVersionOfSatelliteAccessConfig;
        }

        /**
         * A builder class to create {@link SatelliteControllerParams} data structure class
         */
@@ -360,6 +370,7 @@ public class SatelliteStats {
            private int mCountOfP2PSmsAvailableNotificationShown = 0;
            private int mCountOfP2PSmsAvailableNotificationRemoved = 0;
            private Optional<Boolean> mIsNtnOnlyCarrier = Optional.empty();
            private Optional<Integer> mVersionOfSatelliteAccessConfig = Optional.empty();

            /**
             * Sets countOfSatelliteServiceEnablementsSuccess value of {@link SatelliteController}
@@ -718,6 +729,15 @@ public class SatelliteStats {
                return this;
            }

            /**
             * Sets versionOfSatelliteAccessConfig value of {@link SatelliteController} atom
             * then returns Builder class
             */
            public Builder setVersionOfSatelliteAccessControl(int version) {
                this.mVersionOfSatelliteAccessConfig = Optional.of(version);
                return this;
            }

            /**
             * Returns ControllerParams, which contains whole component of
             * {@link SatelliteController} atom
@@ -777,7 +797,7 @@ public class SatelliteStats {
                    + mCountOfP2PSmsAvailableNotificationShown
                    + ", countOfP2PSmsAvailableNotificationRemoved="
                    + mCountOfP2PSmsAvailableNotificationRemoved
                    + ", isNtnOnlyCarrier=" + sIsNtnOnlyCarrier
                    + ", versionOfSatelliteAccessConfig=" + sVersionOfSatelliteAccessConfig
                    + ")";
        }
    }
@@ -2701,6 +2721,7 @@ public class SatelliteStats {
        proto.countOfP2PSmsAvailableNotificationRemoved =
                param.getCountOfP2PSmsAvailableNotificationRemoved();
        proto.isNtnOnlyCarrier = param.isNtnOnlyCarrier();
        proto.versionOfSatelliteAccessConfig = param.getVersionSatelliteAccessConfig();

        mAtomsStorage.addSatelliteControllerStats(proto);
    }
+11 −0
Original line number Diff line number Diff line
@@ -414,6 +414,17 @@ public class ControllerMetricsStats {
        mSatelliteStats.onSatelliteControllerMetrics(controllerParam);
    }

    /**
     * Report a current version of satellite access config.
     */
    public void reportCurrentVersionOfSatelliteAccessConfig(int version) {
        logd("reportCurrentVersionOfSatelliteAccessConfig:" + version);
        mSatelliteStats.onSatelliteControllerMetrics(
                new SatelliteStats.SatelliteControllerParams.Builder()
                        .setVersionOfSatelliteAccessControl(version)
                        .build());
    }

    /**
     * Add count when the notification for P2P SMS over satellite avaibility is shown or removed.
     */