Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions fragment/fragment/api/current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ package androidx.fragment.app {
method public androidx.fragment.app.FragmentFactory getFragmentFactory();
method public java.util.List<androidx.fragment.app.Fragment!> getFragments();
method public androidx.fragment.app.Fragment? getPrimaryNavigationFragment();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy? getStrictModePolicy();
method public boolean isDestroyed();
method public boolean isStateSaved();
method public void popBackStack();
Expand All @@ -304,6 +305,7 @@ package androidx.fragment.app {
method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
method public final void setFragmentResult(String, android.os.Bundle);
method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
method public void setStrictModePolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy?);
method public void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
Expand Down Expand Up @@ -452,3 +454,62 @@ package androidx.fragment.app {

}

package androidx.fragment.app.strictmode {

public final class FragmentReuseViolation extends androidx.fragment.app.strictmode.Violation {
ctor public FragmentReuseViolation();
}

public final class FragmentStrictMode {
method public static androidx.fragment.app.strictmode.FragmentStrictMode.Policy getDefaultPolicy();
method public static void setDefaultPolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy);
}

public static interface FragmentStrictMode.OnViolationListener {
method public void onViolation(androidx.fragment.app.strictmode.Violation);
}

public static final class FragmentStrictMode.Policy {
field public static final androidx.fragment.app.strictmode.FragmentStrictMode.Policy LAX;
}

public static final class FragmentStrictMode.Policy.Builder {
ctor public FragmentStrictMode.Policy.Builder();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy build();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder detectFragmentReuse();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder detectFragmentTagUsage();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder detectRetainInstanceUsage();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder detectSetUserVisibleHint();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder detectTargetFragmentUsage();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder detectWrongFragmentContainer();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder penaltyDeath();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder penaltyListener(androidx.fragment.app.strictmode.FragmentStrictMode.OnViolationListener);
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder penaltyLog();
}

public final class FragmentTagUsageViolation extends androidx.fragment.app.strictmode.Violation {
ctor public FragmentTagUsageViolation();
}

public final class RetainInstanceUsageViolation extends androidx.fragment.app.strictmode.Violation {
ctor public RetainInstanceUsageViolation();
}

public final class SetUserVisibleHintViolation extends androidx.fragment.app.strictmode.Violation {
ctor public SetUserVisibleHintViolation();
}

public final class TargetFragmentUsageViolation extends androidx.fragment.app.strictmode.Violation {
ctor public TargetFragmentUsageViolation();
}

public abstract class Violation extends java.lang.RuntimeException {
ctor public Violation();
}

public final class WrongFragmentContainerViolation extends androidx.fragment.app.strictmode.Violation {
ctor public WrongFragmentContainerViolation();
}

}

