Commit Graph

27 Commits

Author SHA1 Message Date
Hai Zhang
f5e8ccd88f Use a boolean Consumer instead of RoleManagerCallback.
And use RemoteCallback for it under the hood. This removes one AIDL
interface and allows using lambda, while aligning with what
PermissionControllerService does.

Bug: 127691087
Test: manual
Change-Id: Ia94e5bac59773380b2a4764d766bf6ff1dd5b7ff
2019-03-08 15:51:02 -08:00
TreeHugger Robot
3ac202db6f Merge "Revert "Make getInstalledDialerApplications() require an InCallService."" 2019-02-11 23:17:51 +00:00
Hai Zhang
7c8d2e79a7 Revert "Make getInstalledDialerApplications() require an InCallService."
This reverts commit b73ec01a17.

Reason for revert: Dialer actually don't require an InCallService.

Bug: 124238689
Change-Id: Idba1af59ad39da87cf3c77c9c5e31843ce2d78d1
2019-02-11 19:15:11 +00:00
Hai Zhang
71d70360b2 Add flags parameter for managing role holders.
This change allows passing a flag parameter when managing role
holders, including a DONT_KILL_APP flag that can be used by the
request role dialog.

Bug: 123429697
Test: manual
Change-Id: I57b690dcdfbf6fd13940cf45d392a48adeccdfaa
2019-02-05 15:37:40 -08:00
Eugene Susla
03f6205e3e Merge "Fix dialer cts test" 2019-02-01 18:27:58 +00:00
Eugene Susla
98a872d75b Fix dialer cts test
Whether setting default dialer succeeds is propagated all the way to API,
and (apparently) enforced by cts, so it looks like we should wait for it

Fixes: 123718729
Test: atest android.telecom.cts.DefaultDialerOperationsTest#testSetDefaultDialerNoDialIntent_notSupported
Change-Id: I2f7b8d4a32d1b570d0aba8cc4cc529f58a9dbc20
2019-01-31 18:31:15 -08:00
Hai Zhang
b73ec01a17 Make getInstalledDialerApplications() require an InCallService.
So that the old default dialer app picker don't show apps that don't
qualify for this new requirement in dialer role.

Bug: 110557011
Test: manual
Change-Id: Iafb33c7ee0f865991822013c839890d2fe18c692
2019-01-30 16:37:33 -08:00
Eugene Susla
92b88c7fab Migrate dialer to RoleManager
Test: ensure settings UI is ok, ensure stock dialer can still make a call
Change-Id: Iab835939fbb92af06d9440910fbde2725ca66f70
2019-01-25 17:20:39 -08:00
Nicholas Sauer
8d7120f68a Retrieve packages for the specified user.
DefaultDialerManager#setDefaultDialerApplication is meant to execute on
the current user. However it retreives packages for the user specified
in the context --  which can be different than the user specified in the
method call. As a result, calls to setDefaultDialerApplication can be
successful even if the component is disabled in the current (secondary)
user.

bug: 121094764
Test: via CTS
adb shell am switch-user 10
cts-tradefed run cts-dev -a arm64-v8a -m CtsTelecomTestCases -t android.telecom.cts.DefaultDialerOpest#testSetDefaultDialerNoDialIntent_notSupported

adb shell am switch-user 0
cts-tradefed run cts-dev -a arm64-v8a -m CtsTelecomTestCases -t android.telecom.cts.DefaultDialerOpest#testSetDefaultDialerNoDialIntent_notSupported

Change-Id: I0992594f8791791eacba43e03ca1c293832eddcf
2018-12-16 19:34:36 +00:00
Tony Mak
39198faea1 getInstalledDialerApplications should not count ForwardIntentToParent
Issues:
1. Work profile call is logged into work profile side even there
is no work profile dialer.
2. In Settings, "Android" is shown as the default work profile dialer.

Cause:
When are querying installed dialers in work profile,
getInstalledDialerApplications return android/ForwardIntentToParent
because we forward calls to personal side if work dialer
is absent. But apparently, ForwardIntentToParent is not an installed
dialer in work profile. So Settings shows "Android" as default work
dialer and Telecom wrongly think that we have work dialer and insert
calllog in to work profile side.

Solution:
Ignore cross profile resolver by checking targetUserId.


Test: Manual
1. Check Settings, no longer see "Android" is set as work dialer.
2. Make a phone call using work contacts, observed that the call
   is inserted into persoonal side.
3. Make a phone call using personal side, observed that the call
   is inserted into personal side.

BUG: 65672386

Change-Id: I13d4234ad1684f714e1b4d7704f2413d903a0179
2017-09-15 17:52:16 +01:00
Tyler Gunn
0907bd674a Prevent INTERACT_ACROSS_USERS exception in DefaultDialerManager.
When TelecomManager methods perform a read phonestate check from a work
profile user, it is possible to get an INTERACT_ACROSS_USERS exception.
This is due to the fact that the filterByIntent method was not calling
queryIntentActivitiesAsUser.

Test: Manual
Bug: 31304557
Change-Id: I2a1869162e5a52aed986a99cc378a6c630af4a70
2017-09-01 15:17:05 -07:00
Hall Liu
15dbf2b3f0 Make use of user id in getDefaultDialerApplication
In the version of getDefaultDialerApplication that has an argument for
user id, make use of it when querying the list of installed dialer
packages. Otherwise, a secondary user may find their default dialer
pointing to an app that they had disabled.

Test: manual
Change-Id: Id85ff730b820741cddb6afee8af095232d3dae0f
2016-12-08 14:51:38 -08:00
Tony Mak
b401a94d84 Make getInstalledDialerApplications to query for specific user
BUG=26634502

