@Test public void testPermission_shouldReturnNotGrantedPermission() throws Exception { RootRequest rootRequest = TestObjects.permissionGrantedRequest(false); PermissionRequestHandler permissionRequestHandler = new PermissionRequestHandler(rootRequest) { @Override public RootResponse getResponse() { return new RootResponse(); } }; assertFalse(permissionRequestHandler.isPermissionGranted()); }
public boolean isPermissionGranted() { RootRequest rootRequest = getRootRequest(); if (StandardIntents.PERMISSION.equals(AssistantUtils.getActionIntent(rootRequest))) { for (Argument argument : rootRequest.inputs.get(0).arguments) { if (ActionsConfig.ARG_PERMISSION_GRANTED.equals(argument.name)) { return Boolean.valueOf(argument.text_value); } } } return false; }
PermissionRequestHandler extends RequestHandler { public boolean isPermissionGranted() { RootRequest rootRequest = getRootRequest(); if (StandardIntents.PERMISSION.equals(AssistantUtils.getActionIntent(rootRequest))) { for (Argument argument : rootRequest.inputs.get(0).arguments) { if (ActionsConfig.ARG_PERMISSION_GRANTED.equals(argument.name)) { return Boolean.valueOf(argument.text_value); } } } return false; } }
PermissionRequestHandler extends RequestHandler { public boolean isPermissionGranted() { RootRequest rootRequest = getRootRequest(); if (StandardIntents.PERMISSION.equals(AssistantUtils.getActionIntent(rootRequest))) { for (Argument argument : rootRequest.inputs.get(0).arguments) { if (ActionsConfig.ARG_PERMISSION_GRANTED.equals(argument.name)) { return Boolean.valueOf(argument.text_value); } } } return false; } protected  PermissionRequestHandler(RootRequest rootRequest); }
PermissionRequestHandler extends RequestHandler { public boolean isPermissionGranted() { RootRequest rootRequest = getRootRequest(); if (StandardIntents.PERMISSION.equals(AssistantUtils.getActionIntent(rootRequest))) { for (Argument argument : rootRequest.inputs.get(0).arguments) { if (ActionsConfig.ARG_PERMISSION_GRANTED.equals(argument.name)) { return Boolean.valueOf(argument.text_value); } } } return false; } protected  PermissionRequestHandler(RootRequest rootRequest); boolean isPermissionGranted(); @Nullable UserProfile getUserProfile(); @Nullable Location getLocation(); }
PermissionRequestHandler extends RequestHandler { public boolean isPermissionGranted() { RootRequest rootRequest = getRootRequest(); if (StandardIntents.PERMISSION.equals(AssistantUtils.getActionIntent(rootRequest))) { for (Argument argument : rootRequest.inputs.get(0).arguments) { if (ActionsConfig.ARG_PERMISSION_GRANTED.equals(argument.name)) { return Boolean.valueOf(argument.text_value); } } } return false; } protected  PermissionRequestHandler(RootRequest rootRequest); boolean isPermissionGranted(); @Nullable UserProfile getUserProfile(); @Nullable Location getLocation();  }