13431 Commits

Author SHA1 Message Date
Carlos Valdivia
55cab009f0 am 9272db02: am c45bd7f2: Prevent authenticators from using Settings to launch arbitrary activities.
* commit '9272db024d013fbb48ec476c77562ab31d75a461':
  Prevent authenticators from using Settings to  launch arbitrary activities.
2014-02-27 11:22:53 -08:00
Carlos Valdivia
c45bd7f209 Prevent authenticators from using Settings to launch arbitrary activities.
Various authenticator results such as getAuthToken and addAccount might
result in an Intent returned to the AccountManager caller. A malicious
authenticator could exploit the fact that the Settings are a system app,
lead the user to launch add account for their account type and thus get
Settings to use the intent to start some arbitrary third parties Activity.

The fix is to make sure that the UID of the app associated with Activity
to be launched by the supplied intent and the Authenticators UID share
the same signature.  This means that an authenticator implementer can only
exploit apps they control.

Bug: 7699048
Change-Id: I34330454c341e6a8422ca1ed3b390466a0feedce
(cherry picked from commit 5bab9daf3cf66f4de19f8757e386030e8bef23ce)
2014-02-27 17:03:15 +00:00
Robert Greenwalt
1f9ebc5fa7 am 868d4c34: am 95023066: DO NOT MERGE Sanitize WifiConfigs
* commit '868d4c341034de6e2ebb6c1a247488b00d17c78d':
  DO NOT MERGE Sanitize WifiConfigs
2014-02-25 10:12:35 -08:00
Robert Greenwalt
950230663f DO NOT MERGE Sanitize WifiConfigs
Do this both on input from apps (giving error) and between wifi and
ConnectivityService (ignoring bad data).  This means removing all
addresses beyond the first and all routes but the first default and
the implied direct-connect routes.

We do this because the user can't monitor the others (no UI), their
support wasn't intended, they allow redirection of all traffic
without user knowledge and they allow circumvention of legacy VPNs.

This should not move forward from JB as it breaks IPv6 and K has
a more resilient VPN.

Bug:12663469
Change-Id: I0d92db7efc30a1bb3e5b8c6e5595bdb9793a16f2

Conflicts:
	core/java/android/net/LinkProperties.java
	services/java/com/android/server/WifiService.java
	wifi/java/android/net/wifi/WifiStateMachine.java
2014-02-24 15:20:32 -08:00
Daniel Cashman
9ecadd7ced am 6f34b938: am 3238d0d9: Merge "Clear cached locations when location providers disabled Bug: 12118307" into jb-mr2-dev
* commit '6f34b9382f0dac64952e0e5c05e96ea2ef3e28e8':
  Clear cached locations when location providers disabled Bug: 12118307
2014-01-13 10:53:31 -08:00
David Christie
766b5c4342 Clear cached locations when location providers disabled
Bug: 12118307

(cherry picked from commit b084fef18ee1b5d24d15cff37dc3a053933d361e)

Change-Id: Ief869b9e38858092bfa3f8d6d090a278dee7d86c
2014-01-06 15:30:34 -08:00
Christopher Tate
5d515f269b am fd706246: am 562fddce: am 05e3f55f: am 1d8f592a: am ef12b1d4: am ea198841: am ef4694cb: am ae229d99: am 43253333: am 50cbfd55: System package permission decls take precedence over 3rd party apps\'
* commit 'fd70624629c42b0e0444a4d99ba64d58551fa6b0':
  System package permission decls take precedence over 3rd party apps'
2013-11-08 12:56:07 -08:00
Christopher Tate
562fddce2f am 05e3f55f: am 1d8f592a: am ef12b1d4: am ea198841: am ef4694cb: am ae229d99: am 43253333: am 50cbfd55: System package permission decls take precedence over 3rd party apps\'
* commit '05e3f55f17e36b415a23095dbeaa1d04716aed5a':
  System package permission decls take precedence over 3rd party apps'
2013-11-08 12:47:43 -08:00
Christopher Tate
05e3f55f17 am 1d8f592a: am ef12b1d4: am ea198841: am ef4694cb: am ae229d99: am 43253333: am 50cbfd55: System package permission decls take precedence over 3rd party apps\'
* commit '1d8f592a752c30534a6e03889f1ba42b232770ef':
  System package permission decls take precedence over 3rd party apps'
