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

Commit 63d9c6db authored by Steve Kondik's avatar Steve Kondik
Browse files

cmparts: Implement summaries for dashboard tiles

Change-Id: Ibc6ad6180b0c25fcf815eba7961176723f851fe4
parent 1827c853
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@
        <receiver android:name=".RefreshReceiver" android:enabled="true">
            <intent-filter>
                <action android:name="org.cyanogenmod.cmparts.REFRESH_PART" />
                <action android:name="org.cyanogenmod.settings.REFRESH_SUMMARY" />
            </intent-filter>
        </receiver>

@@ -95,6 +96,12 @@
            <meta-data
                android:name="com.android.settings.icon"
                android:resource="@drawable/ic_settings_privacy" />
            <meta-data
                android:name="org.cyanogenmod.settings.summary.receiver"
                android:value="org.cyanogenmod.cmparts.RefreshReceiver" />
            <meta-data
                android:name="org.cyanogenmod.settings.summary.key"
                android:value="privacy_settings" />
        </activity-alias>

        <!-- Button settings (dashboard) -->
@@ -113,6 +120,12 @@
            <meta-data
                android:name="com.android.settings.icon"
                android:resource="@drawable/ic_settings_buttons" />
            <meta-data
                android:name="org.cyanogenmod.settings.summary.receiver"
                android:value="org.cyanogenmod.cmparts.RefreshReceiver" />
            <meta-data
                android:name="org.cyanogenmod.settings.summary.key"
                android:value="button_settings" />
        </activity-alias>

        <!-- Profiles settings (dashboard) -->
@@ -131,6 +144,12 @@
            <meta-data
                android:name="com.android.settings.icon"
                android:resource="@drawable/ic_settings_profiles" />
            <meta-data
                android:name="org.cyanogenmod.settings.summary.receiver"
                android:value="org.cyanogenmod.cmparts.RefreshReceiver" />
            <meta-data
                android:name="org.cyanogenmod.settings.summary.key"
                android:value="profiles_settings" />
        </activity-alias>

        <!-- Status bar settings (dashboard) -->
@@ -149,6 +168,12 @@
            <meta-data
                android:name="com.android.settings.icon"
                android:resource="@drawable/ic_settings_statusbar" />
            <meta-data
                android:name="org.cyanogenmod.settings.summary.receiver"
                android:value="org.cyanogenmod.cmparts.RefreshReceiver" />
            <meta-data
                android:name="org.cyanogenmod.settings.summary.key"
                android:value="status_bar_settings" />
        </activity-alias>

        <!-- Anonymous Statistics -->
@@ -176,7 +201,7 @@
                 android:enabled="true"
                 android:exported="false" />

		<!-- Weather settings (dashboard) -->
		<!-- Weather settings -->
        <activity-alias
            android:name=".weather.WeatherServiceSettings"
            android:label="@string/weather_settings_title"
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
    <string name="privacy_guard_dlg_text">When Privacy Guard is enabled, the app will not be able to access personal data such as contacts, messages or call logs.</string>
    <string name="privacy_guard_dlg_system_app_text">When enabling Privacy Guard for a built-in app, the app will not be able to access or provide personal data. This may cause other apps to misbehave.</string>
    <string name="privacy_guard_default_title">Enabled by default</string>
    <string name="privacy_guard_default_summary_on">Privacy Guard is enabled</string>
    <string name="privacy_guard_default_summary">Enable by default for newly-installed apps</string>
    <string name="privacy_guard_manager_summary">Manage which apps have access to your personal data</string>
    <string name="privacy_guard_no_user_apps">No apps are installed</string>
@@ -282,6 +283,7 @@
    <string name="profile_menu_delete">Delete</string>
    <string name="profile_settings_title">Profile</string>
    <string name="profile_empty_list_profiles_off">To configure and use system profiles, turn profiles on.</string>
    <string name="profile_settings_summary_off">Profiles are disabled</string>
    <string name="profile_trigger_configure">Configure trigger</string>
    <string name="profile_write_nfc_tag">Write to NFC tag</string>
    <string name="profile_write_touch_tag">Touch tag to write</string>
+2 −2
Original line number Diff line number Diff line
@@ -19,11 +19,11 @@
    android:key="privacy_guard_manager"
    android:title="@*cyanogenmod.platform:string/privacy_guard_manager_title">

    <SwitchPreference
    <cyanogenmod.preference.CMSecureSettingSwitchPreference
        android:key="privacy_guard_default"
        android:title="@string/privacy_guard_default_title"
        android:summary="@string/privacy_guard_default_summary"
        android:persistent="false" />
        android:defaultValue="false" />

    <cyanogenmod.preference.CMSecureSettingSwitchPreference
        android:key="privacy_guard_notification"
+3 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import java.util.Set;
import static org.cyanogenmod.internal.cmparts.PartsList.ACTION_PART_CHANGED;
import static org.cyanogenmod.internal.cmparts.PartsList.EXTRA_PART;
import static org.cyanogenmod.internal.cmparts.PartsList.EXTRA_PART_KEY;
import static org.cyanogenmod.internal.cmparts.PartsList.EXTRA_PART_SUMMARY;

/**
 * PartsRefresher keeps remote UI clients up to date with any changes in the
@@ -125,6 +126,7 @@ public class PartsRefresher {

        pi.setSummary(si.getSummary(mContext, key));
        bundle.putString(EXTRA_PART_KEY, key);
        bundle.putString(EXTRA_PART_SUMMARY, pi.getSummary());
        bundle.putParcelable(EXTRA_PART, pi);
        return true;
    }
@@ -178,6 +180,7 @@ public class PartsRefresher {
                    uris.add(contentUri);
                    if (!mRefs.contains(contentUri)) {
                        mResolver.registerContentObserver(contentUri, false, this);
                        listener.onRefresh(mContext, null);
                    }
                    mRefs.add(contentUri);
                }
+14 −0
Original line number Diff line number Diff line
@@ -16,8 +16,11 @@

package org.cyanogenmod.cmparts;

import android.content.Context;
import android.os.Bundle;

import cyanogenmod.providers.CMSettings;

/**
 * Privacy settings
 */
@@ -29,4 +32,15 @@ public class PrivacySettings extends SettingsPreferenceFragment {

        addPreferencesFromResource(R.xml.privacy_settings);
    }

    public static final SummaryProvider SUMMARY_PROVIDER = new SummaryProvider() {
        @Override
        public String getSummary(Context context, String key) {
            if (CMSettings.Secure.getInt(context.getContentResolver(),
                    CMSettings.Secure.PRIVACY_GUARD_DEFAULT, 0) == 1) {
                return context.getString(R.string.privacy_guard_default_summary_on);
            }
            return null;
        }
    };
}
Loading