@@ -0,0 +1,1819 @@
+// Copyright 2019 The Bazel Authors. All rights reserved.%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//    http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0Apackage com.google.devtools.build.android.desugar.runtime;%0A%0Aimport android.app.role.RoleManager;%0Aimport android.os.UserHandle;%0Aimport java.util.concurrent.Executor;%0Aimport java.util.function.Consumer;%0A%0A/**%0A * Conversion from desugared to built-in %7B@link Consumer%7D for calling hidden Android APIs (see%0A * b/145531945).%0A */%0A// TODO(b/74087778): Unnecessary when j$.u.f.Consumer becomes subtype of built-in j.u.f.Consumer%0A@SuppressWarnings(%22AndroidJdkLibsChecker%22)%0Apublic final class HiddenConsumerWrapper%3CT%3E implements Consumer%3CT%3E %7B%0A%0A  private final j$.util.function.Consumer%3CT%3E wrapped;%0A%0A  private HiddenConsumerWrapper(j$.util.function.Consumer%3CT%3E wrapped) %7B%0A    this.wrapped = wrapped;%0A  %7D%0A%0A  @Override%0A  public void accept(T t) %7B%0A    wrapped.accept(t);%0A  %7D%0A%0A  public static void addRoleHolderAsUser(%0A      RoleManager receiver,%0A      String roleName,%0A      String packageName,%0A      int flags,%0A      UserHandle user,%0A      Executor executor,%0A      j$.util.function.Consumer%3CBoolean%3E callback) %7B%0A    receiver.addRoleHolderAsUser(%0A        roleName,%0A        packageName,%0A        flags,%0A        user,%0A        executor,%0A        callback != null ? new HiddenConsumerWrapper%3CBoolean%3E(callback) : null);%0A  %7D%0A%7D%0A

Add desugaring support for RoleManager#addRoleHolderAsUser