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

Commit e8380c98 authored by Yifan Hong's avatar Yifan Hong
Browse files

UpdateEngine.AllocateSpaceResult: rename functions

Rename functions from X() to getX().

Also update docs.

Bug: 148486809
Test: builds

Change-Id: Ib692bff06bcf0018826e78b28f0a9b2ed0431060
parent fb9adf0d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -6485,8 +6485,8 @@ package android.os {
  }
  public static final class UpdateEngine.AllocateSpaceResult {
    method public int errorCode();
    method public long freeSpaceRequired();
    method public int getErrorCode();
    method public long getFreeSpaceRequired();
  }
  public static final class UpdateEngine.ErrorCodeConstants {
+9 −7
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ public class UpdateEngine {
         * </ul>
         */
        @ErrorCode
        public int errorCode() {
        public int getErrorCode() {
            return mErrorCode;
        }

@@ -492,14 +492,15 @@ public class UpdateEngine {
         *
         * @return The following values:
         * <ul>
         * <li>zero if {@link #errorCode} returns {@link ErrorCodeConstants#SUCCESS}</li>
         * <li>non-zero if {@link #errorCode} returns {@link ErrorCodeConstants#NOT_ENOUGH_SPACE}.
         * <li>zero if {@link #getErrorCode} returns {@link ErrorCodeConstants#SUCCESS}</li>
         * <li>non-zero if {@link #getErrorCode} returns
         * {@link ErrorCodeConstants#NOT_ENOUGH_SPACE}.
         * Value is the estimated total space required on userdata partition.</li>
         * </ul>
         * @throws IllegalStateException if {@link #errorCode} is not one of the above.
         * @throws IllegalStateException if {@link #getErrorCode} is not one of the above.
         *
         */
        public long freeSpaceRequired() {
        public long getFreeSpaceRequired() {
            if (mErrorCode == ErrorCodeConstants.SUCCESS) {
                return 0;
            }
@@ -507,7 +508,7 @@ public class UpdateEngine {
                return mFreeSpaceRequired;
            }
            throw new IllegalStateException(String.format(
                    "freeSpaceRequired() is not available when error code is %d", mErrorCode));
                    "getFreeSpaceRequired() is not available when error code is %d", mErrorCode));
        }
    }

@@ -531,7 +532,8 @@ public class UpdateEngine {
     *
     * @param payloadMetadataFilename See {@link #verifyPayloadMetadata}.
     * @param headerKeyValuePairs See {@link #applyPayload}.
     * @return See {@link AllocateSpaceResult}.
     * @return See {@link AllocateSpaceResult#getErrorCode} and
     *             {@link AllocateSpaceResult#getFreeSpaceRequired}.
     */
    @NonNull
    public AllocateSpaceResult allocateSpace(