d4rken-org / sdmaid

SD Maid is an Android app that helps you manage files and apps.
https://play.google.com/store/apps/details?id=eu.thedarken.sdm
1.52k stars 752 forks source link

AppControl sort-mode spinner can trigger scan on open #784

Closed d4rken closed 6 years ago

d4rken commented 7 years ago

It's possible that somekind of UI racecondition can cause AppControl to start scanning when opening the UI. The sort-mode spinner in the rightside filter drawer likely triggers this.

NeoBeum commented 7 years ago

Oh, I didn't see this. This issue has been here since I found this app ages ago.

d4rken commented 7 years ago

Since before the right side filter menu existed? Then it couldn't be the spinner...

NeoBeum commented 7 years ago

I had a look at play store account and I got pro in OCT2016, so I would have had SD Maid in September 2016

NeoBeum commented 7 years ago

Maybe the spinner gets triggered on page fragment load

d4rken commented 7 years ago

Think I added the spinner in NOV2016, see: https://github.com/d4rken/sdmaid-public/blob/master/CHANGELOG.md#appcontrol-14

Maybe the spinner gets triggered on page fragment load

Something like that. I think it might be an issue with restoring the correct spinner item being selected and that triggering a scan (because if you change the sort mode it automatically scans).

d4rken commented 7 years ago

@NeoBeum If you can no longer reproduce this (I never could), then just close this ticket.

NeoBeum commented 7 years ago

yeah you can close this one, I'll let you know if it comes back

d4rken commented 7 years ago

Smartphone Lenovo A7010, factory firmware Lenovo Vibe UI, Android 6.0.