2013-11-08 12:45:38 -08:00
Christopher Tate
1d8f592a75 am ef12b1d4: am ea198841: am ef4694cb: am ae229d99: am 43253333: am 50cbfd55: System package permission decls take precedence over 3rd party apps\'
* commit 'ef12b1d4a9ba6a91b61647feadaf2c4cdf34c356':
  System package permission decls take precedence over 3rd party apps'
2013-11-08 12:41:57 -08:00
Christopher Tate
ef12b1d4a9 am ea198841: am ef4694cb: am ae229d99: am 43253333: am 50cbfd55: System package permission decls take precedence over 3rd party apps\'
* commit 'ea198841a9e64d72de49811e0e2c555eb2c40b9b':
  System package permission decls take precedence over 3rd party apps'
2013-11-08 12:37:43 -08:00
Christopher Tate
ef4694cbdd am ae229d99: am 43253333: am 50cbfd55: System package permission decls take precedence over 3rd party apps\'
* commit 'ae229d991711745bdf8da2e716c31efde534e6da':
  System package permission decls take precedence over 3rd party apps'
2013-11-08 12:34:13 -08:00
Christopher Tate
ae229d9917 am 43253333: am 50cbfd55: System package permission decls take precedence over 3rd party apps\'
* commit '43253333d24e856a7ffef818fdfaedf3fd60d3b6':
  System package permission decls take precedence over 3rd party apps'
2013-11-08 12:31:09 -08:00
Christopher Tate
43253333d2 am 50cbfd55: System package permission decls take precedence over 3rd party apps\'
* commit '50cbfd554f0bdf05c701d8baf15c862fbb8a6dc0':
  System package permission decls take precedence over 3rd party apps'
2013-11-08 12:27:10 -08:00
Christopher Tate
50cbfd554f System package permission decls take precedence over 3rd party apps'
In particular, if a 3rd party app tries to define a permission that
turns out to be defined by system packages following an upgrade,
the system package gets ownership and grants are re-evaluated
on that basis.

Bug 11242510

(Cherry-pick backport to JB)

Change-Id: Iabf7b6280e6c6674a51af5624142bd19ea0750ed
2013-11-07 19:04:22 -08:00
Wink Saville
fc7a146b82 am 50f86448: am 59a9884b: Merge "Do not change NetworkInfo.DetailedState." into jb-mr2-dev
* commit '50f864480d6e9cf9e4d83b4533e3764753b4d408':
  Do not change NetworkInfo.DetailedState.
2013-09-06 09:17:19 -07:00
Wink Saville
67c3821926 Do not change NetworkInfo.DetailedState.
I'd changed DetailedState to force ConnectivityService to treat
provisioning apn's specially. In particular so that they wouldn't
be identified they were fully connected until the provisioning
actually started. The problem is that DetailedState is a public enum
that has a CTS test and just changing the CTS to allow for the new
state (CONNECTED_TO_PROVISIONING_NETWORK) was inappropriate.

Instead I've added a new mIsConnectedToProvisioningNetwork variable
and used the DetailedState.SUSPENDED as the intermediate state.

Bug: 10620248
Change-Id: Id4a842398cad67455541ce629959351c27d83639
2013-09-05 12:02:25 -07:00
Wink Saville
270226b0dd am 8cb2f42e: am 948282b0: Add support for handling mobile provisioning networks.
* commit '8cb2f42eea2ef3b249528aa7913fc7a6dfc6b741':
  Add support for handling mobile provisioning networks.
2013-08-29 10:26:06 -07:00
Wink Saville
948282b0e6 Add support for handling mobile provisioning networks.
When a sim is new or it has expired it needs to be provisioned
with the carrier. Basically provisioning is associating a sim with
a user account. When a sim isn't provisioned then operators will
restrict access to the network and only allow certain addresses
or services to be used.

This set of changes allows two types of provisioning networks to be
recognized. The first is a network that causes all DNS lookups to be
redirected to a different address than was intended. This is exemplified
by how T-Mobile works.

