As refer by Getting "debuggable" value of androidManifest from code?, there are two options of checking if the build is debuggable:
1.) BuildConfig.DEBUG flag
if (BuildConfig.DEBUG)`
2.) ApplicationInfo.FLAG_DEBUGGABLE
if (0 != (getContext().getApplicationInfo().flags &
ApplicationInfo.FLAG_DEBUGGABLE))
Are they two identical, or they are different? When to use what?