Commit Graph

5164 Commits

Author SHA1 Message Date
Andreas Gampe
92fc065cf6 Frameworks: Handle exceptions in SystemProperties callbacks
When notifying callbacks, catch thrown exceptions.

(cherry picked from commit 7074e6fd4c)

Bug: 73058952
Test: m
Test: atest SystemPropertiesTest
Merged-In: I1c61e11b833e8ddd30d80b9859b20a9fb3185a33
Change-Id: I1c61e11b833e8ddd30d80b9859b20a9fb3185a33
2018-03-19 20:33:49 -07:00
TreeHugger Robot
46c0e91b74 Merge "Removing the settings-based IncidentReportArgs method." into pi-dev 2018-03-19 22:15:11 +00:00
TreeHugger Robot
0f8f3f25cf Merge "Frameworks: Fix Binder.joinThreadPool" into pi-dev 2018-03-19 21:40:37 +00:00
Adam Powell
fa38f238b1 Merge "Add factory methods for async Handlers" into pi-dev 2018-03-19 21:09:01 +00:00
Tej Singh
eee317b7b6 Atoms: Mobile Connection
Atom definitions for MobileConnectionStateChanged and
MobileRadioTechnologyChanged

Also cleans up batterystats.

Bug: b/72320589
Test: verified logs appear in adb logcat -b stats
Change-Id: I9feb258cf6dd4a8c8bf1cffc9566b5d0a851a9fa
2018-03-19 09:48:22 -07:00
Adam Powell
8709ba863e Add factory methods for async Handlers
Message.setAsynchronous is already public and this makes working
with posted messages that do not interact with UIs quite a bit nicer.

Added as factory methods for better integration with support shims
as well as generally encouraging the use of the handler callback
instead of subclassing for working with custom messages.

Bug: 73124158

Change-Id: I1210e7dc524fdf771e7af19297d5a822fdbd502c
2018-03-19 15:54:13 +00:00
Kweku Adams
015288241e Removing the settings-based IncidentReportArgs method.
Bug: 72378645
Test: Flashed device
Change-Id: Ia12afffed169e1d0201e99887e74398de40c6cf6
2018-03-16 18:15:46 -07:00
Andreas Gampe
acd1987950 Frameworks: Fix Binder.joinThreadPool
Fix the lack of a native implementation.

Bug: 75254055
Bug: 75291614
Test: atest BinderTest
Change-Id: Id5b15442a59851e566a24d406a7487f9de66d42f
2018-03-16 17:03:22 -07:00
Yi Jin
163967fe8e Fix privacy tags based on PWG review meeting.
1. Remove unnecessary hex_hashs.
2. Make intent extras LOCAL
3. Make mnc EXPLICIT
4. Make diskstats error AUTO since it is only IOException.

It is safe to modify proto numbers since they are not used yet.

Bug: 74837756
Test: flash the changes and call incident -d, also updated go/irpf
Change-Id: Idee0e927515e737c9a42a1dc29cb3c05e6d91ca9
2018-03-15 18:31:36 -07:00
TreeHugger Robot
81cacb274c Merge "Statsd BroadcastSubscribers can receive 'cookies'" into pi-dev 2018-03-12 18:27:02 +00:00
TreeHugger Robot
a71712dfa8 Merge "Avoid changing display power state on draw wake lock" into pi-dev 2018-03-12 17:58:55 +00:00
Bookatz
058d869826 Statsd BroadcastSubscribers can receive 'cookies'
Subscribers can now provide additional Strings that will be passed back to
it when an anomaly is detected. This way, the Subscriber can be informed
about anomaly-specific information has meaning to it.
Statsd itself does not use these strings and doesn't care what they are
- it simply passes them back to the subscriber.

Change-Id: If269872397c4ed2c67e41d54d850cdc664d4f73e
Fixes: 74012329
Test: run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.alert.BroadcastSubscriberTests
2018-03-09 10:44:48 -08:00
Fyodor Kupolov
70e7543066 Added ACTION_BATTERY_LEVEL_CHANGED
Sent when the current battery level changes.

It has EXTRA_EVENTS that carries a list of Bundle instances representing
individual battery level changes with associated extras from
ACTION_BATTERY_CHANGED

Each event has EXTRA_EVENT_TIMESTAMP representing time when it occured.

Test: manual
Bug: 74020080
Change-Id: I993005950299c5298c9111ca51cc7717e1f029de
2018-03-08 10:09:01 -08:00
Ivan Podogov
56bc6d0a47 Avoid changing display power state on draw wake lock
When Sidekick is controlling the display, any draw wake lock can cause a
sequence of endDisplayControl/setDisplayPowerState/beginDisplayControl
twice, because of DOZE_SUSPEND -> DOZE -> DOZE_SUSPEND transitions.
We can avoid that by telling power manager that display is controlled by
Sidekick, and draw wake locks shouldn't change the display power state.

Bug: 70574675
Test: build, flash Sardine, run Stopwatch, observe logcat
Change-Id: Ie4dac76606e45f0d3b62bc5890841f4f24d454d7
2018-03-07 18:02:55 +00:00
yuemingw
1d13eaea83 Block adb from changing certain settings value when corresponding user
restriction is on.

Check calling uid in isSettingRestrictedForUser(which is called by settingsprovider),
 and only allow system_uid when certain user restriction is on, so that user won't be
able to change these settings with adb:
Settings.Secure.LOCATION_MODE,
Settings.Secure.PROVIDERS_ALLOWED,
Settings.System.SCREEN_BRIGHTNESS,
Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_OFF_TIMEOUT,
Settings.Global.AUTO_TIME,
Settings.Global.AUTO_TIME_ZONE.
This check also prevents 3rd party apps from modifying system settings value
when corresponding user restriction is on.
In addition, any attempt to change AUTO_TIME will also go through the check
for dpm.getAutoTimeRequired().

Test: manually by running the adb command with restriction set and not set
Bug: 72549013
Bug: 72548203
Bug: 72548533
Bug: 72686466
Bug: 72687105
Bug: 72940551
Bug: 72940562
Change-Id: I1d1fd20d9fa0f76f27905d62873f6a6e9af0224e
2018-03-07 11:04:34 +00:00
Dianne Hackborn
16268a69d6 Merge "Fix issue #72116995: Add permission guarding Service#startForeground" into pi-dev 2018-03-06 23:04:16 +00:00
TreeHugger Robot
8fa420c261 Merge "Stop invoking secdiscard when deleting password data" into pi-dev 2018-03-06 22:37:43 +00:00
TreeHugger Robot
9015d24332 Merge "Using UserManagerInternal for access control instead of UserManager" into pi-dev 2018-03-06 22:37:09 +00:00
Andrew Grieve
0fec93682e Expose Process.isIsolated()
Rather than have a process attempt to perform IO / IPC and check if it
fails, it makes much more sense to expose this getter.

My specific motivation for exposing this information more directly is to
be able to perform process-specific initialization logic in
Application.attachBaseContext():

https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java?rcl=ac2e180a1265f88dd4030bb35d69f5d0b2dc488d&l=54

Bug: 73343822
Test: Same code that's used in Chrome via reflection.
Change-Id: I1505962679da36ac42401230b204bff7b3376b73
2018-03-06 17:17:43 +00:00
Dianne Hackborn
dd027b3ab2 Fix issue #72116995: Add permission guarding Service#startForeground
Now requires permission if targeting P.

Note that this is a separate permission from the existing one
that is required for instant apps to use foreground services.  The
reason for this is that their semantics are different (the instant
apps permission is associated with an app op for control over what
the app is allowed, while the regular app permission is just a
normal permission that is always granted and only there for
auditing of apps), and there are probably going to be cases where
a developer will want to use a foreground service in the full
version of their app but not as an instant app.

Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: I883c9515c307ed8e39f0bf888c4045944c8183ac
2018-03-05 16:59:21 -08:00
Sunny Goyal
145c8f80a9 Using UserManagerInternal for access control instead of UserManager
Bug: 36067387
Test: for C in {1..10}; do adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest$C \
      -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner; done
      atest CtsDevicePolicyManagerTestCases:LauncherAppsSingleUserTest \
            CtsDevicePolicyManagerTestCases:LauncherAppsProfileTest \
            CtsDevicePolicyManagerTestCases:LauncherAppsMultiUserTest
      atest CtsShortcutManagerTestCases
