Changed: Add general compatibility fixes for minSdkVerion 21

This commit is contained in:
agnostic-apollo
2022-04-26 02:31:21 +05:00
parent fa829623a8
commit 677a580042
15 changed files with 168 additions and 25 deletions

View File

@@ -48,9 +48,12 @@ public class AndroidUtils {
!filesDir.equals("/data/data/" + context.getPackageName() + "/files"))
AndroidUtils.appendPropertyToMarkdown(markdownString,"FILES_DIR", filesDir);
Long userId = PackageUtils.getUserIdForPackage(context);
if (userId == null || userId != 0)
AndroidUtils.appendPropertyToMarkdown(markdownString,"USER_ID", userId);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ) {
Long userId = PackageUtils.getUserIdForPackage(context);
if (userId == null || userId != 0)
AndroidUtils.appendPropertyToMarkdown(markdownString, "USER_ID", userId);
}
AndroidUtils.appendPropertyToMarkdownIfSet(markdownString,"PROFILE_OWNER", PackageUtils.getProfileOwnerPackageNameForUser(context));