Commit Graph

8421 Commits

Author SHA1 Message Date
TreeHugger Robot
6c7012413e Merge "Create CombinedVibrationEffect.aidl" 2020-10-22 14:06:09 +00:00
Jeff Sharkey
1992cdb4de Merge changes from topic "oct16c"
* changes:
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStringsChecker.
  Apply fixes for EfficientCollections.
  Trivial refactor for consistent naming.
  Expand formatSimple() to support widths.
  Refinement of EfficientStringsChecker.
2020-10-21 15:27:15 +00:00
Jeff Sharkey
c603ca2dd8 Apply fixes for EfficientStrings.
Refactoring to avoid StringBuffer synchronization overhead.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ibf843ed780c1202d5d96a11eaca889e592f19263
2020-10-20 22:00:20 -06:00
Jeff Sharkey
f18719bb73 Apply fixes for EfficientStrings.
Refactoring to avoid paying the cost of extra StringBuilder that are
quickly disposed.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Icd914a63cdadf8123c1e5a5073f85245f0791f0b
2020-10-20 22:00:18 -06:00
Jeff Sharkey
1c08f48253 Apply fixes for EfficientStringsChecker.
The recently-built Error Prone checker has found many instances where
we're always paying the cost of StringBuilder concatenation, even in
the typical cases where preconditions are successfully met.

Benchmarks have shown that even when replacing these with varargs
formatter strings, the default case is 20x faster.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If8c00bc73467bfb91ec16c162969c9d26ca53646
2020-10-20 22:00:16 -06:00
Jeff Sharkey
df8dc2b4a5 Apply fixes for EfficientCollections.
Drop-in replacements suggested for inefficient collections.  Also
annotate a handful of places where we're unable to update.

Bug: 155703208
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I48b600508df8160ac9b40fea7afca974b2c972f6
2020-10-20 21:57:00 -06:00
Jeongik Cha
7e56edb84f Merge "Expose 'ParcelableHolder' as SystemApi" am: 135efb0b73 am: 5e1cacaa28 am: d5bae241d4 am: 0522a33e24
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1458065

Change-Id: Ic28ef16a1e1d08db0f2ea6c735295d748b3f8a89
2020-10-21 02:01:58 +00:00
Jeongik Cha
0522a33e24 Merge "Expose 'ParcelableHolder' as SystemApi" am: 135efb0b73 am: 5e1cacaa28 am: d5bae241d4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1458065

Change-Id: I5f8d912b43a546aca9cbbd8d9c480ffa101c1452
2020-10-21 01:42:20 +00:00
Jeongik Cha
d5bae241d4 Merge "Expose 'ParcelableHolder' as SystemApi" am: 135efb0b73 am: 5e1cacaa28
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1458065

Change-Id: I7af96574a930efed7c5c7d45a0c5bfd40a569d22
2020-10-21 01:14:09 +00:00
Jeongik Cha
135efb0b73 Merge "Expose 'ParcelableHolder' as SystemApi" 2020-10-21 00:42:09 +00:00
Hangyu Kuang
a4fc0b078c Merge "Avoid transcoding in MediaPlayers" 2020-10-21 00:23:13 +00:00
Zim
95c8a18133 Avoid transcoding in MediaPlayers
Test: Manual
Bug: 158466177
Change-Id: I71776e1e81002b1505f5094c92fdd10706d1268e
2020-10-20 22:26:22 +01:00
Anton Hansson
24b4d166dd Merge "Remove @TestApi from @SystemApi symbols" am: d2d4637685 am: cbe282347e am: 14897c256d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1466264

Change-Id: I859503688ea3254d5bd1b55e80cf1962286e948f
2020-10-20 20:31:58 +00:00
Anton Hansson
14897c256d Merge "Remove @TestApi from @SystemApi symbols" am: d2d4637685 am: cbe282347e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1466264

