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

Commit 80436174 authored by Dave Mankoff's avatar Dave Mankoff Committed by Automerger Merge Worker
Browse files

Merge changes from topic...

Merge changes from topic "revert-23727772-b279054964-flag-api-udc-qpr-dev-YOBAYFNKLI" into udc-qpr-dev am: 20fb6e46 am: 8e7f23af

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24042325



Change-Id: Ic65338d06ebb9c9a774a8e70eb2d4759277e0f5e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 49eaf63c 8e7f23af
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -38,15 +38,6 @@ filegroup {
    srcs: ["com/android/internal/os/IBinaryTransparencyService.aidl"],
}

filegroup {
    name: "feature_flags_aidl",
    srcs: [
        "android/flags/IFeatureFlags.aidl",
        "android/flags/IFeatureFlagsCallback.aidl",
        "android/flags/SyncableFlag.aidl",
    ],
}

filegroup {
    name: "ITracingServiceProxy.aidl",
    srcs: ["android/tracing/ITracingServiceProxy.aidl"],
+0 −7
Original line number Diff line number Diff line
@@ -5297,13 +5297,6 @@ public abstract class Context {
    @SystemApi
    public static final String APP_PREDICTION_SERVICE = "app_prediction";

    /**
     * Used for reading system-wide, overridable flags.
     *
     * @hide
     */
    public static final String FEATURE_FLAGS_SERVICE = "feature_flags";

    /**
     * Official published name of the search ui service.
     *
+0 −52
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.flags;

import android.annotation.NonNull;

/**
 * A flag representing a true or false value.
 *
 * The value will always be the same during the lifetime of the process it is read in.
 *
 * @hide
 */
public class BooleanFlag extends BooleanFlagBase {
    private final boolean mDefault;

    /**
     * @param namespace A namespace for this flag. See {@link android.provider.DeviceConfig}.
     * @param name A name for this flag.
     * @param defaultValue The value of this flag if no other override is present.
     */
    BooleanFlag(String namespace, String name, boolean defaultValue) {
        super(namespace, name);
        mDefault = defaultValue;
    }

    @Override
    @NonNull
    public Boolean getDefault() {
        return mDefault;
    }

    @Override
    public BooleanFlag defineMetaData(String label, String description, String categoryName) {
        super.defineMetaData(label, description, categoryName);
        return this;
    }
}
+0 −82
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.flags;

import android.annotation.NonNull;

abstract class BooleanFlagBase implements Flag<Boolean> {

    private final String mNamespace;
    private final String mName;
    private String mLabel;
    private String mDescription;
    private String mCategoryName;

    /**
     * @param namespace A namespace for this flag. See {@link android.provider.DeviceConfig}.
     * @param name A name for this flag.
     */
    BooleanFlagBase(String namespace, String name) {
        mNamespace = namespace;
        mName = name;
        mLabel = name;
    }

    public abstract Boolean getDefault();

    @Override
    @NonNull
    public String getNamespace() {
        return mNamespace;
    }

    @Override
    @NonNull
    public String getName() {
        return mName;
    }

    @Override
    public BooleanFlagBase defineMetaData(String label, String description, String categoryName) {
        mLabel = label;
        mDescription = description;
        mCategoryName = categoryName;
        return this;
    }

    @Override
    @NonNull
    public String getLabel() {
        return mLabel;
    }

    @Override
    public String getDescription() {
        return mDescription;
    }

    @Override
    public String getCategoryName() {
        return mCategoryName;
    }

    @Override
    @NonNull
    public String toString() {
        return getNamespace() + "." + getName() + "[" + getDefault() + "]";
    }
}
+0 −50
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.flags;

/**
 * A flag representing a true or false value.
 *
 * The value may be different from one read to the next.
 *
 * @hide
 */
public class DynamicBooleanFlag extends BooleanFlagBase implements DynamicFlag<Boolean> {

    private final boolean mDefault;

    /**
     * @param namespace A namespace for this flag. See {@link android.provider.DeviceConfig}.
     * @param name A name for this flag.
     * @param defaultValue The value of this flag if no other override is present.
     */
    DynamicBooleanFlag(String namespace, String name, boolean defaultValue) {
        super(namespace, name);
        mDefault = defaultValue;
    }

    @Override
    public Boolean getDefault() {
        return mDefault;
    }

    @Override
    public DynamicBooleanFlag defineMetaData(String label, String description, String categoryName) {
        super.defineMetaData(label, description, categoryName);
        return this;
    }
}
Loading