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
Stop interning string metadata values as well as class names as it's
unlikely there will be much duplication among these.
Also make sure we intern the same set of strings when parsing packages
from their cache entries as we do when parsing them from the package
itself.
This change also improves error reporting for the unit-test and fixes
a failure that was introduced by a previous change (the addition of
static libraries).
Test: PackageParserTest
Bug: 34726698
Change-Id: Ia0d0342b91b3294bd5569756255918d1dc886e05
When passed a color, resolveThemeAttribute was not parsing the value
into the .data field.
Bug: http://b.android.com/232870
Test: Added new test
Change-Id: I9d91e3a70c24f1e71d9d89977fe79b0965e98893
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
ENABLE_CPUSETS is usually set in BoardConfig.mk to use CONFIG_CPUSETS
feature of Linux kernel.
This change turns the build time variable into runtime decision by
checking if a special file, "tasks", can be found under the mount
point, /dev/cpuset, for cpusets.
Bug: 34726944
Test: Tested on Sailfish
without cpuset mounted
with cpuset mounted, but without schedtune mounted
with cpuset mounted and with schedtune mounted
Change-Id: I1c044c3c9d4d15360a1605e7022da84d94df4014
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