The second technique uses a special apn for provisioning. An example is
AT&T where lwaactivate is the provisioning apn and broadband is the
normal apn. We first try broadband and if we are unable to connect we
try lwaactivate. When we see the activate we identify it as special and
the ApnContext.isProvisioningApn will return true.

In the future our plan is to create a new network type that can be added
to the apn list, but for now it identified by name.

Here is a list of significant changes:

 - CaptivePortalTracker now only test WiFi networks instead of all networks
 - checkMobileProvisioning checks for provisioning networks and doesn't
   try to ping.
 - IConnectivityManager.aidl changes:
   * getProvisioningOrActiveNetworkInfo was added to and used by Manage
     mobile plan in WirelessSettings so even when there is no active
     network it will still allow provisioning. Otherwise it would report
     no internet connection.
   * setSignInErrorNotificationVisible is used by both
     CaptiviePortalTracker and checkMobileProvisioning so they use the
     same code for the notifications.
   * checkMobileProvisioning was simplified to have only a timeout as
     returning the result is now harder as we abort simultaneous call
     otherwise we'd could get into loops because we now check every time
     we connect to mobile.
 - Enhanced MDST to handle the provisioning network.
 - Added CONNECTED_TO_PROVISIONING_NETWORK to NetworkInfo to make a new
   state so we don't announce to the world we're connected.
 - TelephonyIntents.ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN
   is sent by the low level data connection code to notify Connectivity
   Service that a provisioning apn has connected. This allows CS to
   handle the connection differently than a normal connection.

Bug: 10328264
Change-Id: I3925004011bb1243793c4c1b963d923dc2b00cb5
2013-08-29 08:55:16 -07:00
Wink Saville
59adfca65d am 33283a97: am dce52cdb: DO NOT MERGE: MDST is not ready until connected to DcTracker.
* commit '33283a9726a29b5a79d7885fe194d52c0ebe7450':
  DO NOT MERGE: MDST is not ready until connected to DcTracker.
2013-08-26 11:50:10 -07:00
Wink Saville
4e6e1749ed am b42beeaf: am e63411f2: In isMobileOk don\'t execute finally if mobile data is not supported.
* commit 'b42beeafcf8117fb4ac41dd91fc9e6113c0d6aae':
  In isMobileOk don't execute finally if mobile data is not supported.
2013-08-26 11:43:25 -07:00
Wink Saville
dce52cdbf1 DO NOT MERGE: MDST is not ready until connected to DcTracker.
When the system becomes loaded the PhoneApp can be delayed
significantly and a call to setEnableFailFastMobileData may not
occur because the channel between the MobileDataStateTracker (MDST)
and DcTracker (DCT) is not connected.

Solution: Add a isReady to MDST and isMobileDataStateTrackerReady to
ConnectivityService and call it from isMobileOk.

Bug: 10351868
Change-Id: I92f9d58121b88186b636cd71c2fd2ef9a28f7cf6
2013-08-16 17:17:28 -07:00
Wink Saville
e63411f28b In isMobileOk don't execute finally if mobile data is not supported.
Move the early return outside the try {} finally so we don't call
setEnableFailFastMobileData(DctContants.DISABLED). Otherwise
referencing counting is wrong and an exception is thrown in DcTrackerBase.

Bug: 10304904
Change-Id: I5ba5121e473bada9f3daa8d6f3d3577cec8212fc
2013-08-15 21:14:30 -07:00
Wink Saville
9b7b445018 am 02eab434: am 4d87d91d: Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev
* commit '02eab434ad9faa25291e63023b7e66698ca457a8':
  If in a mobile captive portal is detected enable fail fast.
2013-08-08 15:46:55 -07:00
Wink Saville
7c00be48fc am 55adb390: am 35152f13: Merge "Have CaptivePortalTracker use gservices updateable provisioning urls." into jb-mr2-dev
* commit '55adb390bb96175db9abee3ead349a98b4dc4262':
  Have CaptivePortalTracker use gservices updateable provisioning urls.
