SystemAnimations { public static void restoreAll(@NonNull Context context) { getInstance(context).restoreAll(); } @VisibleForTesting  SystemAnimations(); static void disableAll(@NonNull Context context); static void enableAll(@NonNull Context context); static void restoreAll(@NonNull Context context);  }
@Test public void testRestoreAll() throws Exception { grantPermission(true); when(mockWindowManager.getAnimationScales()) .thenReturn(new float[]{2f, 0f, 0f}) .thenReturn(new float[]{0f, 0f, 0f}); mSystemAnimations.disableAll(); mSystemAnimations.restoreAll(); verify(mockWindowManager, times(2)).getAnimationScales(); verify(mockWindowManager).setAnimationScales(new float[]{0f, 0f, 0f}); verify(mockWindowManager).setAnimationScales(new float[]{2f, 0f, 0f}); }