@@ -40,13 +40,13 @@ public void onCreatePreferences(final Bundle savedInstanceState, final String ro
4040 assert showErrorSnackbarPreference != null ;
4141 assert createErrorNotificationPreference != null ;
4242
43- final Optional <DebugSettingsBVLeakCanaryAPI > optBVLeakCanary = getBVLeakCanary ();
43+ final Optional <DebugSettingsBVDLeakCanaryAPI > optBVLeakCanary = getBVDLeakCanary ();
4444
4545 allowHeapDumpingPreference .setEnabled (optBVLeakCanary .isPresent ());
4646 showMemoryLeaksPreference .setEnabled (optBVLeakCanary .isPresent ());
4747
4848 if (optBVLeakCanary .isPresent ()) {
49- final DebugSettingsBVLeakCanaryAPI pdLeakCanary = optBVLeakCanary .get ();
49+ final DebugSettingsBVDLeakCanaryAPI pdLeakCanary = optBVLeakCanary .get ();
5050
5151 showMemoryLeaksPreference .setOnPreferenceClickListener (preference -> {
5252 startActivity (pdLeakCanary .getNewLeakDisplayActivityIntent ());
@@ -79,11 +79,15 @@ public void onCreatePreferences(final Bundle savedInstanceState, final String ro
7979 });
8080 }
8181
82- private Optional <DebugSettingsBVLeakCanaryAPI > getBVLeakCanary () {
82+ /**
83+ * Tries to find the {@link DebugSettingsBVDLeakCanaryAPI#IMPL_CLASS} and loads it if available.
84+ * @return An {@link Optional} which is empty if the implementation class couldn't be loaded.
85+ */
86+ private Optional <DebugSettingsBVDLeakCanaryAPI > getBVDLeakCanary () {
8387 try {
8488 // Try to find the implementation of the LeakCanary API
85- return Optional .of ((DebugSettingsBVLeakCanaryAPI )
86- Class .forName (DebugSettingsBVLeakCanaryAPI .IMPL_CLASS )
89+ return Optional .of ((DebugSettingsBVDLeakCanaryAPI )
90+ Class .forName (DebugSettingsBVDLeakCanaryAPI .IMPL_CLASS )
8791 .getDeclaredConstructor ()
8892 .newInstance ());
8993 } catch (final Exception e ) {
@@ -92,12 +96,12 @@ private Optional<DebugSettingsBVLeakCanaryAPI> getBVLeakCanary() {
9296 }
9397
9498 /**
95- * Build variant dependent leak canary API for this fragment.
99+ * Build variant dependent (BVD) leak canary API for this fragment.
96100 * Why is LeakCanary not used directly? Because it can't be assured
97101 */
98- public interface DebugSettingsBVLeakCanaryAPI {
102+ public interface DebugSettingsBVDLeakCanaryAPI {
99103 String IMPL_CLASS =
100- "org.schabi.newpipe.settings.DebugSettingsBVLeakCanary " ;
104+ "org.schabi.newpipe.settings.DebugSettingsBVDLeakCanary " ;
101105
102106 Intent getNewLeakDisplayActivityIntent ();
103107 }
0 commit comments