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

Google Maps location information sharing page settings button click n… #2634

Merged
merged 2 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions play-services-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,10 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.gms.location.settings.LOCATION_SHARING"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>

<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ private val ALLOWED_WEB_PREFIXES = setOf(
)

private val ACTION_TO_SCREEN_ID = hashMapOf(
ACTION_MY_ACCOUNT to 1,
ACTION_ACCOUNT_PREFERENCES_SETTINGS to 1,
ACTION_SECURITY_SETTINGS to 10006,
ACTION_PRIVACY_SETTINGS to 10004,
ACTION_LOCATION_SHARING to 210,
)

class MainActivity : AppCompatActivity() {
Expand All @@ -134,7 +133,7 @@ class MainActivity : AppCompatActivity() {
Log.d(TAG, "Invoked with ${intent.action} and extras $extras")
super.onCreate(savedInstanceState)

val screenId = intent?.getIntExtra(EXTRA_SCREEN_ID, -1).takeIf { it != -1 } ?: ACTION_TO_SCREEN_ID[intent.action] ?: 1
val screenId = ACTION_TO_SCREEN_ID[intent.action] ?: intent?.getIntExtra(EXTRA_SCREEN_ID, -1)?.takeIf { it > 0 } ?: 1
val product = intent?.getStringExtra(EXTRA_SCREEN_MY_ACTIVITY_PRODUCT)
val kidOnboardingParams = intent?.getStringExtra(EXTRA_SCREEN_KID_ONBOARDING_PARAMS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const val ACTION_MY_ACCOUNT = "com.google.android.gms.accountsettings.MY_ACCOUNT
const val ACTION_ACCOUNT_PREFERENCES_SETTINGS = "com.google.android.gms.accountsettings.ACCOUNT_PREFERENCES_SETTINGS"
const val ACTION_PRIVACY_SETTINGS = "com.google.android.gms.accountsettings.PRIVACY_SETTINGS"
const val ACTION_SECURITY_SETTINGS = "com.google.android.gms.accountsettings.SECURITY_SETTINGS"
const val ACTION_LOCATION_SHARING = "com.google.android.gms.location.settings.LOCATION_SHARING"

const val EXTRA_CALLING_PACKAGE_NAME = "extra.callingPackageName"
const val EXTRA_IGNORE_ACCOUNT = "extra.ignoreAccount"
Expand Down
Loading