Change-Id: I86daec690141893837ec58ab1d75aecc88557ff9
2020-10-20 19:45:04 +00:00
Jordan Jozwiak
2a4b6d8024 Merge "Move constants from service to manager" 2020-10-20 17:21:24 +00:00
TreeHugger Robot
373d5d59f2 Merge "[incremental/pm] set health listener on commit and on reboot" 2020-10-20 16:49:22 +00:00
Anton Hansson
d2d4637685 Merge "Remove @TestApi from @SystemApi symbols" 2020-10-20 13:45:13 +00:00
Anton Hansson
586a3cf229 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-20 09:04:03 +01:00
TreeHugger Robot
4af480c6c1 Merge "Make restoreCallingIdentity() @CriticalNative." 2020-10-20 06:20:57 +00:00
Jeff Sharkey
4c4ca9a50c Make restoreCallingIdentity() @CriticalNative.
The validation check that might throw an exception is almost a decade
old at this point, and isn't likely to be hit.  In addition, the
recently added "AndroidFrameworkBinderIdentity" Error Prone checker
ensures that clients working with these identities are well-behaved.

Removing this exception code is what enables @CriticalNative.

Bug: 171078335
Test: none
Change-Id: Ib4cc9becf325979a97a9b0e58ac2277f3b226aaa
2020-10-19 22:12:10 -06:00
Jeongik Cha
d6018d5984 Expose 'ParcelableHolder' as SystemApi
ParcelableHolder is the way to extend already defined parcelables. So,
it's supposed to be used by OEM's modules.

For Parcelable to be used by the OEM's module, it should be exposed as
SystemApi

Bug: 146611855
Test: atest aidl_unittests aidl_integration_test CtsNdkBinderTest
Change-Id: I3d3e3d6b22ffd128dcfc8281d998ee3f55a398c5
2020-10-20 11:59:45 +09:00
Songchun Fan
2570ec01c6 [incremental/pm] set health listener on commit and on reboot
This changes allow Incremental Service to directly report health status
to package manager service.

A health listener is created during package installation session to
monitor incremental storage health. After commit, a new listener is
created and will overwrite the old one.

The new listener will listen to incremental storage health and report
the status to package manager service, which will then send the status
to IncrementalStates, where the startability state and unstartable
reason might change, based on the health status code.

During reboot, for each incremental package, if it is not fully loaded,
the package manager service will register a health status listener to
continue monitor the health status of this package.

Test: unit test
Test: manual
BUG: 170435166
Change-Id: I220f230c523cfaf2c96019f9478554665e6af486
2020-10-20 01:13:07 +00:00
TreeHugger Robot
5d8bfdc5e5 Merge "[GraphicsEnvironment] Remove unnecessary prefix." 2020-10-19 21:43:36 +00:00
Anton Hansson
dd7d52f963 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-19 16:41:01 +01:00
Jordan Jozwiak
64ec3641ad Move constants from service to manager
These constants must be in the Manager so that they can be accessed by
CarUserManagerService. They are @hide since they are not meant to be
exposed publicly.

Bug: 155913815
Test: atest UserManagerTest
Change-Id: I62922c1487e2eb0d66f38ac7b0b8d58f31d3ec90
2020-10-16 10:03:51 -07:00
Peiyong Lin
706d1ef565 [GraphicsEnvironment] Remove unnecessary prefix.
ANGLE global settings variables have an unnecessary prefix, remove it.

Bug: b/170982184
Test: atest CtsAngleIntegrationHostTestCases
Change-Id: Id98e69820c90ede16cec8e798c0c77200b951966
2020-10-15 13:36:47 -07:00
Roman Kalukiewicz
24403f7ef2 Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00
Jordan Jozwiak
a4091c6922 Merge "Add removeUserOrSetEphemeral" 2020-10-15 16:44:39 +00:00
Jordan Jozwiak
c22af8e24e Add removeUserOrSetEphemeral
To support removing a user as soon as possible, we introduce an
API that will remove a non-current user immediately or mark the
current user as ephemeral so that it is removed on user switch
or reboot.

