forked from microg/GmsCore
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to open Google account settings from microG settings
- Loading branch information
1 parent
4cbb55b
commit a710c82
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
play-services-core/src/main/java/org/microg/gms/ui/ShowAccountSettingsActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.microg.gms.ui; | ||
|
||
import android.content.ActivityNotFoundException; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.provider.Settings; | ||
import android.util.Log; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
import org.microg.gms.auth.AuthConstants; | ||
|
||
/** | ||
* This is just an activity that forwards to Android account settings | ||
*/ | ||
public class ShowAccountSettingsActivity extends AppCompatActivity { | ||
private static final String TAG = "GmsShowAccountSettings"; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS); | ||
intent.putExtra(Settings.EXTRA_AUTHORITIES, new String[] { "com.android.contacts" }); | ||
intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, new String[] { AuthConstants.DEFAULT_ACCOUNT_TYPE }); | ||
try { | ||
startActivity(intent); | ||
} catch (ActivityNotFoundException e) { | ||
Log.w(TAG, e); | ||
} | ||
finish(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters