Skip to content

microG Settings integration, icon/activity changes #1191

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
android.useAndroidX=true
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError
56 changes: 43 additions & 13 deletions play-services-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -438,17 +438,10 @@
</intent-filter>
</activity>

<!-- microG Settings shown in Launcher -->
<!-- microG Settings activity -->
<activity
android:name="org.microg.gms.ui.SettingsActivity"
android:icon="@mipmap/ic_microg_settings"
android:label="@string/gms_settings_name"
android:process=":ui"
android:roundIcon="@mipmap/ic_microg_settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<action android:name="com.google.android.gms.settings.EXPOSURE_NOTIFICATION_SETTINGS" />
Expand All @@ -466,18 +459,41 @@

<!-- microG Settings embedded in System Settings on SDK 23 and newer -->
<activity-alias
android:enabled="true"
android:exported="true"
android:name="org.microg.gms.ui.SettingsActivityLink"
android:icon="@drawable/microg_light_color_24"
android:label="@string/gms_settings_name"
android:process=":ui"
android:targetActivity="org.microg.gms.ui.SettingsActivity">
android:targetActivity="org.microg.gms.ui.SettingsActivity"
android:process=":ui">
<intent-filter>
<action android:name="com.android.settings.action.EXTRA_SETTINGS" />
<action android:name="com.android.settings.action.EXTRA_SETTINGS"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.personal"/>
<meta-data
android:name="com.android.settings.icon"
android:resource="@drawable/microg_light_color_24"/>
</activity-alias>

<!-- microG Settings embedded in System Settings on SDK 26 and newer -->
<activity-alias
android:enabled="true"
android:exported="true"
android:name="org.microg.gms.ui.SettingsActivityIALink"
android:targetActivity="org.microg.gms.ui.SettingsActivity"
android:icon="@drawable/microg_light_color_24"
android:label="@string/gms_settings_name"
android:process=":ui">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<meta-data
android:name="com.android.settings.category"
android:value="com.android.settings.category.device" />
android:value="com.android.settings.category.ia.homepage"/>
<meta-data
android:name="com.android.settings.icon"
android:resource="@drawable/microg_light_color_24" />
Expand All @@ -486,6 +502,20 @@
android:resource="@string/gms_settings_summary" />
</activity-alias>

<!-- microG Settings activity-alias shown in Launcher -->
<activity-alias
android:enabled="true"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be interesting to try something like this:
android:enabled="@bool/is_alias_enabled"
then add <bool name="is_alias_enabled">true</bool> to bools.xml
and create ../values-v23/bools.xml with this

<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 microG Project Team
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<resources>
    <bool name="is_alias_enabled">false</bool>
</resources>

So launcher icon should be always disabled Android 6.0 and newer.
Settings integration is available starting from this android version.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So launcher icon should be always disabled Android 6.0 and newer. Settings integration is available starting from this android version.

Honeslty I think that can be still visible, is a shortcut, wothout go on settings>system>microg.
For the same reason I have installed an app to open update on lineageos.

android:name="org.microg.gms.ui.SettingsActivityLauncher"
android:targetActivity="org.microg.gms.ui.SettingsActivity"
android:icon="@mipmap/ic_microg_settings"
android:roundIcon="@mipmap/ic_microg_settings"
android:label="@string/gms_settings_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity-alias>

