Loading core/java/android/widget/ActivityChooserModel.java +24 −3 Original line number Diff line number Diff line Loading @@ -948,12 +948,29 @@ public class ActivityChooserModel extends DataSetObservable { componentNameToActivityMap.clear(); final int activityCount = activities.size(); ComponentName highPriComponentName = null; if (!TextUtils.isEmpty(mContext.getString(com.android.internal.R. string.def_hipri_share_component_pkg)) && !TextUtils.isEmpty(mContext.getString(com.android.internal.R. string.def_hipri_share_component_class))) { highPriComponentName = new ComponentName( mContext.getString(com.android.internal.R. string.def_hipri_share_component_pkg), mContext.getString(com.android.internal.R. string.def_hipri_share_component_class)); } for (int i = 0; i < activityCount; i++) { ActivityResolveInfo activity = activities.get(i); activity.weight = 0.0f; ComponentName componentName = new ComponentName( activity.resolveInfo.activityInfo.packageName, activity.resolveInfo.activityInfo.name); if ((highPriComponentName != null) && highPriComponentName.equals(componentName)) { activity.weight = Float.MAX_VALUE; } componentNameToActivityMap.put(componentName, activity); } Loading @@ -963,11 +980,15 @@ public class ActivityChooserModel extends DataSetObservable { HistoricalRecord historicalRecord = historicalRecords.get(i); ComponentName componentName = historicalRecord.activity; ActivityResolveInfo activity = componentNameToActivityMap.get(componentName); if ((highPriComponentName != null) && highPriComponentName.equals(componentName)) { continue; } else { if (activity != null) { activity.weight += historicalRecord.weight * nextRecordWeight; nextRecordWeight = nextRecordWeight * WEIGHT_DECAY_COEFFICIENT; } } } Collections.sort(activities); Loading core/res/res/values/strings.xml +2 −1 Original line number Diff line number Diff line Loading @@ -5219,5 +5219,6 @@ <string name="data_conn_status_title"></string> <string name="user_authentication_failed"></string> <string name="service_not_subscribed"></string> <string name="def_hipri_share_component_pkg"></string> <string name="def_hipri_share_component_class"></string> </resources> core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -2336,4 +2336,7 @@ <java-symbol type="bool" name="config_LTE_eri_for_network_name" /> <java-symbol type="bool" name="config_defaultInTouchMode" /> <java-symbol type="bool" name="config_fdn_contact_search"/> <java-symbol type="string" name="def_hipri_share_component_pkg"/> <java-symbol type="string" name="def_hipri_share_component_class"/> </resources> Loading
core/java/android/widget/ActivityChooserModel.java +24 −3 Original line number Diff line number Diff line Loading @@ -948,12 +948,29 @@ public class ActivityChooserModel extends DataSetObservable { componentNameToActivityMap.clear(); final int activityCount = activities.size(); ComponentName highPriComponentName = null; if (!TextUtils.isEmpty(mContext.getString(com.android.internal.R. string.def_hipri_share_component_pkg)) && !TextUtils.isEmpty(mContext.getString(com.android.internal.R. string.def_hipri_share_component_class))) { highPriComponentName = new ComponentName( mContext.getString(com.android.internal.R. string.def_hipri_share_component_pkg), mContext.getString(com.android.internal.R. string.def_hipri_share_component_class)); } for (int i = 0; i < activityCount; i++) { ActivityResolveInfo activity = activities.get(i); activity.weight = 0.0f; ComponentName componentName = new ComponentName( activity.resolveInfo.activityInfo.packageName, activity.resolveInfo.activityInfo.name); if ((highPriComponentName != null) && highPriComponentName.equals(componentName)) { activity.weight = Float.MAX_VALUE; } componentNameToActivityMap.put(componentName, activity); } Loading @@ -963,11 +980,15 @@ public class ActivityChooserModel extends DataSetObservable { HistoricalRecord historicalRecord = historicalRecords.get(i); ComponentName componentName = historicalRecord.activity; ActivityResolveInfo activity = componentNameToActivityMap.get(componentName); if ((highPriComponentName != null) && highPriComponentName.equals(componentName)) { continue; } else { if (activity != null) { activity.weight += historicalRecord.weight * nextRecordWeight; nextRecordWeight = nextRecordWeight * WEIGHT_DECAY_COEFFICIENT; } } } Collections.sort(activities); Loading
core/res/res/values/strings.xml +2 −1 Original line number Diff line number Diff line Loading @@ -5219,5 +5219,6 @@ <string name="data_conn_status_title"></string> <string name="user_authentication_failed"></string> <string name="service_not_subscribed"></string> <string name="def_hipri_share_component_pkg"></string> <string name="def_hipri_share_component_class"></string> </resources>
core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -2336,4 +2336,7 @@ <java-symbol type="bool" name="config_LTE_eri_for_network_name" /> <java-symbol type="bool" name="config_defaultInTouchMode" /> <java-symbol type="bool" name="config_fdn_contact_search"/> <java-symbol type="string" name="def_hipri_share_component_pkg"/> <java-symbol type="string" name="def_hipri_share_component_class"/> </resources>