2013-08-08 15:46:52 -07:00
Wink Saville
81b1fa6fc6 am 9b6363e5: am cbad1243: Merge "Check that hipri has started." into jb-mr2-dev
* commit '9b6363e5e6d37e3e8d103751d81613eeca32bbbf':
  Check that hipri has started.
2013-08-08 15:46:46 -07:00
Wink Saville
4d87d91dfe Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev 2013-08-08 22:07:27 +00:00
Wink Saville
35152f13b3 Merge "Have CaptivePortalTracker use gservices updateable provisioning urls." into jb-mr2-dev 2013-08-08 22:06:21 +00:00
Wink Saville
cbad1243ad Merge "Check that hipri has started." into jb-mr2-dev 2013-08-08 22:03:45 +00:00
Wink Saville
d747cbc898 If in a mobile captive portal is detected enable fail fast.
When captive portal checking completes pass back the result.
This is used to enable/disable failing fast for mobile. When
failing fast is enabled we don't check for data stalls and thus
won't be continually trying to do recovery operations, such as
restarting the radio.

Bug: 9462512
Change-Id: I0dea0eee519f8ee7f94e79d40e82c18f30d7fe2e
2013-08-07 16:22:47 -07:00
Dianne Hackborn
42380b6de6 am 9f11f105: am 7f09ec39: Fix issue #10226007: Reset apps restores most of the changed settings...
* commit '9f11f105cd2983021a73b9aa921674fbff3457f3':
  Fix issue #10226007: Reset apps restores most of the changed settings...
2013-08-07 16:14:11 -07:00
Dianne Hackborn
7f09ec39b6 Fix issue #10226007: Reset apps restores most of the changed settings...
...to original but not all modified ones

Very stupid mistakes in messing up the iteration when pruning op
entries.

Change-Id: Ie536b9095f797fcd2b86c9a386a72746796430d1
2013-08-07 15:49:02 -07:00
Wink Saville
7f6ee2ec90 Check that hipri has started.
I needed to test the result of startUsingNetworkFeature, otherwise
on mobile networks that are slow to come up, we won't detect
warm SIMs after booting.

Bug: 9962943
Change-Id: Ib638a4e43867ecaa85d6abff65643b77a63526b6
2013-08-07 11:02:57 -07:00
Wink Saville
42d4f08db2 Have CaptivePortalTracker use gservices updateable provisioning urls.
After detecting there is a captive portal the url used in the
notification for mobile networks should be updateable via gservices.
These urls will be the same as used by CheckMp and is needed for
carriers that have specific provisioning urls such as AT&T and Verizon.

Bug: 9622647
Change-Id: Idcf4dabc72ece1dbbe1d5e5a21e550dd06fe16c7
2013-08-05 14:15:54 -07:00
Dianne Hackborn
c8911ddd48 am 373a2f15: am 607b414d: Add new app ops method to reset all op modes.
* commit '373a2f15667956ff8a00ba59b42972b9c930af92':
  Add new app ops method to reset all op modes.
2013-08-02 19:32:13 -07:00
Dianne Hackborn
607b414d04 Add new app ops method to reset all op modes.
Change-Id: I5ee6764de8dc31d812e5a788914ab0099bbef4c0
2013-08-02 19:06:25 -07:00
Dave Burke
0eab98dd24 am 019f4385: am 7925e7cc: Merge "Revert "Add version identifier to app ops."" into jb-mr2-dev
* commit '019f4385d17234324db23521149e1f1cb6d7d061':
  Revert "Add version identifier to app ops."
2013-08-02 13:42:03 -07:00
Dave Burke
7925e7cc08 Merge "Revert "Add version identifier to app ops."" into jb-mr2-dev 2013-08-02 20:36:28 +00:00
Dave Burke
0997c5bd79 Revert "Add version identifier to app ops."
This reverts commit 483a6bbfc118409b9c46b226cf0aa6afdc4d9159.

Change-Id: I91d6b8b8d1789089bf9764e734f7fe59d03151a2
2013-08-02 20:25:02 +00:00
Sascha Prueter
95990fe4c3 am aa268f8f: am d364859c: Merge "Add version identifier to app ops." into jb-mr2-dev
* commit 'aa268f8fb2855335fc0d4f181cbf91505448e5eb':
  Add version identifier to app ops.
