diff options
34 files changed, 768 insertions, 236 deletions
diff --git a/Android.bp b/Android.bp index 0f9977cb65b3..c22dafb670a3 100644 --- a/Android.bp +++ b/Android.bp @@ -289,6 +289,14 @@ java_defaults { "staledataclass-annotation-processor", "error_prone_android_framework", ], + // Exports needed for staledataclass-annotation-processor, see b/139342589. + javacflags: [ + "-J--add-modules=jdk.compiler", + "-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", + "-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", + "-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", + "-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + ], required: [ // TODO(b/120066492): remove default_television.xml when the build system // propagates "required" properly. diff --git a/apct-tests/perftests/core/src/android/opengl/perftests/MatrixPerfTest.java b/apct-tests/perftests/core/src/android/opengl/perftests/MatrixPerfTest.java new file mode 100644 index 000000000000..b29614817ee2 --- /dev/null +++ b/apct-tests/perftests/core/src/android/opengl/perftests/MatrixPerfTest.java @@ -0,0 +1,397 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.opengl.perftests; + +import android.opengl.Matrix; +import android.perftests.utils.BenchmarkState; +import android.perftests.utils.PerfStatusReporter; + +import androidx.test.filters.LargeTest; + +import org.junit.Rule; +import org.junit.Test; + +import java.util.Random; + +@LargeTest +public class MatrixPerfTest { + @Rule + public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter(); + + @Rule + public float[] array = new float[48]; + + @Rule + public float[] bigArray = new float[16 * 1024 * 1024]; + + + @Test + public void testMultiplyMM() { + Random rng = new Random(); + for (int i = 0; i < 32; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMM(array, 32, array, 16, array, 0); + } + } + + @Test + public void testMultiplyMMLeftOverlapResult() { + Random rng = new Random(); + for (int i = 0; i < 32; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMM(array, 16, array, 16, array, 0); + } + } + + @Test + public void testMultiplyMMRightOverlapResult() { + Random rng = new Random(); + for (int i = 0; i < 32; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMM(array, 0, array, 16, array, 0); + } + } + + @Test + public void testMultiplyMMAllOverlap() { + Random rng = new Random(); + for (int i = 0; i < 16; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMM(array, 0, array, 0, array, 0); + } + } + + @Test + public void testMultiplyMMOutputBigArray() { + Random rng = new Random(); + for (int i = 0; i < 32; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMM(bigArray, 1024, array, 16, array, 0); + } + } + + @Test + public void testMultiplyMMAllBigArray() { + Random rng = new Random(); + for (int i = 0; i < 32; i++) { + bigArray[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMM(bigArray, 1024, bigArray, 16, bigArray, 0); + } + } + + @Test + public void testMultiplyMV() { + Random rng = new Random(); + for (int i = 0; i < 20; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMV(array, 20, array, 4, array, 0); + } + } + + @Test + public void testMultiplyMVLeftOverlapResult() { + Random rng = new Random(); + for (int i = 0; i < 20; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMV(array, 4, array, 4, array, 0); + } + } + + @Test + public void testMultiplyMVRightOverlapResult() { + Random rng = new Random(); + for (int i = 0; i < 32; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMV(array, 0, array, 16, array, 0); + } + } + + @Test + public void testMultiplyMVAllOverlap() { + Random rng = new Random(); + for (int i = 0; i < 16; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMV(array, 0, array, 0, array, 0); + } + } + + @Test + public void testMultiplyMVOutputBigArray() { + Random rng = new Random(); + for (int i = 0; i < 20; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMV(bigArray, 1024, array, 16, array, 0); + } + } + + @Test + public void testMultiplyMVAllBigArray() { + Random rng = new Random(); + for (int i = 0; i < 20; i++) { + bigArray[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.multiplyMV(bigArray, 1024, bigArray, 16, bigArray, 0); + } + } + + @Test + public void testTransposeM() { + Random rng = new Random(); + for (int i = 0; i < 16; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.transposeM(array, 16, array, 0); + } + } + + @Test + public void testInvertM() { + // non-singular matrix + array[ 0] = 0.814f; + array[ 1] = 4.976f; + array[ 2] = -3.858f; + array[ 3] = 7.206f; + array[ 4] = 5.112f; + array[ 5] = -2.420f; + array[ 6] = 8.791f; + array[ 7] = 6.426f; + array[ 8] = 2.945f; + array[ 9] = 1.801f; + array[10] = -2.594f; + array[11] = 2.663f; + array[12] = -5.003f; + array[13] = -4.188f; + array[14] = 3.340f; + array[15] = -1.235f; + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.invertM(array, 16, array, 0); + } + } + + @Test + public void testOrthoM() { + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.orthoM(array, 0, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); + } + } + + @Test + public void testFrustumM() { + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.frustumM(array, 0, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); + } + } + + @Test + public void testPerspectiveM() { + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.perspectiveM(array, 0, 45.0f, 1.0f, 1.0f, 100.0f); + } + } + + @Test + public void testLength() { + Random rng = new Random(); + for (int i = 0; i < 3; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.length(array[0], array[1], array[2]); + } + } + + @Test + public void testSetIdentityM() { + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.setIdentityM(array, 0); + } + } + + @Test + public void testScaleM() { + Random rng = new Random(); + for (int i = 0; i < 19; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.scaleM(array, 19, array, 0, array[16], array[17], array[18]); + } + } + + @Test + public void testScaleMInPlace() { + Random rng = new Random(); + for (int i = 0; i < 19; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.scaleM(array, 0, array[16], array[17], array[18]); + } + } + + @Test + public void testTranslateM() { + Random rng = new Random(); + for (int i = 0; i < 19; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.translateM(array, 19, array, 0, array[16], array[17], array[18]); + } + } + + @Test + public void testTranslateMInPlace() { + Random rng = new Random(); + for (int i = 0; i < 19; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.translateM(array, 0, array[16], array[17], array[18]); + } + } + + @Test + public void testRotateM() { + Random rng = new Random(); + for (int i = 0; i < 20; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.rotateM(array, 20, array, 0, array[16], array[17], array[18], array[19]); + } + } + + @Test + public void testRotateMInPlace() { + Random rng = new Random(); + for (int i = 0; i < 20; i++) { + array[i] = rng.nextFloat(); + } + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.rotateM(array, 0, array[16], array[17], array[18], array[19]); + } + } + + @Test + public void testSetRotateM() { + Random rng = new Random(); + array[0] = rng.nextFloat() * 90.0f; + array[1] = rng.nextFloat() + 0.5f; + array[2] = rng.nextFloat() + 0.5f; + array[3] = rng.nextFloat() + 0.5f; + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.setRotateM(array, 4, array[0], array[1], array[2], array[3]); + } + } + + @Test + public void testSetRotateEulerM() { + Random rng = new Random(); + array[0] = rng.nextFloat() * 90.0f; + array[1] = rng.nextFloat() * 90.0f; + array[2] = rng.nextFloat() * 90.0f; + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.setRotateEulerM(array, 3, array[0], array[1], array[2]); + } + } + + @Test + public void testSetLookAtM() { + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + Matrix.setLookAtM(array, 9, + 1.0f, 0.0f, 0.0f, + 1.0f, 0.0f, 1.0f, + 0.0f, 1.0f, 0.0f); + } + } +} diff --git a/core/java/android/accessibilityservice/OWNERS b/core/java/android/accessibilityservice/OWNERS index a31cfae995b2..fb06e236dd8a 100644 --- a/core/java/android/accessibilityservice/OWNERS +++ b/core/java/android/accessibilityservice/OWNERS @@ -1,4 +1,6 @@ -svetoslavganov@google.com pweaver@google.com -rhedjao@google.com ryanlwlin@google.com +danielnorman@google.com +sallyyuen@google.com +aarmaly@google.com +fuego@google.com diff --git a/core/java/android/app/OWNERS b/core/java/android/app/OWNERS index 068304d75910..f3fc46869916 100644 --- a/core/java/android/app/OWNERS +++ b/core/java/android/app/OWNERS @@ -29,7 +29,7 @@ per-file ProfilerInfo* = file:/services/core/java/com/android/server/am/OWNERS per-file Service* = file:/services/core/java/com/android/server/am/OWNERS per-file SystemServiceRegistry.java = file:/services/core/java/com/android/server/am/OWNERS per-file *UserSwitchObserver* = file:/services/core/java/com/android/server/am/OWNERS -per-file UiAutomation.java = file:/services/accessibility/OWNERS +per-file UiAutomation* = file:/services/accessibility/OWNERS per-file GameManager* = file:/GAME_MANAGER_OWNERS per-file GameState* = file:/GAME_MANAGER_OWNERS per-file IGameManager* = file:/GAME_MANAGER_OWNERS diff --git a/core/java/android/nfc/cardemulation/CardEmulation.java b/core/java/android/nfc/cardemulation/CardEmulation.java index 2b34d8639235..0b56d19201fb 100644 --- a/core/java/android/nfc/cardemulation/CardEmulation.java +++ b/core/java/android/nfc/cardemulation/CardEmulation.java @@ -209,7 +209,8 @@ public final class CardEmulation { */ public boolean isDefaultServiceForCategory(ComponentName service, String category) { try { - return sService.isDefaultServiceForCategory(mContext.getUserId(), service, category); + return sService.isDefaultServiceForCategory(mContext.getUser().getIdentifier(), + service, category); } catch (RemoteException e) { // Try one more time recoverService(); @@ -218,8 +219,8 @@ public final class CardEmulation { return false; } try { - return sService.isDefaultServiceForCategory(mContext.getUserId(), service, - category); + return sService.isDefaultServiceForCategory(mContext.getUser().getIdentifier(), + service, category); } catch (RemoteException ee) { Log.e(TAG, "Failed to recover CardEmulationService."); return false; @@ -240,7 +241,8 @@ public final class CardEmulation { */ public boolean isDefaultServiceForAid(ComponentName service, String aid) { try { - return sService.isDefaultServiceForAid(mContext.getUserId(), service, aid); + return sService.isDefaultServiceForAid(mContext.getUser().getIdentifier(), + service, aid); } catch (RemoteException e) { // Try one more time recoverService(); @@ -249,7 +251,8 @@ public final class CardEmulation { return false; } try { - return sService.isDefaultServiceForAid(mContext.getUserId(), service, aid); + return sService.isDefaultServiceForAid(mContext.getUser().getIdentifier(), + service, aid); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); return false; @@ -348,7 +351,8 @@ public final class CardEmulation { List<String> aids) { AidGroup aidGroup = new AidGroup(aids, category); try { - return sService.registerAidGroupForService(mContext.getUserId(), service, aidGroup); + return sService.registerAidGroupForService(mContext.getUser().getIdentifier(), + service, aidGroup); } catch (RemoteException e) { // Try one more time recoverService(); @@ -357,8 +361,8 @@ public final class CardEmulation { return false; } try { - return sService.registerAidGroupForService(mContext.getUserId(), service, - aidGroup); + return sService.registerAidGroupForService(mContext.getUser().getIdentifier(), + service, aidGroup); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); return false; @@ -391,7 +395,7 @@ public final class CardEmulation { } try { - return sService.unsetOffHostForService(mContext.getUserId(), service); + return sService.unsetOffHostForService(mContext.getUser().getIdentifier(), service); } catch (RemoteException e) { // Try one more time recoverService(); @@ -400,7 +404,7 @@ public final class CardEmulation { return false; } try { - return sService.unsetOffHostForService(mContext.getUserId(), service); + return sService.unsetOffHostForService(mContext.getUser().getIdentifier(), service); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); return false; @@ -468,7 +472,7 @@ public final class CardEmulation { } try { - return sService.setOffHostForService(mContext.getUserId(), service, + return sService.setOffHostForService(mContext.getUser().getIdentifier(), service, offHostSecureElement); } catch (RemoteException e) { // Try one more time @@ -478,7 +482,7 @@ public final class CardEmulation { return false; } try { - return sService.setOffHostForService(mContext.getUserId(), service, + return sService.setOffHostForService(mContext.getUser().getIdentifier(), service, offHostSecureElement); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); @@ -503,8 +507,8 @@ public final class CardEmulation { */ public List<String> getAidsForService(ComponentName service, String category) { try { - AidGroup group = sService.getAidGroupForService(mContext.getUserId(), service, - category); + AidGroup group = sService.getAidGroupForService(mContext.getUser().getIdentifier(), + service, category); return (group != null ? group.getAids() : null); } catch (RemoteException e) { recoverService(); @@ -513,8 +517,8 @@ public final class CardEmulation { return null; } try { - AidGroup group = sService.getAidGroupForService(mContext.getUserId(), service, - category); + AidGroup group = sService.getAidGroupForService(mContext.getUser().getIdentifier(), + service, category); return (group != null ? group.getAids() : null); } catch (RemoteException ee) { Log.e(TAG, "Failed to recover CardEmulationService."); @@ -540,7 +544,8 @@ public final class CardEmulation { */ public boolean removeAidsForService(ComponentName service, String category) { try { - return sService.removeAidGroupForService(mContext.getUserId(), service, category); + return sService.removeAidGroupForService(mContext.getUser().getIdentifier(), service, + category); } catch (RemoteException e) { // Try one more time recoverService(); @@ -549,7 +554,8 @@ public final class CardEmulation { return false; } try { - return sService.removeAidGroupForService(mContext.getUserId(), service, category); + return sService.removeAidGroupForService(mContext.getUser().getIdentifier(), + service, category); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); return false; @@ -684,7 +690,8 @@ public final class CardEmulation { @Nullable public List<String> getAidsForPreferredPaymentService() { try { - ApduServiceInfo serviceInfo = sService.getPreferredPaymentService(mContext.getUserId()); + ApduServiceInfo serviceInfo = sService.getPreferredPaymentService( + mContext.getUser().getIdentifier()); return (serviceInfo != null ? serviceInfo.getAids() : null); } catch (RemoteException e) { recoverService(); @@ -694,7 +701,7 @@ public final class CardEmulation { } try { ApduServiceInfo serviceInfo = - sService.getPreferredPaymentService(mContext.getUserId()); + sService.getPreferredPaymentService(mContext.getUser().getIdentifier()); return (serviceInfo != null ? serviceInfo.getAids() : null); } catch (RemoteException ee) { Log.e(TAG, "Failed to recover CardEmulationService."); @@ -723,7 +730,8 @@ public final class CardEmulation { @Nullable public String getRouteDestinationForPreferredPaymentService() { try { - ApduServiceInfo serviceInfo = sService.getPreferredPaymentService(mContext.getUserId()); + ApduServiceInfo serviceInfo = sService.getPreferredPaymentService( + mContext.getUser().getIdentifier()); if (serviceInfo != null) { if (!serviceInfo.isOnHost()) { return serviceInfo.getOffHostSecureElement() == null ? @@ -740,7 +748,7 @@ public final class CardEmulation { } try { ApduServiceInfo serviceInfo = - sService.getPreferredPaymentService(mContext.getUserId()); + sService.getPreferredPaymentService(mContext.getUser().getIdentifier()); if (serviceInfo != null) { if (!serviceInfo.isOnHost()) { return serviceInfo.getOffHostSecureElement() == null ? @@ -766,7 +774,8 @@ public final class CardEmulation { @Nullable public CharSequence getDescriptionForPreferredPaymentService() { try { - ApduServiceInfo serviceInfo = sService.getPreferredPaymentService(mContext.getUserId()); + ApduServiceInfo serviceInfo = sService.getPreferredPaymentService( + mContext.getUser().getIdentifier()); return (serviceInfo != null ? serviceInfo.getDescription() : null); } catch (RemoteException e) { recoverService(); @@ -776,7 +785,7 @@ public final class CardEmulation { } try { ApduServiceInfo serviceInfo = - sService.getPreferredPaymentService(mContext.getUserId()); + sService.getPreferredPaymentService(mContext.getUser().getIdentifier()); return (serviceInfo != null ? serviceInfo.getDescription() : null); } catch (RemoteException ee) { Log.e(TAG, "Failed to recover CardEmulationService."); @@ -790,7 +799,8 @@ public final class CardEmulation { */ public boolean setDefaultServiceForCategory(ComponentName service, String category) { try { - return sService.setDefaultServiceForCategory(mContext.getUserId(), service, category); + return sService.setDefaultServiceForCategory(mContext.getUser().getIdentifier(), + service, category); } catch (RemoteException e) { // Try one more time recoverService(); @@ -799,8 +809,8 @@ public final class CardEmulation { return false; } try { - return sService.setDefaultServiceForCategory(mContext.getUserId(), service, - category); + return sService.setDefaultServiceForCategory(mContext.getUser().getIdentifier(), + service, category); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); return false; @@ -813,7 +823,7 @@ public final class CardEmulation { */ public boolean setDefaultForNextTap(ComponentName service) { try { - return sService.setDefaultForNextTap(mContext.getUserId(), service); + return sService.setDefaultForNextTap(mContext.getUser().getIdentifier(), service); } catch (RemoteException e) { // Try one more time recoverService(); @@ -822,7 +832,7 @@ public final class CardEmulation { return false; } try { - return sService.setDefaultForNextTap(mContext.getUserId(), service); + return sService.setDefaultForNextTap(mContext.getUser().getIdentifier(), service); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); return false; @@ -857,7 +867,7 @@ public final class CardEmulation { */ public List<ApduServiceInfo> getServices(String category) { try { - return sService.getServices(mContext.getUserId(), category); + return sService.getServices(mContext.getUser().getIdentifier(), category); } catch (RemoteException e) { // Try one more time recoverService(); @@ -866,7 +876,7 @@ public final class CardEmulation { return null; } try { - return sService.getServices(mContext.getUserId(), category); + return sService.getServices(mContext.getUser().getIdentifier(), category); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); return null; diff --git a/core/java/android/nfc/cardemulation/NfcFCardEmulation.java b/core/java/android/nfc/cardemulation/NfcFCardEmulation.java index 557e41a2b103..3c924556365e 100644 --- a/core/java/android/nfc/cardemulation/NfcFCardEmulation.java +++ b/core/java/android/nfc/cardemulation/NfcFCardEmulation.java @@ -117,7 +117,7 @@ public final class NfcFCardEmulation { throw new NullPointerException("service is null"); } try { - return sService.getSystemCodeForService(mContext.getUserId(), service); + return sService.getSystemCodeForService(mContext.getUser().getIdentifier(), service); } catch (RemoteException e) { // Try one more time recoverService(); @@ -126,7 +126,8 @@ public final class NfcFCardEmulation { return null; } try { - return sService.getSystemCodeForService(mContext.getUserId(), service); + return sService.getSystemCodeForService(mContext.getUser().getIdentifier(), + service); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); ee.rethrowAsRuntimeException(); @@ -163,7 +164,7 @@ public final class NfcFCardEmulation { throw new NullPointerException("service or systemCode is null"); } try { - return sService.registerSystemCodeForService(mContext.getUserId(), + return sService.registerSystemCodeForService(mContext.getUser().getIdentifier(), service, systemCode); } catch (RemoteException e) { // Try one more time @@ -173,7 +174,7 @@ public final class NfcFCardEmulation { return false; } try { - return sService.registerSystemCodeForService(mContext.getUserId(), + return sService.registerSystemCodeForService(mContext.getUser().getIdentifier(), service, systemCode); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); @@ -194,7 +195,7 @@ public final class NfcFCardEmulation { throw new NullPointerException("service is null"); } try { - return sService.removeSystemCodeForService(mContext.getUserId(), service); + return sService.removeSystemCodeForService(mContext.getUser().getIdentifier(), service); } catch (RemoteException e) { // Try one more time recoverService(); @@ -203,7 +204,8 @@ public final class NfcFCardEmulation { return false; } try { - return sService.removeSystemCodeForService(mContext.getUserId(), service); + return sService.removeSystemCodeForService(mContext.getUser().getIdentifier(), + service); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); ee.rethrowAsRuntimeException(); @@ -229,7 +231,7 @@ public final class NfcFCardEmulation { throw new NullPointerException("service is null"); } try { - return sService.getNfcid2ForService(mContext.getUserId(), service); + return sService.getNfcid2ForService(mContext.getUser().getIdentifier(), service); } catch (RemoteException e) { // Try one more time recoverService(); @@ -238,7 +240,7 @@ public final class NfcFCardEmulation { return null; } try { - return sService.getNfcid2ForService(mContext.getUserId(), service); + return sService.getNfcid2ForService(mContext.getUser().getIdentifier(), service); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); ee.rethrowAsRuntimeException(); @@ -272,7 +274,7 @@ public final class NfcFCardEmulation { throw new NullPointerException("service or nfcid2 is null"); } try { - return sService.setNfcid2ForService(mContext.getUserId(), + return sService.setNfcid2ForService(mContext.getUser().getIdentifier(), service, nfcid2); } catch (RemoteException e) { // Try one more time @@ -282,7 +284,7 @@ public final class NfcFCardEmulation { return false; } try { - return sService.setNfcid2ForService(mContext.getUserId(), + return sService.setNfcid2ForService(mContext.getUser().getIdentifier(), service, nfcid2); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); @@ -380,7 +382,7 @@ public final class NfcFCardEmulation { */ public List<NfcFServiceInfo> getNfcFServices() { try { - return sService.getNfcFServices(mContext.getUserId()); + return sService.getNfcFServices(mContext.getUser().getIdentifier()); } catch (RemoteException e) { // Try one more time recoverService(); @@ -389,7 +391,7 @@ public final class NfcFCardEmulation { return null; } try { - return sService.getNfcFServices(mContext.getUserId()); + return sService.getNfcFServices(mContext.getUser().getIdentifier()); } catch (RemoteException ee) { Log.e(TAG, "Failed to reach CardEmulationService."); return null; diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java index 56652f57e6f1..a6ae663dabb0 100644 --- a/core/java/android/os/Parcel.java +++ b/core/java/android/os/Parcel.java @@ -560,7 +560,9 @@ public final class Parcel { */ public final void recycle() { if (mRecycled) { - Log.w(TAG, "Recycle called on unowned Parcel. (recycle twice?)", mStack); + Log.w(TAG, "Recycle called on unowned Parcel. (recycle twice?) Here: " + + Log.getStackTraceString(new Throwable()) + + " Original recycle call (if DEBUG_RECYCLE): ", mStack); } mRecycled = true; diff --git a/core/java/android/text/OWNERS b/core/java/android/text/OWNERS index 0b51b2d90b79..a6be687ab4c9 100644 --- a/core/java/android/text/OWNERS +++ b/core/java/android/text/OWNERS @@ -1,4 +1,10 @@ set noparent +halilibo@google.com +haoyuchang@google.com +justinghan@google.com +klippenstein@google.com +nona@google.com +seanmcq@google.com siyamed@google.com -nona@google.com
\ No newline at end of file +soboleva@google.com diff --git a/core/java/android/view/accessibility/OWNERS b/core/java/android/view/accessibility/OWNERS index b1d3967a8b04..73d134146c3f 100644 --- a/core/java/android/view/accessibility/OWNERS +++ b/core/java/android/view/accessibility/OWNERS @@ -10,3 +10,7 @@ ogunwale@google.com jjaggi@google.com pweaver@google.com ryanlwlin@google.com +danielnorman@google.com +sallyyuen@google.com +aarmaly@google.com +fuego@google.com diff --git a/core/java/android/widget/OWNERS b/core/java/android/widget/OWNERS index 56310aef7752..02dafd44d3bd 100644 --- a/core/java/android/widget/OWNERS +++ b/core/java/android/widget/OWNERS @@ -8,8 +8,8 @@ siyamed@google.com mount@google.com njawad@google.com -per-file TextView*,EditText.java,Editor.java,EditorTouchState.java = file:../text/OWNERS +per-file TextView*,Edit*,Selection* = file:../text/OWNERS per-file SpellChecker.java = file:../view/inputmethod/OWNERS -per-file RemoteViews* = file:../appwidget/OWNERS
\ No newline at end of file +per-file RemoteViews* = file:../appwidget/OWNERS diff --git a/core/java/com/android/internal/accessibility/OWNERS b/core/java/com/android/internal/accessibility/OWNERS index b3c09e9d539a..0955e005791e 100644 --- a/core/java/com/android/internal/accessibility/OWNERS +++ b/core/java/com/android/internal/accessibility/OWNERS @@ -1,4 +1,6 @@ # Bug component: 44214 -svetoslavganov@google.com pweaver@google.com -qasid@google.com +danielnorman@google.com +sallyyuen@google.com +aarmaly@google.com +fuego@google.com diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp index 59c914f0198c..03f02de98efe 100644 --- a/libs/hwui/renderthread/DrawFrameTask.cpp +++ b/libs/hwui/renderthread/DrawFrameTask.cpp @@ -243,7 +243,9 @@ bool DrawFrameTask::syncFrameState(TreeInfo& info) { mContext->unpinImages(); for (size_t i = 0; i < mLayers.size(); i++) { - mLayers[i]->apply(); + if (mLayers[i]) { + mLayers[i]->apply(); + } } mLayers.clear(); mContext->setContentDrawBounds(mContentDrawBounds); diff --git a/libs/incident/Android.bp b/libs/incident/Android.bp index 547d7192090a..ff1714da2008 100644 --- a/libs/incident/Android.bp +++ b/libs/incident/Android.bp @@ -133,4 +133,6 @@ cc_test { static_libs: [ "libgmock", ], + + host_required: ["compatibility-tradefed"], } diff --git a/services/accessibility/OWNERS b/services/accessibility/OWNERS index 2b9f179b832d..6e76a207e06f 100644 --- a/services/accessibility/OWNERS +++ b/services/accessibility/OWNERS @@ -2,3 +2,5 @@ pweaver@google.com sallyyuen@google.com ryanlwlin@google.com fuego@google.com +danielnorman@google.com +aarmaly@google.com diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java index 9a1d29554ad6..8044af5dcb58 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -728,7 +728,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub intentFilter.addAction(Intent.ACTION_USER_SWITCHED); intentFilter.addAction(Intent.ACTION_USER_UNLOCKED); intentFilter.addAction(Intent.ACTION_USER_REMOVED); - intentFilter.addAction(Intent.ACTION_USER_PRESENT); intentFilter.addAction(Intent.ACTION_SETTING_RESTORED); mContext.registerReceiverAsUser(new BroadcastReceiver() { @@ -746,14 +745,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub unlockUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_USER_REMOVED.equals(action)) { removeUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); - } else if (Intent.ACTION_USER_PRESENT.equals(action)) { - // We will update when the automation service dies. - synchronized (mLock) { - AccessibilityUserState userState = getCurrentUserStateLocked(); - if (readConfigurationForUserStateLocked(userState)) { - onUserStateChangedLocked(userState); - } - } } else if (Intent.ACTION_SETTING_RESTORED.equals(action)) { final String which = intent.getStringExtra(Intent.EXTRA_SETTING_NAME); if (Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES.equals(which)) { diff --git a/services/core/java/com/android/server/OWNERS b/services/core/java/com/android/server/OWNERS index 6ff8e36a1f82..5dbdb9b3b77c 100644 --- a/services/core/java/com/android/server/OWNERS +++ b/services/core/java/com/android/server/OWNERS @@ -35,6 +35,8 @@ per-file NetIdManager.java = file:/services/core/java/com/android/server/net/OWN per-file PackageWatchdog.java, RescueParty.java = file:/services/core/java/com/android/server/rollback/OWNERS per-file PinnerService.java = file:/apct-tests/perftests/OWNERS per-file RescueParty.java = fdunlap@google.com, shuc@google.com +per-file SystemClockTime.java = file:/services/core/java/com/android/server/timedetector/OWNERS +per-file SystemTimeZone.java = file:/services/core/java/com/android/server/timezonedetector/OWNERS per-file TelephonyRegistry.java = file:/telephony/OWNERS per-file UiModeManagerService.java = file:/packages/SystemUI/OWNERS per-file VcnManagementService.java = file:/services/core/java/com/android/server/vcn/OWNERS diff --git a/services/core/java/com/android/server/am/ProcessProfileRecord.java b/services/core/java/com/android/server/am/ProcessProfileRecord.java index cee34d5568b5..252a00bace20 100644 --- a/services/core/java/com/android/server/am/ProcessProfileRecord.java +++ b/services/core/java/com/android/server/am/ProcessProfileRecord.java @@ -17,7 +17,6 @@ package com.android.server.am; import static android.app.ActivityManager.PROCESS_STATE_NONEXISTENT; -import static android.app.ActivityManager.processStateAmToProto; import android.annotation.IntDef; import android.app.IApplicationThread; @@ -318,12 +317,6 @@ final class ProcessProfileRecord { origBase.setState(ProcessStats.STATE_NOTHING, tracker.getMemFactorLocked(), SystemClock.uptimeMillis(), pkgList.getPackageListLocked()); - pkgList.forEachPackage((pkgName, holder) -> - FrameworkStatsLog.write(FrameworkStatsLog.PROCESS_STATE_CHANGED, - mApp.uid, mApp.processName, pkgName, - processStateAmToProto(ProcessStats.STATE_NOTHING), - holder.appVersion) - ); } origBase.makeInactive(); } @@ -362,12 +355,6 @@ final class ProcessProfileRecord { origBase.setState(ProcessStats.STATE_NOTHING, tracker.getMemFactorLocked(), SystemClock.uptimeMillis(), pkgList.getPackageListLocked()); - pkgList.forEachPackage((pkgName, holder) -> - FrameworkStatsLog.write(FrameworkStatsLog.PROCESS_STATE_CHANGED, - mApp.uid, mApp.processName, pkgName, - processStateAmToProto(ProcessStats.STATE_NOTHING), - holder.appVersion) - ); } origBase.makeInactive(); setBaseProcessTracker(null); diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java index 07b6fcdcb0ca..482e6a792a90 100644 --- a/services/core/java/com/android/server/am/ProcessRecord.java +++ b/services/core/java/com/android/server/am/ProcessRecord.java @@ -54,7 +54,6 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.app.procstats.ProcessState; import com.android.internal.app.procstats.ProcessStats; import com.android.internal.os.Zygote; -import com.android.internal.util.FrameworkStatsLog; import com.android.server.wm.WindowProcessController; import com.android.server.wm.WindowProcessListener; @@ -1212,12 +1211,6 @@ class ProcessRecord implements WindowProcessListener { long now = SystemClock.uptimeMillis(); baseProcessTracker.setState(ProcessStats.STATE_NOTHING, tracker.getMemFactorLocked(), now, mPkgList.getPackageListLocked()); - mPkgList.forEachPackage((pkgName, holder) -> - FrameworkStatsLog.write(FrameworkStatsLog.PROCESS_STATE_CHANGED, - uid, processName, pkgName, - ActivityManager.processStateAmToProto(ProcessStats.STATE_NOTHING), - holder.appVersion) - ); if (numOfPkgs != 1) { mPkgList.forEachPackageProcessStats(holder -> { if (holder.state != null && holder.state != baseProcessTracker) { diff --git a/services/core/java/com/android/server/am/ProcessStateRecord.java b/services/core/java/com/android/server/am/ProcessStateRecord.java index 262436d693ec..f0241aa5ed82 100644 --- a/services/core/java/com/android/server/am/ProcessStateRecord.java +++ b/services/core/java/com/android/server/am/ProcessStateRecord.java @@ -36,7 +36,6 @@ import android.util.TimeUtils; import com.android.internal.annotations.CompositeRWLock; import com.android.internal.annotations.GuardedBy; -import com.android.internal.util.FrameworkStatsLog; import com.android.server.am.PlatformCompatCache.CachedCompatChangeId; import java.io.PrintWriter; @@ -599,12 +598,6 @@ final class ProcessStateRecord { @GuardedBy({"mService", "mProcLock"}) void setReportedProcState(int repProcState) { mRepProcState = repProcState; - mApp.getPkgList().forEachPackage((pkgName, holder) -> - FrameworkStatsLog.write(FrameworkStatsLog.PROCESS_STATE_CHANGED, - mApp.uid, mApp.processName, pkgName, - ActivityManager.processStateAmToProto(mRepProcState), - holder.appVersion) - ); mApp.getWindowProcessController().setReportedProcState(repProcState); } @@ -620,12 +613,6 @@ final class ProcessStateRecord { mRepProcState = newState; setCurProcState(newState); setCurRawProcState(newState); - mApp.getPkgList().forEachPackage((pkgName, holder) -> - FrameworkStatsLog.write(FrameworkStatsLog.PROCESS_STATE_CHANGED, - mApp.uid, mApp.processName, pkgName, - ActivityManager.processStateAmToProto(mRepProcState), - holder.appVersion) - ); } } } diff --git a/services/core/java/com/android/server/audio/AudioDeviceBroker.java b/services/core/java/com/android/server/audio/AudioDeviceBroker.java index eba9c7a5f14e..9a5171243864 100644 --- a/services/core/java/com/android/server/audio/AudioDeviceBroker.java +++ b/services/core/java/com/android/server/audio/AudioDeviceBroker.java @@ -17,9 +17,12 @@ package com.android.server.audio; import android.annotation.NonNull; import android.annotation.Nullable; +import android.app.compat.CompatChanges; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHeadset; import android.bluetooth.BluetoothProfile; +import android.compat.annotation.ChangeId; +import android.compat.annotation.EnabledSince; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; @@ -118,8 +121,39 @@ import java.util.concurrent.atomic.AtomicBoolean; // TODO do not "share" the lock between AudioService and BtHelpr, see b/123769055 /*package*/ final Object mSetModeLock = new Object(); - /** PID of current audio mode owner communicated by AudioService */ - private int mModeOwnerPid = 0; + /** AudioModeInfo contains information on current audio mode owner + * communicated by AudioService */ + /* package */ static final class AudioModeInfo { + /** Current audio mode */ + final int mMode; + /** PID of current audio mode owner */ + final int mPid; + /** UID of current audio mode owner */ + final int mUid; + + AudioModeInfo(int mode, int pid, int uid) { + mMode = mode; + mPid = pid; + mUid = uid; + } + + @Override + public String toString() { + return "AudioModeInfo: mMode=" + AudioSystem.modeToString(mMode) + + ", mPid=" + mPid + + ", mUid=" + mUid; + } + }; + + private AudioModeInfo mAudioModeOwner = new AudioModeInfo(AudioSystem.MODE_NORMAL, 0, 0); + + /** + * Indicates that default communication device is chosen by routing rules in audio policy + * manager and not forced by AudioDeviceBroker. + */ + @ChangeId + @EnabledSince(targetSdkVersion = android.os.Build.VERSION_CODES.S_V2) + public static final long USE_SET_COMMUNICATION_DEVICE = 243827847L; //------------------------------------------------------------------- /*package*/ AudioDeviceBroker(@NonNull Context context, @NonNull AudioService service) { @@ -187,7 +221,7 @@ import java.util.concurrent.atomic.AtomicBoolean; /*package*/ void onSystemReady() { synchronized (mSetModeLock) { synchronized (mDeviceStateLock) { - mModeOwnerPid = mAudioService.getModeOwnerPid(); + mAudioModeOwner = mAudioService.getAudioModeOwner(); mBtHelper.onSystemReady(); } } @@ -368,11 +402,11 @@ import java.util.concurrent.atomic.AtomicBoolean; @GuardedBy("mDeviceStateLock") private CommunicationRouteClient topCommunicationRouteClient() { for (CommunicationRouteClient crc : mCommunicationRouteClients) { - if (crc.getPid() == mModeOwnerPid) { + if (crc.getPid() == mAudioModeOwner.mPid) { return crc; } } - if (!mCommunicationRouteClients.isEmpty() && mModeOwnerPid == 0) { + if (!mCommunicationRouteClients.isEmpty() && mAudioModeOwner.mPid == 0) { return mCommunicationRouteClients.get(0); } return null; @@ -390,7 +424,7 @@ import java.util.concurrent.atomic.AtomicBoolean; AudioDeviceAttributes device = crc != null ? crc.getDevice() : null; if (AudioService.DEBUG_COMM_RTE) { Log.v(TAG, "requestedCommunicationDevice, device: " - + device + " mode owner pid: " + mModeOwnerPid); + + device + "mAudioModeOwner: " + mAudioModeOwner.toString()); } return device; } @@ -774,8 +808,9 @@ import java.util.concurrent.atomic.AtomicBoolean; sendLMsgNoDelay(MSG_II_SET_LE_AUDIO_OUT_VOLUME, SENDMSG_REPLACE, info); } - /*package*/ void postSetModeOwnerPid(int pid, int mode) { - sendIIMsgNoDelay(MSG_I_SET_MODE_OWNER_PID, SENDMSG_REPLACE, pid, mode); + /*package*/ void postSetModeOwner(int mode, int pid, int uid) { + sendLMsgNoDelay(MSG_I_SET_MODE_OWNER, SENDMSG_REPLACE, + new AudioModeInfo(mode, pid, uid)); } /*package*/ void postBluetoothA2dpDeviceConfigChange(@NonNull BluetoothDevice device) { @@ -1162,7 +1197,7 @@ import java.util.concurrent.atomic.AtomicBoolean; pw.println(prefix + "mAccessibilityStrategyId: " + mAccessibilityStrategyId); - pw.println("\n" + prefix + "mModeOwnerPid: " + mModeOwnerPid); + pw.println("\n" + prefix + "mAudioModeOwner: " + mAudioModeOwner); mBtHelper.dump(pw, prefix); } @@ -1288,12 +1323,19 @@ import java.util.concurrent.atomic.AtomicBoolean; } break; case MSG_L_SET_BT_ACTIVE_DEVICE: - synchronized (mDeviceStateLock) { - BtDeviceInfo btInfo = (BtDeviceInfo) msg.obj; - mDeviceInventory.onSetBtActiveDevice(btInfo, - (btInfo.mProfile != BluetoothProfile.LE_AUDIO || btInfo.mIsLeOutput) - ? mAudioService.getBluetoothContextualVolumeStream() - : AudioSystem.STREAM_DEFAULT); + synchronized (mSetModeLock) { + synchronized (mDeviceStateLock) { + BtDeviceInfo btInfo = (BtDeviceInfo) msg.obj; + mDeviceInventory.onSetBtActiveDevice(btInfo, + (btInfo.mProfile + != BluetoothProfile.LE_AUDIO || btInfo.mIsLeOutput) + ? mAudioService.getBluetoothContextualVolumeStream() + : AudioSystem.STREAM_DEFAULT); + if (btInfo.mProfile == BluetoothProfile.LE_AUDIO + || btInfo.mProfile == BluetoothProfile.HEARING_AID) { + onUpdateCommunicationRouteClient("setBluetoothActiveDevice"); + } + } } break; case MSG_BT_HEADSET_CNCT_FAILED: @@ -1338,11 +1380,11 @@ import java.util.concurrent.atomic.AtomicBoolean; mBtHelper.setAvrcpAbsoluteVolumeIndex(msg.arg1); } break; - case MSG_I_SET_MODE_OWNER_PID: + case MSG_I_SET_MODE_OWNER: synchronized (mSetModeLock) { synchronized (mDeviceStateLock) { - mModeOwnerPid = msg.arg1; - if (msg.arg2 != AudioSystem.MODE_RINGTONE) { + mAudioModeOwner = (AudioModeInfo) msg.obj; + if (mAudioModeOwner.mMode != AudioSystem.MODE_RINGTONE) { onUpdateCommunicationRouteClient("setNewModeOwner"); } } @@ -1504,7 +1546,7 @@ import java.util.concurrent.atomic.AtomicBoolean; private static final int MSG_REPORT_NEW_ROUTES = 13; private static final int MSG_II_SET_HEARING_AID_VOLUME = 14; private static final int MSG_I_SET_AVRCP_ABSOLUTE_VOLUME = 15; - private static final int MSG_I_SET_MODE_OWNER_PID = 16; + private static final int MSG_I_SET_MODE_OWNER = 16; private static final int MSG_I_BT_SERVICE_DISCONNECTED_PROFILE = 22; private static final int MSG_IL_BT_SERVICE_CONNECTED_PROFILE = 23; @@ -1826,8 +1868,16 @@ import java.util.concurrent.atomic.AtomicBoolean; AudioSystem.setParameters("BT_SCO=on"); } if (preferredCommunicationDevice == null) { - removePreferredDevicesForStrategySync(mCommunicationStrategyId); - removePreferredDevicesForStrategySync(mAccessibilityStrategyId); + AudioDeviceAttributes defaultDevice = getDefaultCommunicationDevice(); + if (defaultDevice != null) { + setPreferredDevicesForStrategySync( + mCommunicationStrategyId, Arrays.asList(defaultDevice)); + setPreferredDevicesForStrategySync( + mAccessibilityStrategyId, Arrays.asList(defaultDevice)); + } else { + removePreferredDevicesForStrategySync(mCommunicationStrategyId); + removePreferredDevicesForStrategySync(mAccessibilityStrategyId); + } } else { setPreferredDevicesForStrategySync( mCommunicationStrategyId, Arrays.asList(preferredCommunicationDevice)); @@ -1856,26 +1906,24 @@ import java.util.concurrent.atomic.AtomicBoolean; } } + // @GuardedBy("mSetModeLock") + @GuardedBy("mDeviceStateLock") private void onUpdatePhoneStrategyDevice(AudioDeviceAttributes device) { - synchronized (mSetModeLock) { - synchronized (mDeviceStateLock) { - boolean wasSpeakerphoneActive = isSpeakerphoneActive(); - mPreferredCommunicationDevice = device; - updateActiveCommunicationDevice(); - if (wasSpeakerphoneActive != isSpeakerphoneActive()) { - try { - mContext.sendBroadcastAsUser( - new Intent(AudioManager.ACTION_SPEAKERPHONE_STATE_CHANGED) - .setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), - UserHandle.ALL); - } catch (Exception e) { - Log.w(TAG, "failed to broadcast ACTION_SPEAKERPHONE_STATE_CHANGED: " + e); - } - } - mAudioService.postUpdateRingerModeServiceInt(); - dispatchCommunicationDevice(); + boolean wasSpeakerphoneActive = isSpeakerphoneActive(); + mPreferredCommunicationDevice = device; + updateActiveCommunicationDevice(); + if (wasSpeakerphoneActive != isSpeakerphoneActive()) { + try { + mContext.sendBroadcastAsUser( + new Intent(AudioManager.ACTION_SPEAKERPHONE_STATE_CHANGED) + .setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), + UserHandle.ALL); + } catch (Exception e) { + Log.w(TAG, "failed to broadcast ACTION_SPEAKERPHONE_STATE_CHANGED: " + e); } } + mAudioService.postUpdateRingerModeServiceInt(); + dispatchCommunicationDevice(); } private CommunicationRouteClient removeCommunicationRouteClient( @@ -1915,6 +1963,32 @@ import java.util.concurrent.atomic.AtomicBoolean; return null; } + @GuardedBy("mDeviceStateLock") + private boolean communnicationDeviceCompatOn() { + return mAudioModeOwner.mMode == AudioSystem.MODE_IN_COMMUNICATION + && !(CompatChanges.isChangeEnabled( + USE_SET_COMMUNICATION_DEVICE, mAudioModeOwner.mUid) + || mAudioModeOwner.mUid == android.os.Process.SYSTEM_UID); + } + + @GuardedBy("mDeviceStateLock") + AudioDeviceAttributes getDefaultCommunicationDevice() { + // For system server (Telecom) and APKs targeting S and above, we let the audio + // policy routing rules select the default communication device. + // For older APKs, we force Hearing Aid or LE Audio headset when connected as + // those APKs cannot select a LE Audio or Hearing Aid device explicitly. + AudioDeviceAttributes device = null; + if (communnicationDeviceCompatOn()) { + // If both LE and Hearing Aid are active (thie should not happen), + // priority to Hearing Aid. + device = mDeviceInventory.getDeviceOfType(AudioSystem.DEVICE_OUT_HEARING_AID); + if (device == null) { + device = mDeviceInventory.getDeviceOfType(AudioSystem.DEVICE_OUT_BLE_HEADSET); + } + } + return device; + } + @Nullable UUID getDeviceSensorUuid(AudioDeviceAttributes device) { synchronized (mDeviceStateLock) { return mDeviceInventory.getDeviceSensorUuid(device); diff --git a/services/core/java/com/android/server/audio/AudioDeviceInventory.java b/services/core/java/com/android/server/audio/AudioDeviceInventory.java index c1f496905dba..35da73ef58c0 100644 --- a/services/core/java/com/android/server/audio/AudioDeviceInventory.java +++ b/services/core/java/com/android/server/audio/AudioDeviceInventory.java @@ -294,6 +294,7 @@ public class AudioDeviceInventory { } } + // @GuardedBy("AudioDeviceBroker.mSetModeLock") @GuardedBy("AudioDeviceBroker.mDeviceStateLock") void onSetBtActiveDevice(@NonNull AudioDeviceBroker.BtDeviceInfo btInfo, int streamType) { if (AudioService.DEBUG_DEVICES) { @@ -376,7 +377,8 @@ public class AudioDeviceInventory { makeLeAudioDeviceUnavailable(address, btInfo.mAudioSystemDevice); } else if (switchToAvailable) { makeLeAudioDeviceAvailable(address, BtHelper.getName(btInfo.mDevice), - streamType, btInfo.mVolume, btInfo.mAudioSystemDevice, + streamType, btInfo.mVolume == -1 ? -1 : btInfo.mVolume * 10, + btInfo.mAudioSystemDevice, "onSetBtActiveDevice"); } break; @@ -1526,6 +1528,19 @@ public class AudioDeviceInventory { return di.mSensorUuid; } } + + /* package */ AudioDeviceAttributes getDeviceOfType(int type) { + synchronized (mDevicesLock) { + for (DeviceInfo di : mConnectedDevices.values()) { + if (di.mDeviceType == type) { + return new AudioDeviceAttributes( + di.mDeviceType, di.mDeviceAddress, di.mDeviceName); + } + } + } + return null; + } + //---------------------------------------------------------- // For tests only diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index 56874f74afb1..c69eae3ede76 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -3841,7 +3841,7 @@ public class AudioService extends IAudioService.Stub } } - private void setLeAudioVolumeOnModeUpdate(int mode) { + private void setLeAudioVolumeOnModeUpdate(int mode, int streamType, int device) { switch (mode) { case AudioSystem.MODE_IN_COMMUNICATION: case AudioSystem.MODE_IN_CALL: @@ -3857,8 +3857,6 @@ public class AudioService extends IAudioService.Stub return; } - int streamType = getBluetoothContextualVolumeStream(mode); - // Currently, DEVICE_OUT_BLE_HEADSET is the only output type for LE_AUDIO profile. // (See AudioDeviceBroker#createBtDeviceInfo()) int index = mStreamStates[streamType].getIndex(AudioSystem.DEVICE_OUT_BLE_HEADSET); @@ -3869,6 +3867,7 @@ public class AudioService extends IAudioService.Stub + index + " maxIndex=" + maxIndex + " streamType=" + streamType); } mDeviceBroker.postSetLeAudioVolumeIndex(index, maxIndex, streamType); + mDeviceBroker.postApplyVolumeOnDevice(streamType, device, "setLeAudioVolumeOnModeUpdate"); } private void setStreamVolume(int streamType, int index, int flags, String callingPackage, @@ -5053,16 +5052,17 @@ public class AudioService extends IAudioService.Stub } /** - * Return the pid of the current audio mode owner + * Return information on the current audio mode owner * @return 0 if nobody owns the mode */ @GuardedBy("mDeviceBroker.mSetModeLock") - /*package*/ int getModeOwnerPid() { + /*package*/ AudioDeviceBroker.AudioModeInfo getAudioModeOwner() { SetModeDeathHandler hdlr = getAudioModeOwnerHandler(); if (hdlr != null) { - return hdlr.getPid(); + return new AudioDeviceBroker.AudioModeInfo( + hdlr.getMode(), hdlr.getPid(), hdlr.getUid()); } - return 0; + return new AudioDeviceBroker.AudioModeInfo(AudioSystem.MODE_NORMAL, 0 , 0); } /** @@ -5244,11 +5244,11 @@ public class AudioService extends IAudioService.Stub // Forcefully set LE audio volume as a workaround, since the value of 'device' // is not DEVICE_OUT_BLE_* even when BLE is connected. - setLeAudioVolumeOnModeUpdate(mode); + setLeAudioVolumeOnModeUpdate(mode, streamType, device); // when entering RINGTONE, IN_CALL or IN_COMMUNICATION mode, clear all SCO // connections not started by the application changing the mode when pid changes - mDeviceBroker.postSetModeOwnerPid(pid, mode); + mDeviceBroker.postSetModeOwner(mode, pid, uid); } else { Log.w(TAG, "onUpdateAudioMode: failed to set audio mode to: " + mode); } @@ -5575,7 +5575,10 @@ public class AudioService extends IAudioService.Stub } return deviceIds.stream().mapToInt(Integer::intValue).toArray(); } - /** @see AudioManager#setCommunicationDevice(int) */ + /** + * @see AudioManager#setCommunicationDevice(int) + * @see AudioManager#clearCommunicationDevice() + */ public boolean setCommunicationDevice(IBinder cb, int portId) { final int uid = Binder.getCallingUid(); final int pid = Binder.getCallingPid(); @@ -5590,7 +5593,8 @@ public class AudioService extends IAudioService.Stub throw new IllegalArgumentException("invalid device type " + device.getType()); } } - final String eventSource = new StringBuilder("setCommunicationDevice(") + final String eventSource = new StringBuilder() + .append(device == null ? "clearCommunicationDevice(" : "setCommunicationDevice(") .append(") from u/pid:").append(uid).append("/") .append(pid).toString(); diff --git a/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java b/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java index b3e7e31d37fc..93841fe288e1 100644 --- a/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java +++ b/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java @@ -49,6 +49,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.concurrent.ConcurrentLinkedQueue; import java.util.function.Consumer; /** @@ -104,11 +105,7 @@ public final class PlaybackActivityMonitor private static final VolumeShaper.Operation PLAY_SKIP_RAMP = new VolumeShaper.Operation.Builder(PLAY_CREATE_IF_NEEDED).setXOffset(1.0f).build(); - private final ArrayList<PlayMonitorClient> mClients = new ArrayList<PlayMonitorClient>(); - // a public client is one that needs an anonymized version of the playback configurations, we - // keep track of whether there is at least one to know when we need to create the list of - // playback configurations that do not contain uid/pid/package name information. - private boolean mHasPublicClients = false; + private final ConcurrentLinkedQueue<PlayMonitorClient> mClients = new ConcurrentLinkedQueue<>(); private final Object mPlayerLock = new Object(); @GuardedBy("mPlayerLock") @@ -458,11 +455,9 @@ public final class PlaybackActivityMonitor + DateFormat.getTimeInstance().format(new Date())); synchronized(mPlayerLock) { pw.println("\n playback listeners:"); - synchronized(mClients) { - for (PlayMonitorClient pmc : mClients) { - pw.print(" " + (pmc.mIsPrivileged ? "(S)" : "(P)") - + pmc.toString()); - } + for (PlayMonitorClient pmc : mClients) { + pw.print(" " + (pmc.isPrivileged() ? "(S)" : "(P)") + + pmc.toString()); } pw.println("\n"); // all players @@ -534,48 +529,33 @@ public final class PlaybackActivityMonitor * @param iplayerReleased indicates if the change was due to a player being released */ private void dispatchPlaybackChange(boolean iplayerReleased) { - synchronized (mClients) { - // typical use case, nobody is listening, don't do any work - if (mClients.isEmpty()) { - return; - } - } if (DEBUG) { Log.v(TAG, "dispatchPlaybackChange to " + mClients.size() + " clients"); } final List<AudioPlaybackConfiguration> configsSystem; - // list of playback configurations for "public consumption". It is only computed if there + // list of playback configurations for "public consumption". It is computed lazy if there // are non-system playback activity listeners. - final List<AudioPlaybackConfiguration> configsPublic; + List<AudioPlaybackConfiguration> configsPublic = null; synchronized (mPlayerLock) { if (mPlayers.isEmpty()) { return; } - configsSystem = new ArrayList<AudioPlaybackConfiguration>(mPlayers.values()); + configsSystem = new ArrayList<>(mPlayers.values()); } - synchronized (mClients) { - // was done at beginning of method, but could have changed - if (mClients.isEmpty()) { - return; - } - configsPublic = mHasPublicClients ? anonymizeForPublicConsumption(configsSystem) : null; - final Iterator<PlayMonitorClient> clientIterator = mClients.iterator(); - while (clientIterator.hasNext()) { - final PlayMonitorClient pmc = clientIterator.next(); - try { - // do not spam the logs if there are problems communicating with this client - if (pmc.mErrorCount < PlayMonitorClient.MAX_ERRORS) { - if (pmc.mIsPrivileged) { - pmc.mDispatcherCb.dispatchPlaybackConfigChange(configsSystem, - iplayerReleased); - } else { - // non-system clients don't have the control interface IPlayer, so - // they don't need to flush commands when a player was released - pmc.mDispatcherCb.dispatchPlaybackConfigChange(configsPublic, false); - } + + final Iterator<PlayMonitorClient> clientIterator = mClients.iterator(); + while (clientIterator.hasNext()) { + final PlayMonitorClient pmc = clientIterator.next(); + // do not spam the logs if there are problems communicating with this client + if (!pmc.reachedMaxErrorCount()) { + if (pmc.isPrivileged()) { + pmc.dispatchPlaybackConfigChange(configsSystem, + iplayerReleased); + } else { + if (configsPublic == null) { + configsPublic = anonymizeForPublicConsumption(configsSystem); } - } catch (RemoteException e) { - pmc.mErrorCount++; - Log.e(TAG, "Error (" + pmc.mErrorCount + - ") trying to dispatch playback config change to " + pmc, e); + // non-system clients don't have the control interface IPlayer, so + // they don't need to flush commands when a player was released + pmc.dispatchPlaybackConfigChange(configsPublic, false); } } } @@ -798,14 +778,9 @@ public final class PlaybackActivityMonitor if (pcdb == null) { return; } - synchronized(mClients) { - final PlayMonitorClient pmc = new PlayMonitorClient(pcdb, isPrivileged); - if (pmc.init()) { - if (!isPrivileged) { - mHasPublicClients = true; - } - mClients.add(pmc); - } + final PlayMonitorClient pmc = new PlayMonitorClient(pcdb, isPrivileged); + if (pmc.init()) { + mClients.add(pmc); } } @@ -813,23 +788,14 @@ public final class PlaybackActivityMonitor if (pcdb == null) { return; } - synchronized(mClients) { - final Iterator<PlayMonitorClient> clientIterator = mClients.iterator(); - boolean hasPublicClients = false; - // iterate over the clients to remove the dispatcher to remove, and reevaluate at - // the same time if we still have a public client. - while (clientIterator.hasNext()) { - PlayMonitorClient pmc = clientIterator.next(); - if (pcdb.asBinder().equals(pmc.mDispatcherCb.asBinder())) { - pmc.release(); - clientIterator.remove(); - } else { - if (!pmc.mIsPrivileged) { - hasPublicClients = true; - } - } + final Iterator<PlayMonitorClient> clientIterator = mClients.iterator(); + // iterate over the clients to remove the dispatcher + while (clientIterator.hasNext()) { + PlayMonitorClient pmc = clientIterator.next(); + if (pmc.equalsDispatcher(pcdb)) { + pmc.release(); + clientIterator.remove(); } - mHasPublicClients = hasPublicClients; } } @@ -857,24 +823,34 @@ public final class PlaybackActivityMonitor // can afford to be static because only one PlaybackActivityMonitor ever instantiated static PlaybackActivityMonitor sListenerDeathMonitor; - final IPlaybackConfigDispatcher mDispatcherCb; - final boolean mIsPrivileged; - - int mErrorCount = 0; // number of errors after which we don't update this client anymore to not spam the logs - static final int MAX_ERRORS = 5; + private static final int MAX_ERRORS = 5; + + private final IPlaybackConfigDispatcher mDispatcherCb; + + @GuardedBy("this") + private final boolean mIsPrivileged; + @GuardedBy("this") + private boolean mIsReleased = false; + @GuardedBy("this") + private int mErrorCount = 0; PlayMonitorClient(IPlaybackConfigDispatcher pcdb, boolean isPrivileged) { mDispatcherCb = pcdb; mIsPrivileged = isPrivileged; } + @Override public void binderDied() { Log.w(TAG, "client died"); sListenerDeathMonitor.unregisterPlaybackCallback(mDispatcherCb); } - boolean init() { + synchronized boolean init() { + if (mIsReleased) { + // Do not init after release + return false; + } try { mDispatcherCb.asBinder().linkToDeath(this, 0); return true; @@ -884,8 +860,43 @@ public final class PlaybackActivityMonitor } } - void release() { + synchronized void release() { mDispatcherCb.asBinder().unlinkToDeath(this, 0); + mIsReleased = true; + } + + void dispatchPlaybackConfigChange(List<AudioPlaybackConfiguration> configs, + boolean flush) { + synchronized (this) { + if (mIsReleased) { + // Do not dispatch anything after release + return; + } + } + try { + mDispatcherCb.dispatchPlaybackConfigChange(configs, flush); + } catch (RemoteException e) { + synchronized (this) { + mErrorCount++; + Log.e(TAG, "Error (" + mErrorCount + + ") trying to dispatch playback config change to " + this, e); + } + } + } + + synchronized boolean isPrivileged() { + return mIsPrivileged; + } + + synchronized boolean reachedMaxErrorCount() { + return mErrorCount >= MAX_ERRORS; + } + + synchronized boolean equalsDispatcher(IPlaybackConfigDispatcher pcdb) { + if (pcdb == null) { + return false; + } + return pcdb.asBinder().equals(mDispatcherCb.asBinder()); } } diff --git a/services/core/java/com/android/server/locksettings/OWNERS b/services/core/java/com/android/server/locksettings/OWNERS index 7577ee5c9fde..55b0cffb32df 100644 --- a/services/core/java/com/android/server/locksettings/OWNERS +++ b/services/core/java/com/android/server/locksettings/OWNERS @@ -1,4 +1,3 @@ +ebiggers@google.com jaggies@google.com -kchyn@google.com rubinxu@google.com -xunchang@google.com diff --git a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java index 1eb74facb840..46691a61930e 100644 --- a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java +++ b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java @@ -314,6 +314,8 @@ class PackageManagerShellCommand extends ShellCommand { return runRemoveUser(); case "set-user-restriction": return runSetUserRestriction(); + case "supports-multiple-users": + return runSupportsMultipleUsers(); case "get-max-users": return runGetMaxUsers(); case "get-max-running-users": @@ -3014,6 +3016,12 @@ class PackageManagerShellCommand extends ShellCommand { return 0; } + public int runSupportsMultipleUsers() { + getOutPrintWriter().println("Is multiuser supported: " + + UserManager.supportsMultipleUsers()); + return 0; + } + public int runGetMaxUsers() { getOutPrintWriter().println("Maximum supported users: " + UserManager.getMaxSupportedUsers()); diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java index d0b058b4c8f2..e197319707e3 100644 --- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java @@ -1337,6 +1337,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } FgThread.getHandler().removeCallbacks(mResetRunnable); mContext.getMainThreadHandler().removeCallbacks(mTryToRebindRunnable); + mContext.getMainThreadHandler().removeCallbacks(mDisconnectRunnable); } } } diff --git a/services/core/jni/com_android_server_companion_virtual_InputController.cpp b/services/core/jni/com_android_server_companion_virtual_InputController.cpp index 8197b67355d4..daca1531d41f 100644 --- a/services/core/jni/com_android_server_companion_virtual_InputController.cpp +++ b/services/core/jni/com_android_server_companion_virtual_InputController.cpp @@ -21,6 +21,7 @@ #include <android/keycodes.h> #include <errno.h> #include <fcntl.h> +#include <input/Input.h> #include <linux/uinput.h> #include <math.h> #include <nativehelper/JNIHelp.h> @@ -271,6 +272,14 @@ static int openUinput(const char* readableName, jint vendorId, jint productId, c ALOGE("Error creating touchscreen uinput pressure axis: %s", strerror(errno)); return -errno; } + uinput_abs_setup slotAbsSetup; + slotAbsSetup.code = ABS_MT_SLOT; + slotAbsSetup.absinfo.maximum = MAX_POINTERS; + slotAbsSetup.absinfo.minimum = 0; + if (ioctl(fd, UI_ABS_SETUP, &slotAbsSetup) != 0) { + ALOGE("Error creating touchscreen uinput slots: %s", strerror(errno)); + return -errno; + } } if (ioctl(fd, UI_DEV_SETUP, &setup) != 0) { ALOGE("Error creating uinput device: %s", strerror(errno)); diff --git a/services/incremental/test/IncrementalServiceTest.cpp b/services/incremental/test/IncrementalServiceTest.cpp index 59d96d2393ef..d9d3d62e92e2 100644 --- a/services/incremental/test/IncrementalServiceTest.cpp +++ b/services/incremental/test/IncrementalServiceTest.cpp @@ -474,8 +474,8 @@ public: m.mutable_loader()->set_package_name("com.test"); m.mutable_loader()->set_arguments("com.uri"); const auto metadata = m.SerializeAsString(); - m.mutable_loader()->release_arguments(); - m.mutable_loader()->release_package_name(); + static_cast<void>(m.mutable_loader()->release_arguments()); + static_cast<void>(m.mutable_loader()->release_package_name()); return {metadata.begin(), metadata.end()}; } RawMetadata getStorageMetadata(const Control& control, std::string_view path) { @@ -492,8 +492,8 @@ public: bp.set_allocated_dest_path(&destPath); bp.set_allocated_source_subdir(&srcPath); const auto metadata = bp.SerializeAsString(); - bp.release_source_subdir(); - bp.release_dest_path(); + static_cast<void>(bp.release_source_subdir()); + static_cast<void>(bp.release_dest_path()); return std::vector<char>(metadata.begin(), metadata.end()); } }; diff --git a/tests/Codegen/Android.bp b/tests/Codegen/Android.bp index ddbf16817b94..7fbe3b37f99e 100644 --- a/tests/Codegen/Android.bp +++ b/tests/Codegen/Android.bp @@ -24,6 +24,14 @@ android_test { plugins: [ "staledataclass-annotation-processor", ], + // Exports needed for staledataclass-annotation-processor, see b/139342589. + javacflags: [ + "-J--add-modules=jdk.compiler", + "-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", + "-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", + "-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", + "-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + ], static_libs: [ "junit", "hamcrest", diff --git a/tests/HandwritingIme/OWNERS b/tests/HandwritingIme/OWNERS new file mode 100644 index 000000000000..6bb4b17ed4eb --- /dev/null +++ b/tests/HandwritingIme/OWNERS @@ -0,0 +1,3 @@ +# Bug component: 34867 + +include /services/core/java/com/android/server/inputmethod/OWNERS diff --git a/tests/RollbackTest/Android.bp b/tests/RollbackTest/Android.bp index b7c4c5b28168..f2234fb64108 100644 --- a/tests/RollbackTest/Android.bp +++ b/tests/RollbackTest/Android.bp @@ -51,6 +51,7 @@ java_test_host { data: [ ":com.android.apex.apkrollback.test_v1", ":test.rebootless_apex_v1", + ":RollbackTest", ], } diff --git a/tools/lint/OWNERS b/tools/lint/OWNERS index 2c526a1e239e..33e237d306fc 100644 --- a/tools/lint/OWNERS +++ b/tools/lint/OWNERS @@ -4,3 +4,6 @@ jsharkey@google.com per-file *CallingSettingsNonUserGetterMethods* = file:/packages/SettingsProvider/OWNERS per-file *RegisterReceiverFlagDetector* = jacobhobbie@google.com +# Android lint in the Android platform maintainers +colefaust@google.com +farivar@google.com diff --git a/tools/processors/staledataclass/Android.bp b/tools/processors/staledataclass/Android.bp index 1e5097662a0a..2169c49a91a5 100644 --- a/tools/processors/staledataclass/Android.bp +++ b/tools/processors/staledataclass/Android.bp @@ -22,17 +22,13 @@ java_plugin { static_libs: [ "codegen-version-info", ], - // The --add-modules/exports flags below don't work for kotlinc yet, so pin this module to Java language level 8 (see b/139342589): - java_version: "1.8", - openjdk9: { - javacflags: [ - "--add-modules=jdk.compiler", - "--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", - "--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", - "--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", - "--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", - ], - }, + javacflags: [ + "--add-modules=jdk.compiler", + "--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", + "--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", + "--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", + "--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + ], use_tools_jar: true, } diff --git a/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt b/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt index 27a8853a2219..1cef5b0c8dfb 100644 --- a/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt +++ b/tools/processors/staledataclass/src/android/processor/staledataclass/StaleDataclassProcessor.kt @@ -14,6 +14,7 @@ * limitations under the License. */ +@file:Suppress("JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE") package android.processor.staledataclass |