diff options
author | Live Channels Team <no-reply@google.com> | 2019-04-29 16:08:15 -0700 |
---|---|---|
committer | Nick Chalko <nchalko@google.com> | 2019-05-15 19:58:07 -0700 |
commit | 2632ba510ac3ae7137b162c51242c611a29a5948 (patch) | |
tree | 8823d8fbeddf48e60bddf8771c90dd7f1876f3c3 /common | |
parent | 95831cf1c01d3a012a4a312636d01ebfb7fed625 (diff) | |
download | TV-2632ba510ac3ae7137b162c51242c611a29a5948.tar.gz |
Use BuildTypeFactory
PiperOrigin-RevId: 245843574
Change-Id: I5242c015ca1defda2ee62c62fe4f5eaccc432093
Test: m LiveTv
Diffstat (limited to 'common')
-rw-r--r-- | common/src/com/android/tv/common/buildtype/BuildTypeFactory.java | 41 | ||||
-rw-r--r-- | common/src/com/android/tv/common/buildtype/BuildTypeModule.java | 3 |
2 files changed, 43 insertions, 1 deletions
diff --git a/common/src/com/android/tv/common/buildtype/BuildTypeFactory.java b/common/src/com/android/tv/common/buildtype/BuildTypeFactory.java new file mode 100644 index 00000000..706a6034 --- /dev/null +++ b/common/src/com/android/tv/common/buildtype/BuildTypeFactory.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2019 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 com.android.tv.common.buildtype; + +import com.google.common.base.Supplier; + +import javax.inject.Inject; + + +/** Factory for {@link HasBuildType.BuildType}. + * + * <p>Hardcoded to {@link HasBuildType.BuildType#AOSP}. + */ +public class BuildTypeFactory implements Supplier<HasBuildType> { + private static final HasBuildType INSTANCE = new AospBuildTypeProvider(); + + @Inject + public BuildTypeFactory() {} + + public static HasBuildType create() { + return INSTANCE; + } + + @Override + public HasBuildType get() { + return INSTANCE; + } +}
\ No newline at end of file diff --git a/common/src/com/android/tv/common/buildtype/BuildTypeModule.java b/common/src/com/android/tv/common/buildtype/BuildTypeModule.java index 96d0c633..43f398d5 100644 --- a/common/src/com/android/tv/common/buildtype/BuildTypeModule.java +++ b/common/src/com/android/tv/common/buildtype/BuildTypeModule.java @@ -23,7 +23,8 @@ import dagger.Reusable; /** Provides BuildType */ @Module public class BuildTypeModule { - private static final HasBuildType.BuildType BUILD_TYPE = HasBuildType.BuildType.AOSP; + private static final HasBuildType.BuildType BUILD_TYPE = + BuildTypeFactory.create().getBuildType(); @Provides @Reusable |