Loading AndroidManifest.xml +13 −0 Original line number Diff line number Diff line Loading @@ -2668,6 +2668,19 @@ </intent-filter> </activity> <activity android:name="Settings$ManageDefaultAppsActivity" android:taskAffinity="" android:exported="true"> <intent-filter android:priority="1"> <action android:name="android.settings.MANAGE_DEFAULT_APPS_SETTINGS" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <meta-data android:name="com.android.settings.FRAGMENT_CLASS" android:value="com.android.settings.applications.ManageDefaultApps" /> <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED" android:value="true" /> </activity> <!-- Conditional receivers, only enabled during silenced state, default off--> <receiver android:name=".dashboard.conditional.HotspotCondition$Receiver" Loading res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -5720,6 +5720,9 @@ <!-- [CHAR LIMIT=100] Notification Importance slider: max importance level description --> <string name="notification_importance_max">Urgent: Peek onto the screen and make sound</string> <!-- Default Apps > Default notification assistant --> <string name="default_notification_assistant">Notification assistant</string> <!-- Sound & notification > Advanced section: Title for managing notification listeners option. [CHAR LIMIT=30] --> <string name="manage_notification_access_title">Notification access</string> Loading res/xml/default_apps.xml +4 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,8 @@ settings:keywords="@string/keywords_more_default_sms_app" /> <com.android.settings.applications.DefaultNotificationAssistantPreference android:key="default_notification_asst_app" android:title="@string/default_notification_assistant" /> </PreferenceScreen> src/com/android/settings/AppListPreference.java +43 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.settings; import android.app.Activity; import android.app.AlertDialog; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.pm.ApplicationInfo; Loading Loading @@ -131,6 +132,48 @@ public class AppListPreference extends CustomListPreference { } } public void setComponentNames(ComponentName[] componentNames, ComponentName defaultCN) { // Look up all package names in PackageManager. Skip ones we can't find. PackageManager pm = getContext().getPackageManager(); final int entryCount = componentNames.length + (mShowItemNone ? 1 : 0); List<CharSequence> applicationNames = new ArrayList<>(entryCount); List<CharSequence> validatedComponentNames = new ArrayList<>(entryCount); List<Drawable> entryDrawables = new ArrayList<>(entryCount); int selectedIndex = -1; for (int i = 0; i < componentNames.length; i++) { try { ApplicationInfo appInfo = pm.getApplicationInfo( componentNames[i].getPackageName().toString(), 0); applicationNames.add(appInfo.loadLabel(pm)); validatedComponentNames.add(componentNames[i].flattenToString()); entryDrawables.add(appInfo.loadIcon(pm)); if (defaultCN != null && componentNames[i].equals(defaultCN)) { selectedIndex = i; } } catch (NameNotFoundException e) { // Skip unknown packages. } } if (mShowItemNone) { applicationNames.add( getContext().getResources().getText(R.string.app_list_preference_none)); validatedComponentNames.add(ITEM_NONE_VALUE); entryDrawables.add(getContext().getDrawable(R.drawable.ic_remove_circle)); } setEntries(applicationNames.toArray(new CharSequence[applicationNames.size()])); setEntryValues( validatedComponentNames.toArray(new CharSequence[validatedComponentNames.size()])); mEntryDrawables = entryDrawables.toArray(new Drawable[entryDrawables.size()]); if (selectedIndex != -1) { setValueIndex(selectedIndex); } else { setValue(null); } } protected ListAdapter createListAdapter() { final String selectedValue = getValue(); final boolean selectedNone = selectedValue == null || Loading src/com/android/settings/Settings.java +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ public class Settings extends SettingsActivity { public static class WriteSettingsActivity extends SettingsActivity { /* empty */ } public static class AppDrawOverlaySettingsActivity extends SettingsActivity { /* empty */ } public static class AppWriteSettingsActivity extends SettingsActivity { /* empty */ } public static class ManageDefaultAppsActivity extends SettingsActivity { /* empty */ } // Categories. public static class WirelessSettings extends SettingsActivity { /* empty */ } Loading Loading
AndroidManifest.xml +13 −0 Original line number Diff line number Diff line Loading @@ -2668,6 +2668,19 @@ </intent-filter> </activity> <activity android:name="Settings$ManageDefaultAppsActivity" android:taskAffinity="" android:exported="true"> <intent-filter android:priority="1"> <action android:name="android.settings.MANAGE_DEFAULT_APPS_SETTINGS" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <meta-data android:name="com.android.settings.FRAGMENT_CLASS" android:value="com.android.settings.applications.ManageDefaultApps" /> <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED" android:value="true" /> </activity> <!-- Conditional receivers, only enabled during silenced state, default off--> <receiver android:name=".dashboard.conditional.HotspotCondition$Receiver" Loading
res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -5720,6 +5720,9 @@ <!-- [CHAR LIMIT=100] Notification Importance slider: max importance level description --> <string name="notification_importance_max">Urgent: Peek onto the screen and make sound</string> <!-- Default Apps > Default notification assistant --> <string name="default_notification_assistant">Notification assistant</string> <!-- Sound & notification > Advanced section: Title for managing notification listeners option. [CHAR LIMIT=30] --> <string name="manage_notification_access_title">Notification access</string> Loading
res/xml/default_apps.xml +4 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,8 @@ settings:keywords="@string/keywords_more_default_sms_app" /> <com.android.settings.applications.DefaultNotificationAssistantPreference android:key="default_notification_asst_app" android:title="@string/default_notification_assistant" /> </PreferenceScreen>
src/com/android/settings/AppListPreference.java +43 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.settings; import android.app.Activity; import android.app.AlertDialog; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.pm.ApplicationInfo; Loading Loading @@ -131,6 +132,48 @@ public class AppListPreference extends CustomListPreference { } } public void setComponentNames(ComponentName[] componentNames, ComponentName defaultCN) { // Look up all package names in PackageManager. Skip ones we can't find. PackageManager pm = getContext().getPackageManager(); final int entryCount = componentNames.length + (mShowItemNone ? 1 : 0); List<CharSequence> applicationNames = new ArrayList<>(entryCount); List<CharSequence> validatedComponentNames = new ArrayList<>(entryCount); List<Drawable> entryDrawables = new ArrayList<>(entryCount); int selectedIndex = -1; for (int i = 0; i < componentNames.length; i++) { try { ApplicationInfo appInfo = pm.getApplicationInfo( componentNames[i].getPackageName().toString(), 0); applicationNames.add(appInfo.loadLabel(pm)); validatedComponentNames.add(componentNames[i].flattenToString()); entryDrawables.add(appInfo.loadIcon(pm)); if (defaultCN != null && componentNames[i].equals(defaultCN)) { selectedIndex = i; } } catch (NameNotFoundException e) { // Skip unknown packages. } } if (mShowItemNone) { applicationNames.add( getContext().getResources().getText(R.string.app_list_preference_none)); validatedComponentNames.add(ITEM_NONE_VALUE); entryDrawables.add(getContext().getDrawable(R.drawable.ic_remove_circle)); } setEntries(applicationNames.toArray(new CharSequence[applicationNames.size()])); setEntryValues( validatedComponentNames.toArray(new CharSequence[validatedComponentNames.size()])); mEntryDrawables = entryDrawables.toArray(new Drawable[entryDrawables.size()]); if (selectedIndex != -1) { setValueIndex(selectedIndex); } else { setValue(null); } } protected ListAdapter createListAdapter() { final String selectedValue = getValue(); final boolean selectedNone = selectedValue == null || Loading
src/com/android/settings/Settings.java +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ public class Settings extends SettingsActivity { public static class WriteSettingsActivity extends SettingsActivity { /* empty */ } public static class AppDrawOverlaySettingsActivity extends SettingsActivity { /* empty */ } public static class AppWriteSettingsActivity extends SettingsActivity { /* empty */ } public static class ManageDefaultAppsActivity extends SettingsActivity { /* empty */ } // Categories. public static class WirelessSettings extends SettingsActivity { /* empty */ } Loading