Loading services/core/java/com/android/server/power/hint/HintManagerService.java +1 −3 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import static android.os.Flags.adpfUseFmqChannel; import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR; import static com.android.server.power.hint.Flags.adpfSessionTag; import static com.android.server.power.hint.Flags.cpuHeadroomAffinityCheck; import static com.android.server.power.hint.Flags.powerhintThreadCleanup; import static com.android.server.power.hint.Flags.resetOnForkEnabled; Loading Loading @@ -1604,8 +1603,7 @@ public final class HintManagerService extends SystemService { } } } if (cpuHeadroomAffinityCheck() && mCheckHeadroomAffinity && params.tids.length > 1) { if (mCheckHeadroomAffinity && params.tids.length > 1) { checkThreadAffinityForTids(params.tids); } halParams.tids = params.tids; Loading services/tests/performancehinttests/src/com/android/server/power/hint/HintManagerServiceTest.java +1 −27 Original line number Diff line number Diff line Loading @@ -70,8 +70,6 @@ import android.os.PerformanceHintManager; import android.os.Process; import android.os.RemoteException; import android.os.SessionCreationConfig; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.platform.test.annotations.RequiresFlagsEnabled; import android.platform.test.flag.junit.CheckFlagsRule; import android.platform.test.flag.junit.DeviceFlagsValueProvider; Loading Loading @@ -1388,7 +1386,6 @@ public class HintManagerServiceTest { @Test @EnableFlags({Flags.FLAG_CPU_HEADROOM_AFFINITY_CHECK}) public void testCpuHeadroomCache() throws Exception { CpuHeadroomParamsInternal params1 = new CpuHeadroomParamsInternal(); CpuHeadroomParams halParams1 = new CpuHeadroomParams(); Loading Loading @@ -1476,8 +1473,7 @@ public class HintManagerServiceTest { } @Test @EnableFlags({Flags.FLAG_CPU_HEADROOM_AFFINITY_CHECK}) public void testGetCpuHeadroomDifferentAffinity_flagOn() throws Exception { public void testGetCpuHeadroomDifferentAffinity() throws Exception { CountDownLatch latch = new CountDownLatch(2); int[] tids = createThreads(2, latch); CpuHeadroomParamsInternal params = new CpuHeadroomParamsInternal(); Loading @@ -1497,28 +1493,6 @@ public class HintManagerServiceTest { verify(mIPowerMock, times(0)).getCpuHeadroom(any()); } @Test @DisableFlags({Flags.FLAG_CPU_HEADROOM_AFFINITY_CHECK}) public void testGetCpuHeadroomDifferentAffinity_flagOff() throws Exception { CountDownLatch latch = new CountDownLatch(2); int[] tids = createThreads(2, latch); CpuHeadroomParamsInternal params = new CpuHeadroomParamsInternal(); params.tids = tids; CpuHeadroomParams halParams = new CpuHeadroomParams(); halParams.tids = tids; float headroom = 0.1f; CpuHeadroomResult halRet = CpuHeadroomResult.globalHeadroom(headroom); String ret1 = runAndWaitForCommand("taskset -p 1 " + tids[0]); String ret2 = runAndWaitForCommand("taskset -p 3 " + tids[1]); HintManagerService service = createService(); clearInvocations(mIPowerMock); when(mIPowerMock.getCpuHeadroom(eq(halParams))).thenReturn(halRet); assertEquals("taskset cmd return: " + ret1 + "\n" + ret2, halRet, service.getBinderServiceInstance().getCpuHeadroom(params)); verify(mIPowerMock, times(1)).getCpuHeadroom(any()); } private String runAndWaitForCommand(String command) throws Exception { java.lang.Process process = Runtime.getRuntime().exec(command); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); Loading Loading
services/core/java/com/android/server/power/hint/HintManagerService.java +1 −3 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import static android.os.Flags.adpfUseFmqChannel; import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR; import static com.android.server.power.hint.Flags.adpfSessionTag; import static com.android.server.power.hint.Flags.cpuHeadroomAffinityCheck; import static com.android.server.power.hint.Flags.powerhintThreadCleanup; import static com.android.server.power.hint.Flags.resetOnForkEnabled; Loading Loading @@ -1604,8 +1603,7 @@ public final class HintManagerService extends SystemService { } } } if (cpuHeadroomAffinityCheck() && mCheckHeadroomAffinity && params.tids.length > 1) { if (mCheckHeadroomAffinity && params.tids.length > 1) { checkThreadAffinityForTids(params.tids); } halParams.tids = params.tids; Loading
services/tests/performancehinttests/src/com/android/server/power/hint/HintManagerServiceTest.java +1 −27 Original line number Diff line number Diff line Loading @@ -70,8 +70,6 @@ import android.os.PerformanceHintManager; import android.os.Process; import android.os.RemoteException; import android.os.SessionCreationConfig; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.platform.test.annotations.RequiresFlagsEnabled; import android.platform.test.flag.junit.CheckFlagsRule; import android.platform.test.flag.junit.DeviceFlagsValueProvider; Loading Loading @@ -1388,7 +1386,6 @@ public class HintManagerServiceTest { @Test @EnableFlags({Flags.FLAG_CPU_HEADROOM_AFFINITY_CHECK}) public void testCpuHeadroomCache() throws Exception { CpuHeadroomParamsInternal params1 = new CpuHeadroomParamsInternal(); CpuHeadroomParams halParams1 = new CpuHeadroomParams(); Loading Loading @@ -1476,8 +1473,7 @@ public class HintManagerServiceTest { } @Test @EnableFlags({Flags.FLAG_CPU_HEADROOM_AFFINITY_CHECK}) public void testGetCpuHeadroomDifferentAffinity_flagOn() throws Exception { public void testGetCpuHeadroomDifferentAffinity() throws Exception { CountDownLatch latch = new CountDownLatch(2); int[] tids = createThreads(2, latch); CpuHeadroomParamsInternal params = new CpuHeadroomParamsInternal(); Loading @@ -1497,28 +1493,6 @@ public class HintManagerServiceTest { verify(mIPowerMock, times(0)).getCpuHeadroom(any()); } @Test @DisableFlags({Flags.FLAG_CPU_HEADROOM_AFFINITY_CHECK}) public void testGetCpuHeadroomDifferentAffinity_flagOff() throws Exception { CountDownLatch latch = new CountDownLatch(2); int[] tids = createThreads(2, latch); CpuHeadroomParamsInternal params = new CpuHeadroomParamsInternal(); params.tids = tids; CpuHeadroomParams halParams = new CpuHeadroomParams(); halParams.tids = tids; float headroom = 0.1f; CpuHeadroomResult halRet = CpuHeadroomResult.globalHeadroom(headroom); String ret1 = runAndWaitForCommand("taskset -p 1 " + tids[0]); String ret2 = runAndWaitForCommand("taskset -p 3 " + tids[1]); HintManagerService service = createService(); clearInvocations(mIPowerMock); when(mIPowerMock.getCpuHeadroom(eq(halParams))).thenReturn(halRet); assertEquals("taskset cmd return: " + ret1 + "\n" + ret2, halRet, service.getBinderServiceInstance().getCpuHeadroom(params)); verify(mIPowerMock, times(1)).getCpuHeadroom(any()); } private String runAndWaitForCommand(String command) throws Exception { java.lang.Process process = Runtime.getRuntime().exec(command); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); Loading