Add input validation for throttlingTimeSec in onDeregistered
The onDeregistered method accepts a throttlingTimeSec parameter, which is intended to be a non-negative value representing a time in seconds. However, there was no explicit validation to prevent negative values from being passed. Passing a negative value is invalid and could lead to undefined behavior. This change introduces validation for the throttlingTimeSec parameter: An IllegalArgumentException is now thrown if throttlingTimeSec is negative. The @IntRange(from = 0) annotation has been added to enforce this constraint at the API level. The Javadoc for the method has been updated to reflect this new validation and clarify the parameter's expected range. This makes the API more robust by ensuring only valid inputs are processed. Bug: 412452528 Test: atest ImsServiceTest Flag: com.android.internal.telephony.flags.support_throttle_time_for_deregistration Change-Id: I9646fc2ced6bf74c50447aeb13cabc4a0afeb4f5
Loading
Please register or sign in to comment