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

Commit ab0bb489 authored by Neil Fuller's avatar Neil Fuller Committed by Gerrit Code Review
Browse files

Merge "Move column definitions to an inner class"

parents 2708da7b d07c3313
Loading
Loading
Loading
Loading
+88 −67
Original line number Diff line number Diff line
@@ -39,76 +39,97 @@ public final class TimeZoneRulesDataContract {
    /** A content:// style uri to the authority for the time zone data content provider */
    private static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY);

    /**
     * Defines fields exposed through the {@link Operation#CONTENT_URI} for describing a time zone
     * distro operation.
     */
    public static final class Operation {

        /** Not instantiable. */
        private Operation() {
        }

        /**
         * The content:// style URI for determining what type of update is available.
         *
         * <p>The URI can be queried using
         * {@link android.content.ContentProvider#query(Uri, String[], String, String[], String)};
     * the result will be a cursor with a single row. If the {@link #COLUMN_OPERATION}
     * column is {@link #OPERATION_INSTALL} then see {@link #DATA_URI} for how to obtain the
     * binary data.
         * the result will be a cursor with a single row. If the {@link Operation#TYPE}
         * column is {@link Operation#TYPE_INSTALL} then see {@link Data#CONTENT_URI} for how
         * to obtain the binary data.
         */
    public static final Uri OPERATION_URI = Uri.withAppendedPath(AUTHORITY_URI, "operation");
        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "operation");

        /**
     * The {@code String} column of the {@link #OPERATION_URI} that provides an int specifying the
     * type of operation to perform. See {@link #OPERATION_NO_OP}, {@link #OPERATION_UNINSTALL} and
     * {@link #OPERATION_INSTALL}.
         * The {@code String} column of the {@link #CONTENT_URI} that provides an int specifying
         * the type of operation to perform. See {@link #TYPE_NO_OP},
         * {@link #TYPE_UNINSTALL} and {@link #TYPE_INSTALL}.
         */
    public static final String COLUMN_OPERATION = "operation";
        public static final String TYPE = "type";

        /**
     * An operation type used when the time zone rules on device should be left as they are.
     * This is not expected to be used in normal operation but a safe result in the event of an
     * error that cannot be recovered from.
         * An operation type used when the current time zone rules on device should be replaced by
         * a new set obtained via the {@link android.content.ContentProvider#openFile(Uri, String)}
         * method.
         */
    public static final String OPERATION_NO_OP = "NOOP";
        public static final String TYPE_INSTALL = "INSTALL";

        /**
         * An operation type used when the current time zone rules on device should be uninstalled,
         * returning to the values held in the system partition.
         */
    public static final String OPERATION_UNINSTALL = "UNINSTALL";
        public static final String TYPE_UNINSTALL = "UNINSTALL";

        /**
     * An operation type used when the current time zone rules on device should be replaced by
     * a new set obtained via the {@link android.content.ContentProvider#openFile(Uri, String)}
     * method.
         * An operation type used when the time zone rules on device should be left as they are.
         * This is not expected to be used in normal operation but a safe result in the event of an
         * error that cannot be recovered from.
         */
    public static final String OPERATION_INSTALL = "INSTALL";
        public static final String TYPE_NO_OP = "NOOP";

        /**
     * The {@code nullable int} column of the {@link #OPERATION_URI} that describes the major
         * The {@code nullable int} column of the {@link #CONTENT_URI} that describes the major
         * version of the distro to be installed.
     * Only non-null if {@link #COLUMN_OPERATION} contains {@link #OPERATION_INSTALL}.
         * Only non-null if {@link #TYPE} contains {@link #TYPE_INSTALL}.
         */
    public static final String COLUMN_DISTRO_MAJOR_VERSION = "distro_major_version";
        public static final String DISTRO_MAJOR_VERSION = "distro_major_version";

        /**
     * The {@code nullable int} column of the {@link #OPERATION_URI} that describes the minor
         * The {@code nullable int} column of the {@link #CONTENT_URI} that describes the minor
         * version of the distro to be installed.
     * Only non-null if {@link #COLUMN_OPERATION} contains {@link #OPERATION_INSTALL}.
         * Only non-null if {@link #TYPE} contains {@link #TYPE_INSTALL}.
         */
    public static final String COLUMN_DISTRO_MINOR_VERSION = "distro_minor_version";
        public static final String DISTRO_MINOR_VERSION = "distro_minor_version";

        /**
     * The {@code nullable String} column of the {@link #OPERATION_URI} that describes the IANA
         * The {@code nullable String} column of the {@link #CONTENT_URI} that describes the IANA
         * rules version of the distro to be installed.
     * Only non-null if {@link #COLUMN_OPERATION} contains {@link #OPERATION_INSTALL}.
         * Only non-null if {@link #TYPE} contains {@link #TYPE_INSTALL}.
         */
    public static final String COLUMN_RULES_VERSION = "rules_version";
        public static final String RULES_VERSION = "rules_version";

        /**
     * The {@code nullable int} column of the {@link #OPERATION_URI} that describes the revision
         * The {@code nullable int} column of the {@link #CONTENT_URI} that describes the revision
         * number of the distro to be installed.
     * Only non-null if {@link #COLUMN_OPERATION} contains {@link #OPERATION_INSTALL}.
         * Only non-null if {@link #TYPE} contains {@link #TYPE_INSTALL}.
         */
        public static final String REVISION = "revision";
    }

    /**
     * Defines the {@link Data#CONTENT_URI} for obtaining time zone distro binary data.
     */
    public static final String COLUMN_REVISION = "revision";
    public static final class Data {

        /** Not instantiable. */
        private Data() {
        }

        /**
         * The content:// style URI for obtaining time zone bundle data.
         *
         * <p>Use {@link android.content.ContentProvider#openFile(Uri, String)} with "r" mode.
         */
    public static final Uri DATA_URI = Uri.withAppendedPath(AUTHORITY_URI, "data");
        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "data");
    }
}