Loading src/com/android/contacts/activities/ContactEditorSpringBoardActivity.java +6 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ import android.widget.Toast; import com.android.contacts.AppCompatContactsActivity; import com.android.contacts.R; import com.android.contacts.common.activity.RequestPermissionsActivity; import com.android.contacts.common.logging.EditorEvent; import com.android.contacts.common.logging.Logger; import com.android.contacts.common.model.AccountTypeManager; import com.android.contacts.common.util.ImplicitIntentsUtil; import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette; Loading Loading @@ -108,6 +110,8 @@ public class ContactEditorSpringBoardActivity extends AppCompatContactsActivity // Go straight to editor if we're passed a raw contact Uri. if (ContactsContract.AUTHORITY.equals(authority) && RawContacts.CONTENT_ITEM_TYPE.equals(type)) { Logger.logEditorEvent( EditorEvent.EventType.SHOW_RAW_CONTACT_PICKER, /* numberRawContacts */ 0); final long rawContactId = ContentUris.parseId(mUri); startEditorAndForwardExtras(getIntentForRawContact(rawContactId)); } else if (android.provider.Contacts.AUTHORITY.equals(authority)) { Loading Loading @@ -169,6 +173,8 @@ public class ContactEditorSpringBoardActivity extends AppCompatContactsActivity * the editor is started normally and handles creation of a new writable raw contact. */ private void loadEditor() { Logger.logEditorEvent( EditorEvent.EventType.SHOW_RAW_CONTACT_PICKER, /* numberRawContacts */ 0); final Intent intent; if (mHasWritableAccount) { intent = getIntentForRawContact(mResult.rawContacts.get(mWritableAccountPosition).id); Loading src/com/android/contacts/common/logging/EditorEvent.java 0 → 100644 +40 −0 Original line number Diff line number Diff line /* * Copyright (C) 2016 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. */ package com.android.contacts.common.logging; import com.google.common.base.MoreObjects; public class EditorEvent { /** The editor event type that is logged. */ public int eventType; /** The number of raw contacts shown in the raw contacts picker. */ public int numberRawContacts; public static final class EventType { public static final int UNKNOWN = 0; public static final int SHOW_RAW_CONTACT_PICKER = 1; } @Override public String toString() { return MoreObjects.toStringHelper(this) .add("eventType", eventType) .add("numberRawContacts", numberRawContacts) .toString(); } } src/com/android/contacts/common/logging/Logger.java +11 −0 Original line number Diff line number Diff line Loading @@ -96,8 +96,19 @@ public abstract class Logger { } } public static void logEditorEvent(int eventType, int numberRawContacts) { final Logger logger = getInstance(); if (logger != null) { final EditorEvent event = new EditorEvent(); event.eventType = eventType; event.numberRawContacts = numberRawContacts; logger.logEditorEventImpl(event); } } public abstract void logScreenViewImpl(int screenType, int previousScreenType); public abstract void logSearchEventImpl(SearchState searchState); public abstract void logListEventImpl(ListEvent event); public abstract void logQuickContactEventImpl(QuickContactEvent event); public abstract void logEditorEventImpl(EditorEvent event); } src/com/android/contacts/editor/PickRawContactDialogFragment.java +6 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ import android.widget.TextView; import com.android.contacts.R; import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.logging.EditorEvent; import com.android.contacts.common.logging.Logger; import com.android.contacts.common.model.AccountTypeManager; import com.android.contacts.common.model.account.AccountDisplayInfo; import com.android.contacts.common.model.account.AccountDisplayInfoFactory; Loading Loading @@ -181,6 +183,10 @@ public class PickRawContactDialogFragment extends DialogFragment { } }); builder.setCancelable(true); if (savedInstanceState == null) { Logger.logEditorEvent(EditorEvent.EventType.SHOW_RAW_CONTACT_PICKER, /* numberRawContacts */ mAdapter.getCount()); } return builder.create(); } Loading Loading
src/com/android/contacts/activities/ContactEditorSpringBoardActivity.java +6 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ import android.widget.Toast; import com.android.contacts.AppCompatContactsActivity; import com.android.contacts.R; import com.android.contacts.common.activity.RequestPermissionsActivity; import com.android.contacts.common.logging.EditorEvent; import com.android.contacts.common.logging.Logger; import com.android.contacts.common.model.AccountTypeManager; import com.android.contacts.common.util.ImplicitIntentsUtil; import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette; Loading Loading @@ -108,6 +110,8 @@ public class ContactEditorSpringBoardActivity extends AppCompatContactsActivity // Go straight to editor if we're passed a raw contact Uri. if (ContactsContract.AUTHORITY.equals(authority) && RawContacts.CONTENT_ITEM_TYPE.equals(type)) { Logger.logEditorEvent( EditorEvent.EventType.SHOW_RAW_CONTACT_PICKER, /* numberRawContacts */ 0); final long rawContactId = ContentUris.parseId(mUri); startEditorAndForwardExtras(getIntentForRawContact(rawContactId)); } else if (android.provider.Contacts.AUTHORITY.equals(authority)) { Loading Loading @@ -169,6 +173,8 @@ public class ContactEditorSpringBoardActivity extends AppCompatContactsActivity * the editor is started normally and handles creation of a new writable raw contact. */ private void loadEditor() { Logger.logEditorEvent( EditorEvent.EventType.SHOW_RAW_CONTACT_PICKER, /* numberRawContacts */ 0); final Intent intent; if (mHasWritableAccount) { intent = getIntentForRawContact(mResult.rawContacts.get(mWritableAccountPosition).id); Loading
src/com/android/contacts/common/logging/EditorEvent.java 0 → 100644 +40 −0 Original line number Diff line number Diff line /* * Copyright (C) 2016 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. */ package com.android.contacts.common.logging; import com.google.common.base.MoreObjects; public class EditorEvent { /** The editor event type that is logged. */ public int eventType; /** The number of raw contacts shown in the raw contacts picker. */ public int numberRawContacts; public static final class EventType { public static final int UNKNOWN = 0; public static final int SHOW_RAW_CONTACT_PICKER = 1; } @Override public String toString() { return MoreObjects.toStringHelper(this) .add("eventType", eventType) .add("numberRawContacts", numberRawContacts) .toString(); } }
src/com/android/contacts/common/logging/Logger.java +11 −0 Original line number Diff line number Diff line Loading @@ -96,8 +96,19 @@ public abstract class Logger { } } public static void logEditorEvent(int eventType, int numberRawContacts) { final Logger logger = getInstance(); if (logger != null) { final EditorEvent event = new EditorEvent(); event.eventType = eventType; event.numberRawContacts = numberRawContacts; logger.logEditorEventImpl(event); } } public abstract void logScreenViewImpl(int screenType, int previousScreenType); public abstract void logSearchEventImpl(SearchState searchState); public abstract void logListEventImpl(ListEvent event); public abstract void logQuickContactEventImpl(QuickContactEvent event); public abstract void logEditorEventImpl(EditorEvent event); }
src/com/android/contacts/editor/PickRawContactDialogFragment.java +6 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ import android.widget.TextView; import com.android.contacts.R; import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.logging.EditorEvent; import com.android.contacts.common.logging.Logger; import com.android.contacts.common.model.AccountTypeManager; import com.android.contacts.common.model.account.AccountDisplayInfo; import com.android.contacts.common.model.account.AccountDisplayInfoFactory; Loading Loading @@ -181,6 +183,10 @@ public class PickRawContactDialogFragment extends DialogFragment { } }); builder.setCancelable(true); if (savedInstanceState == null) { Logger.logEditorEvent(EditorEvent.EventType.SHOW_RAW_CONTACT_PICKER, /* numberRawContacts */ mAdapter.getCount()); } return builder.create(); } Loading