From 21ee446a4bf6331b58169cfd0f2e85dae6c5a215 Mon Sep 17 00:00:00 2001 From: Ashish Yadav <48384865+criticalAY@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:46:20 +0530 Subject: [PATCH] modified and renamed class --- .../core/compat/ResolveInfoFlagsBitsCompat.kt | 47 +++++++++++++++++++ ...nfoCompat.kt => ResolveInfoFlagsCompat.kt} | 27 ----------- 2 files changed, 47 insertions(+), 27 deletions(-) create mode 100644 core/src/main/java/org/kiwix/kiwixmobile/core/compat/ResolveInfoFlagsBitsCompat.kt rename core/src/main/java/org/kiwix/kiwixmobile/core/compat/{ResolveInfoCompat.kt => ResolveInfoFlagsCompat.kt} (84%) diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/compat/ResolveInfoFlagsBitsCompat.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/compat/ResolveInfoFlagsBitsCompat.kt new file mode 100644 index 000000000..7d29d74a2 --- /dev/null +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/compat/ResolveInfoFlagsBitsCompat.kt @@ -0,0 +1,47 @@ +/* + * Kiwix Android + * Copyright (c) 2023 Kiwix + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package org.kiwix.kiwixmobile.core.compat + +import androidx.annotation.LongDef + +@LongDef( + flag = true, + // prefix = ["GET_", "MATCH_"], + value = [ + GET_META_DATA.toLong(), + GET_RESOLVED_FILTER.toLong(), + GET_SHARED_LIBRARY_FILES.toLong(), + MATCH_ALL.toLong(), + MATCH_DISABLED_COMPONENTS.toLong(), + MATCH_DISABLED_UNTIL_USED_COMPONENTS.toLong(), + MATCH_DEFAULT_ONLY.toLong(), + MATCH_DIRECT_BOOT_AUTO.toLong(), + MATCH_DIRECT_BOOT_AWARE.toLong(), + MATCH_DIRECT_BOOT_UNAWARE.toLong(), + MATCH_SYSTEM_ONLY.toLong(), + MATCH_UNINSTALLED_PACKAGES.toLong() + // PackageManager.MATCH_INSTANT, // @SystemApi + // PackageManager.MATCH_DEBUG_TRIAGED_MISSING, // deprecated + // PackageManager.GET_DISABLED_COMPONENTS, // deprecated + // PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS, // deprecated + // PackageManager.GET_UNINSTALLED_PACKAGES.toLong() // deprecated + ] +) +@Retention(AnnotationRetention.SOURCE) +annotation class ResolveInfoFlagsBitsCompat diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/compat/ResolveInfoCompat.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/compat/ResolveInfoFlagsCompat.kt similarity index 84% rename from core/src/main/java/org/kiwix/kiwixmobile/core/compat/ResolveInfoCompat.kt rename to core/src/main/java/org/kiwix/kiwixmobile/core/compat/ResolveInfoFlagsCompat.kt index 1f8308f99..339c334a9 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/compat/ResolveInfoCompat.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/compat/ResolveInfoFlagsCompat.kt @@ -23,7 +23,6 @@ import android.content.pm.ComponentInfo import android.content.pm.PackageManager import android.content.pm.ResolveInfo import android.os.UserManager -import androidx.annotation.LongDef class ResolveInfoFlagsCompat private constructor(@ResolveInfoFlagsBitsCompat value: Long) : Flags(value) { @@ -136,29 +135,3 @@ const val MATCH_DIRECT_BOOT_AWARE = 0x00080000 * @see UserManager.isUserUnlocked */ const val MATCH_DIRECT_BOOT_UNAWARE = 0x00040000 - -@LongDef( - flag = true, - // prefix = ["GET_", "MATCH_"], - value = [ - GET_META_DATA.toLong(), - GET_RESOLVED_FILTER.toLong(), - GET_SHARED_LIBRARY_FILES.toLong(), - MATCH_ALL.toLong(), - MATCH_DISABLED_COMPONENTS.toLong(), - MATCH_DISABLED_UNTIL_USED_COMPONENTS.toLong(), - MATCH_DEFAULT_ONLY.toLong(), - MATCH_DIRECT_BOOT_AUTO.toLong(), - MATCH_DIRECT_BOOT_AWARE.toLong(), - MATCH_DIRECT_BOOT_UNAWARE.toLong(), - MATCH_SYSTEM_ONLY.toLong(), - MATCH_UNINSTALLED_PACKAGES.toLong() - // PackageManager.MATCH_INSTANT, // @SystemApi - // PackageManager.MATCH_DEBUG_TRIAGED_MISSING, // deprecated - // PackageManager.GET_DISABLED_COMPONENTS, // deprecated - // PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS, // deprecated - // PackageManager.GET_UNINSTALLED_PACKAGES.toLong() // deprecated - ] -) -@Retention(AnnotationRetention.SOURCE) -annotation class ResolveInfoFlagsBitsCompat