Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bb2f53e authored by qqzhou's avatar qqzhou Committed by Steve Kondik
Browse files

Dialer: add support for duration type in call detail

We use one config to control whether show duration type
"active duration" or "call out duration" in call detail.

Change-Id: I0b07404995b5ed0cf0ff9c5cb12914461ce28424
parent f9aa96d0
Loading
Loading
Loading
Loading

res/values-zh-rCN/strings.xml

100644 → 100755
+2 −0
Original line number Diff line number Diff line
@@ -130,6 +130,8 @@
    <string name="dialerKeyboardHintText" msgid="5401660096579787344">"使用键盘拨号"</string>
    <string name="dialerDialpadHintText" msgid="5824490365898349041">"拨号以添加通话"</string>
    <string name="callDetailsDurationFormat" msgid="8157706382818184268">"<xliff:g id="MINUTES">%s</xliff:g><xliff:g id="SECONDS">%s</xliff:g>秒"</string>
    <string name="call_duration_active">"通话时长:"</string>
    <string name="call_duration_call_out">"呼叫时长:"</string>
    <string name="dialog_phone_call_prohibited_message" msgid="6554711866586660441">"电话未拨出"</string>
    <string name="dialog_voicemail_not_ready_message" msgid="4384716252789515378">"要设置语音信箱,请转到“菜单”&gt;“设置”。"</string>
    <string name="dialog_voicemail_airplane_mode_message" msgid="530922773669546093">"要呼叫语音信箱,请先关闭飞行模式。"</string>
+3 −0
Original line number Diff line number Diff line
@@ -34,4 +34,7 @@
         Ignored if empty. -->
    <string name="config_prohibited_phone_number_regexp"></string>

    <bool name="call_duration_enabled">true</bool>

    <bool name="call_durationtype_enabled">false</bool>
</resources>

res/values/strings.xml

100644 → 100755
+3 −0
Original line number Diff line number Diff line
@@ -514,6 +514,9 @@
    <!-- A nicely formatted call duration displayed when viewing call details. For example "42 mins 28 secs" -->
    <string name="callDetailsDurationFormat"><xliff:g id="minutes" example="42">%s</xliff:g> mins <xliff:g id="seconds" example="28">%s</xliff:g> secs</string>

    <string name="call_duration_active">Active duration:</string>
    <string name="call_duration_call_out">Call duration:</string>

    <!-- Dialog message which is shown when the user tries to make a phone call
         to prohibited phone numbers [CHAR LIMIT=NONE] -->
    <string name="dialog_phone_call_prohibited_message" msgid="4313552620858880999">Call not sent</string>
+5 −2
Original line number Diff line number Diff line
@@ -221,7 +221,8 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe
        CallLog.Calls.PHONE_ACCOUNT_ID,
        CallLog.Calls.FEATURES,
        CallLog.Calls.DATA_USAGE,
        CallLog.Calls.TRANSCRIPTION
        CallLog.Calls.TRANSCRIPTION,
        CallLog.Calls.DURATION_TYPE
    };

    static final int DATE_COLUMN_INDEX = 0;
@@ -236,6 +237,7 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe
    static final int FEATURES = 9;
    static final int DATA_USAGE = 10;
    static final int TRANSCRIPTION_COLUMN_INDEX = 11;
    static final int DURATION_TYPE_COLUMN_INDEX = 12;

    @Override
    protected void onCreate(Bundle icicle) {
@@ -558,6 +560,7 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe
            String countryIso = callCursor.getString(COUNTRY_ISO_COLUMN_INDEX);
            final String geocode = callCursor.getString(GEOCODED_LOCATION_COLUMN_INDEX);
            final String transcription = callCursor.getString(TRANSCRIPTION_COLUMN_INDEX);
            final int durationType = callCursor.getInt(DURATION_TYPE_COLUMN_INDEX);

            final String accountLabel = PhoneAccountUtils.getAccountLabel(this,
                    PhoneAccountUtils.getAccount(
@@ -615,7 +618,7 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe
                    formattedNumber, countryIso, geocode,
                    new int[]{ callType }, date, duration,
                    nameText, numberType, numberLabel, lookupUri, photoUri, sourceType,
                    accountLabel, null, features, dataUsage, transcription, subId);
                    accountLabel, null, features, dataUsage, transcription, subId, durationType);
        } finally {
            if (callCursor != null) {
                callCursor.close();
+9 −2
Original line number Diff line number Diff line
@@ -96,6 +96,11 @@ public class PhoneCallDetails {
     */
    public final static int DEFAULT_PHONE_ID = 0;

    /**
     * Duration type for this call.
     */
    public final int durationType;

    /**
     * Create the details for a call, with empty defaults specified for extra fields that are
     * not necessary for testing.
@@ -137,7 +142,8 @@ public class PhoneCallDetails {
            Long dataUsage, String transcription) {
       this(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes,
               date, duration, name, numberType, numberLabel, contactUri, photoUri, sourceType,
               accountLabel, accountIcon, features, dataUsage, transcription, DEFAULT_PHONE_ID);
               accountLabel, accountIcon, features, dataUsage, transcription, DEFAULT_PHONE_ID,
               Calls.DURATION_TYPE_ACTIVE);
    }

    /** Create the details for a call with a number associated with a contact. */
@@ -146,7 +152,7 @@ public class PhoneCallDetails {
            int[] callTypes, long date, long duration, CharSequence name,
            int numberType, CharSequence numberLabel, Uri contactUri,
            Uri photoUri, int sourceType, String accountLabel, Drawable accountIcon, int features,
            Long dataUsage, String transcription, int accountId) {
            Long dataUsage, String transcription, int accountId, int durationType) {
        this.number = number;
        this.numberPresentation = numberPresentation;
        this.formattedNumber = formattedNumber;
@@ -167,5 +173,6 @@ public class PhoneCallDetails {
        this.dataUsage = dataUsage;
        this.transcription = transcription;
        this.accountId = accountId;
        this.durationType = durationType;
    }
}
Loading