Change-Id: Ia4ddea58f66861ef760865b6d8831563584f85c9
2018-03-05 19:45:38 +00:00
Rubin Xu
841fd43338 Stop invoking secdiscard when deleting password data
secdiscard never works on recent devices; stop calling it to
reduce the false SELinux denials messages. Just logically
zeroize the data before unlinking it.

Bug: 62140539
Test: flash device; change PIN; observe no SELinux error messages.
Change-Id: I5f47fc81735a7d9995c2da9e52a25ae903db3ced
2018-03-05 16:12:32 +00:00
TreeHugger Robot
b0ebe11b74 Merge "Report total latency instead of average for jobs last run" 2018-03-03 00:14:22 +00:00
Kweku Adams
7a16084c25 Changing batterystats to use proto values.
This should help make sure the two stay in sync, and that the values
don't get rearranged.

Bug: 67013665
Test: N/A
Change-Id: I43f617b69d8c8107755c13dbfa8f071ef2c7c554
2018-03-02 02:07:11 +00:00
Amith Yamasani
0ca706bb9e Report total latency instead of average for jobs last run
Instead of computing the average on the device, upload the
total sum of the latencies. Server can divide by the event count
if it wants to get the average.

Also change the latency buckets to 1 hr, 2 hrs, 4 hrs, 8 hrs and
greater than 8 hrs.

Bug: 70297451
Test: launch an app
      dumpsys batterystats --checkin | grep jbd,
      Observe the dumped values for the app

Change-Id: Iecda808594fc960fb16fa0407e5875bbc47db43a
2018-03-01 17:32:53 -08:00
TreeHugger Robot
ad1fe51997 Merge "Pass forward listeners when using existing builder" 2018-03-01 23:51:26 +00:00
TreeHugger Robot
701194a72f Merge "lowRamDevice TVs can have multi-user" 2018-03-01 12:03:29 +00:00
Benjamin Franz
8b16046a53 Merge "Update javadoc for DISALLOW_SYSTEM_ERROR_DIALOGS" 2018-03-01 09:30:12 +00:00
TreeHugger Robot
19130fea91 Merge "More work on issue #73301635: Ability to extract device configuration" 2018-02-28 23:19:13 +00:00
Dianne Hackborn
337e01ac10 More work on issue #73301635: Ability to extract device configuration
Now include Gl extensions (thanks to whoever wrote the code
I copied!).

Tweak the protos a bit to include missing info and correct
some things.

Add some new test APIs that are needed for CTS.

Bug: 73301635
Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerGetConfigTests
Change-Id: Ie3f8173d217468246e8b6c7f45b7cbfcb352d60f
2018-02-28 11:29:20 -08:00
Benjamin Franz
0c86fe1b16 Update javadoc for DISALLOW_SYSTEM_ERROR_DIALOGS
Bug: 73720585
Test: make docs
Change-Id: I5fca4a9cb254f91f7eac2abb002242b5553059fa
2018-02-28 14:48:52 +00:00
Kurt Nelson
7a8804ad68 Pass forward listeners when using existing builder
This is how VmPolicy behaves.

Bug: 62458446
Test: cts-tradefed run commandAndExit cts-dev --module CtsOsTestCases
--test android.os.cts.StrictModeTest

Change-Id: Iccab728bf21bad695f26891042dfe355506cdc5c
2018-02-27 16:45:27 -08:00
TreeHugger Robot
a65d4f8587 Merge "Add AOD to BatterySaverPolicy" 2018-02-28 00:41:32 +00:00
TreeHugger Robot
7e96e0a137 Merge "createAndManageUser should communicate reason of failure to caller" 2018-02-28 00:39:33 +00:00
Alex Chau
f4f9fb6d3d Merge "API Review: android.os.UserManager.DISALLOW_USER_SWITCH" 2018-02-28 00:16:41 +00:00
TreeHugger Robot
03b91d77c4 Merge "Alarm: wakes up statsd and notifies the subscribers." 2018-02-27 23:08:31 +00:00
Yangster-mac
932ececa16 Alarm: wakes up statsd and notifies the subscribers.
Test: manually tested it.
Change-Id: Id796a68976aeb1611183023ba4e9c6a8b8c44bb8
2018-02-27 13:30:48 -08:00
Lucas Dupin
92a62e5533 Add AOD to BatterySaverPolicy
Test: activate/deactivate battery saver, look at AOD
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BatteryControllerTest.java
Fixes: 62797110
Change-Id: I9fc5f4fc5aa9cfd45e90e602251e4c2c863dfbcc
2018-02-27 09:05:09 -08:00
TreeHugger Robot
837d2076ad Merge changes I7ce670f5,I0bd2de38
* changes:
  Preload with RELRO sharing in the WebView zygote.
  Make WebViewLibraryLoader interface more flexible.
