When there is a very early system server runtime restart, we may not
yet have a published BatteryManagerInternal, so we need to go directly
to the "batteryproperties" native service to detect the USB state.
Test: builds, rescue is suppressed when USB is connected
Bug: 34872406
Change-Id: I949984cb95495c77de85ac322075177cff07b8b6
This reverts commit 2e7d6d64b9b16ea27634bc0e8843717a465142b4.
Bug: 35590590
Fix: 35590106
Test: runtest managed-provisioning
Test: manual verified that work profile can be inflated
Change-Id: Ie780b94053e65bca2f96b32055937c0c9e8beae8
When the screen is off, MediaSessionService doesn't get the volume key
long-press events from the PhoneWindowManager because PhoneWindowManager
intercepts them and only sends initial down and up events.
This is intended because users cannot see the safety warning dialog
which warns users about too loud volume.
This CL assumes that volume key is long-pressed if the key up doesn't
happen after the initial down within the long-press timeout, and notify
them with IOnVolumeKeyLongPressListener.
Bug: 35328001
Test: Manual test
Change-Id: I3b5aec4c2dd66a181bf41786f1417cc65874356c
My previous CL [1] that aimed to fix Bug 35395372 was imperfect.
It just converted InvalidParameterException into NullPointerException
due to a silly mistake in a new error check.
[1]: Ib9448c551d9a30776a999c27a5ff20f1a095633a
ee2a7ed3d971f83134a2b28258dd2e56f9634f94
Test: Made sure Bug 35395372 and Bug 35479942 are no longer
reproducible, that is,
1. Flash a new image and complete the setup wizard on a
direct-boot unaware device.
2. Set a device password and require it upon each device boot.
3. adb reboot
4. Observe the default IME does not crash because of
NullPointerException/InvalidParameterException thrown by IMMS.
Test: Made sure IMM#showSoftInputFromInputMethod(IBinder, int) does
not throw an NullPointerException even in an extreme case.
1. Rebuild LatinIME with the following code in LatinIME.java
@Override
public AbstractInputMethodImpl onCreateInputMethodInterface() {
return new InputMethodService.InputMethodImpl() {
@Override
public void attachToken(IBinder token) {
super.attachToken(token);
final InputMethodManager imm =
getSystemService(InputMethodManager.class);
final IBinder imeToken =
getWindow().getWindow().getAttributes().token;
imm.showSoftInputFromInputMethod(imeToken, 0);
}
};
}
2. adb install -r LatinIME.apk
3. adb shell ime enable com.android.inputmethod.latin/.LatinIME
4. adb shell ime set com.android.inputmethod.latin/.LatinIME
5. Tap any text field.
4. Observe LatinIME does not crash because of
NullPointerException/InvalidParameterException thrown by IMMS.
Bug: 34628091
Bug: 35079353
Fixes: 35395372
Fixes: 35479942
Change-Id: Id8e34ecb28480755e8141b6e46820b37fe3dc92b
When looking for the AudioPlaybackConfiguration to act on a player,
check that the PIID is valid.
(Note that this is also handled in checkConfigurationCaller())
Test: see bug
Bug 35484407
Change-Id: Ic46ad10f9730593f6600175ab3ca8f496cc6d972
- When the menu activity is hidden or destroyed by the system, we should
reset the state so that we can restore the input consumer and show again
property next time the PiP is interacted with.
- Also ensuring that non-focused pinned stack windows are not added to the
input window list
Bug: 35462085
Bug: 34281221
Test: Relaunch a PiP activity that is single top.
Test: Launch a new task/activity from a PiP activity after
the menu is visible.
Change-Id: I43829cce50669de704caf5a720c2adf7daf92398
Iterating over ArraySet using iterators is still more efficient than
first calling ArraySet#toArray and then iterating over the array.
Test: Minor optimization. make and existing tests should suffice.
Change-Id: Ifc282bfca98cf89b047dddddd78a6de020f27381
Explore-By-Touch has been dispatching touch events to the screen
rather than using the accessibility API. This was intended as a
workaround for apps that did not properly handle accessibility,
but the workaround itself has been causing bugs in corner cases
where properly accessible Views are partially covered by windows.
This CL first tries to dispatch a click action, and falls back on
the touch dispatch only if the click action fails.
Bug: 35200501
Bug: 26216304
Bug: 20665958
Bug: 34949365
Bug: 34844480
Bug: 29535082
Test: Poking around with first party apps and TalkBack works fine.
This behavior isn't covered by automated testing.
Change-Id: I9cc18399d8f40f7381dfcbef91b5991b711bb7f1
Also expand the slew window for minimizing the effects of time-set
flapping from 500ms to 1000ms.
Bug 35319393
Change-Id: I6d6df1e086115ebe12c0bc4b9d761a11a0267012
Resolving intents with a specified component goes down a different
path than regular resolution. For Instant Apps, that meant that
sometimes the Instant App was not able to resolve it's own
activities. Added some new CTS tests to verify that this works.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Ic8a8eaef7eb9e230fdc701c79c85227d0939d974
Allows the user to associate alert windows with specific apps
and revoke the permission if they want.
Test: manual
Bug: 33256752
Change-Id: Ie28325b6bb799b3df253770ebe655f97ebbadd90
ro.kernel.qemu based check to determine whether Bluetooth should be
started or not was an old hack used when "features" was not available to
determine hardware availability. This was later fixed with the
hasSystemFeature check. However, the old check was not removed.
The presence of the old check causes Bluetooth to not start on Android
Things devices which have ro.kernel.qemu set for graphics usage. It's
also preferable to depend on the system API rather than on build
configs. Related CLs modify the emulator builds to correct the config in
builds.
Bug: 35361545
Change-Id: I219ce5e14709c76dcba43af4693093e985269d43
Test: Verified by launching bluetooth on local devices after removing
the old check. Also verified by booting up the emulator and verifying
that Bluetooth Services do not start.
We were previously setting this based on when the window was added and
removed. This can lead to issues where an app isn't allowed to show
alert windows so window manager hides the window after the permission is
revoked, but the window still exist in the system so the process
importance will still be high. We now set the process importance based
on if it has visible window surfaces or not.
Bug: 33256752
Test: cts/.../run-test CtsAppTestCases android.app.cts.AlertWindowsTests
Change-Id: I4e406a94683ec0eecc0911d0195e641c693e1c4a
Starting from O, install_non_market_apps is deprecated and will not be
checked by the package installer. Device admin apps should be using the
user restriction instead.
Since on managed profiles, the default value blocked install from
unknown sources, the system will set the user restriction on behalf of
the profile owners (if the profile has one).
For non-managed profiles, the user had access to the settings to change
the value of install_non_market_apps. So going forward, any request to
change it's value by dpm#setSecureSetting in such users is going to be
ignored.
Test: Manually tested that:
1. For a profile with PO, when install_non_market_apps was set to 0,
user restriction is set on upgrade
2. For a profile with PO, when install_non_market_apps was set to 1,
user restriction is not set on upgrade
3. After upgrade, newly created managed profiles with PO have user
restriction set
Bug: 33947615
Change-Id: I063e9ee608b52086ffdf8ed2b24e2928574c58cd