When starting a new batteystats history file, before inserting a new
CMD_CURRENT_TIME HistoryItem at beginning of the history
buffer, make a copy of the current HistoryItem. Otherwise the current
HistoryItem could be overriden by the CMD_CURRENT_TIME and we lose
a HistoryItem.
In b/130083227, the longwake start event happends before opening the new
history file, after CMD_CURRENT_TIME event, the longwake finish event
is missing. The fix is to make a copy of current HistoryItem before
adding CMD_CURRENT_TIME event.
Change-Id: I5048f98b6b47f54336fb01e354fb5a6284c84b43
Fix: 130083227
Test: b/130083227 can be reproduced by createFakeHistoryEvents() call,
missing longwake finish event can be seen after "TIME:" record. With the
fix, no more missing longwake finish event after "TIME:" record.
“adb shell dumpsys batterystats --history-create-events 50000” to
create enough events to start new history files,
“adb shell dumpsys batterystats --history” to observe all history records.
If we only use a view for it, it may not be visible depending on
what the app will do with the DecorView, i.e. set a weird clip
region. To fix that, we also draw the legacy navigation bar
background separately in a post-draw callback.
Test: TikTok
Test: Material app is still able to set bar color
Fixes: 131211797
Change-Id: Id744b98780f8f7f6dcd3482803a680a8f93be4c5
- Always use white text with shadows on media
- Use lock screen colors for shade theme
- Remove legacy wallpaper visibility listener
- Remove shadow from black title
Test: set white wallpaper
Test: set dark wallpaper
Test: set dark wallpaper on home, light on ls
Test: set dark wallpaper on ls, light on home
Test: atest SysuiColorExtractorTests
Fixes: 134119878
Change-Id: I64ee2dee14322b2c02891c3ffe5fc0b25d1f100b
Merged-In: I64ee2dee14322b2c02891c3ffe5fc0b25d1f100b
This patch partially reversts ag/6991475 and ag/7161709. These changes
are no longer needed due to a change in the graphics driver strategy for
Q.
In addition, the preloading of the graphics driver in the USAPs need to
be removed to avoid causing a memory regression on devices with graphics
driver preloading in the Zygote disabled.
Bug: 134526352
Test: Treehugger
Change-Id: I570037866d1ae90794c711622e6045ebbffa5b9c
Merged-In: I570037866d1ae90794c711622e6045ebbffa5b9c
(cherry picked from commit fcd68fd74b)
Fixes several issues with the status guard:
- poor background color for light status bar background
- guard & action mode need insets for the navigation bar in landscape
- status guard was not properly dismissed after completion of the action mode
- uses the proper non-zero root inset when LAYOUT_HIDE_NAVIGATION is unset & in landscape
Bug: 132924796
Test: make ApiDemos, use SystemUiModes activity to trigger action mode
Change-Id: Ie9ba2b6fb2c87a1825df85f756ffb062a45d4f55
Make sure to force the item count to 0 to make sure the direct share
area stays hidden.
Bug: 134776740
Test: Low ram device, manual
Change-Id: I598752db5747b1c845495af7ae2f591488799352
Improve direct share loading by:
1. Do not issue redundant service calls within the watchdog timeout
period
2. Set a min and max watchdog timeout period, and if all services
return early, then informt the user we are done to so that they don't
have to wait until the max timeout period.
3. Be more specific on package changes. Resolver requires any change
to trigger a refresh, but chooser only needs to know about top level
package changes.
Bug: 134416594
Test: Manual
Change-Id: I075fd5b6f64c25637fd7ba7aa6b163dca81371a8
The USAP pool management code contained two data races. One could cause
a double decrement if a runtime thread executed the SIGCHLD handler
while the server was responding to a pool exit message from a USAP. The
other data race could occur when the SIGCHLD handler executed in the
middle of a USAP pool flush.
The solution to the first race is to change the return value from a
helper function to ensure that the decrement only occurs when the entry
is invalidated through that specific invocation of the helper.
The second data race was fixed by using SIGTERM instead of SIGKILL when
flushing the USAP pool. This allows the Zygote to clear the table
entries outside of the SIGCHLD handler, and the handler to avoid
duplicate bookkeeping cleanup when this occurs. SIGTERM is used so that
it can be differentiated from other process termination events and so
that it can be blocked while the USAP is specializing, but hasn't yet
informed the Zygote of it's removal from the pool. This issue and this
fix will no longer be necessary once the Zygote signal handler has been
replaced with a signalfd.
Bug: 132794985
Test: atest SignedConfigHostTest
Change-Id: Ie01637a10b356b80b5aa62291a97f2c167242827
Merged-In: Ie01637a10b356b80b5aa62291a97f2c167242827
(cherry picked from commit fb329ba7c8)
This reverts commit 917327b193.
Reason for revert: This change has been implicated in 4-way deadlocks as seen in b/134244752.
Bug: 134244752
Change-Id: Ibdaad3a4cbf0d8ef1ed53cfab1e454b9b878bae9
- User learning state is reset when leaving REMINDER_EXP behavior.
- Default parameters updated for easier testing and better experience
- Show and go only performed once per day when gesture has been learned
- Slightly delay handle showing when entering an apps with a longer
delay when switching between apps rapidly.
- Adds state dump to improve debugability.
- Adds ability to suppress handle showing in specific states using
flags.
Test: atest AssistHandleBehaviorControllerTest
Test: Tested locally
BUG:132983599
Change-Id: I7829ad55d7667f5db3633e702add709968dcd0a9
Previously, when the Game Driver package name is set, graphics driver preloading
is automatically disabled. Now we'd like to decouple the relation here. So Game
Driver could still work no matter graphics driver is preloaded in Zygote or not.
Bug: 134526352
Test: build, flash and boot.
Change-Id: Id720cc11e3365423dd9b984b7d30a2dbeecb6116
Button bar insets were set before the inset callback. Add a call to
layout the button bar during the inset callback.
Bug: 134472146
Test: Steps from defect
Change-Id: I0246f06315cd05343002071dd6d217d41e0059ca
Also do a WTF when the same process registers 1000 observers with the
same observer instance.
Fix: 133388082
Test: manual test: Launch leaky app and make sure WTF is raised
Test: manual test: Open contacts app, close, and make sure the
"Total number of unique observers" goes back
Test: manual test: Open contacts app, kill it, and make sure the
"Total number of unique observers" goes back
Test: manual test: Open contacts app while contacts are syncing,
and make sure the activity refreshes itself.
Test: atest cts/tests/tests/content/src/android/content/cts/ContentResolverTest.java
Test: atest FrameworksCoreTests:BinderDeathDispatcherTest
Test: atest FrameworksServicesTests:com.android.server.content.ObserverNodeTest
Change-Id: Id738ca66023c029b92db3d108d99a9fc240fe77c
The mStartClockTime represents the time device is fully charged.
Currently mStartClockTime is set again whenever the device clock
changes. Since the device clock could change many times, we lost
original mStartClockTime value, unreasonable mStartClockTime values
for example 26 days could be returned (because the device clock changes)
when getStartClockTime() is called.
A better solution is to only set mStartClockTime when device is fully
charged, the value is persisted across device reboot. When getStartClockTime()
is called, we return adjusted value according to current time.
Change-Id: I49ded1519bc31daf1a51a572325cbbe67f1abd09
Fix: 132914064
Test: Manual test, checking Settings--Battery--Last full Charge
We must create the string right away; if we wait then the binary array
might be zeroed out.
Bug: 133215398
Test: per bug, on Crosshatch modified to use FDE.
Change-Id: I7681e5a474d5f32d9a7eb472cecbe6503621d0ef
Support Accessibility education according to
1. Gesture Navigation is on or off
2. Screen reader feature (such as TalkBack) is enabled or not
Manual test screenshot: https://drive.google.com/open?id=1afTDRYPMcZphM5cL0krPDA_Vh9pRX-8x
Bug: 133811747
Test: Manual
Change-Id: I04ca36c9e88ff14e29103db41cfab2a9b53985d5
With gesture navigation, it no longer makes sense to force the navigation bar
to black in split screen, instead we can show the respective navbar backgrounds of
the applications.
Fixes: 130913061
Test: enable gesture navigation, enter splitscreen, observe that navigation bar backgrounds are properly drawn, also verify the same if IME is open.
Change-Id: If1464dd9cf0c5499c7c33caab06eb430fb59cb30
When using multi-mode and holding the phone in portrait, android will
report it's orientation as LANDSCAPE. Take multi-window mode into
account when determining fixed widths as well as number of items per
row.
Bug: 132828939
Test: Use multi-window mode
Change-Id: I97b722ea58c9f79aea2a3ab594c3ad7d78f8607c
Previously when batterystats history buffer exceeds MAX_HISTORY_BUFFER
size, we create a new history file which is empty until batterystats
history buffer is written to the file. But the buffer is written to the
file every 30 minutes by default. When the file is empty, if the
system server process crashed or abrupt powered off, the file will remain
empty.
During the device bootup, batterystats reads history buffer from
the empty file and failed. The important mHistoryBaseTime variable is zero,
which causes all timestamps in subsequent history events are wrong, this
causes volta go/powerbug displays wrong, also Battery Usage in Settings
are wrong.
The fix is to not create new empty history file on disk until we actually
write history buffer to the file.
This problem can be manually reproduced by creating new empty file under
battery-history directory, then power off the device by long press power
button.
Bug: 133525277
Test: frameworks/base/core/tests/coretests/src/com/android/internal/os/BatteryStatsHistoryTest.java
Change-Id: I0c22881df6897e8832b472cc5e82fbf2727eb252
When IME window switches from current display to another display and back quickly,
system will re-bind InputMethodService to re-attach window token for each moving,
the IME service lifecycle will be onBind -> onUnBind -> onDestroy -> onBind.
Ideally, system will deliver window token when onServiceConnected and system should
only receive one onServiceConnected when the last service bound.
But due to user switch display very quick, before unbind service callbacked from client,
the next bind service request comes, caused the connection exists in system side and
client will then callback 2 onServiceConnected to system.
Since CL [1] introduced InputMethodPrivilegedOperationsRegistry to deal with token
registraction singleton-ness, the exception will be thrown for above case due to
the duplicate window token passed to client.
Add InputMethodPrivilegedOperationsRegistry#isRegistered to check if the token
already registered, if so, skip this duplicate initialization request.
[1]: I4a61470f06ffac5f7a512536f8431489db0108f4
Fix: 133624278
Test: manual as below steps:
1) Settings > Developer options, enable "Simulated display" & "force desktop mode"
2) Reboot device.
3) Launch app from simulated display.
4) Launch app from primary display (i.e. contacts), focus EditText to show IME.
5) Tapping primary & simulated display repeatly & quickly.
6) See if any exception log from IME application. (i.e. Gboard)
Change-Id: Ie6bfbae735724fe744590e715124d2737d2b665d
Improves behavior modes to use more reliable callback mechanisms. Added
phenotype flag hooks for control of behavior and behavior parameters.
Added more robust null guarding.
Test: Tested locally
BUG:132983599
Change-Id: I42039152836071941d6b4f1cafb3670c62a65824
* changes:
Add one more test for VPN usage stats.
Addressing comments for http://ag/7700679.
NetworkStatsService: Fix getDetailedUidStats to take VPNs into account.
Take all VPN underlying networks into account when migrating traffic for VPN uid.
Turns out there's a secondary layout used by resolver which does not
contain R.id.empty. Check for null.
Bug: 133707284
Test: Open PDF file through resolver
Change-Id: I311f1c1d2fa6edcebc81d9056755884b1585a7cb
Continue to hide the direct share area for low ram devices. Make sure
the A-Z list loads properly.
Bug: 132342311
Test: Use low ram device
Change-Id: I66b58af3994e034e4d870286ef62ba4a9289e083
VPN uid.
(cherry picked from commit 95aa6d446f)
Bug: 113122541
Bug: 120145746
Test: atest FrameworksNetTests
Test: Manually verified on device that stats from VPN UID are moved
appropriately based on its declared underlying network set.
Test: vogar --mode app_process --benchmark NetworkStatsBenchmark.java
Change-Id: I7f368c5970b2dcb969fe0daf5ef44edb1f51d09d
To prevent main thread from being blocked and potential ANRs, load
images on AsyncTasks. If no images are successfully loaded within a
timeout period, hide the content preview area. Optimize scrolling by
reusing the views in their entirety and not reloading images. Also
allow for more time for direct share loading
Bug: 132698784
Test: Manual
Change-Id: Ia73e9b6912bf36a1c6c9660423d6f0602e832187