<activity
android:name="org.microg.gms.ui.AskPushPermission"
android:excludeFromRecents="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt"
android:viewportWidth="256"
android:viewportHeight="256"
android:width="256dp"
android:height="256dp">
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="#ffffffff" android:pathData="M207.03481 139.53168c0.42667 -3.41333 0.74667 -6.82666 0.74667 -10.45333 0 -3.62667 -0.32 -7.04 -0.74667 -10.45333l22.50667 -17.6c2.02667 -1.599996 2.56 -4.479996 1.28 -6.826666L209.48815 57.291687c-1.28 -2.346666 -4.16 -3.2 -6.50667 -2.346666l-26.56 10.666666c-5.54667 -4.266666 -11.52 -7.786666 -18.02667 -10.453333l-4.05333 -28.266667c-0.32 -2.56 -2.56 -4.48 -5.22667 -4.48h-42.66666c-2.66667 0 -4.90667 1.92 -5.22667 4.48l-4.053331 28.266667c-6.50667 2.666667 -12.48 6.293333 -18.02667 10.453333l-26.56 -10.666666c-2.45333 -0.96 -5.22667 0 -6.50667 2.346666l-21.33333 36.906667c-1.38667 2.34667 -0.74667 5.22667 1.28 6.826666l22.50667 17.6c-0.42667 3.41333 -0.74667 6.93333 -0.74667 10.45333 0 3.52 0.32 7.04 0.74667 10.45333l-22.50667 17.6c-2.02667 1.6 -2.56 4.48 -1.28 6.82667l21.33333 36.90667c1.28 2.34666 4.16 3.2 6.50667 2.34666l26.56 -10.66666c5.54667 4.26666 11.52 7.78666 18.02667 10.45333l4.053331 28.26667c0.32 2.56 2.56 4.48 5.22667 4.48h42.66666c2.66667 0 4.90667 -1.92 5.22667 -4.48l4.05333 -28.26667c6.50667 -2.66667 12.48 -6.29333 18.02667 -10.45333l26.56 10.66666c2.45333 0.96 5.22667 0 6.50667 -2.34666l21.33333 -36.90667c1.28 -2.34667 0.74667 -5.22667 -1.28 -6.82667z">
</path>
android:fillColor="#ffffffff"
android:pathData="M14.5335,0.0569535 L9.43985,0.0705542 C9.24288,0.102156,9.0985,0.18001,9.06273,0.352909 L8.55771,3.75569 C7.70454,4.01856,7.0852,4.47885,6.46902,4.94163 L3.48987,3.74936 C3.23326,3.67936,2.95937,3.47486,2.64004,3.95331 L0.0871706,8.21668 C0.0372893,8.41036,0.0580599,8.56989,0.145272,8.69686 L2.93012,10.8425 C2.83047,11.6279,2.86713,12.4355,2.90092,13.2426 L0.23227,15.219 C0.005066,15.4246,0.050044,15.7049,0.087127,15.8119 L2.78493,20.2165 C2.89848,20.3411,3.04458,20.3919,3.22668,20.3608 L6.49813,19.1434 C7.12487,19.6363,7.79275,20.0492,8.52873,20.3294 L8.99269,23.3505 C9.11365,23.56,9.09564,23.8073,9.4858,23.9434 L14.6784,23.9434 C14.8701,23.8649,15.0801,23.8217,15.1137,23.4353 L15.5776,20.2729 C16.4832,19.9372,17.01,19.5277,17.6663,19.1435 L20.7121,20.3576 C21.1885,20.4803,21.2695,20.2522,21.3504,20.16 L23.8741,15.8401 C23.9395,15.7104,23.9625,15.4495,23.787,15.2191 L21.1762,13.2708 C21.1953,12.4738,21.2347,11.6899,21.1762,10.8426 L23.874,8.72511 C23.996,8.49886,23.9302,8.24834,23.874,8.10387 L21.3214,3.92514 C21.1924,3.70382,20.9206,3.64557,20.7701,3.67097 L17.6082,4.94163 C16.8967,4.38465,16.2039,3.98905,15.5197,3.67097 L14.9974,0.395711 C14.9027,0.136848,14.7173,0.0991057,14.5334,0.0570135 Z M11.8718,5.62811 C13.7255,5.60431,15.517,6.32771,16.5932,7.54186 L14.7953,9.4995 C13.2639,8.11395,9.57199,7.53593,8.30443,11.1012 C7.82376,12.9227,8.54727,14.4138,10.0518,15.2852 C11.6506,16.1862,14.0977,15.4204,14.7343,14.7492 L16.6846,16.6771 C15.8496,17.3442,12.7132,19.81,8.67011,17.6858 C6.61824,16.5517,4.69843,14.6267,5.53146,10.4485 C6.00671,8.8177,7.06262,7.50059,8.60931,6.53345 C9.62512,5.92563,10.7596,5.64239,11.8718,5.62811 Z" />
</vector>