From b01e0a62c8230450c3d688cc44f2e6f08820dddb Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Wed, 22 Jun 2022 16:38:00 +0600 Subject: [PATCH 1/3] App Lounge: fixed flickering partially --- .../java/foundation/e/apps/MainActivity.kt | 22 +++++++++---------- .../e/apps/MainActivityViewModel.kt | 2 +- .../foundation/e/apps/home/HomeFragment.kt | 2 ++ .../e/apps/home/model/HomeParentRVAdapter.kt | 2 ++ 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/MainActivity.kt b/app/src/main/java/foundation/e/apps/MainActivity.kt index 8f44d8b46..ed2191f1d 100644 --- a/app/src/main/java/foundation/e/apps/MainActivity.kt +++ b/app/src/main/java/foundation/e/apps/MainActivity.kt @@ -90,20 +90,20 @@ class MainActivity : AppCompatActivity() { if (isInternetAvailable) { binding.noInternet.visibility = View.GONE binding.fragment.visibility = View.VISIBLE + } + } - viewModel.userType.observe(this) { user -> - viewModel.handleAuthDataJson() - } + viewModel.userType.observe(this) { user -> + viewModel.handleAuthDataJson() + } - signInViewModel.authLiveData.observe(this) { - viewModel.updateAuthData(it) - } + signInViewModel.authLiveData.observe(this) { + viewModel.updateAuthData(it) + } - // Watch and refresh authentication data - viewModel.authDataJson.observe(this) { - viewModel.handleAuthDataJson() - } - } + // Watch and refresh authentication data + viewModel.authDataJson.observe(this) { + viewModel.handleAuthDataJson() } viewModel.authValidity.observe(this) { diff --git a/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt b/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt index b66a7d49d..3e8c4e184 100644 --- a/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt +++ b/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt @@ -226,7 +226,7 @@ class MainActivityViewModel @Inject constructor( if (!isUserLoggedIn(user, json)) { generateAuthDataBasedOnUserType(user) - } else if (isEligibleToValidateJson(json)) { + } else if (isEligibleToValidateJson(json) && internetConnection.value == true) { validateAuthData() Log.d(TAG, ">>> Authentication data is available!") } diff --git a/app/src/main/java/foundation/e/apps/home/HomeFragment.kt b/app/src/main/java/foundation/e/apps/home/HomeFragment.kt index e3af670ba..c9e4d6edc 100644 --- a/app/src/main/java/foundation/e/apps/home/HomeFragment.kt +++ b/app/src/main/java/foundation/e/apps/home/HomeFragment.kt @@ -19,6 +19,7 @@ package foundation.e.apps.home import android.os.Bundle +import android.util.Log import android.view.View import android.widget.ImageView import androidx.fragment.app.activityViewModels @@ -158,6 +159,7 @@ class HomeFragment : TimeoutFragment(R.layout.fragment_home), FusedAPIInterface homeViewModel.homeScreenData.observe(viewLifecycleOwner) { stopLoadingUI() if (it.second == ResultStatus.OK) { + Log.d("TAG", ">>> homeScreenData updated ") dismissTimeoutDialog() homeParentRVAdapter?.setData(it.first) } else { diff --git a/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt b/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt index 1af6ce558..11763e131 100644 --- a/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt +++ b/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt @@ -18,6 +18,7 @@ package foundation.e.apps.home.model +import android.util.Log import android.view.LayoutInflater import android.view.ViewGroup import androidx.lifecycle.LifecycleOwner @@ -93,6 +94,7 @@ class HomeParentRVAdapter( ) { lifecycleOwner?.let { mainActivityViewModel.downloadList.observe(it) { + Log.d("TAG", ">>> ParentRVAdapter updated downloadlist: ") mainActivityViewModel.updateStatusOfFusedApps(fusedHome.list, it) (homeChildRVAdapter as HomeChildRVAdapter).setData(fusedHome.list) } -- GitLab From 962d3d8da5d44ff95d37ca8d2761ce9bdc5c2c52 Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Thu, 23 Jun 2022 01:35:19 +0600 Subject: [PATCH 2/3] App Lounge: fixed flickering in homepage --- .../java/foundation/e/apps/MainActivity.kt | 41 +++++++++++++------ .../e/apps/MainActivityViewModel.kt | 19 +++++---- .../foundation/e/apps/home/HomeFragment.kt | 4 +- .../e/apps/home/model/HomeParentRVAdapter.kt | 1 - .../e/apps/manager/fused/FusedManagerImpl.kt | 2 +- .../manager/workmanager/InstallAppWorker.kt | 14 ++----- .../e/apps/updates/manager/UpdatesWorker.kt | 2 +- 7 files changed, 49 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/MainActivity.kt b/app/src/main/java/foundation/e/apps/MainActivity.kt index cdf715a2c..a834a14ff 100644 --- a/app/src/main/java/foundation/e/apps/MainActivity.kt +++ b/app/src/main/java/foundation/e/apps/MainActivity.kt @@ -27,6 +27,7 @@ import android.os.storage.StorageManager import android.util.Log import android.view.View import androidx.appcompat.app.AppCompatActivity +import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope import androidx.navigation.NavOptions @@ -60,6 +61,7 @@ class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + Timber.d(">>> onCreate") binding = ActivityMainBinding.inflate(layoutInflater) setContentView(binding.root) @@ -91,32 +93,35 @@ class MainActivity : AppCompatActivity() { if (isInternetAvailable) { binding.noInternet.visibility = View.GONE binding.fragment.visibility = View.VISIBLE + + // Watch and refresh authentication data + if(viewModel.authDataJson.value == null) { + viewModel.authDataJson.observe(this) { + viewModel.handleAuthDataJson() + } + } + } } + Timber.d(">>> userTypeLiveData: ${viewModel.userType.value}") + Timber.d(">>> authDataJsonLiveData: ${viewModel.authDataJson.value}") viewModel.userType.observe(this) { user -> viewModel.handleAuthDataJson() } - signInViewModel.authLiveData.observe(this) { - viewModel.updateAuthData(it) - } - - // Watch and refresh authentication data - viewModel.authDataJson.observe(this) { - viewModel.handleAuthDataJson() + if(signInViewModel.authLiveData.value == null) { + signInViewModel.authLiveData.observe(this) { + viewModel.updateAuthData(it) + } } viewModel.authValidity.observe(this) { viewModel.handleAuthValidity(it) { - Log.d(TAG, "Timeout validating auth data!") + Timber.d("Timeout validating auth data!") val lastFragment = navHostFragment.childFragmentManager.fragments[0] if (lastFragment is TimeoutFragment) { - Log.d( - TAG, - "Displaying timeout from MainActivity on fragment: " + - lastFragment::class.java.name - ) + Timber.d("Displaying timeout from MainActivity on fragment: " + Fragment.java.name) lastFragment.onTimeout() } } @@ -288,4 +293,14 @@ class MainActivity : AppCompatActivity() { val availableBlocks = stat.availableBlocksLong return availableBlocks * blockSize } + + override fun onResume() { + Timber.d(">>> onResume") + super.onResume() + } + + override fun onDestroy() { + Timber.d(">>> onDestroy") + super.onDestroy() + } } diff --git a/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt b/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt index fd9c07305..165834e26 100644 --- a/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt +++ b/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt @@ -224,12 +224,12 @@ class MainActivityViewModel @Inject constructor( if (user == null || json == null) { return } - + Timber.d(">>> handleAuthDataJson: internet: ${internetConnection.value}") if (!isUserLoggedIn(user, json)) { generateAuthDataBasedOnUserType(user) } else if (isEligibleToValidateJson(json) && internetConnection.value == true) { validateAuthData() - Log.d(TAG, ">>> Authentication data is available!") + Timber.d(">>> Authentication data is available!") } } @@ -239,7 +239,7 @@ class MainActivityViewModel @Inject constructor( private fun isEligibleToValidateJson(authDataJson: String?) = !authDataJson.isNullOrEmpty() && !userType.value.isNullOrEmpty() && !userType.value.contentEquals( User.UNAVAILABLE.name - ) + ) && authValidity.value != true fun handleAuthValidity(isValid: Boolean, handleTimeoOut: () -> Unit) { if (isGoogleLoginRunning) { @@ -247,11 +247,11 @@ class MainActivityViewModel @Inject constructor( } isTokenValidationCompletedOnce = true if (isValid) { - Log.d(TAG, "Authentication data is valid!") + Timber.d("Authentication data is valid!") generateAuthData() return } - Log.d(TAG, ">>> Authentication data validation failed!") + Timber.d(">>> Authentication data validation failed!") destroyCredentials { user -> if (isTimeEligibleForTokenRefresh()) { generateAuthDataBasedOnUserType(user) @@ -268,7 +268,7 @@ class MainActivityViewModel @Inject constructor( when (User.valueOf(user)) { User.ANONYMOUS -> { if (authDataJson.value.isNullOrEmpty() && !authRequestRunning) { - Log.d(TAG, ">>> Fetching new authentication data") + Timber.d(">>> Fetching new authentication data") setFirstTokenFetchTime() getAuthData() } @@ -278,7 +278,7 @@ class MainActivityViewModel @Inject constructor( } User.GOOGLE -> { if (authData.value == null && !authRequestRunning) { - Log.d(TAG, ">>> Fetching new authentication data") + Timber.d(">>> Fetching new authentication data") setFirstTokenFetchTime() doFetchAuthData() } @@ -540,4 +540,9 @@ class MainActivityViewModel @Inject constructor( fun updateAppWarningList() { blockedAppRepository.fetchUpdateOfAppWarningList() } + + override fun onCleared() { + Timber.d(">>> onCleared") + super.onCleared() + } } diff --git a/app/src/main/java/foundation/e/apps/home/HomeFragment.kt b/app/src/main/java/foundation/e/apps/home/HomeFragment.kt index c9e4d6edc..ae95fd497 100644 --- a/app/src/main/java/foundation/e/apps/home/HomeFragment.kt +++ b/app/src/main/java/foundation/e/apps/home/HomeFragment.kt @@ -159,7 +159,9 @@ class HomeFragment : TimeoutFragment(R.layout.fragment_home), FusedAPIInterface homeViewModel.homeScreenData.observe(viewLifecycleOwner) { stopLoadingUI() if (it.second == ResultStatus.OK) { - Log.d("TAG", ">>> homeScreenData updated ") + if(homeParentRVAdapter?.itemCount ?: 0 > 0) { + return@observe + } dismissTimeoutDialog() homeParentRVAdapter?.setData(it.first) } else { diff --git a/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt b/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt index 11763e131..b1836bf76 100644 --- a/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt +++ b/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt @@ -94,7 +94,6 @@ class HomeParentRVAdapter( ) { lifecycleOwner?.let { mainActivityViewModel.downloadList.observe(it) { - Log.d("TAG", ">>> ParentRVAdapter updated downloadlist: ") mainActivityViewModel.updateStatusOfFusedApps(fusedHome.list, it) (homeChildRVAdapter as HomeChildRVAdapter).setData(fusedHome.list) } diff --git a/app/src/main/java/foundation/e/apps/manager/fused/FusedManagerImpl.kt b/app/src/main/java/foundation/e/apps/manager/fused/FusedManagerImpl.kt index 6e9c9e7cc..c0c1627fc 100644 --- a/app/src/main/java/foundation/e/apps/manager/fused/FusedManagerImpl.kt +++ b/app/src/main/java/foundation/e/apps/manager/fused/FusedManagerImpl.kt @@ -132,7 +132,7 @@ class FusedManagerImpl @Inject constructor( pkgManagerModule.installApplication(list, fusedDownload.packageName) Timber.d( "installApp: ENDED ${fusedDownload.name} ${list.size}") } catch (e: Exception) { - Log.d(TAG, ">>> installApp app failed ") + Timber.d(">>> installApp app failed ") installationIssue(fusedDownload) throw e } diff --git a/app/src/main/java/foundation/e/apps/manager/workmanager/InstallAppWorker.kt b/app/src/main/java/foundation/e/apps/manager/workmanager/InstallAppWorker.kt index bf4533730..1a2871619 100644 --- a/app/src/main/java/foundation/e/apps/manager/workmanager/InstallAppWorker.kt +++ b/app/src/main/java/foundation/e/apps/manager/workmanager/InstallAppWorker.kt @@ -84,13 +84,10 @@ class InstallAppWorker @AssistedInject constructor( var fusedDownload: FusedDownload? = null try { val fusedDownloadString = params.inputData.getString(INPUT_DATA_FUSED_DOWNLOAD) ?: "" - Timber.d( "Fused download name $fusedDownloadString") + Timber.d("Fused download name $fusedDownloadString") fusedDownload = databaseRepository.getDownloadById(fusedDownloadString) - Log.d( - TAG, - ">>> dowork started for Fused download name ${fusedDownload?.name} $fusedDownloadString" - ) + Timber.d(">>> dowork started for Fused download name " + fusedDownload?.name + " " + fusedDownloadString) fusedDownload?.let { if (fusedDownload.status != Status.AWAITING) { return Result.success() @@ -118,7 +115,7 @@ class InstallAppWorker @AssistedInject constructor( fusedDownload: FusedDownload ) { fusedManagerRepository.downloadApp(fusedDownload) - Timber.d( "===> doWork: Download started ${fusedDownload.name} ${fusedDownload.status}") + Timber.d("===> doWork: Download started ${fusedDownload.name} ${fusedDownload.status}") isDownloading = true tickerFlow(3.seconds) .onEach { @@ -133,10 +130,7 @@ class InstallAppWorker @AssistedInject constructor( } } }.launchIn(CoroutineScope(Dispatchers.IO)) - Log.d( - TAG, - ">>> ===> doWork: Download started ${fusedDownload.name} ${fusedDownload.status}" - ) + Timber.d(">>> ===> doWork: Download started " + fusedDownload.name + " " + fusedDownload.status) } private fun isAppDownloading(download: FusedDownload): Boolean { diff --git a/app/src/main/java/foundation/e/apps/updates/manager/UpdatesWorker.kt b/app/src/main/java/foundation/e/apps/updates/manager/UpdatesWorker.kt index 66c8b17ae..a2fdae874 100644 --- a/app/src/main/java/foundation/e/apps/updates/manager/UpdatesWorker.kt +++ b/app/src/main/java/foundation/e/apps/updates/manager/UpdatesWorker.kt @@ -150,7 +150,7 @@ class UpdatesWorker @AssistedInject constructor( fusedManagerRepository.updateAwaiting(fusedDownload) Timber.d("startUpdateProcess: Enqueued for update: ${fusedDownload.name} ${fusedDownload.id} ${fusedDownload.status}") InstallWorkManager.enqueueWork(fusedDownload) - Log.d(TAG, ">>> startUpdateProcess: ${fusedDownload.name}") + Timber.d(">>> startUpdateProcess: " + fusedDownload.name) } } -- GitLab From c5d9477cf5f0a204f2df2ad163c6985076505724 Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Thu, 23 Jun 2022 11:56:25 +0600 Subject: [PATCH 3/3] App Lounge: fixed pipeline --- .../foundation/e/apps/AppLoungeApplication.kt | 1 - .../java/foundation/e/apps/MainActivity.kt | 25 ++++--------------- .../e/apps/MainActivityViewModel.kt | 10 ++------ .../foundation/e/apps/PrivacyInfoViewModel.kt | 2 -- .../foundation/e/apps/api/DownloadManager.kt | 1 - .../e/apps/api/fused/FusedAPIImpl.kt | 3 +-- .../e/apps/api/gplay/GPlayAPIImpl.kt | 2 +- .../e/apps/api/gplay/utils/GPlayHttpClient.kt | 3 +-- .../e/apps/application/ApplicationFragment.kt | 3 +-- .../e/apps/categories/CategoriesFragment.kt | 3 +-- .../foundation/e/apps/home/HomeFragment.kt | 3 +-- .../e/apps/home/model/HomeParentRVAdapter.kt | 3 +-- .../manager/download/DownloadManagerBR.kt | 3 +-- .../manager/download/DownloadManagerUtils.kt | 1 - .../download/data/DownloadProgressLD.kt | 3 +-- .../e/apps/manager/fused/FileManager.kt | 5 ++-- .../e/apps/manager/fused/FusedManagerImpl.kt | 9 +++---- .../manager/pkg/PackageInstallerService.kt | 3 +-- .../e/apps/manager/pkg/PkgManagerBR.kt | 5 ++-- .../e/apps/manager/pkg/PkgManagerModule.kt | 5 ++-- .../manager/workmanager/InstallAppWorker.kt | 4 +-- .../e/apps/purchase/AppPurchaseFragment.kt | 2 -- .../e/apps/settings/SettingsFragment.kt | 3 +-- .../signin/LocaleChangedBroadcastReceiver.kt | 3 +-- .../manager/UpdatesBroadcastReceiver.kt | 3 +-- .../e/apps/updates/manager/UpdatesWorker.kt | 1 - 26 files changed, 32 insertions(+), 77 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/AppLoungeApplication.kt b/app/src/main/java/foundation/e/apps/AppLoungeApplication.kt index 7a8c42151..fe0adc009 100644 --- a/app/src/main/java/foundation/e/apps/AppLoungeApplication.kt +++ b/app/src/main/java/foundation/e/apps/AppLoungeApplication.kt @@ -35,7 +35,6 @@ import timber.log.Timber.Forest.plant import java.util.concurrent.Executors import javax.inject.Inject - @HiltAndroidApp @DelicateCoroutinesApi class AppLoungeApplication : Application(), Configuration.Provider { diff --git a/app/src/main/java/foundation/e/apps/MainActivity.kt b/app/src/main/java/foundation/e/apps/MainActivity.kt index a834a14ff..37a2823a9 100644 --- a/app/src/main/java/foundation/e/apps/MainActivity.kt +++ b/app/src/main/java/foundation/e/apps/MainActivity.kt @@ -24,10 +24,8 @@ import android.os.Bundle import android.os.Environment import android.os.StatFs import android.os.storage.StorageManager -import android.util.Log import android.view.View import androidx.appcompat.app.AppCompatActivity -import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope import androidx.navigation.NavOptions @@ -95,22 +93,19 @@ class MainActivity : AppCompatActivity() { binding.fragment.visibility = View.VISIBLE // Watch and refresh authentication data - if(viewModel.authDataJson.value == null) { + if (viewModel.authDataJson.value == null) { viewModel.authDataJson.observe(this) { viewModel.handleAuthDataJson() } } - } } - Timber.d(">>> userTypeLiveData: ${viewModel.userType.value}") - Timber.d(">>> authDataJsonLiveData: ${viewModel.authDataJson.value}") viewModel.userType.observe(this) { user -> viewModel.handleAuthDataJson() } - if(signInViewModel.authLiveData.value == null) { + if (signInViewModel.authLiveData.value == null) { signInViewModel.authLiveData.observe(this) { viewModel.updateAuthData(it) } @@ -121,7 +116,7 @@ class MainActivity : AppCompatActivity() { Timber.d("Timeout validating auth data!") val lastFragment = navHostFragment.childFragmentManager.fragments[0] if (lastFragment is TimeoutFragment) { - Timber.d("Displaying timeout from MainActivity on fragment: " + Fragment.java.name) + Timber.d("Displaying timeout from MainActivity on fragment: " + lastFragment.javaClass.name) lastFragment.onTimeout() } } @@ -223,7 +218,7 @@ class MainActivity : AppCompatActivity() { } viewModel.updateAwaiting(it) InstallWorkManager.enqueueWork(it) - Timber.d( "===> onCreate: AWAITING ${it.name}") + Timber.d("===> onCreate: AWAITING ${it.name}") } } @@ -278,7 +273,7 @@ class MainActivity : AppCompatActivity() { statsManager.getFreeBytes(StorageManager.UUID_DEFAULT) } } catch (e: Exception) { - Timber.e( "calculateAvailableDiskSpace: ${e.stackTraceToString()}") + Timber.e("calculateAvailableDiskSpace: ${e.stackTraceToString()}") getAvailableInternalMemorySize() } } else { @@ -293,14 +288,4 @@ class MainActivity : AppCompatActivity() { val availableBlocks = stat.availableBlocksLong return availableBlocks * blockSize } - - override fun onResume() { - Timber.d(">>> onResume") - super.onResume() - } - - override fun onDestroy() { - Timber.d(">>> onDestroy") - super.onDestroy() - } } diff --git a/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt b/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt index 165834e26..7f814995e 100644 --- a/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt +++ b/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt @@ -23,7 +23,6 @@ import android.graphics.Bitmap import android.os.Build import android.os.SystemClock import android.util.Base64 -import android.util.Log import android.widget.ImageView import androidx.annotation.RequiresApi import androidx.appcompat.app.AlertDialog @@ -189,10 +188,10 @@ class MainActivityViewModel @Inject constructor( if (regenerateFunction != null) { dataStoreModule.userType.collect { user -> if (!user.isBlank() && User.valueOf(user) == User.ANONYMOUS) { - Timber.d( "Regenerating auth data for Anonymous user") + Timber.d("Regenerating auth data for Anonymous user") regenerateFunction(user) } else { - Timber.d( "Ask Google user to log in again") + Timber.d("Ask Google user to log in again") dataStoreModule.clearUserType() } } @@ -540,9 +539,4 @@ class MainActivityViewModel @Inject constructor( fun updateAppWarningList() { blockedAppRepository.fetchUpdateOfAppWarningList() } - - override fun onCleared() { - Timber.d(">>> onCleared") - super.onCleared() - } } diff --git a/app/src/main/java/foundation/e/apps/PrivacyInfoViewModel.kt b/app/src/main/java/foundation/e/apps/PrivacyInfoViewModel.kt index a4ade66ae..01afa6db9 100644 --- a/app/src/main/java/foundation/e/apps/PrivacyInfoViewModel.kt +++ b/app/src/main/java/foundation/e/apps/PrivacyInfoViewModel.kt @@ -1,6 +1,5 @@ package foundation.e.apps -import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.liveData @@ -10,7 +9,6 @@ import foundation.e.apps.api.exodus.models.AppPrivacyInfo import foundation.e.apps.api.exodus.repositories.IAppPrivacyInfoRepository import foundation.e.apps.api.fused.data.FusedApp import foundation.e.apps.utils.modules.CommonUtilsModule.LIST_OF_NULL -import timber.log.Timber import javax.inject.Inject import kotlin.math.ceil import kotlin.math.round diff --git a/app/src/main/java/foundation/e/apps/api/DownloadManager.kt b/app/src/main/java/foundation/e/apps/api/DownloadManager.kt index 8356dc230..c03400feb 100644 --- a/app/src/main/java/foundation/e/apps/api/DownloadManager.kt +++ b/app/src/main/java/foundation/e/apps/api/DownloadManager.kt @@ -19,7 +19,6 @@ package foundation.e.apps.api import android.app.DownloadManager import android.net.Uri -import android.util.Log import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay diff --git a/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt b/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt index 5927a805c..ad0772ee6 100644 --- a/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt +++ b/app/src/main/java/foundation/e/apps/api/fused/FusedAPIImpl.kt @@ -20,7 +20,6 @@ package foundation.e.apps.api.fused import android.content.Context import android.text.format.Formatter -import android.util.Log import androidx.lifecycle.LiveData import androidx.lifecycle.liveData import androidx.lifecycle.map @@ -162,7 +161,7 @@ class FusedAPIImpl @Inject constructor( } catch (e: TimeoutCancellationException) { e.printStackTrace() apiStatus = ResultStatus.TIMEOUT - Timber.d( "Timed out fetching home data for type: $applicationType") + Timber.d("Timed out fetching home data for type: $applicationType") } catch (e: Exception) { apiStatus = ResultStatus.UNKNOWN Timber.e(e) diff --git a/app/src/main/java/foundation/e/apps/api/gplay/GPlayAPIImpl.kt b/app/src/main/java/foundation/e/apps/api/gplay/GPlayAPIImpl.kt index 27bc73754..e0526b2ec 100644 --- a/app/src/main/java/foundation/e/apps/api/gplay/GPlayAPIImpl.kt +++ b/app/src/main/java/foundation/e/apps/api/gplay/GPlayAPIImpl.kt @@ -32,10 +32,10 @@ import com.aurora.gplayapi.data.models.StreamCluster import com.aurora.gplayapi.helpers.AppDetailsHelper import com.aurora.gplayapi.helpers.AuthValidator import com.aurora.gplayapi.helpers.CategoryHelper +import com.aurora.gplayapi.helpers.ExpandedBrowseHelper import com.aurora.gplayapi.helpers.PurchaseHelper import com.aurora.gplayapi.helpers.SearchHelper import com.aurora.gplayapi.helpers.StreamHelper -import com.aurora.gplayapi.helpers.ExpandedBrowseHelper import com.aurora.gplayapi.helpers.TopChartsHelper import dagger.hilt.android.qualifiers.ApplicationContext import foundation.e.apps.api.gplay.token.TokenRepository diff --git a/app/src/main/java/foundation/e/apps/api/gplay/utils/GPlayHttpClient.kt b/app/src/main/java/foundation/e/apps/api/gplay/utils/GPlayHttpClient.kt index 351bf9051..c6b3bb304 100644 --- a/app/src/main/java/foundation/e/apps/api/gplay/utils/GPlayHttpClient.kt +++ b/app/src/main/java/foundation/e/apps/api/gplay/utils/GPlayHttpClient.kt @@ -19,7 +19,6 @@ package foundation.e.apps.api.gplay.utils -import android.util.Log import com.aurora.gplayapi.data.models.PlayResponse import com.aurora.gplayapi.network.IHttpClient import foundation.e.apps.BuildConfig @@ -170,7 +169,7 @@ class GPlayHttpClient @Inject constructor( } private fun handleExceptionOnGooglePlayRequest(e: Exception): PlayResponse { - Timber.e( "processRequest: ${e.localizedMessage}") + Timber.e("processRequest: ${e.localizedMessage}") return PlayResponse() } diff --git a/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt b/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt index 60eebeba8..ef93e0a16 100644 --- a/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt +++ b/app/src/main/java/foundation/e/apps/application/ApplicationFragment.kt @@ -24,7 +24,6 @@ import android.graphics.drawable.Drawable import android.os.Bundle import android.text.Html import android.text.format.Formatter -import android.util.Log import android.view.View import android.widget.ImageView import android.widget.RelativeLayout @@ -402,7 +401,7 @@ class ApplicationFragment : TimeoutFragment(R.layout.fragment_application) { appSize ) else -> { - Timber.d( "Unknown status: $status") + Timber.d("Unknown status: $status") } } } diff --git a/app/src/main/java/foundation/e/apps/categories/CategoriesFragment.kt b/app/src/main/java/foundation/e/apps/categories/CategoriesFragment.kt index 76360f2d3..3eb07a1d8 100644 --- a/app/src/main/java/foundation/e/apps/categories/CategoriesFragment.kt +++ b/app/src/main/java/foundation/e/apps/categories/CategoriesFragment.kt @@ -19,7 +19,6 @@ package foundation.e.apps.categories import android.os.Bundle -import android.util.Log import android.view.View import com.aurora.gplayapi.data.models.AuthData import com.google.android.material.tabs.TabLayoutMediator @@ -70,7 +69,7 @@ class CategoriesFragment : TimeoutFragment(R.layout.fragment_categories) { fragment?.let { if (it is TimeoutFragment) { - Timber.d( "Showing timeout on Categories fragment: " + it::class.java.name) + Timber.d("Showing timeout on Categories fragment: " + it::class.java.name) it.onTimeout() } } diff --git a/app/src/main/java/foundation/e/apps/home/HomeFragment.kt b/app/src/main/java/foundation/e/apps/home/HomeFragment.kt index ae95fd497..83f7c1cee 100644 --- a/app/src/main/java/foundation/e/apps/home/HomeFragment.kt +++ b/app/src/main/java/foundation/e/apps/home/HomeFragment.kt @@ -19,7 +19,6 @@ package foundation.e.apps.home import android.os.Bundle -import android.util.Log import android.view.View import android.widget.ImageView import androidx.fragment.app.activityViewModels @@ -159,7 +158,7 @@ class HomeFragment : TimeoutFragment(R.layout.fragment_home), FusedAPIInterface homeViewModel.homeScreenData.observe(viewLifecycleOwner) { stopLoadingUI() if (it.second == ResultStatus.OK) { - if(homeParentRVAdapter?.itemCount ?: 0 > 0) { + if (!homeParentRVAdapter?.currentList.isNullOrEmpty()) { return@observe } dismissTimeoutDialog() diff --git a/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt b/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt index b1836bf76..4d65c1112 100644 --- a/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt +++ b/app/src/main/java/foundation/e/apps/home/model/HomeParentRVAdapter.kt @@ -18,7 +18,6 @@ package foundation.e.apps.home.model -import android.util.Log import android.view.LayoutInflater import android.view.ViewGroup import androidx.lifecycle.LifecycleOwner @@ -112,7 +111,7 @@ class HomeParentRVAdapter( override fun onViewDetachedFromWindow(holder: ViewHolder) { super.onViewDetachedFromWindow(holder) - if(isDetachedFromRecyclerView) { + if (isDetachedFromRecyclerView) { holder.binding.childRV.adapter = null } } diff --git a/app/src/main/java/foundation/e/apps/manager/download/DownloadManagerBR.kt b/app/src/main/java/foundation/e/apps/manager/download/DownloadManagerBR.kt index a7ecf29a4..3665d0d44 100644 --- a/app/src/main/java/foundation/e/apps/manager/download/DownloadManagerBR.kt +++ b/app/src/main/java/foundation/e/apps/manager/download/DownloadManagerBR.kt @@ -22,7 +22,6 @@ import android.app.DownloadManager import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import android.util.Log import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.DelicateCoroutinesApi import timber.log.Timber @@ -44,7 +43,7 @@ class DownloadManagerBR : BroadcastReceiver() { val action = intent?.action if (context != null && action != null) { val id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, 0) - Timber.d( "onReceive: DownloadBR $action $id") + Timber.d("onReceive: DownloadBR $action $id") when (action) { DownloadManager.ACTION_DOWNLOAD_COMPLETE -> { downloadedList.add(id) diff --git a/app/src/main/java/foundation/e/apps/manager/download/DownloadManagerUtils.kt b/app/src/main/java/foundation/e/apps/manager/download/DownloadManagerUtils.kt index 386c2542d..13b450fb7 100644 --- a/app/src/main/java/foundation/e/apps/manager/download/DownloadManagerUtils.kt +++ b/app/src/main/java/foundation/e/apps/manager/download/DownloadManagerUtils.kt @@ -19,7 +19,6 @@ package foundation.e.apps.manager.download import android.content.Context -import android.util.Log import dagger.hilt.android.qualifiers.ApplicationContext import foundation.e.apps.manager.fused.FusedManagerRepository import foundation.e.apps.utils.enums.Status diff --git a/app/src/main/java/foundation/e/apps/manager/download/data/DownloadProgressLD.kt b/app/src/main/java/foundation/e/apps/manager/download/data/DownloadProgressLD.kt index 76b7c3127..bba555692 100644 --- a/app/src/main/java/foundation/e/apps/manager/download/data/DownloadProgressLD.kt +++ b/app/src/main/java/foundation/e/apps/manager/download/data/DownloadProgressLD.kt @@ -1,7 +1,6 @@ package foundation.e.apps.manager.download.data import android.app.DownloadManager -import android.util.Log import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.LiveData import androidx.lifecycle.Observer @@ -87,7 +86,7 @@ class DownloadProgressLD @Inject constructor( } } } catch (e: Exception) { - Timber.e( "downloading Ids: $downloadingIds ${e.localizedMessage}") + Timber.e("downloading Ids: $downloadingIds ${e.localizedMessage}") } delay(20) } diff --git a/app/src/main/java/foundation/e/apps/manager/fused/FileManager.kt b/app/src/main/java/foundation/e/apps/manager/fused/FileManager.kt index 1fed37915..43b57cb58 100644 --- a/app/src/main/java/foundation/e/apps/manager/fused/FileManager.kt +++ b/app/src/main/java/foundation/e/apps/manager/fused/FileManager.kt @@ -1,6 +1,5 @@ package foundation.e.apps.manager.fused -import android.util.Log import timber.log.Timber import java.io.File import java.io.FileInputStream @@ -34,9 +33,9 @@ object FileManager { // delete the original file File(inputPath + inputFile).delete() } catch (e: FileNotFoundException) { - Timber.e( e.stackTraceToString()) + Timber.e(e.stackTraceToString()) } catch (e: Exception) { - Timber.e( e.stackTraceToString()) + Timber.e(e.stackTraceToString()) } finally { inputStream?.close() inputStream = null diff --git a/app/src/main/java/foundation/e/apps/manager/fused/FusedManagerImpl.kt b/app/src/main/java/foundation/e/apps/manager/fused/FusedManagerImpl.kt index c0c1627fc..64e62cc7d 100644 --- a/app/src/main/java/foundation/e/apps/manager/fused/FusedManagerImpl.kt +++ b/app/src/main/java/foundation/e/apps/manager/fused/FusedManagerImpl.kt @@ -25,7 +25,6 @@ import android.content.Context import android.net.Uri import android.os.Build import android.os.Environment -import android.util.Log import androidx.annotation.RequiresApi import androidx.lifecycle.LiveData import dagger.hilt.android.qualifiers.ApplicationContext @@ -128,9 +127,9 @@ class FusedManagerImpl @Inject constructor( list.sort() if (list.size != 0) { try { - Timber.d( "installApp: STARTED ${fusedDownload.name} ${list.size}") + Timber.d("installApp: STARTED ${fusedDownload.name} ${list.size}") pkgManagerModule.installApplication(list, fusedDownload.packageName) - Timber.d( "installApp: ENDED ${fusedDownload.name} ${list.size}") + Timber.d("installApp: ENDED ${fusedDownload.name} ${list.size}") } catch (e: Exception) { Timber.d(">>> installApp app failed ") installationIssue(fusedDownload) @@ -139,7 +138,7 @@ class FusedManagerImpl @Inject constructor( } } else -> { - Timber.d( "Unsupported application type!") + Timber.d("Unsupported application type!") fusedDownload.status = Status.INSTALLATION_ISSUE databaseRepository.updateDownload(fusedDownload) delay(100) @@ -163,7 +162,7 @@ class FusedManagerImpl @Inject constructor( databaseRepository.deleteDownload(fusedDownload) flushOldDownload(fusedDownload.packageName) } else { - Timber.d( "Unable to cancel download!") + Timber.d("Unable to cancel download!") } } diff --git a/app/src/main/java/foundation/e/apps/manager/pkg/PackageInstallerService.kt b/app/src/main/java/foundation/e/apps/manager/pkg/PackageInstallerService.kt index 4614c46f2..c4d7ea74c 100644 --- a/app/src/main/java/foundation/e/apps/manager/pkg/PackageInstallerService.kt +++ b/app/src/main/java/foundation/e/apps/manager/pkg/PackageInstallerService.kt @@ -22,7 +22,6 @@ import android.app.Service import android.content.Intent import android.content.pm.PackageInstaller import android.os.IBinder -import android.util.Log import dagger.hilt.android.AndroidEntryPoint import foundation.e.apps.manager.fused.FusedManagerRepository import foundation.e.apps.utils.enums.Status @@ -50,7 +49,7 @@ class PackageInstallerService : Service() { if (status == PackageInstaller.STATUS_SUCCESS) { updateDownloadStatus(packageName) } else { - Timber.e( "Installation failed due to error: $extra") + Timber.e("Installation failed due to error: $extra") updateInstallationIssue(packageName) } } diff --git a/app/src/main/java/foundation/e/apps/manager/pkg/PkgManagerBR.kt b/app/src/main/java/foundation/e/apps/manager/pkg/PkgManagerBR.kt index 384ab2e62..211e3dbca 100644 --- a/app/src/main/java/foundation/e/apps/manager/pkg/PkgManagerBR.kt +++ b/app/src/main/java/foundation/e/apps/manager/pkg/PkgManagerBR.kt @@ -22,7 +22,6 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.pm.PackageInstaller -import android.util.Log import dagger.hilt.android.AndroidEntryPoint import foundation.e.apps.manager.fused.FusedManagerRepository import foundation.e.apps.utils.enums.Status @@ -56,7 +55,7 @@ open class PkgManagerBR : BroadcastReceiver() { val status = intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -69) val packageName = intent.getStringExtra(PackageInstaller.EXTRA_PACKAGE_NAME) - Timber.d( "onReceive: $packageName $action $extra $status") + Timber.d("onReceive: $packageName $action $extra $status") packages?.let { pkgList -> pkgList.forEach { pkgName -> when (action) { @@ -67,7 +66,7 @@ open class PkgManagerBR : BroadcastReceiver() { if (!isUpdating) deleteDownload(pkgName) } PkgManagerModule.ERROR_PACKAGE_INSTALL -> { - Timber.e( "Installation failed due to error: $extra") + Timber.e("Installation failed due to error: $extra") updateInstallationIssue(pkgName) } } diff --git a/app/src/main/java/foundation/e/apps/manager/pkg/PkgManagerModule.kt b/app/src/main/java/foundation/e/apps/manager/pkg/PkgManagerModule.kt index f195384f6..e694d89e7 100644 --- a/app/src/main/java/foundation/e/apps/manager/pkg/PkgManagerModule.kt +++ b/app/src/main/java/foundation/e/apps/manager/pkg/PkgManagerModule.kt @@ -27,7 +27,6 @@ import android.content.pm.PackageInfo import android.content.pm.PackageInstaller import android.content.pm.PackageManager import android.os.Build -import android.util.Log import androidx.core.content.pm.PackageInfoCompat import dagger.hilt.android.qualifiers.ApplicationContext import foundation.e.apps.api.fused.FusedAPIImpl @@ -117,7 +116,7 @@ class PkgManagerModule @Inject constructor( val targetPackage = fusedDownload.packageName try { packageManager.setInstallerPackageName(targetPackage, fakeStorePackageName) - Timber.d( "Changed installer to $fakeStorePackageName for $targetPackage") + Timber.d("Changed installer to $fakeStorePackageName for $targetPackage") } catch (e: Exception) { e.printStackTrace() } @@ -169,7 +168,7 @@ class PkgManagerModule @Inject constructor( ) session.commit(servicePendingIntent.intentSender) } catch (e: Exception) { - Timber.e( "$packageName: \n${e.stackTraceToString()}") + Timber.e("$packageName: \n${e.stackTraceToString()}") val pendingIntent = PendingIntent.getBroadcast( context, sessionId, diff --git a/app/src/main/java/foundation/e/apps/manager/workmanager/InstallAppWorker.kt b/app/src/main/java/foundation/e/apps/manager/workmanager/InstallAppWorker.kt index 1a2871619..4299c44be 100644 --- a/app/src/main/java/foundation/e/apps/manager/workmanager/InstallAppWorker.kt +++ b/app/src/main/java/foundation/e/apps/manager/workmanager/InstallAppWorker.kt @@ -101,12 +101,12 @@ class InstallAppWorker @AssistedInject constructor( mutex.lock() } } catch (e: Exception) { - Timber.e( "doWork: Failed: ${e.stackTraceToString()}") + Timber.e("doWork: Failed: ${e.stackTraceToString()}") fusedDownload?.let { fusedManagerRepository.installationIssue(it) } } finally { - Timber.d( "doWork: RESULT SUCCESS: ${fusedDownload?.name}") + Timber.d("doWork: RESULT SUCCESS: ${fusedDownload?.name}") return Result.success() } } diff --git a/app/src/main/java/foundation/e/apps/purchase/AppPurchaseFragment.kt b/app/src/main/java/foundation/e/apps/purchase/AppPurchaseFragment.kt index 901490495..bafc74ffa 100644 --- a/app/src/main/java/foundation/e/apps/purchase/AppPurchaseFragment.kt +++ b/app/src/main/java/foundation/e/apps/purchase/AppPurchaseFragment.kt @@ -2,7 +2,6 @@ package foundation.e.apps.purchase import android.os.Build import android.os.Bundle -import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -14,7 +13,6 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels import foundation.e.apps.MainActivityViewModel import foundation.e.apps.databinding.FragmentAppPurchaseBinding -import timber.log.Timber /** * A simple [Fragment] subclass. diff --git a/app/src/main/java/foundation/e/apps/settings/SettingsFragment.kt b/app/src/main/java/foundation/e/apps/settings/SettingsFragment.kt index d92e92af4..f652c2ce4 100644 --- a/app/src/main/java/foundation/e/apps/settings/SettingsFragment.kt +++ b/app/src/main/java/foundation/e/apps/settings/SettingsFragment.kt @@ -22,7 +22,6 @@ import android.content.Intent import android.os.Bundle import android.os.Handler import android.os.Looper -import android.util.Log import android.view.View import android.widget.Toast import androidx.fragment.app.viewModels @@ -71,7 +70,7 @@ class SettingsFragment : PreferenceFragmentCompat() { val updateCheckInterval = preferenceManager.findPreference(getString(R.string.update_check_intervals)) updateCheckInterval?.setOnPreferenceChangeListener { _, newValue -> - Timber.d( "onCreatePreferences: updated Value: $newValue") + Timber.d("onCreatePreferences: updated Value: $newValue") context?.let { UpdatesWorkManager.enqueueWork( it, diff --git a/app/src/main/java/foundation/e/apps/setup/signin/LocaleChangedBroadcastReceiver.kt b/app/src/main/java/foundation/e/apps/setup/signin/LocaleChangedBroadcastReceiver.kt index 15980e9ed..2c47379f0 100644 --- a/app/src/main/java/foundation/e/apps/setup/signin/LocaleChangedBroadcastReceiver.kt +++ b/app/src/main/java/foundation/e/apps/setup/signin/LocaleChangedBroadcastReceiver.kt @@ -21,7 +21,6 @@ package foundation.e.apps.setup.signin import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import android.util.Log import com.aurora.gplayapi.data.models.AuthData import com.google.gson.Gson import dagger.hilt.android.AndroidEntryPoint @@ -59,7 +58,7 @@ class LocaleChangedBroadcastReceiver : BroadcastReceiver() { cache.evictAll() } } catch (ex: Exception) { - Timber.e( ex.message.toString()) + Timber.e(ex.message.toString()) } } } diff --git a/app/src/main/java/foundation/e/apps/updates/manager/UpdatesBroadcastReceiver.kt b/app/src/main/java/foundation/e/apps/updates/manager/UpdatesBroadcastReceiver.kt index db2da50be..cb4dff421 100644 --- a/app/src/main/java/foundation/e/apps/updates/manager/UpdatesBroadcastReceiver.kt +++ b/app/src/main/java/foundation/e/apps/updates/manager/UpdatesBroadcastReceiver.kt @@ -20,7 +20,6 @@ package foundation.e.apps.updates.manager import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import android.util.Log import androidx.preference.PreferenceManager import androidx.work.ExistingPeriodicWorkPolicy import foundation.e.apps.R @@ -32,7 +31,7 @@ class UpdatesBroadcastReceiver : BroadcastReceiver() { } override fun onReceive(context: Context, intent: Intent) { - Timber.d( "onReceive: ${intent.action}") + Timber.d("onReceive: ${intent.action}") if (intent.action == Intent.ACTION_BOOT_COMPLETED) { val preferences = PreferenceManager.getDefaultSharedPreferences(context) val interval = diff --git a/app/src/main/java/foundation/e/apps/updates/manager/UpdatesWorker.kt b/app/src/main/java/foundation/e/apps/updates/manager/UpdatesWorker.kt index a2fdae874..f73370521 100644 --- a/app/src/main/java/foundation/e/apps/updates/manager/UpdatesWorker.kt +++ b/app/src/main/java/foundation/e/apps/updates/manager/UpdatesWorker.kt @@ -8,7 +8,6 @@ import android.graphics.BitmapFactory import android.net.ConnectivityManager import android.net.NetworkCapabilities import android.util.Base64 -import android.util.Log import androidx.hilt.work.HiltWorker import androidx.preference.PreferenceManager import androidx.work.CoroutineWorker -- GitLab