1498930248916 I/Debug: F: VERSIONNAME:4.7.5; VERSIONCODE:40705
1498930248918 I/Debug: P: VERSIONNAME:4.1.1; VERSIONCODE:40101
1498930248942 D/Debug: ro.build.id=MRA58K
1498930248943 D/Debug: ro.build.display.id=A7010a48_S232_161227_ROW
1498930248943 D/Debug: ro.build.version.incremental=A7010a48_S232_161227_ROW
1498930248944 D/Debug: ro.build.version.sdk=23
1498930248944 D/Debug: ro.build.version.preview_sdk=0
1498930248944 D/Debug: ro.build.version.codename=REL
1498930248944 D/Debug: ro.build.version.all_codenames=REL
1498930248945 D/Debug: ro.build.version.release=6.0
1498930248945 D/Debug: ro.build.version.security_patch=2016-12-05
1498930248945 D/Debug: ro.build.version.base_os=
1498930248945 D/Debug: ro.build.date=2016年 12月 27日 星期二 14:35:36 CST
1498930248946 D/Debug: ro.build.date.utc=1482820536
1498930248946 D/Debug: ro.build.type=user
1498930248946 D/Debug: ro.build.user=buildslave
1498930248947 D/Debug: ro.build.host=njbs15
1498930248949 D/Debug: ro.build.tags=release-keys
1498930248950 D/Debug: ro.build.flavor=k5fpr-user
1498930248951 D/Debug: ro.product.model=Lenovo A7010a48
1498930248951 D/Debug: ro.product.brand=Lenovo
1498930248952 D/Debug: ro.product.name=k5fpr
1498930248953 D/Debug: ro.product.device=A7010a48
1498930248953 D/Debug: ro.product.board=
1498930248953 D/Debug: ro.product.cpu.abi=arm64-v8a
1498930248954 D/Debug: ro.product.cpu.abilist=arm64-v8a,armeabi-v7a,armeabi
1498930248955 D/Debug: ro.product.cpu.abilist32=armeabi-v7a,armeabi
1498930248957 D/Debug: ro.product.cpu.abilist64=arm64-v8a
1498930248959 D/Debug: ro.product.manufacturer=LENOVO
1498930248960 D/Debug: ro.product.locale=en-US
1498930248960 D/Debug: ro.build.product=A7010a48
1498930248961 D/Debug: ro.build.description=k5fpr-user 6.0 MRA58K A7010a48_S232_161227_ROW release-keys
1498930248961 D/Debug: ro.build.fingerprint=Lenovo/k5fpr/A7010a48:6.0/MRA58K/RA7010a48_S232_161227_ROW.12271429:user/release-keys
1498930248962 D/Debug: ro.build.characteristics=default
1498930248962 D/Debug: ro.product.sw.internal.version=A7010a48_USR_S232_1612271410_mp1V2.39.1_ROW
1498930248964 D/Debug: ro.product.hw.version=H201
1498930248965 D/Debug: ro.product.ota.model=LenovoA7010a48_M_ROW
1498930249231 V/Fragment:OneClickFragment(fee1589): onAttach(context=eu.thedarken.sdm.SDMMainActivity@db94af7)
1498930249232 V/Fragment:OneClickFragment(fee1589): onCreate(savedInstanceState=null)
1498930249321 V/Fragment:OneClickFragment(fee1589): onViewCreated(view=android.support.design.widget.CoordinatorLayout{60efdbc V.E...... ......I. 0,0-0,0 #7f0f0006 app:id/coordinatorlayout}, savedInstanceState=null)
1498930249322 V/Fragment:OneClickFragment(fee1589): onActivityCreated(savedInstanceState=null)
1498930249326 V/SDMActivity:SDMMainActivity(db94af7): onResume()
1498930249339 V/Fragment:NavigationFragment(54be4df): onResume()
1498930249340 D/SDMActivity:SDMMainActivity(db94af7): requestBinder(customer=eu.thedarken.sdm.navigation.NavigationFragment$1@6c1d004)
1498930249340 V/Fragment:OneClickFragment(fee1589): onResume()
1498930249341 D/SDMActivity:SDMMainActivity(db94af7): requestBinder(customer=OneClickFragment{fee1589 #1 id=0x7f0f008f eu.thedarken.sdm.oneclick.OneClickFragment})
1498930249341 D/PiwikHelper: TrackTime UNLOCKER in 3
1498930249352 D/PIWIK:Tracker: Event added to the queue: org.piwik.sdk.d@564417a
1498930249394 D/SDMService: onCreate
1498930249399 D/SDMService: onStartCommand
1498930249400 D/PiwikHelper: TrackTime SDMAID in 2
1498930249401 D/SDMService: onBind
1498930249607 V/QuickAccessWidgetProvider: ExternalEventSet onReceive(Intent { act=eu.thedarken.sdm.ACTION_EXTERNAL_EVENT flg=0x10 cmp=eu.thedarken.sdm/.oneclick.widget.QuickAccessWidgetProvider (has extras) })
1498930249613 D/QuickAccessWidgetProvider: ID: 33, Eventset: ExternalEventSet(working={}, events={})
1498930249623 D/SDMActivity:SDMMainActivity(db94af7): Service is bound
1498930249624 D/SDMActivity:SDMMainActivity(db94af7): Delivering SDMBinder(OneClickFragment{fee1589 #1 id=0x7f0f008f eu.thedarken.sdm.oneclick.OneClickFragment})
1498930249624 D/OneClickFragment: onBinderAvailable
1498930249643 D/SDMActivity:SDMMainActivity(db94af7): Delivering SDMBinder(eu.thedarken.sdm.navigation.NavigationFragment$1@6c1d004)

^ Started on quick access

1498930254271 V/SDMMainActivity: onDrawerOpened
1498930256376 V/SDMRecyclerView: onRecyclerItemClick(pos:4)->true
1498930256418 V/Fragment:AppControlFragment(1597c4b): onAttach(context=eu.thedarken.sdm.SDMMainActivity@db94af7)

^ Switching to AppControl

1498930256418 V/Fragment:AppControlFragment(1597c4b): onCreate(savedInstanceState=null)
1498930256421 V/Fragment:OneClickFragment(fee1589): onPause()
1498930256424 V/Fragment:OneClickFragment(fee1589): onDestroyView()

^ Quick access page is gone

1498930256519 D/UIPostHelper: attach(android.support.design.widget.CoordinatorLayout{8ffcb22 V.E...... ......I. 0,0-0,0 #7f0f0006 app:id/coordinatorlayout})
1498930256520 D/UIPostHelper: addListener(eu.thedarken.sdm.ui.AbstractWorkerUIFragment$1@2421fb6)
1498930256521 V/Fragment:AppControlFragment(1597c4b): onViewCreated(view=android.support.design.widget.CoordinatorLayout{8ffcb22 V.E...... ......I. 0,0-0,0 #7f0f0006 app:id/coordinatorlayout}, savedInstanceState=null)
1498930256529 D/SDMActivity:SDMMainActivity(db94af7): requestBinder(customer=eu.thedarken.sdm.appcontrol.ui.j@89524b7)
1498930256529 V/Fragment:AppControlFragment(1597c4b): onActivityCreated(savedInstanceState=null)
1498930256530 V/Fragment:AppControlFragment(1597c4b): onResume()
1498930256531 D/SDMActivity:SDMMainActivity(db94af7): requestBinder(customer=AppControlFragment{1597c4b #2 id=0x7f0f008f eu.thedarken.sdm.appcontrol.ui.AppControlFragment})

^ App control is almost ready

1498930256551 D/PIWIK:Tracker: Event added to the queue: org.piwik.sdk.d@cc88142
1498930256632 D/AppControlFragment: internalSwitchWorkingState(false)
1498930256633 D/GlideGif: setState(fragment=AppControlFragment{1597c4b #2 id=0x7f0f008f eu.thedarken.sdm.appcontrol.ui.AppControlFragment}, state=INTRO
1498930256716 D/WorkerHub: Task submitted: ScanTask()
1498930256721 D/WorkerHub: Creating TaskProcessor for: AppControlWorker
1498930256723 D/WorkerHub:Processor:AppControlWorker: Task submitted: ScanTask()

^ Seems like updating the UI state setState triggers the scan...

NeoBeum commented 7 years ago

if you wanted appcontrol to be triggered by the scan button, then you could pass the state of an empty page for app control, like in overview. I was just testing as a user, and sd maid doesn't run as background task, if I switch to this browser post while scanning, sd maid gets a notification icon, so if sd maid is swiped away from the app overview device softkey it clears the ui state, and launching sd maid will trigger the scan. if I switch to sd maid without having swiped away the app, I can switch between all menu options in sd maid, and any app, without app control rescanning

screenshot_20170702-112822

screenshot_20170702-112949

screenshot_20170702-112957

NeoBeum commented 7 years ago

that's good though, because it means sd maid closes all tasks and processes properly.

if you don't switch apps while scan is in progress, there's no icon, that's why the preview page looks like its starting a scan

Vankog commented 6 years ago

Well, for me the AppControl scan triggers every time I enter the tool. Any way I can help?

d4rken commented 6 years ago

Any way I can help?

Currently not, I just need to find time to look into this again.

What Android/Version device do you have? Because I can't reproduce it everytime. Some devoces just seem to hit this racecondition every time ☹️

Vankog commented 6 years ago

7.0 - April 2017 Patch ARM nVidia SHIELD Tablet LTE rooted