# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html

# Some tests use thenThrow from Mockito which require information on
# checked exceptions.
-keepattributes Exceptions

# Keep all Fragments in this package, which are used by reflection.
-keep public class com.android.settings*.** extends androidx.fragment.app.Fragment

# Keep all preference controllers needed by slice and DashboardFragment.
-keep class * extends com.android.settings.core.BasePreferenceController {
    *;
}

-keep class * extends com.android.settings.core.TogglePreferenceController {
    *;
}

# We want to keep methods in Activity that could be used in the XML attribute onClick.
-keepclassmembers class com.android.settings*.** extends android.app.Activity {
    public void *(android.view.View);
    public void *(android.view.MenuItem);
}

# Keep setters in Views so that animations can still work.
-keep public class com.android.settings*.** extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);

    void set*(***);
    *** get*();
}

# Keep classes that may be inflated from XML.
-keepclasseswithmembers class com.android.settings*.** {
    public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class com.android.settings*.** {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclasseswithmembers class com.android.settings*.** {
    public <init>(android.content.Context, android.util.AttributeSet, int, int);
}

# Keep specific fields used via reflection.
-keepclassmembers class * {
    public static ** SEARCH_INDEX_DATA_PROVIDER;
    public static ** SUMMARY_PROVIDER_FACTORY;
}
-keep class androidx.core.app.CoreComponentFactory

# Keep classes that implements CustomSliceable, which are used by reflection.
-keepclasseswithmembers class * implements com.android.settings.slices.CustomSliceable {
    public <init>(android.content.Context);
}

# Keep classes that extends SliceBackgroundWorker, which are used by reflection.
-keepclasseswithmembers class * extends com.android.settings.slices.SliceBackgroundWorker {
    public <init>(android.content.Context, android.net.Uri);
}

# Keep WM Jetpack classes and callbacks
-keep class androidx.window.extensions.** { *; }
-dontwarn androidx.window.extensions.**
-keep class androidx.window.** { *; }
