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
The previous changes to these files, which inlined the behavior
of Assert.assertTrue() were done in a hurry to fix the build.
This change makes use of the existing Utils.assertTrue() method
that was created for this purpose.
Bug: 30188076
Test: make checkbuild
Change-Id: Iacd505f8c3f7cefe6de94d30b56e39600bb9b0af
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
Apps that expect to use the current SDK don't specify anything in their
manifest and the build system rightfully injects the current SDK.
Any apps that specify their own <uses-sdk> or versionCode are telling
the build system that they are purposely using some other minSdkVersion,
etc (support library demos).
Test: None
Change-Id: I0aba3a71e15703c7bcafcf4d35608a1851dd8567
Fixes: 34901699
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