Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_InCallUI
Commits
126265d8
Commit
126265d8
authored
9 years ago
by
Anthony Lee
Committed by
Android (Google) Code Review
9 years ago
Browse files
Options
Download
Plain Diff
Merge "Ensure call subject is hidden if disabled for carrier." into mnc-dr-dev
parents
7bfb8135
07f5e7af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
2 deletions
+36
-2
src/com/android/incallui/Call.java
src/com/android/incallui/Call.java
+32
-0
src/com/android/incallui/CallCardPresenter.java
src/com/android/incallui/CallCardPresenter.java
+2
-1
src/com/android/incallui/StatusBarNotifier.java
src/com/android/incallui/StatusBarNotifier.java
+2
-1
No files found.
src/com/android/incallui/Call.java
View file @
126265d8
...
...
@@ -30,6 +30,7 @@ import android.telecom.GatewayInfo;
import
android.telecom.InCallService.VideoCall
;
import
android.telecom.PhoneAccount
;
import
android.telecom.PhoneAccountHandle
;
import
android.telecom.TelecomManager
;
import
android.telecom.VideoProfile
;
import
android.telephony.PhoneNumberUtils
;
import
android.text.TextUtils
;
...
...
@@ -262,6 +263,13 @@ public class Call {
private
String
mChildNumber
;
private
String
mLastForwardedNumber
;
private
String
mCallSubject
;
private
PhoneAccountHandle
mPhoneAccountHandle
;
/**
* Indicates whether the phone account associated with this call supports specifying a call
* subject.
*/
private
boolean
mIsCallSubjectSupported
;
/**
* Used only to create mock calls for testing
...
...
@@ -373,6 +381,22 @@ public class Call {
mHandle
=
newHandle
;
updateEmergencyCallState
();
}
// If the phone account handle of the call is set, cache capability bit indicating whether
// the phone account supports call subjects.
PhoneAccountHandle
newPhoneAccountHandle
=
mTelecommCall
.
getDetails
().
getAccountHandle
();
if
(!
Objects
.
equals
(
mPhoneAccountHandle
,
newPhoneAccountHandle
))
{
mPhoneAccountHandle
=
newPhoneAccountHandle
;
if
(
mPhoneAccountHandle
!=
null
)
{
TelecomManager
mgr
=
InCallPresenter
.
getInstance
().
getTelecomManager
();
PhoneAccount
phoneAccount
=
mgr
.
getPhoneAccount
(
mPhoneAccountHandle
);
if
(
phoneAccount
!=
null
)
{
mIsCallSubjectSupported
=
phoneAccount
.
hasCapabilities
(
PhoneAccount
.
CAPABILITY_CALL_SUBJECT
);
}
}
}
}
private
static
int
translateState
(
int
state
)
{
...
...
@@ -477,6 +501,14 @@ public class Call {
return
mCallSubject
;
}
/**
* @return {@code true} if the call's phone account supports call subjects, {@code false}
* otherwise.
*/
public
boolean
isCallSubjectSupported
()
{
return
mIsCallSubjectSupported
;
}
/** Returns call disconnect cause, defined by {@link DisconnectCause}. */
public
DisconnectCause
getDisconnectCause
()
{
if
(
mState
==
State
.
DISCONNECTED
||
mState
==
State
.
IDLE
)
{
...
...
This diff is collapsed.
Click to expand it.
src/com/android/incallui/CallCardPresenter.java
View file @
126265d8
...
...
@@ -921,7 +921,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
boolean
isIncomingOrWaiting
=
mPrimary
.
getState
()
==
Call
.
State
.
INCOMING
||
mPrimary
.
getState
()
==
Call
.
State
.
CALL_WAITING
;
return
isIncomingOrWaiting
&&
!
TextUtils
.
isEmpty
(
call
.
getCallSubject
())
&&
call
.
getNumberPresentation
()
==
TelecomManager
.
PRESENTATION_ALLOWED
;
call
.
getNumberPresentation
()
==
TelecomManager
.
PRESENTATION_ALLOWED
&&
call
.
isCallSubjectSupported
();
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/com/android/incallui/StatusBarNotifier.java
View file @
126265d8
...
...
@@ -427,7 +427,8 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener,
call
.
getState
()
==
Call
.
State
.
CALL_WAITING
;
if
(
isIncomingOrWaiting
&&
!
TextUtils
.
isEmpty
(
call
.
getCallSubject
())
&&
call
.
getNumberPresentation
()
==
TelecomManager
.
PRESENTATION_ALLOWED
)
{
call
.
getNumberPresentation
()
==
TelecomManager
.
PRESENTATION_ALLOWED
&&
call
.
isCallSubjectSupported
())
{
return
call
.
getCallSubject
();
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment