1 /* 2 * Copyright (C) 2020 The Dagger Authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package dagger.hilt.android; 18 19 import dagger.Module; 20 import dagger.Provides; 21 import dagger.hilt.InstallIn; 22 import dagger.hilt.android.components.ActivityComponent; 23 import dagger.hilt.components.SingletonComponent; 24 import javax.inject.Qualifier; 25 26 public final class MultiTestRootExternalModules { 27 static final long EXTERNAL_LONG_VALUE = 43L; 28 static final String EXTERNAL_STR_VALUE = "EXTERNAL_STRING_VALUE"; 29 30 @Qualifier 31 @interface External {} 32 33 @Module 34 @InstallIn(SingletonComponent.class) 35 interface PkgPrivateAppModule { 36 @Provides 37 @External provideStringValue()38 static String provideStringValue() { 39 return EXTERNAL_STR_VALUE; 40 } 41 } 42 43 @Module 44 @InstallIn(ActivityComponent.class) 45 interface PkgPrivateActivityModule { 46 @Provides 47 @External provideLongValue()48 static Long provideLongValue() { 49 return EXTERNAL_LONG_VALUE; 50 } 51 } 52 MultiTestRootExternalModules()53 private MultiTestRootExternalModules() {} 54 } 55