Home
last modified time | relevance | path

Searched refs:newUnit (Results 1 – 9 of 9) sorted by relevance

/packages/modules/HealthFitness/apk/src/com/android/healthconnect/controller/dataentries/units/
DUnitsFragment.kt62 unitsPreferences.getHeightUnit().toString()) { newUnit -> in <lambda>() method
63 val newHeightUnit = HeightUnit.valueOf(newUnit) in <lambda>()
77 unitsPreferences.getWeightUnit().toString()) { newUnit -> in <lambda>() method
78 val newWeightUnit = WeightUnit.valueOf(newUnit) in <lambda>()
93 unitsPreferences.getDistanceUnit().toString()) { newUnit -> in <lambda>() method
94 val newDistanceUnit = DistanceUnit.valueOf(newUnit) in <lambda>()
108 unitsPreferences.getEnergyUnit().toString()) { newUnit -> in <lambda>() method
109 val newEnergyUnit = EnergyUnit.valueOf(newUnit) in <lambda>()
123 unitsPreferences.getTemperatureUnit().toString()) { newUnit -> in <lambda>() method
124 val newTemperatureUnit = TemperatureUnit.valueOf(newUnit) in <lambda>()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/units/
DUnitsSpeedPreferenceControllerTest.java98 Unit newUnit = AVAILABLE_UNITS[1]; in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit() local
101 Integer.toString(newUnit.getId())); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
105 newUnit.getId()); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
111 Unit newUnit = AVAILABLE_UNITS[1];; in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue() local
113 when(mCarPropertyValue.getValue()).thenReturn(newUnit.getId()); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
116 assertThat(mPreference.getValue()).isEqualTo(Integer.toString(newUnit.getId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
118 .isEqualTo(mContext.getString(newUnit.getAbbreviationResId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
DUnitsEnergyConsumptionPreferenceControllerTest.java101 Unit newUnit = AVAILABLE_UNITS[1]; in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit() local
104 Integer.toString(newUnit.getId())); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
108 newUnit.getId()); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
114 Unit newUnit = AVAILABLE_UNITS[1];; in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue() local
116 when(mCarPropertyValue.getValue()).thenReturn(newUnit.getId()); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
119 assertThat(mPreference.getValue()).isEqualTo(Integer.toString(newUnit.getId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
121 mPreferenceController.generateSummaryFromUnit(newUnit)); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
DUnitsDistancePreferenceControllerTest.java97 Unit newUnit = AVAILABLE_UNITS[1]; in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit() local
100 Integer.toString(newUnit.getId())); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
103 newUnit.getId()); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
109 Unit newUnit = AVAILABLE_UNITS[1];; in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue() local
111 when(mCarPropertyValue.getValue()).thenReturn(newUnit.getId()); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
114 assertThat(mPreference.getValue()).isEqualTo(Integer.toString(newUnit.getId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
116 .isEqualTo(mContext.getString(newUnit.getAbbreviationResId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
DUnitsPressurePreferenceControllerTest.java98 Unit newUnit = AVAILABLE_UNITS[1]; in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit() local
101 Integer.toString(newUnit.getId())); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
105 newUnit.getId()); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
111 Unit newUnit = AVAILABLE_UNITS[1];; in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue() local
113 when(mCarPropertyValue.getValue()).thenReturn(newUnit.getId()); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
116 assertThat(mPreference.getValue()).isEqualTo(Integer.toString(newUnit.getId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
118 .isEqualTo(mContext.getString(newUnit.getAbbreviationResId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
DUnitsVolumePreferenceControllerTest.java97 Unit newUnit = AVAILABLE_UNITS[1]; in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit() local
100 Integer.toString(newUnit.getId())); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
103 newUnit.getId()); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
109 Unit newUnit = AVAILABLE_UNITS[1];; in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue() local
111 when(mCarPropertyValue.getValue()).thenReturn(newUnit.getId()); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
114 assertThat(mPreference.getValue()).isEqualTo(Integer.toString(newUnit.getId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
116 .isEqualTo(mContext.getString(newUnit.getAbbreviationResId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
DUnitsTemperaturePreferenceControllerTest.java97 Unit newUnit = AVAILABLE_UNITS[1]; in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit() local
100 Integer.toString(newUnit.getId())); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
104 newUnit.getId()); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
110 Unit newUnit = AVAILABLE_UNITS[1];; in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue() local
112 when(mCarPropertyValue.getValue()).thenReturn(newUnit.getId()); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
115 assertThat(mPreference.getValue()).isEqualTo(Integer.toString(newUnit.getId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
117 .isEqualTo(mContext.getString(newUnit.getAbbreviationResId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
DUnitsFuelConsumptionPreferenceControllerTest.java100 Unit newUnit = AVAILABLE_UNITS[1]; in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit() local
103 Integer.toString(newUnit.getId())); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
107 newUnit.getId()); in onPreferenceChanged_runsSetUnitUsedByPropertyWithNewUnit()
113 Unit newUnit = AVAILABLE_UNITS[1];; in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue() local
115 when(mCarPropertyValue.getValue()).thenReturn(newUnit.getId()); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
118 assertThat(mPreference.getValue()).isEqualTo(Integer.toString(newUnit.getId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
120 mPreferenceController.generateSummaryFromUnit(newUnit) in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
DUnitsBasePreferenceControllerTest.java246 Unit newUnit = UnitsMap.SECS; in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue() local
248 when(mCarPropertyValue.getValue()).thenReturn(newUnit.getId()); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
251 assertThat(mPreference.getValue()).isEqualTo(Integer.toString(newUnit.getId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitIdAsValue()
257 Unit newUnit = UnitsMap.SECS; in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitAbbreviationAsSummary() local
259 when(mCarPropertyValue.getValue()).thenReturn(newUnit.getId()); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitAbbreviationAsSummary()
263 .isEqualTo(mContext.getString(newUnit.getAbbreviationResId())); in onPropertyChanged_propertyStatusIsAvailable_setsNewUnitAbbreviationAsSummary()
306 Unit newUnit = UnitsMap.MAP.get(unitId); in handlePreferenceChanged() local
307 if (newUnit != null) { in handlePreferenceChanged()
308 updateDefaultUnit(newUnit); in handlePreferenceChanged()