This API will be used by CarService, which runs in a different
process, so the API must be exposed on UserManager (instead of
just UserManagerInternal).

Bug: 155913815
Test: adb shell pm remove-user --set-ephemeral-if-in-use <uid>
Change-Id: I5975a70c439bd7892939bcee65be2f2dd85026ed
2020-10-14 13:09:07 -07:00
Hall Liu
0eca33ec91 Update and expose ModemActivityInfo
Update ModemActivityInfo to present a nicer API surface and expose it as
a SystemApi. Also change clients in BatteryStats to match the new
surface.

This is part 1. Part 2 will modify the methods in TelephonyManager to
use a more up-to-standards threading model.

Bug: 170427831
Test: atest ModemActivityInfoTest
Change-Id: I762ed949342861c75d94eafce88335e7bd8c9139
2020-10-14 11:22:11 -07:00
Lais Andrade
6d06239336 Create CombinedVibrationEffect.aidl
Add new parcelable aidl and class using @hide while WIP.

Add methods vibrate and cancelVibrate to VibratorManagerService,
throwing UnsupportedOperationException while WIP.

Bug: 166586119
Test: atest FrameworksServicesTest:VibratorManagerServiceTest
      atest FrameworksCoreTest:CombinedVibrationEffectTest
Change-Id: I78510631c3c5cae9836789f5a0de29c81994a852
2020-10-12 17:23:50 +00:00
Xin Li
986e6eeddf Merge ab/6749736 in stage.
Bug: 167233921
Merged-In: Iecef31f7bf10ad97b7e0075cf302ae94e248474a
Change-Id: I9e9c873bc2e05a0cfe3af0bf74725500f3f108db
2020-10-10 20:38:57 -07:00
Jeff Sharkey
f76ffeaff1 Merge changes from topic "oct6"
* changes:
  Upgrade AndroidFrameworkBinderIdentity to fatal.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
2020-10-08 18:50:22 +00:00
TreeHugger Robot
b2ddafa37f Merge "Remove deprecated VibrationAttributes.getAudioAttrs method" 2020-10-08 12:48:17 +00:00
Jeff Sharkey
b93712f623 Tighten up Binder.clearCallingIdentity() usage.
This is a third CL in a chain that adjusts existing malformed code
to follow AndroidFrameworkBinderIdentity best-practices.

Specifically, if a thread clears an identity they need to restore it
to avoid obscure security vulnerabilities.  In addition, the relevant
"try" block must start immediately after the identity is cleared to
ensure that its restored if/when any exceptions are thrown.

Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I74cb958b68d55a647547aae21baff6ddc364859b
2020-10-07 21:24:05 -06:00
Jeff Sharkey
2d2e07e2ff Tighten up Binder.clearCallingIdentity() usage.
The recently added AndroidFrameworkBinderIdentity Error Prone checker
examines code to ensure that any cleared identities are restored to
avoid obscure security vulnerabilities.

This change is a purely mechanical refactoring that adds the "final"
keyword to the cleared identity to ensure that it's not accidentally
modified before eventually being cleared.  Here's the exact command
used to generate this CL:

$ find . -name "*.java" -exec sed -Ei \
    's/    (long \w+ = .+?clearCallingIdentity)/    final \1/' \
    {} \;

Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I832c9d70c3dfcd8d669cf71939d97837becc973a
2020-10-06 11:18:09 -06:00
Martijn Coenen
d4e36b6942 Remove calls to remountUid().
These are no-ops with FUSE enabled, so avoid doing needless work.

Bug: 141394269
Test: N/A
Change-Id: Id9f56ff3235cc2746195b4dd6f8f13e0f7cd0f67
2020-10-05 15:54:38 +02:00
Zimuzo Ezeozue
2d9b034fdc Merge "Removed unused mount mode constants" 2020-10-05 12:15:34 +00:00
Zim
c8fe3d2acd Removed unused mount mode constants
Since FUSE in R, there are only 4 mount modes that are used
from IVold.aidl:

