Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83d6f38f authored by Flavio Fiszman's avatar Flavio Fiszman
Browse files

Enable People Space launch icon based on flag.

Change-Id: I96cdca776feafa738f96b8bffa61c780e68067da
Test: Boot device with both flag values and check if icon is present.
Bug: 169783793
parent f858c6db
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
            Takes precedence over the disallowed apps lists. -->
    <string-array translatable="false" name="required_apps_managed_device">
        <item>com.android.settings</item>
        <item>com.android.systemui</item>
        <item>com.android.contacts</item>
        <item>com.android.dialer</item>
        <item>com.android.stk</item>  <!-- Required by com.android.phone by certain carriers -->
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
    <string-array translatable="false" name="required_apps_managed_profile">
        <item>com.android.contacts</item>
        <item>com.android.settings</item>
        <item>com.android.systemui</item>
        <item>com.android.providers.downloads</item>
        <item>com.android.providers.downloads.ui</item>
        <item>com.android.documentsui</item>
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
            Takes precedence over the disallowed apps lists. -->
    <string-array translatable="false" name="required_apps_managed_user">
        <item>com.android.settings</item>
        <item>com.android.systemui</item>
        <item>com.android.contacts</item>
        <item>com.android.dialer</item>
        <item>com.android.stk</item>  <!-- Required by com.android.phone by certain carriers -->
+10 −3
Original line number Diff line number Diff line
@@ -573,10 +573,17 @@
        </activity>

        <!-- People Space UI Screen -->
        <activity
            android:name=".people.PeopleSpaceActivity"
        <activity android:name=".people.PeopleSpaceActivity"
            android:label="People"
            android:icon="@drawable/ic_music_note"
            android:exported="true"
            android:theme="@android:style/Theme.Material.NoActionBar">
            android:enabled="false"
            android:theme="@android:style/Theme.Material.NoActionBar"
            android:launchMode="singleInstance">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <!-- a gallery of delicious treats -->
+17 −0
Original line number Diff line number Diff line
@@ -19,15 +19,18 @@ package com.android.systemui;
import android.app.ActivityThread;
import android.app.Application;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.os.Process;
import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
import android.util.TimingsTraceLog;

@@ -35,6 +38,7 @@ import com.android.systemui.dagger.ContextComponentHelper;
import com.android.systemui.dagger.GlobalRootComponent;
import com.android.systemui.dagger.SysUIComponent;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.people.PeopleSpaceActivity;
import com.android.systemui.util.NotificationChannels;

import java.lang.reflect.Constructor;
@@ -104,6 +108,19 @@ public class SystemUIApplication extends Application implements
                            mServices[i].onBootCompleted();
                        }
                    }
                    // If flag SHOW_PEOPLE_SPACE is true, enable People Space launcher icon.
                    try {
                        int showPeopleSpace = Settings.Global.getInt(context.getContentResolver(),
                                Settings.Global.SHOW_PEOPLE_SPACE);
                        context.getPackageManager().setComponentEnabledSetting(
                                new ComponentName(context, PeopleSpaceActivity.class),
                                showPeopleSpace == 1
                                        ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
                                        : PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                                PackageManager.DONT_KILL_APP);
                    } catch (Exception e) {
                        Log.w(TAG, "Error enabling People Space launch icon:", e);
                    }
                }
            }, bootCompletedFilter);