13209 Commits

Author SHA1 Message Date
Todd Kennedy
7dba93c087 DO NOT MERGE Restore calling identity before checking permission
Using the system service identity to check the CHANGE_CONFIGURATION
permission isn't likely to catch a security violation. Changing
back to the original caller and then checking permissions is
preferred.

Cherry picked from lmp. Fixes bug 15989465.

Change-Id: Iff08d04422bcc052a487194154f1fd0d727d38f4
2015-01-14 15:33:21 -08:00
Jeff Vander Stoep
e2adb1ff4a Merge "Sanity-check paths of files to be restored" into jb-mr2-dev 2014-09-23 16:13:42 +00:00
Jeff Vander Stoep
7bc601d5d7 Sanity-check paths of files to be restored
(cherry picked from commit 7d51cc701a6735cf455af8479f56c9c0b2109e02)
Bug: 16298491
Change-Id: I0c2d6523c9d152dad4d27d06d3853afd432e5af7
2014-09-22 23:21:20 +00:00
Jeff Vander Stoep
a8f6d1bffc Change permission guard on bindBackupAgent()
Bug: 15829193
Change-Id: I6c1c39923b7b1a9f528f97da10913cb7f2d7e8f9
2014-09-10 14:20:14 -07: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
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
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
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
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
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
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
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
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
607b414d04 Add new app ops method to reset all op modes.
Change-Id: I5ee6764de8dc31d812e5a788914ab0099bbef4c0
2013-08-02 19:06:25 -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
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
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
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
Robert Greenwalt
c13368bfd1 Make CS.isTetheringSupported dynamic
It used to be set at boot, but that was too quick to pick up carrier
specific resources.  With this change even if you switch sims subequent
checks get the new values.

bug:9865616
Change-Id: I8c270c6b02fc6bdd3c3d76ceea58172df25e058d
2013-07-18 14:24:42 -07:00
Robert Greenwalt
e874bd351f Merge "Add gservices updater for carrier provisioning url" into jb-mr2-dev 2013-07-17 23:46:25 +00:00
Robert Greenwalt
e182bfe398 Add gservices updater for carrier provisioning url
bug:9623159
Change-Id: I36697ed341353b7a3dbec5afe20241102e76f6f1
2013-07-17 14:05:33 -07:00
Wink Saville
e3badc1011 Merge "When a SIM is changed check mobile provisioning." into jb-mr2-dev 2013-07-17 18:43:30 +00:00
Wink Saville
fde1ac9bec When a SIM is changed check mobile provisioning.
A simple mechanism for doing this is to take advantage of the fact
that we require the device to reboot after a sim has been changed.
Thus when connectivity service is started we wait to get a connection
then call checkMobileProvisioning once. We also add a check that
the DEVICE_PROVISIONED is true, i.e. SetupWizard has been run.

Bug: 9784024
Change-Id: I5c1936744f6fc55a447ae44cd36eec3849d27e21
2013-07-16 17:16:37 -07:00
Jeff Brown
ba8a54136d Fix missing lock in power manager.
The display wake lock and other internal state could become
out of sync if we happened to execute the power manager's update
function concurrently due to the missing lock.

This bug can be trigged due to display state changes or proximity
sensor updated.  Although it would be extremely rare, we have
some evidence of this happening on at least a few devices resulting
in rapid power drain with the screen off or a crash.

Bug: 9880044
Change-Id: I3c674ce429621a50cbb36c3a01883d5f388205b2
(cherry picked from commit d91e417b06388694db213257b4df6b4dd78e0d49)
2013-07-16 22:29:57 +00:00
Craig Mautner
7c6be10d31 Remove iterators (DO NOT MERGE)
Remove DisplayContentsIterator and AllWindowsIterator. These were cute
but they take up valuable resources. Iterate over ArrayList members
in their place.

Change-Id: Ie0c537608532cfb36f34d976cc6eacd21bad98cd
2013-07-16 13:07:48 -07:00
Wink Saville
925ec03fcd Merge "VZW wants the phoneNumber to be 10 zero's if there isn't one." into jb-mr2-dev 2013-07-12 18:59:03 +00:00
Amith Yamasani
06a441de3b Merge "Pass along the user id to AttributeCache requests" into jb-mr2-dev 2013-07-12 18:17:09 +00:00
Wink Saville
8cf3560469 VZW wants the phoneNumber to be 10 zero's if there isn't one.
Bug: 9784059
Change-Id: I41bba908855648d2560440655d8a75a7cb2e0859
2013-07-10 23:00:07 -07:00
Amith Yamasani
4befbecfcc Pass along the user id to AttributeCache requests
Bug: 9759331
Change-Id: Ib96ba6a89c58edc207021aa43a2b67b4f6c50117
2013-07-10 16:18:01 -07:00
Satoshi Kataoka
b7925f2219 Merge "Revert "Stop marking gamepads as keyboards"" into jb-mr2-dev 2013-07-09 17:20:39 +00:00
Ken Wakasa
02a44f7d47 Revert "Stop marking gamepads as keyboards"
This reverts commit 74c8fb601ef75d8e12df5221489c41c125e3b846.

Change-Id: If8ca4d09b4d52f11d48dabebf2dff2984760cdc0
bug: 8896129
2013-07-05 04:08:36 +00:00
Vinit Deshpande
c2656a98ce Merge "Revert "Temporarily disable 'Scan Always' mode"" into jb-mr2-dev 2013-07-03 00:12:53 +00:00
Vinit Deshpande
218339818c Revert "Temporarily disable 'Scan Always' mode"
This reverts commit c16b0d0061108685e74b40d77ad801fe0304bc42.

Change-Id: I89a23f5d786a53eea97fef3f19bd15f97fc26157
2013-07-03 00:10:53 +00:00
Wink Saville
753d754c7d Merge "Fix NPE if mobile is not supported in checkMobileProvisioning." into jb-mr2-dev 2013-07-02 18:17:00 +00:00
Wink Saville
68e6c6452c Fix NPE if mobile is not supported in checkMobileProvisioning.
Bug: 9664438
Change-Id: If0c4938956a80e8d6a21a968aa771d0d8f546b3c
2013-07-02 10:55:14 -07:00