2018-02-27 16:11:02 +00:00
Alex Chau
89386bacc6 createAndManageUser should communicate reason of failure to caller
Bug: 71844474
Test: cts-tradefed run singleCommand cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_LowStorage
Test: cts-tradefed run singleCommand cts -m CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_MaxUsers
Change-Id: I3c069ba86822178fa3f51f1d31cd4792883151cc
2018-02-27 09:12:45 +00:00
TreeHugger Robot
dcd6ae8bc8 Merge "Atom: TemperatureReported" 2018-02-27 07:00:45 +00:00
Tej Singh
4029831e36 Atom: TemperatureReported
Makes the temperature reported atom pulled, and adds CPU, GPU, and SKIN
temperatures. Pulls information from the thermal hal.

Test: CTS test on cl in this topic
Change-Id: I0a8e2d1135bdd77e1cc510f24ff5214ce9e14ead
2018-02-26 20:55:26 -08:00
Torne (Richard Coles)
f4f647e2e0 Preload with RELRO sharing in the WebView zygote.
Now that the WebView zygote is a child of the system zygote it has the
smae address space layout and can use the existing WebView native
library RELRO file.

Preload the native library using the RELRO file in the zygote, to share
this data with applications which are using WebView. This can save up to
1-2MB of dirty memory, replacing it with clean pages that are shared
with more processes and thus have a smaller impact on PSS.

Bug: 63749735
Test: CtsWebkitTests
Change-Id: I7ce670f5fcddae9e98631e21329840ef3ad52f9a
2018-02-26 16:23:09 -05:00
Yueming Wang
348bf6254f Revert "Block adb from changing certain settings value when corresponding user"
This reverts commit 4140f6c4e3.

Reason for revert: This CL is merged accidentally as it got merged together with another CL.  

Change-Id: I043a5872f370775a4261a1ca7ccb00489a588303
2018-02-24 12:52:18 +00:00
TreeHugger Robot
cc25afe000 Merge "Flip order of arguments" 2018-02-24 10:25:40 +00:00
TreeHugger Robot
284786b9f6 Merge "Fix sleep time in Cellular" 2018-02-24 02:37:38 +00:00
TreeHugger Robot
8ae9a37bbc Merge "Implement issue #73301635: Ability to extract device configuration" 2018-02-24 01:21:34 +00:00
Dianne Hackborn
bf5ba6bbcc Implement issue #73301635: Ability to extract device configuration
am get-config can now return its information as a protobuf,
so that we have a nice machine readable representation of the
configuration available.  This is available through the new
"--proto" option.

Also add a new "--device" option which will include additional
device configuration information in the output.

Defined the protos to contain all of this information.  Updated
Configuration to generate everything it should in the proto.

The output has been changed so that configuration history
will not be returned unless you specify the --days option.

Bug: 73301635
Test: Booted, ran, output

Change-Id: I074b92b45d6b1da1c1a499080db9e006d12b9fea
2018-02-23 15:30:04 -08:00
Kurt Nelson
72534b7e22 Flip order of arguments
Callbacks as the second parameter is more Kotlin friendly.

Bug: 73751206
Test: cts-tradefed run commandAndExit cts-dev --module CtsOsTestCases --test android.os.cts.StrictModeTest
Change-Id: Ib9c9469be1b81dc65e74c9e303f474c54a43b18b
2018-02-23 15:12:59 -08:00
TreeHugger Robot
aa360efee0 Merge changes from topic "wipedata"
* changes:
  Rename WipeDataWithReason API to wipeData.
  Block adb from changing certain settings value when corresponding user restriction is on.
2018-02-23 22:54:44 +00:00