chromium/third_party/tflite_support/src/tensorflow_lite_support/odml/java/image/image.pgcfg

# Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Keep objects marked as needing to be "kept" when making the SDK, but don't
# export these rules to end developers, so they will be allowed to strip these.
-keep @interface com.google.android.odml.image.annotation.KeepForSdk
-keep @com.google.android.odml.image.annotation.KeepForSdk class *
-keepclasseswithmembers,includedescriptorclasses class * {
  @com.google.android.odml.image.annotation.KeepForSdk <fields>;
}
-keepclasseswithmembers,includedescriptorclasses class * {
  # We use "!bridge" below to avoid applying the keep on "bridge" methods.
  # Bridge methods are generated by the Java compiler during type erasure:
  # https://docs.oracle.com/javase/tutorial/java/generics/bridgeMethods.html
  # This may cause a super class that does not need the @KeepForSdk on a method
  # to get a generated method that does include the @KeepForSdk (because the
  # subclass has @KeepForSdk on the method being bridged). Since the generated
  # method in the super class gets @KeepForSdk, this causes the super class
  # itself to be unnecessarily kept by name. Since our @KeepForSdk are meant to
  # be explicit directives on a particular method (and not necessarily
  # inheritted), we do not need to apply the @KeepForSdk rule on such bridge
  # methods.
  @com.google.android.odml.image.annotation.KeepForSdk !bridge <methods>;
}
-keepclasseswithmembers,includedescriptorclasses class * {
  @com.google.android.odml.image.annotation.KeepForSdk <init>(...);
}