REMOUNT_MODE_NONE
REMOUNT_MODE_DEFAULT
REMOUNT_MODE_INSTALLER
REMOUNT_MODE_PASS_THROUGH
REMOUNT_MODE_ANDROID_WRITABLE

Bug: 148454884
Test: Manual
Change-Id: I62b66083f2099b429474872b6f9c7cffb9fb906d
2020-10-05 10:26:14 +01:00
Rick Yiu
2d43e28fef Merge "Revert "Refine documentation for Process.setThreadPriority"" am: fe6160ab9c am: 1cb565ec3c am: 017adb4085 am: 765dbc6b67 am: ac2eaa1729
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440031

Change-Id: I681c550a8e3ae87db449fd434c95f46c55ea3cb6
2020-10-02 15:08:51 +00:00
Rick Yiu
ac2eaa1729 Merge "Revert "Refine documentation for Process.setThreadPriority"" am: fe6160ab9c am: 1cb565ec3c am: 017adb4085 am: 765dbc6b67
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440031

Change-Id: If918ed3b7a64bd8e9e3421d4cee2dc82d08117eb
2020-10-02 14:06:33 +00:00
Rick Yiu
765dbc6b67 Merge "Revert "Refine documentation for Process.setThreadPriority"" am: fe6160ab9c am: 1cb565ec3c am: 017adb4085
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440031

Change-Id: Ib3da013ce94288729a2b2d177fcc4d2345e1af58
2020-10-02 13:47:00 +00:00
Rick Yiu
017adb4085 Merge "Revert "Refine documentation for Process.setThreadPriority"" am: fe6160ab9c am: 1cb565ec3c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440031

Change-Id: I1715fe8876ad912282114a2d3db531fdfe577655
2020-10-02 13:15:24 +00:00
Rick Yiu
fe6160ab9c Merge "Revert "Refine documentation for Process.setThreadPriority"" 2020-10-02 12:23:53 +00:00
Treehugger Robot
8ed5dc797e Merge "FileBridge: fix fd ownership mismanagement." am: e80c7cb69a am: bc2ef840e1 am: 5cc3eac681 am: 58c615fbaa am: ff31d87058
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433025

Change-Id: I877dc8e34324a0f4b303d8bb3c8af450dcea341d
2020-10-02 01:11:39 +00:00
Treehugger Robot
f4ce73e3df Merge "Parcel interface token methods @NonNull." am: 403f00bfb8 am: f74b2d4192 am: 008ff2619b am: 92bcee154f am: cf682d9c2e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1444678

Change-Id: Id111b38163356f7b8a7dde7db200059a9b1799d7
2020-10-02 01:10:56 +00:00
Treehugger Robot
ff31d87058 Merge "FileBridge: fix fd ownership mismanagement." am: e80c7cb69a am: bc2ef840e1 am: 5cc3eac681 am: 58c615fbaa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433025

Change-Id: I9dcad087714df784820af2b2439478928dfa5555
2020-10-02 01:03:23 +00:00
Treehugger Robot
cf682d9c2e Merge "Parcel interface token methods @NonNull." am: 403f00bfb8 am: f74b2d4192 am: 008ff2619b am: 92bcee154f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1444678

Change-Id: Ie8c367e500572f3cb1cf8817d28141d52b06867e
2020-10-02 01:02:27 +00:00
Treehugger Robot
58c615fbaa Merge "FileBridge: fix fd ownership mismanagement." am: e80c7cb69a am: bc2ef840e1 am: 5cc3eac681
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433025

Change-Id: Ic3b714e1e80c4a9ced5373f1490d77ce80cd868c
2020-10-02 00:46:23 +00:00
Treehugger Robot
92bcee154f Merge "Parcel interface token methods @NonNull." am: 403f00bfb8 am: f74b2d4192 am: 008ff2619b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1444678

Change-Id: I08fb4d9849f38737528924fdc75944d362f1d9f5
2020-10-02 00:45:23 +00:00