Loading AndroidManifest.xml +16 −0 Original line number Diff line number Diff line Loading @@ -800,6 +800,22 @@ android:resource="@string/wallpaper_suggestion_summary" /> </activity> <activity android:name=".support.NewDeviceIntroSuggestionActivity" android:label="@string/new_device_suggestion_title" android:icon="@drawable/ic_new_releases_24dp" android:theme="@android:style/Theme.NoDisplay"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="com.android.settings.suggested.category.FIRST_IMPRESSION" /> </intent-filter> <meta-data android:name="com.android.settings.dismiss" android:value="0,4" /> <meta-data android:name="com.android.settings.title" android:resource="@string/new_device_suggestion_title" /> <meta-data android:name="com.android.settings.summary" android:resource="@string/new_device_suggestion_summary" /> </activity> <activity android:name="Settings$ZenModeScheduleRuleSettingsActivity" android:exported="true" android:taskAffinity=""> Loading res/drawable/ic_new_releases_24dp.xml 0 → 100644 +26 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2017 The Android Open Source Project 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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:width="24dp" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:tint="?android:attr/colorControlNormal"> <path android:fillColor="#FF000000" android:pathData="M23,12l-2.44,-2.78 0.34,-3.68 -3.61,-0.82 -1.89,-3.18L12,3 8.6,1.54 6.71,4.72l-3.61,0.81 0.34,3.68L1,12l2.44,2.78 -0.34,3.69 3.61,0.82 1.89,3.18L12,21l3.4,1.46 1.89,-3.18 3.61,-0.82 -0.34,-3.68L23,12zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z" /> </vector> res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -8913,4 +8913,6 @@ <!-- The divider symbol between different parts of the notification header including spaces. not translatable [CHAR LIMIT=3] --> <string name="notification_header_divider_symbol_with_spaces" translatable="false">" • "</string> <!-- url for new device suggestion --> <string name="new_device_suggestion_intro_url" translatable="false"></string> </resources> src/com/android/settings/dashboard/DashboardSummary.java +1 −4 Original line number Diff line number Diff line Loading @@ -60,7 +60,6 @@ public class DashboardSummary extends InstrumentedFragment private static final int MAX_WAIT_MILLIS = 700; private static final String TAG = "DashboardSummary"; private static final String SUGGESTIONS = "suggestions"; private static final String EXTRA_SCROLL_POSITION = "scroll_position"; Loading Loading @@ -98,7 +97,7 @@ public class DashboardSummary extends InstrumentedFragment mConditionManager = ConditionManager.get(activity, false); getLifecycle().addObserver(mConditionManager); mSuggestionParser = new SuggestionParser(activity, activity.getSharedPreferences(SUGGESTIONS, 0), R.xml.suggestion_ordering); mSuggestionFeatureProvider.getSharedPrefs(activity), R.xml.suggestion_ordering); mSuggestionsChecks = new SuggestionsChecks(getContext()); if (DEBUG_TIMING) { Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime) Loading Loading @@ -276,8 +275,6 @@ public class DashboardSummary extends InstrumentedFragment for (int i = 0; i < suggestions.size(); i++) { Tile suggestion = suggestions.get(i); if (mSuggestionsChecks.isSuggestionComplete(suggestion)) { mSuggestionFeatureProvider.dismissSuggestion( context, mSuggestionParser, suggestion); suggestions.remove(i--); } } Loading src/com/android/settings/dashboard/suggestions/SuggestionFeatureProvider.java +6 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.settings.dashboard.suggestions; import android.content.ComponentName; import android.content.Context; import android.content.SharedPreferences; import android.support.annotation.NonNull; import com.android.settingslib.drawer.Tile; Loading @@ -33,12 +34,14 @@ public interface SuggestionFeatureProvider { */ boolean isSmartSuggestionEnabled(Context context); /** Return true if {@code suggestion} is managed by this provider. */ boolean isPresent(@NonNull ComponentName suggestion); /** Return true if the suggestion has already been completed and does not need to be shown */ boolean isSuggestionCompleted(Context context, @NonNull ComponentName suggestion); /** * Returns the {@link SharedPreferences} that holds metadata for suggestions. */ SharedPreferences getSharedPrefs(Context context); /** * Ranks the list of suggestions in place. * Loading Loading
AndroidManifest.xml +16 −0 Original line number Diff line number Diff line Loading @@ -800,6 +800,22 @@ android:resource="@string/wallpaper_suggestion_summary" /> </activity> <activity android:name=".support.NewDeviceIntroSuggestionActivity" android:label="@string/new_device_suggestion_title" android:icon="@drawable/ic_new_releases_24dp" android:theme="@android:style/Theme.NoDisplay"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="com.android.settings.suggested.category.FIRST_IMPRESSION" /> </intent-filter> <meta-data android:name="com.android.settings.dismiss" android:value="0,4" /> <meta-data android:name="com.android.settings.title" android:resource="@string/new_device_suggestion_title" /> <meta-data android:name="com.android.settings.summary" android:resource="@string/new_device_suggestion_summary" /> </activity> <activity android:name="Settings$ZenModeScheduleRuleSettingsActivity" android:exported="true" android:taskAffinity=""> Loading
res/drawable/ic_new_releases_24dp.xml 0 → 100644 +26 −0 Original line number Diff line number Diff line <!-- Copyright (C) 2017 The Android Open Source Project 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. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:width="24dp" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:tint="?android:attr/colorControlNormal"> <path android:fillColor="#FF000000" android:pathData="M23,12l-2.44,-2.78 0.34,-3.68 -3.61,-0.82 -1.89,-3.18L12,3 8.6,1.54 6.71,4.72l-3.61,0.81 0.34,3.68L1,12l2.44,2.78 -0.34,3.69 3.61,0.82 1.89,3.18L12,21l3.4,1.46 1.89,-3.18 3.61,-0.82 -0.34,-3.68L23,12zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z" /> </vector>
res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -8913,4 +8913,6 @@ <!-- The divider symbol between different parts of the notification header including spaces. not translatable [CHAR LIMIT=3] --> <string name="notification_header_divider_symbol_with_spaces" translatable="false">" • "</string> <!-- url for new device suggestion --> <string name="new_device_suggestion_intro_url" translatable="false"></string> </resources>
src/com/android/settings/dashboard/DashboardSummary.java +1 −4 Original line number Diff line number Diff line Loading @@ -60,7 +60,6 @@ public class DashboardSummary extends InstrumentedFragment private static final int MAX_WAIT_MILLIS = 700; private static final String TAG = "DashboardSummary"; private static final String SUGGESTIONS = "suggestions"; private static final String EXTRA_SCROLL_POSITION = "scroll_position"; Loading Loading @@ -98,7 +97,7 @@ public class DashboardSummary extends InstrumentedFragment mConditionManager = ConditionManager.get(activity, false); getLifecycle().addObserver(mConditionManager); mSuggestionParser = new SuggestionParser(activity, activity.getSharedPreferences(SUGGESTIONS, 0), R.xml.suggestion_ordering); mSuggestionFeatureProvider.getSharedPrefs(activity), R.xml.suggestion_ordering); mSuggestionsChecks = new SuggestionsChecks(getContext()); if (DEBUG_TIMING) { Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime) Loading Loading @@ -276,8 +275,6 @@ public class DashboardSummary extends InstrumentedFragment for (int i = 0; i < suggestions.size(); i++) { Tile suggestion = suggestions.get(i); if (mSuggestionsChecks.isSuggestionComplete(suggestion)) { mSuggestionFeatureProvider.dismissSuggestion( context, mSuggestionParser, suggestion); suggestions.remove(i--); } } Loading
src/com/android/settings/dashboard/suggestions/SuggestionFeatureProvider.java +6 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.settings.dashboard.suggestions; import android.content.ComponentName; import android.content.Context; import android.content.SharedPreferences; import android.support.annotation.NonNull; import com.android.settingslib.drawer.Tile; Loading @@ -33,12 +34,14 @@ public interface SuggestionFeatureProvider { */ boolean isSmartSuggestionEnabled(Context context); /** Return true if {@code suggestion} is managed by this provider. */ boolean isPresent(@NonNull ComponentName suggestion); /** Return true if the suggestion has already been completed and does not need to be shown */ boolean isSuggestionCompleted(Context context, @NonNull ComponentName suggestion); /** * Returns the {@link SharedPreferences} that holds metadata for suggestions. */ SharedPreferences getSharedPrefs(Context context); /** * Ranks the list of suggestions in place. * Loading