Loading media/tests/mediatestutils/java/com/android/media/mediatestutils/TestUtils.java +8 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public class TestUtils { return getFutureForListener( (recv) -> context.registerReceiver( recv, new IntentFilter(action), Context.RECEIVER_NOT_EXPORTED), recv, new IntentFilter(action), Context.RECEIVER_EXPORTED), (recv) -> { try { context.unregisterReceiver(recv); Loading @@ -75,6 +75,13 @@ public class TestUtils { "Intent receiver future for action: " + action); } /** * Same as previous, but with no predicate. */ public static ListenableFuture<Intent> getFutureForIntent(Context context, String action) { return getFutureForIntent(context, action, i -> true); } /** * Return a future for a callback registered to a listener interface. * @param registerFunc - Function which consumes the callback object for registration Loading Loading
media/tests/mediatestutils/java/com/android/media/mediatestutils/TestUtils.java +8 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public class TestUtils { return getFutureForListener( (recv) -> context.registerReceiver( recv, new IntentFilter(action), Context.RECEIVER_NOT_EXPORTED), recv, new IntentFilter(action), Context.RECEIVER_EXPORTED), (recv) -> { try { context.unregisterReceiver(recv); Loading @@ -75,6 +75,13 @@ public class TestUtils { "Intent receiver future for action: " + action); } /** * Same as previous, but with no predicate. */ public static ListenableFuture<Intent> getFutureForIntent(Context context, String action) { return getFutureForIntent(context, action, i -> true); } /** * Return a future for a callback registered to a listener interface. * @param registerFunc - Function which consumes the callback object for registration Loading