Change-Id: I8fe5506589bae85e3babba1aaab3b737cd12543b
2016-01-19 19:39:01 +00:00
Jeff Sharkey
2f3e35376a More work towards triaging missing app behavior.
Many places across the platform query package details without
gracefully handling packages or components that go missing for
various reasons.  This can cause annoying user data loss, such as
resetting back to built-in apps or dropping of accounts, etc.

This change verifies that system callers have thought about these
edge cases by logging if they use default matching behaviors without
explicitly marking themselves as being "triaged."  (The logging is
currently disabled by default.)

Also creates explicit definitions of supported flags for various
incoming PackageManager calls, and defines a clear distinction
between flag types:

-- GET-style flags are used to request additional data that may have
been elided to save wire space.

-- MATCH-style flags are used to include components or packages that
would have otherwise been omitted from a result set by current system
state.

There are a handful of existing GET flags that better fit under the
MATCH definition, so this change clones them to new constants and
marks the old ones as deprecated.

Fixes bug in JobSchedulerService to consider jobs from apps on
external storage.  Revert some dialer behavior back to being
untriaged.

Change-Id: I9b6ab0968241e3479bddbd78de0c51e3b9917318
2016-01-04 13:19:02 -07:00
Jeff Sharkey
2a9e3f8e68 Better named encryption flags, start triaging.
Create distinct flags for encryption aware, unaware, and both, and
name them like the other MATCH_ flags.

Start adding logic to help triage all system internal callers to
verify that they've done their homework and thought about how to
handle apps while locked.  Call sites in the system should either
ask for explicit matching behavior, or explicitly use the DEFAULT
match flag to indicate that they've been triaged to use the
default state-based matching.

Bug: 26250295
Change-Id: I86214e5c4f71a6dc72f06930800388713aecd107
2015-12-19 15:00:09 -07:00
Svet Ganov
52153f4c05 Add GTS test to ensure valid default permission grants - framework
The platform grants runtime permissions by default to apps on the
system image that provide core device use cases which a user expects
to work out-of-the-box. We are now adding a test to ensure that
OEMs cannot pregrant premissions on non approved components.

bug:23043018

Change-Id: Id76717cce0ee59678956bd0be347d3c045fe4c51
2015-08-12 21:57:59 -07:00
Yorke Lee
db6da48621 Allow default dialer changes and phone account enable/disable via ADB
Add commands accessible via adb shell that can be used for CTS tests
without the need for adb root
*set-phone-account-enabled
*set-phone-account-disabled
*set-default-dialer
*get-default-dialer

Modify enablePhoneAccount/setDefaultDialer to indicate success.

Remove now unused functionality in ProtectedEnableAccountPreferenceActivity
and ProtectedChangeDefaultDialerActivity.

Bug: 21583012
Change-Id: I542d145cc969334c004b8344fbbb01f278256f9d
2015-06-02 14:23:21 -07:00
Yorke Lee
e0895660da Merge "Filter list of possible default dialers" into mnc-dev 2015-05-07 17:34:54 +00:00
Yorke Lee
6526f67e45 Add hidden methods to set/get default dialer across users
First part of a set of changes to make the default dialer work
across multiple users. This initial CL should not affect any
user-facing behavior, just add new methods.

Bug: 20696062
Change-Id: If1651240e185b4c09e960260c822c9265069fb9a
2015-05-04 17:11:46 -07:00
Yorke Lee
856a5ac704 Filter list of possible default dialers
Make sure they handle the ACTION_DIAL intent with the tel scheme

Bug: 20304411
Change-Id: I1822eff8bc014d4679352165ebe2bc819b82f75b
2015-04-28 17:05:00 -07:00
Yorke Lee
b7018ba660 Merge "Simplify DefaultDialerManager" into mnc-dev 2015-04-28 18:57:46 +00:00
Yorke Lee
8e0207ba5b Simplify DefaultDialerManager
The previous code worked with ComponentNames because it was
based off existing code for the default SMS application.
We only really need the package name however, so simplify the
code by storing and retrieving the package name directly.

Bug: 20304458
Change-Id: Icabd3a9f0f8166c105360494b601160d13767fad
2015-04-28 11:30:47 -07:00
Yorke Lee
d0922ed723 Merge "Rename setDefaultDialerApplication for consistency" into mnc-dev 2015-04-27 22:49:34 +00:00
Yorke Lee
a162f02f76 Rename setDefaultDialerApplication for consistency
Change-Id: I8227df913bdb0ed5e1b3472f9d4ebea1158b366b
2015-04-27 15:17:50 -07:00
Yorke Lee
610438230b Add utility method isDefaultOrSystemDialer
Will be used by various system components to determine if a
given package name is a privileged Dialer

Bug: 20333102
Bug: 20304411
Change-Id: I1e5bcbde8ee9a5dc6936b118b1b78f32d97737a6
2015-04-27 12:55:23 -07:00
Yorke Lee
1011f4870c Add APIs to getDefaultDialerPackage and getSystemDialerPackage
getDefaultDialerPackage is a public API and will be used by
apps to determine if they are the default dialer.

getSystemDialerPackage is a hidden API and is only used by
system components.

Also add new public string constants to allow apps to show
a dialog requesting that the user change the current default
dialer.

Bug: 20304458
Change-Id: I121d36741474c1fe171c372fb766a6c128228c9c
2015-04-24 11:12:34 -07:00
Yorke Lee
014de02dd2 Add hidden class in framework for managing the default dialer settings
Bug: 20303635
Change-Id: I7e7318086ade9531fb85f08b8e3f1f001ee0a8d9
2015-04-23 10:19:52 -07:00