Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public enum CommonFlight implements IFlightConfig {
/**
* Flight to enable adding x-client-MN and x-client-WPAvailable extra query parameters
*/
ENABLE_AM_API_WORKPROFILE_EXTRA_QUERY_PARAMETERS("EnableAmApiWorkProfileExtraQueryParameters", false),
ENABLE_AM_API_WORKPROFILE_EXTRA_QUERY_PARAMETERS("EnableAmApiWorkProfileExtraQueryParameters", true),

/** Flight to enable the new key generation without PURPOSE_WRAP_KEY. Default is true.
* This is applicable for API >= 23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static void clearDeviceMetadata(){
}

@GuardedBy("sLock")
public static void setIsInPersonalProfileButClouddpcWorkProfileAvailable(final boolean isWorkProfileAvailable) {
public static void setIsInPersonalProfileButClouddpcWorkProfileAvailable(final Boolean isWorkProfileAvailable) {
sLock.writeLock().lock();
try {
sIsInPersonalProfileButClouddpcWorkProfileAvailable = isWorkProfileAvailable;
Expand All @@ -89,7 +89,7 @@ public static void setIsInPersonalProfileButClouddpcWorkProfileAvailable(final b
}

@GuardedBy("sLock")
public static boolean isInPersonalProfileButClouddpcWorkProfileAvailable() {
public static Boolean isInPersonalProfileButClouddpcWorkProfileAvailable() {
sLock.readLock().lock();
try {
return sIsInPersonalProfileButClouddpcWorkProfileAvailable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class DeviceTest {
@After
public void tearDown() {
Device.clearDeviceMetadata();
Device.setIsInPersonalProfileButClouddpcWorkProfileAvailable(null);
}

@Test
Expand Down Expand Up @@ -135,5 +136,19 @@ public void testGetAllMetadata(){
MockDeviceMetadata.TEST_OS_DRS;
Assert.assertEquals(expectedResult, deviceMetadata.getAllMetadata());
}

@Test
public void testGetWorkProfileField(){
Assert.assertNull(Device.isInPersonalProfileButClouddpcWorkProfileAvailable());

Device.setIsInPersonalProfileButClouddpcWorkProfileAvailable(false);
Assert.assertFalse(Device.isInPersonalProfileButClouddpcWorkProfileAvailable());

Device.setIsInPersonalProfileButClouddpcWorkProfileAvailable(true);
Assert.assertTrue(Device.isInPersonalProfileButClouddpcWorkProfileAvailable());

Device.setIsInPersonalProfileButClouddpcWorkProfileAvailable(null);
Assert.assertNull(Device.isInPersonalProfileButClouddpcWorkProfileAvailable());
}
}