2013-08-01 13:55:43 -07:00
Sascha Prueter
d364859ce6 Merge "Add version identifier to app ops." into jb-mr2-dev 2013-08-01 20:50:02 +00:00
Dianne Hackborn
483a6bbfc1 Add version identifier to app ops.
All old versions drop their modes except for the notification op
(which is the only one there is currently a user-visible control for).

Change-Id: I9e09cebe63e9ea81f2adc01aef7d1a5a59f57a56
2013-08-01 11:15:04 -07:00
Daniel Sandler
9e6f26a8e1 am f3e2f8fe: am 9eb434c3: Allow the user to block notifications for foreground services.
* commit 'f3e2f8feef1a22708cc7ce1a7bc5d914bb53933d':
  Allow the user to block notifications for foreground services.
2013-08-01 09:32:40 -07:00
Daniel Sandler
9eb434c389 Allow the user to block notifications for foreground services.
Stepping carefully around the fix in change Idc788527, we
perform security (and AppOps, and therefore user block)
checks against the uid passed to enqueueNotificationInternal
rather than the Binder caller.

Bug: 9502541
Change-Id: I91745db92823381df75721c1b8f11013a7fa4ecc
2013-08-01 00:44:57 -04:00
Dianne Hackborn
5b45f2366e am bd61ba5b: am a99cb5bc: (DO NOT MERGE) Fix pub issue #58043: Copy crash in Android 4.3...
* commit 'bd61ba5b22f55a70615e128310d365c6175a0a4e':
  (DO NOT MERGE) Fix pub issue #58043: Copy crash in Android 4.3...
2013-07-31 14:18:06 -07:00
Dianne Hackborn
a99cb5bc41 (DO NOT MERGE) Fix pub issue #58043: Copy crash in Android 4.3...
...when clipboard listener attached

We need to clear the calling identity before dispatching change
notifications.  Also make this more robust, so that in the face
of any failure we will clean up the broadcast state.

Integrated from master.

Change-Id: I05e1f76ffd486439535631fe4062dabe94bd2ccf
2013-07-31 13:48:39 -07:00
Lorenzo Colitti
cc4bee55fa am 8fcad020: Merge "Make legacy VPN work over stacked interfaces."
* commit '8fcad020e0c256be1948e42df19d43f53f9f5804':
  Make legacy VPN work over stacked interfaces.
2013-07-30 09:57:21 -07:00
Lorenzo Colitti
6c3e7b5f05 am 15884007: Merge "464xlat: use a gatewayed route, not point-to-point"
* commit '158840079a501784c76e9816b215b3a1839074ef':
  464xlat: use a gatewayed route, not point-to-point
2013-07-30 09:57:18 -07:00
Lorenzo Colitti
bc8f82fb1f Make legacy VPN work over stacked interfaces.
On stacked interfaces like 464xlat, Legacy VPN can't find the
default gateway because it uses getRoutes, which only returns
routes for the base link and not for the stacked links. It also
assumes that the interface that the default route points to is
the interface for the base link (e.g., rmnet0) instead of the
interface the route actually points to (e.g., clat4).

Fix this by calling getAllRoutes to find the default IPv4 route,
and get the interface name from the route we find instead of
assuming it's the base interface.

Bug: 9597516
Change-Id: Ia6ce0b6258a421cd22f60dedca7e94176b32176b
2013-07-31 01:14:30 +09:00
Lorenzo Colitti
efa73c05f7 464xlat: use a gatewayed route, not point-to-point
Various applications such as Skype and our legacy VPN code
do not understand routes pointed directly at point-to-point
interfaces and require a default gateway IPv4 address in
order to function.

Grudgingly accept that routes without default gateways Are Hard
and use gatewayed routes instead. This causes routing to go from:

default dev clat4  scope link

to:

default via 192.0.0.4 dev clat4  scope link
192.0.0.4 dev clat4  scope link

and those apps now work.

Bug: 9597256
Bug: 9597516
Change-Id: I7b7890873802d3cb99affd6eb70b8ab75e7a2cf6
2013-07-31 01:09:53 +09:00