Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump to latest SDK #4657

Merged
merged 3 commits into from
Dec 9, 2019
Merged

bump to latest SDK #4657

merged 3 commits into from
Dec 9, 2019

Conversation

tobiasKaminsky
Copy link
Member

Signed-off-by: tobiasKaminsky tobias@kaminsky.me

@tobiasKaminsky
Copy link
Member Author

/backport to stable-3.8

@AndyScherzinger
Copy link
Member

@tobiasKaminsky massive lint score increase likely due to changed rules because of the sdk bump

@tobiasKaminsky
Copy link
Member Author

../../../src/main/java/com/owncloud/android/datamodel/MediaProvider.java:53: Field requires API level Q (current min is 14): android.provider.MediaStore.MediaColumns#BUCKET_ID

https://developer.android.com/reference/android/provider/MediaStore.MediaColumns.html#BUCKET_ID

This just seems to be wrong. We have this since ages…

@codecov
Copy link

codecov bot commented Oct 15, 2019

Codecov Report

Merging #4657 into master will decrease coverage by 0.02%.
The diff coverage is 27.27%.

@@             Coverage Diff             @@
##             master   #4657      +/-   ##
===========================================
- Coverage     17.72%   17.7%   -0.03%     
  Complexity        3       3              
===========================================
  Files           384     385       +1     
  Lines         32650   32680      +30     
  Branches       4597    4594       -3     
===========================================
- Hits           5788    5785       -3     
- Misses        25938   25966      +28     
- Partials        924     929       +5
Impacted Files Coverage Δ Complexity Δ
.../com/owncloud/android/datamodel/MediaProvider.java 26.53% <27.27%> (-0.53%) 0 <0> (ø)
...va/com/owncloud/android/ui/SquareLinearLayout.java 0% <0%> (-50%) 0% <0%> (ø)
.../android/ui/activity/ThemedPreferenceActivity.java 63.63% <0%> (-3.04%) 0% <0%> (ø)
...m/owncloud/android/ui/activity/DrawerActivity.java 43.16% <0%> (-2.38%) 0% <0%> (ø)
...in/java/com/owncloud/android/utils/ThemeUtils.java 49.41% <0%> (-2.16%) 0% <0%> (ø)
...xtcloud/client/preferences/AppPreferencesImpl.java 58.37% <0%> (-1.52%) 0% <0%> (ø)
.../third_parties/daveKoeller/AlphanumComparator.java 82.14% <0%> (-1.2%) 0% <0%> (ø)
...ncloud/android/ui/fragment/OCFileListFragment.java 25.58% <0%> (-0.28%) 0% <0%> (ø)
src/main/java/com/owncloud/android/MainApp.java 56.11% <0%> (-0.21%) 0% <0%> (ø)
.../nextcloud/client/onboarding/WhatsNewActivity.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
... and 26 more

@AndyScherzinger
Copy link
Member

This just seems to be wrong. We have this since ages…

Yes and no ;) They have been in place for ages, now Google decided to move them up into the interface (via v29) and they are inherited from there, unfortunately this means that now you end up with lint warnings...

@AndyScherzinger
Copy link
Member

@tobiasKaminsky Dies on Android Q Emulator. Take some pictures and then open the Auto Upload

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nextcloud.client/com.owncloud.android.ui.activity.SyncedFoldersActivity}: java.lang.IllegalArgumentException: Invalid column Distinct bucket_id
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.IllegalArgumentException: Invalid column Distinct bucket_id
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:170)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
        at android.content.ContentProviderProxy.query(ContentProviderNative.java:423)
        at android.content.ContentResolver.query(ContentResolver.java:944)
        at android.content.ContentResolver.query(ContentResolver.java:880)
        at android.content.ContentResolver.query(ContentResolver.java:836)
        at com.owncloud.android.datamodel.MediaProvider.getImageFolders(MediaProvider.java:81)
        at com.owncloud.android.ui.activity.SyncedFoldersActivity.load(SyncedFoldersActivity.java:249)
        at com.owncloud.android.ui.activity.SyncedFoldersActivity.setupContent(SyncedFoldersActivity.java:236)
        at com.owncloud.android.ui.activity.SyncedFoldersActivity.onCreate(SyncedFoldersActivity.java:162)
        at android.app.Activity.performCreate(Activity.java:7802)
        at android.app.Activity.performCreate(Activity.java:7791)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 

