{"record":{"id":"dc90bdc10de2f532","repo":"microg/GmsCore","slug":"maxupdateagemillis-must-be-greater-than-or-equal-t","errorCode":null,"errorMessage":"maxUpdateAgeMillis must be greater than or equal to 0","messagePattern":"maxUpdateAgeMillis must be greater than or equal to 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-location/src/main/java/com/google/android/gms/location/CurrentLocationRequest.java","lineNumber":195,"sourceCode":"         */\n        public CurrentLocationRequest.Builder setGranularity(@Granularity int granularity) {\n            GranularityUtil.checkValidGranularity(granularity);\n            this.granularity = granularity;\n            return this;\n        }\n\n        /**\n         * Sets the maximum age of any location returned for this request. A value of 0 indicates that only freshly derived locations will be returned, and no\n         * historical locations will ever be returned. A value {@link Long#MAX_VALUE} represents an effectively unbounded maximum age.\n         * <p>\n         * NOTE: This parameter applies only to historical locations. Freshly derived locations should almost always have timestamps close to the present time -\n         * however it is possible under unlikely conditions for location derivation to take longer than expected, in which case freshly derived locations may\n         * have slightly older timestamps.\n         * <p>\n         * The default value is 1 minute. Do not rely on the default value always being 1 minute as this may change without notice.\n         */\n        public CurrentLocationRequest.Builder setMaxUpdateAgeMillis(long maxUpdateAgeMillis) {\n            if (maxUpdateAgeMillis < 0) throw new IllegalArgumentException(\"maxUpdateAgeMillis must be greater than or equal to 0\");\n            this.maxUpdateAgeMillis = maxUpdateAgeMillis;\n            return this;\n        }\n\n        /**\n         * Sets the {@link Priority} of the location request used to derive the current location if no historical location satisfies the current location\n         * request.\n         * <p>\n         * The default value is {@link Priority#PRIORITY_BALANCED_POWER_ACCURACY}.\n         */\n        public CurrentLocationRequest.Builder setPriority(@Priority int priority) {\n            PriorityUtil.checkValidPriority(priority);\n            this.priority = priority;\n            return this;\n        }\n\n        @Hide\n        public CurrentLocationRequest.Builder setBypass(boolean bypass) {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-location/src/main/java/com/google/android/gms/location/CurrentLocationRequest.java#L177-L213","documentation":"Builder validation in CurrentLocationRequest.Builder.setMaxUpdateAgeMillis: the requested maximum age is negative, but the contract requires >= 0 (0 = only fresh fixes; Long.MAX_VALUE = effectively unbounded).","triggerScenarios":"Thrown at play-services-location/src/main/java/com/google/android/gms/location/CurrentLocationRequest.java:195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Clamp the value to 0 or a positive duration before calling setMaxUpdateAgeMillis","Validate configuration input before building the request"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}