Loading core/java/android/provider/ContactsContract.java +30 −2 Original line number Diff line number Diff line Loading @@ -5542,6 +5542,14 @@ public final class ContactsContract { */ public static final int MODE_LARGE = 3; /** * Extra used to specify the last selected tab index of the Contacts app. * If this is not given or -1 * @hide */ public static final String EXTRA_SELECTED_CONTACTS_APP_TAB_INDEX = "SELECTED_TAB_INDEX"; /** * Trigger a dialog that lists the various methods of interacting with * the requested {@link Contacts} entry. This may be based on available Loading @@ -5567,6 +5575,16 @@ public final class ContactsContract { */ public static void showQuickContact(Context context, View target, Uri lookupUri, int mode, String[] excludeMimes) { context.startActivity(getQuickContactIntent(context, target, lookupUri, mode, excludeMimes)); } /** * Creates the Intent to launch Quick Contacts * @hide */ public static Intent getQuickContactIntent(Context context, View target, Uri lookupUri, int mode, String[] excludeMimes) { // Find location and bounds of target view, adjusting based on the // assumed local density. final float appScale = context.getResources().getCompatibilityInfo().applicationScale; Loading @@ -5580,7 +5598,7 @@ public final class ContactsContract { rect.bottom = (int) ((pos[1] + target.getHeight()) * appScale + 0.5f); // Trigger with obtained rectangle showQuickContact(context, rect, lookupUri, mode, excludeMimes); return getQuickContactIntent(context, rect, lookupUri, mode, excludeMimes); } /** Loading Loading @@ -5611,6 +5629,16 @@ public final class ContactsContract { */ public static void showQuickContact(Context context, Rect target, Uri lookupUri, int mode, String[] excludeMimes) { context.startActivity(getQuickContactIntent(context, target, lookupUri, mode, excludeMimes)); } /** * Creates the Intent to launch Quick Contacts * @hide */ public static Intent getQuickContactIntent(Context context, Rect target, Uri lookupUri, int mode, String[] excludeMimes) { // Launch pivot dialog through intent for now final Intent intent = new Intent(ACTION_QUICK_CONTACT); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP Loading @@ -5620,7 +5648,7 @@ public final class ContactsContract { intent.setSourceBounds(target); intent.putExtra(EXTRA_MODE, mode); intent.putExtra(EXTRA_EXCLUDE_MIMES, excludeMimes); context.startActivity(intent); return intent; } } Loading core/java/android/widget/QuickContactBadge.java +17 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ public class QuickContactBadge extends ImageView implements OnClickListener { private QueryHandler mQueryHandler; private Drawable mBadgeBackground; private Drawable mNoBadgeBackground; private int mSelectedContactsAppTabIndex = -1; protected String[] mExcludeMimes = null; Loading Loading @@ -133,6 +134,15 @@ public class QuickContactBadge extends ImageView implements OnClickListener { onContactUriChanged(); } /** * Sets the currently selected tab of the Contacts application. If not set, this is -1 * and therefore does not save a tab selection when a phone call is being made * @hide */ public void setSelectedContactsAppTabIndex(int value) { mSelectedContactsAppTabIndex = value; } private void onContactUriChanged() { if (mContactUri == null && mContactEmail == null && mContactPhone == null) { if (mNoBadgeBackground == null) { Loading Loading @@ -215,7 +225,13 @@ public class QuickContactBadge extends ImageView implements OnClickListener { } private void trigger(Uri lookupUri) { QuickContact.showQuickContact(getContext(), this, lookupUri, mMode, mExcludeMimes); final Intent intent = QuickContact.getQuickContactIntent(getContext(), this, lookupUri, mMode, mExcludeMimes); if (mSelectedContactsAppTabIndex != -1) { intent.putExtra(QuickContact.EXTRA_SELECTED_CONTACTS_APP_TAB_INDEX, mSelectedContactsAppTabIndex); } getContext().startActivity(intent); } private class QueryHandler extends AsyncQueryHandler { Loading core/java/com/android/internal/widget/ContactHeaderWidget.java +7 −0 Original line number Diff line number Diff line Loading @@ -331,6 +331,13 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList } } /** * @hide */ public void setSelectedContactsAppTabIndex(int value) { mPhotoView.setSelectedContactsAppTabIndex(value); } /** * Turn on/off showing of the aggregate badge element. */ Loading Loading
core/java/android/provider/ContactsContract.java +30 −2 Original line number Diff line number Diff line Loading @@ -5542,6 +5542,14 @@ public final class ContactsContract { */ public static final int MODE_LARGE = 3; /** * Extra used to specify the last selected tab index of the Contacts app. * If this is not given or -1 * @hide */ public static final String EXTRA_SELECTED_CONTACTS_APP_TAB_INDEX = "SELECTED_TAB_INDEX"; /** * Trigger a dialog that lists the various methods of interacting with * the requested {@link Contacts} entry. This may be based on available Loading @@ -5567,6 +5575,16 @@ public final class ContactsContract { */ public static void showQuickContact(Context context, View target, Uri lookupUri, int mode, String[] excludeMimes) { context.startActivity(getQuickContactIntent(context, target, lookupUri, mode, excludeMimes)); } /** * Creates the Intent to launch Quick Contacts * @hide */ public static Intent getQuickContactIntent(Context context, View target, Uri lookupUri, int mode, String[] excludeMimes) { // Find location and bounds of target view, adjusting based on the // assumed local density. final float appScale = context.getResources().getCompatibilityInfo().applicationScale; Loading @@ -5580,7 +5598,7 @@ public final class ContactsContract { rect.bottom = (int) ((pos[1] + target.getHeight()) * appScale + 0.5f); // Trigger with obtained rectangle showQuickContact(context, rect, lookupUri, mode, excludeMimes); return getQuickContactIntent(context, rect, lookupUri, mode, excludeMimes); } /** Loading Loading @@ -5611,6 +5629,16 @@ public final class ContactsContract { */ public static void showQuickContact(Context context, Rect target, Uri lookupUri, int mode, String[] excludeMimes) { context.startActivity(getQuickContactIntent(context, target, lookupUri, mode, excludeMimes)); } /** * Creates the Intent to launch Quick Contacts * @hide */ public static Intent getQuickContactIntent(Context context, Rect target, Uri lookupUri, int mode, String[] excludeMimes) { // Launch pivot dialog through intent for now final Intent intent = new Intent(ACTION_QUICK_CONTACT); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP Loading @@ -5620,7 +5648,7 @@ public final class ContactsContract { intent.setSourceBounds(target); intent.putExtra(EXTRA_MODE, mode); intent.putExtra(EXTRA_EXCLUDE_MIMES, excludeMimes); context.startActivity(intent); return intent; } } Loading
core/java/android/widget/QuickContactBadge.java +17 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ public class QuickContactBadge extends ImageView implements OnClickListener { private QueryHandler mQueryHandler; private Drawable mBadgeBackground; private Drawable mNoBadgeBackground; private int mSelectedContactsAppTabIndex = -1; protected String[] mExcludeMimes = null; Loading Loading @@ -133,6 +134,15 @@ public class QuickContactBadge extends ImageView implements OnClickListener { onContactUriChanged(); } /** * Sets the currently selected tab of the Contacts application. If not set, this is -1 * and therefore does not save a tab selection when a phone call is being made * @hide */ public void setSelectedContactsAppTabIndex(int value) { mSelectedContactsAppTabIndex = value; } private void onContactUriChanged() { if (mContactUri == null && mContactEmail == null && mContactPhone == null) { if (mNoBadgeBackground == null) { Loading Loading @@ -215,7 +225,13 @@ public class QuickContactBadge extends ImageView implements OnClickListener { } private void trigger(Uri lookupUri) { QuickContact.showQuickContact(getContext(), this, lookupUri, mMode, mExcludeMimes); final Intent intent = QuickContact.getQuickContactIntent(getContext(), this, lookupUri, mMode, mExcludeMimes); if (mSelectedContactsAppTabIndex != -1) { intent.putExtra(QuickContact.EXTRA_SELECTED_CONTACTS_APP_TAB_INDEX, mSelectedContactsAppTabIndex); } getContext().startActivity(intent); } private class QueryHandler extends AsyncQueryHandler { Loading
core/java/com/android/internal/widget/ContactHeaderWidget.java +7 −0 Original line number Diff line number Diff line Loading @@ -331,6 +331,13 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList } } /** * @hide */ public void setSelectedContactsAppTabIndex(int value) { mPhotoView.setSelectedContactsAppTabIndex(value); } /** * Turn on/off showing of the aggregate badge element. */ Loading