@tobiasKaminsky
Copy link
Member Author

Invalid column Distinct bucket_id

This is concatenated here:

private static final String[] IMAGES_FOLDER_PROJECTION = {"Distinct " + MediaStore.Images.Media.BUCKET_ID,
MediaStore.Images.Media.BUCKET_DISPLAY_NAME};

I do not find a way how to do it better than to remove "distinct" and manually do a distinct…

@AndyScherzinger
Copy link
Member

This is only happening due to the sdk bump, can distinct be set via api? If so can it be limited to the column?

Else I also have no idea how to do this properly except doing it like you said, manually afterwards.

@tobiasKaminsky
Copy link
Member Author

I do the distinct part now manually.
Hopefully this will not take too much additionally time.

However, this is very rarely used and so it is acceptable to wait a bit longer.

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@tobiasKaminsky
Copy link
Member Author

After merging this, we can also merge the PR on library

@tobiasKaminsky
Copy link
Member Author

@tobiasKaminsky
Copy link
Member Author

This works also on Android 6.
Android 4/5 is failing due to other reasons for me at the moment…

@tobiasKaminsky
Copy link
Member Author

Lint is only about: https://www.kaminsky.me/nc-dev/android-lint/11823.html#InlinedApi

@AndyScherzinger what do you think? Increase lint/spotbugs for this or try to get rid of it with annotations?

@AndyScherzinger
Copy link
Member

what do you think? Increase lint/spotbugs for this or try to get rid of it with annotations?

I'd say so, yes 👍 It is documented and we can fix it over time but it shouldn't block development/merge :)

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@AndyScherzinger
Copy link
Member

@tobiasKaminsky you asked the backport bot for 3.8 while that should be 3.9 by now or none since I am unsure if you want to release this for 3.9.3+ or just 3.10+

@nextcloud-android-bot
Copy link
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11915.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@nextcloud-android-bot
Copy link
Collaborator

Codacy

325

Lint

TypemasterPR
Warnings5973
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings70
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings106
Security Warnings44
Dodgy code Warnings136
Total409

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings70
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings104
Security Warnings44
Dodgy code Warnings136
Total407

@tobiasKaminsky
Copy link
Member Author

@tobiasKaminsky you asked the backport bot for 3.8 while that should be 3.9 by now or none since I am unsure if you want to release this for 3.9.3+ or just 3.10+

backport label was remove, so I hope that nothing gets backported, as we do not need it.
I hope there will be no 3.9.3, so 3.10 is fine :-)

@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.10.0 milestone Dec 9, 2019
@AndyScherzinger
Copy link
Member

Just tested, works fine

@AndyScherzinger AndyScherzinger merged commit 8062340 into master Dec 9, 2019
@delete-merged-branch delete-merged-branch bot deleted the bumpSDK branch December 9, 2019 16:51
tobiasKaminsky added a commit that referenced this pull request Dec 11, 2019
5f6dc23 Merge pull request #4973 from nextcloud/addFastlane
1145c38 Merge pull request #4958 from Infomaniak/fix/see-detail-from-preview-nc
fd3ff4c Merge pull request #4898 from siddharths2710/master
988e797 [tx-robot] updated from transifex
8062340 Merge pull request #4657 from nextcloud/bumpSDK
4b328cb manually increase spotbugs and lint
1290bbe Merge pull request #4918 from Infomaniak/fix/calendar-not-refreshed
da104fc48 Merge pull request #4962 from Infomaniak/fix/add-activities-empty-icon
702c4f7 Merge pull request #4954 from nextcloud/dependabot/gradle/com.android.tools.build-gradle-3.5.3
f7597c1 [tx-robot] updated from transifex
c27f4ce [tx-robot] updated from transifex
7544257 [tx-robot] updated from transifex
4576d45 daily dev 20191207
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants