[android] Fix lint warnings for intent-filters #3595

Merged
root merged 2 commits from rt-android-intent-filter-warnings into master 2022-10-15 06:16:57 +00:00
Owner

Data tags should only declare unique attributes
Consider splitting data tag into multiple tags
with individual attributes to avoid confusion

All the <data> elements contained within the same <intent-filter> element contribute to the same filter. So, for example, the following filter specification,

<intent-filter . . . >
    <data android:scheme="something" android:host="project.example.com" />
    . . .
</intent-filter>

is equivalent to this one:

<intent-filter . . . >
    <data android:scheme="something" />
    <data android:host="project.example.com" />
    . . .
</intent-filter>

https://developer.android.com/guide/topics/manifest/data-element

Signed-off-by: Roman Tsisyk roman@tsisyk.com

> Data tags should only declare unique attributes > Consider splitting data tag into multiple tags > with individual attributes to avoid confusion All the `<data>` elements contained within the same `<intent-filter>` element contribute to the same filter. So, for example, the following filter specification, ``` <intent-filter . . . > <data android:scheme="something" android:host="project.example.com" /> . . . </intent-filter> ``` is equivalent to this one: ``` <intent-filter . . . > <data android:scheme="something" /> <data android:host="project.example.com" /> . . . </intent-filter> ``` https://developer.android.com/guide/topics/manifest/data-element Signed-off-by: Roman Tsisyk <roman@tsisyk.com>
biodranik (Migrated from github.com) reviewed 2022-10-12 09:12:27 +00:00
vng (Migrated from github.com) reviewed 2022-10-12 09:21:29 +00:00
vng (Migrated from github.com) commented 2022-10-12 09:21:29 +00:00

Это нам не надо?

Это нам не надо?
biodranik (Migrated from github.com) requested changes 2022-10-12 09:22:55 +00:00
biodranik (Migrated from github.com) commented 2022-10-12 09:22:51 +00:00

If several hosts can be combined, then we can merge omaps.app with ge0.me. Just leave a comment for ge0.me that it's a legacy from maps.me.

If several hosts can be combined, then we can merge omaps.app with ge0.me. Just leave a comment for ge0.me that it's a legacy from maps.me.
biodranik (Migrated from github.com) commented 2022-10-12 09:22:09 +00:00

Are there any shortened OSM URLs we also should handle in a similar way?

Are there any shortened OSM URLs we also should handle in a similar way?
biodranik (Migrated from github.com) commented 2022-10-12 09:21:43 +00:00

Is /search really needed? Should "/" also match /search?

Is /search really needed? Should "/" also match /search?
biodranik (Migrated from github.com) reviewed 2022-10-12 15:49:50 +00:00
biodranik (Migrated from github.com) commented 2022-10-12 15:49:49 +00:00

Это были какие-то рекламные дип линки типа mapsme://lead?some=params, нам это не надо.

Это были какие-то рекламные дип линки типа mapsme://lead?some=params, нам это не надо.
rtsisyk reviewed 2022-10-13 05:09:06 +00:00
Author
Owner

OK, I will merge them together.

OK, I will merge them together.
rtsisyk reviewed 2022-10-13 05:09:23 +00:00
Author
Owner

Угу, мусор какой-то.

Угу, мусор какой-то.
rtsisyk reviewed 2022-10-13 05:12:26 +00:00
Author
Owner

Yeah, they have a URL shortener, but we don't support it: https://osm.org/go/2EE6hs--.

I added this variant to the list: organicmaps/organicmaps#475

Yeah, they have a URL shortener, but we don't support it: `https://osm.org/go/2EE6hs--`. I added this variant to the list: https://git.omaps.dev/organicmaps/organicmaps/issues/475
rtsisyk reviewed 2022-10-13 05:14:15 +00:00
Author
Owner

The current rule catches https://www.openstreetmap.org/#map=19/33.97896/50.68466 and https://www.openstreetmap.org/search?query=test#map=19/33.97896/50.68419. Probably /search is not really needed.

The current rule catches `https://www.openstreetmap.org/#map=19/33.97896/50.68466` and `https://www.openstreetmap.org/search?query=test#map=19/33.97896/50.68419`. Probably `/search` is not really needed.
rtsisyk reviewed 2022-10-13 05:15:05 +00:00
Author
Owner

The path part of a URI which must begin with a /. The path attribute specifies a complete path that is matched against the complete path in an Intent object. The pathPrefix attribute specifies a partial path that is matched against only the initial part of the path in the Intent object. The pathPattern attribute specifies a complete path that is matched against the complete path in the Intent object, but it can contain the following wildcards:

  • An asterisk ('*') matches a sequence of 0 to many occurrences of the immediately preceding character.
  • A period followed by an asterisk (".*") matches any sequence of 0 to many characters.

Because '' is used as an escape character when the string is read from XML (before it is parsed as a pattern), you will need to double-escape: For example, a literal '' would be written as "\" and a literal '' would be written as "\\". This is basically the same as what you would need to write if constructing the string in Java code.

For more information on these three types of patterns, see the descriptions of PATTERN_LITERAL, PATTERN_PREFIX, and PATTERN_SIMPLE_GLOB in the PatternMatcher class.

These attributes are meaningful only if the scheme and host attributes are also specified for the filter.

https://developer.android.com/guide/topics/manifest/data-element

The path part of a URI which must begin with a /. The path attribute specifies a complete path that is matched against the complete path in an Intent object. The pathPrefix attribute specifies a partial path that is matched against only the initial part of the path in the Intent object. The pathPattern attribute specifies a complete path that is matched against the complete path in the Intent object, but it can contain the following wildcards: - An asterisk ('*') matches a sequence of 0 to many occurrences of the immediately preceding character. - A period followed by an asterisk (".*") matches any sequence of 0 to many characters. Because '\' is used as an escape character when the string is read from XML (before it is parsed as a pattern), you will need to double-escape: For example, a literal '*' would be written as "\\*" and a literal '\' would be written as "\\\\". This is basically the same as what you would need to write if constructing the string in Java code. For more information on these three types of patterns, see the descriptions of [PATTERN_LITERAL](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_LITERAL), [PATTERN_PREFIX](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_PREFIX), and [PATTERN_SIMPLE_GLOB](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_SIMPLE_GLOB) in the [PatternMatcher](https://developer.android.com/reference/android/os/PatternMatcher) class. These attributes are meaningful only if the [scheme](https://developer.android.com/guide/topics/manifest/data-element#scheme) and [host](https://developer.android.com/guide/topics/manifest/data-element#host) attributes are also specified for the filter. https://developer.android.com/guide/topics/manifest/data-element
rtsisyk reviewed 2022-10-13 08:14:43 +00:00
Author
Owner

Merged.

Merged.
vng (Migrated from github.com) approved these changes 2022-10-13 11:59:54 +00:00
vng (Migrated from github.com) commented 2022-10-13 11:59:09 +00:00

nit: A action=android.intent.action.SEND нельзя объединить с action=android.intent.action.VIEW выше?

nit: A action=android.intent.action.SEND нельзя объединить с action=android.intent.action.VIEW выше?
biodranik (Migrated from github.com) requested changes 2022-10-13 12:10:28 +00:00
@ -94,8 +85,9 @@
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
biodranik (Migrated from github.com) commented 2022-10-13 12:09:55 +00:00

Еслт эта хрень не пройдёт autoVerify (а она не пройдёт), тогда из-за этого остальные хосты тоже не будут считаться верифицированными? Проверь, пожалуйста. Если я прав, то надо попробовать оставить отдельным блоком без autoVerify. А если и там не заработает, тогда придётся выпилить, чтобы не жертвовать своим autoVerify.

Еслт эта хрень не пройдёт autoVerify (а она не пройдёт), тогда из-за этого остальные хосты тоже не будут считаться верифицированными? Проверь, пожалуйста. Если я прав, то надо попробовать оставить отдельным блоком без autoVerify. А если и там не заработает, тогда придётся выпилить, чтобы не жертвовать своим autoVerify.
rtsisyk reviewed 2022-10-14 06:35:50 +00:00
@ -94,8 +85,9 @@
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
Author
Owner

Я просто верну взад как было. Спасибо за вредные советы.

Я просто верну взад как было. Спасибо за вредные советы.
rtsisyk reviewed 2022-10-14 08:06:55 +00:00
Author
Owner

Я бы не рисковал.

Я бы не рисковал.
This repo is archived. You cannot comment on pull requests.
No reviewers
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#3595
No description provided.