26 changes: 13 additions & 13 deletions fragment/fragment/api/public_plus_experimental_current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ package androidx.fragment.app {
method public androidx.fragment.app.FragmentFactory getFragmentFactory();
method public java.util.List<androidx.fragment.app.Fragment!> getFragments();
method public androidx.fragment.app.Fragment? getPrimaryNavigationFragment();
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public androidx.fragment.app.strictmode.FragmentStrictMode.Policy? getStrictModePolicy();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy? getStrictModePolicy();
method public boolean isDestroyed();
method public boolean isStateSaved();
method public void popBackStack();
Expand All @@ -306,7 +306,7 @@ package androidx.fragment.app {
method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
method public final void setFragmentResult(String, android.os.Bundle);
method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public void setStrictModePolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy?);
method public void setStrictModePolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy?);
method public void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
Expand Down Expand Up @@ -460,11 +460,11 @@ package androidx.fragment.app {

package androidx.fragment.app.strictmode {

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class FragmentReuseViolation extends androidx.fragment.app.strictmode.Violation {
public final class FragmentReuseViolation extends androidx.fragment.app.strictmode.Violation {
ctor public FragmentReuseViolation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class FragmentStrictMode {
public final class FragmentStrictMode {
method public static androidx.fragment.app.strictmode.FragmentStrictMode.Policy getDefaultPolicy();
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public static void onFragmentReuse(androidx.fragment.app.Fragment);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public static void onFragmentTagUsage(androidx.fragment.app.Fragment);
Expand All @@ -475,15 +475,15 @@ package androidx.fragment.app.strictmode {
method public static void setDefaultPolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy);
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public static interface FragmentStrictMode.OnViolationListener {
public static interface FragmentStrictMode.OnViolationListener {
method public void onViolation(androidx.fragment.app.strictmode.Violation);
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public static final class FragmentStrictMode.Policy {
public static final class FragmentStrictMode.Policy {
field public static final androidx.fragment.app.strictmode.FragmentStrictMode.Policy LAX;
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public static final class FragmentStrictMode.Policy.Builder {
public static final class FragmentStrictMode.Policy.Builder {
ctor public FragmentStrictMode.Policy.Builder();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy build();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder detectFragmentReuse();
Expand All @@ -497,27 +497,27 @@ package androidx.fragment.app.strictmode {
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder penaltyLog();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class FragmentTagUsageViolation extends androidx.fragment.app.strictmode.Violation {
public final class FragmentTagUsageViolation extends androidx.fragment.app.strictmode.Violation {
ctor public FragmentTagUsageViolation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class RetainInstanceUsageViolation extends androidx.fragment.app.strictmode.Violation {
public final class RetainInstanceUsageViolation extends androidx.fragment.app.strictmode.Violation {
ctor public RetainInstanceUsageViolation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class SetUserVisibleHintViolation extends androidx.fragment.app.strictmode.Violation {
public final class SetUserVisibleHintViolation extends androidx.fragment.app.strictmode.Violation {
ctor public SetUserVisibleHintViolation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class TargetFragmentUsageViolation extends androidx.fragment.app.strictmode.Violation {
public final class TargetFragmentUsageViolation extends androidx.fragment.app.strictmode.Violation {
ctor public TargetFragmentUsageViolation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public abstract class Violation extends java.lang.RuntimeException {
public abstract class Violation extends java.lang.RuntimeException {
ctor public Violation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class WrongFragmentContainerViolation extends androidx.fragment.app.strictmode.Violation {
public final class WrongFragmentContainerViolation extends androidx.fragment.app.strictmode.Violation {
ctor public WrongFragmentContainerViolation();
}

Expand Down
26 changes: 13 additions & 13 deletions fragment/fragment/api/restricted_current.txt
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ package androidx.fragment.app {
method public androidx.fragment.app.FragmentFactory getFragmentFactory();
method public java.util.List<androidx.fragment.app.Fragment!> getFragments();
method public androidx.fragment.app.Fragment? getPrimaryNavigationFragment();
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public androidx.fragment.app.strictmode.FragmentStrictMode.Policy? getStrictModePolicy();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy? getStrictModePolicy();
method public boolean isDestroyed();
method public boolean isStateSaved();
method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.fragment.app.FragmentTransaction openTransaction();
Expand All @@ -311,7 +311,7 @@ package androidx.fragment.app {
method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
method public final void setFragmentResult(String, android.os.Bundle);
method public final void setFragmentResultListener(String, androidx.lifecycle.LifecycleOwner, androidx.fragment.app.FragmentResultListener);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public void setStrictModePolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy?);
method public void setStrictModePolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy?);
method public void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
Expand Down Expand Up @@ -486,11 +486,11 @@ package androidx.fragment.app {

package androidx.fragment.app.strictmode {

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class FragmentReuseViolation extends androidx.fragment.app.strictmode.Violation {
public final class FragmentReuseViolation extends androidx.fragment.app.strictmode.Violation {
ctor public FragmentReuseViolation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class FragmentStrictMode {
public final class FragmentStrictMode {
method public static androidx.fragment.app.strictmode.FragmentStrictMode.Policy getDefaultPolicy();
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public static void onFragmentReuse(androidx.fragment.app.Fragment);
method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public static void onFragmentTagUsage(androidx.fragment.app.Fragment);
Expand All @@ -501,15 +501,15 @@ package androidx.fragment.app.strictmode {
method public static void setDefaultPolicy(androidx.fragment.app.strictmode.FragmentStrictMode.Policy);
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public static interface FragmentStrictMode.OnViolationListener {
public static interface FragmentStrictMode.OnViolationListener {
method public void onViolation(androidx.fragment.app.strictmode.Violation);
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public static final class FragmentStrictMode.Policy {
public static final class FragmentStrictMode.Policy {
field public static final androidx.fragment.app.strictmode.FragmentStrictMode.Policy LAX;
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public static final class FragmentStrictMode.Policy.Builder {
public static final class FragmentStrictMode.Policy.Builder {
ctor public FragmentStrictMode.Policy.Builder();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy build();
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder detectFragmentReuse();
Expand All @@ -523,27 +523,27 @@ package androidx.fragment.app.strictmode {
method public androidx.fragment.app.strictmode.FragmentStrictMode.Policy.Builder penaltyLog();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class FragmentTagUsageViolation extends androidx.fragment.app.strictmode.Violation {
public final class FragmentTagUsageViolation extends androidx.fragment.app.strictmode.Violation {
ctor public FragmentTagUsageViolation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class RetainInstanceUsageViolation extends androidx.fragment.app.strictmode.Violation {
public final class RetainInstanceUsageViolation extends androidx.fragment.app.strictmode.Violation {
ctor public RetainInstanceUsageViolation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class SetUserVisibleHintViolation extends androidx.fragment.app.strictmode.Violation {
public final class SetUserVisibleHintViolation extends androidx.fragment.app.strictmode.Violation {
ctor public SetUserVisibleHintViolation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class TargetFragmentUsageViolation extends androidx.fragment.app.strictmode.Violation {
public final class TargetFragmentUsageViolation extends androidx.fragment.app.strictmode.Violation {
ctor public TargetFragmentUsageViolation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public abstract class Violation extends java.lang.RuntimeException {
public abstract class Violation extends java.lang.RuntimeException {
ctor public Violation();
}

@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public final class WrongFragmentContainerViolation extends androidx.fragment.app.strictmode.Violation {
public final class WrongFragmentContainerViolation extends androidx.fragment.app.strictmode.Violation {
ctor public WrongFragmentContainerViolation();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3737,7 +3737,6 @@ LayoutInflater.Factory2 getLayoutInflaterFactory() {

/** Returns the current policy for this FragmentManager. If no policy is set, returns null. */
@Nullable
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public FragmentStrictMode.Policy getStrictModePolicy() {
return mStrictModePolicy;
}
Expand All @@ -3750,7 +3749,6 @@ public FragmentStrictMode.Policy getStrictModePolicy() {
*
* @param policy the policy to put into place
*/
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public void setStrictModePolicy(@Nullable FragmentStrictMode.Policy policy) {
mStrictModePolicy = policy;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package androidx.fragment.app.strictmode;

import androidx.annotation.RestrictTo;

/** See #{@link FragmentStrictMode.Policy.Builder#detectFragmentReuse()}. */
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public final class FragmentReuseViolation extends Violation {
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
* use your application to see the violations as they happen.
*/
@SuppressLint("SyntheticAccessor")
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public final class FragmentStrictMode {
private static final String TAG = "FragmentStrictMode";
private static Policy defaultPolicy = Policy.LAX;
Expand All @@ -66,10 +65,9 @@ private FragmentStrictMode() {}
* When #{@link Policy.Builder#penaltyListener} is enabled, the listener is called when a
* violation occurs.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public interface OnViolationListener {

/** Called on a VM policy violation. */
/** Called on a policy violation. */
void onViolation(@NonNull Violation violation);
}

Expand All @@ -85,7 +83,6 @@ public interface OnViolationListener {
* severe (logging before process death, for example). There's currently no mechanism to choose
* different penalties for different detected actions.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public static final class Policy {
private final Set<Flag> flags;
private final OnViolationListener listener;
Expand All @@ -107,7 +104,6 @@ private Policy(@NonNull Set<Flag> flags, @Nullable OnViolationListener listener)
* <p>You can call as many {@code detect} and {@code penalty} methods as you like. Currently
* order is insignificant: all penalties apply to all detected problems.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public static final class Builder {
private final Set<Flag> flags;
private OnViolationListener listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package androidx.fragment.app.strictmode;

import androidx.annotation.RestrictTo;

/** See #{@link FragmentStrictMode.Policy.Builder#detectFragmentTagUsage()}. */
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public final class FragmentTagUsageViolation extends Violation {
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package androidx.fragment.app.strictmode;

import androidx.annotation.RestrictTo;

/** See #{@link FragmentStrictMode.Policy.Builder#detectRetainInstanceUsage()}. */
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public final class RetainInstanceUsageViolation extends Violation {
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package androidx.fragment.app.strictmode;

import androidx.annotation.RestrictTo;

/** See #{@link FragmentStrictMode.Policy.Builder#detectSetUserVisibleHint()}. */
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public final class SetUserVisibleHintViolation extends Violation {
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package androidx.fragment.app.strictmode;

import androidx.annotation.RestrictTo;

/** See #{@link FragmentStrictMode.Policy.Builder#detectTargetFragmentUsage()}. */
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public final class TargetFragmentUsageViolation extends Violation {
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@

package androidx.fragment.app.strictmode;

import androidx.annotation.RestrictTo;

/** Root class for all FragmentStrictMode violations. */
@SuppressWarnings("ExceptionName")
@RestrictTo(RestrictTo.Scope.LIBRARY) // TODO: Make API public as soon as we have a few checks
public abstract class Violation extends RuntimeException {
}
Loading