Loading Android.bp +31 −0 Original line number Diff line number Diff line Loading @@ -319,6 +319,7 @@ java_defaults { "core/java/android/service/vr/IVrManager.aidl", "core/java/android/service/vr/IVrStateCallbacks.aidl", "core/java/android/service/watchdog/IExplicitHealthCheckService.aidl", "core/java/android/service/watchdog/PackageInfo.aidl", "core/java/android/print/ILayoutResultCallback.aidl", "core/java/android/print/IPrinterDiscoveryObserver.aidl", "core/java/android/print/IPrintDocumentAdapter.aidl", Loading Loading @@ -436,6 +437,7 @@ java_defaults { "core/java/com/android/internal/os/IShellCallback.aidl", "core/java/com/android/internal/statusbar/IStatusBar.aidl", "core/java/com/android/internal/statusbar/IStatusBarService.aidl", "core/java/com/android/internal/statusbar/RegisterStatusBarResult.aidl", "core/java/com/android/internal/textservice/ISpellCheckerService.aidl", "core/java/com/android/internal/textservice/ISpellCheckerServiceCallback.aidl", "core/java/com/android/internal/textservice/ISpellCheckerSession.aidl", Loading Loading @@ -1048,6 +1050,35 @@ cc_library { }, } // This library is meant for vendor code that needs to output protobuf. It links // against the static version of libprotobuf-cpp-lite, for which we can not guarantee // binary compatibility. cc_library { name: "libplatformprotos-static", defaults: ["libplatformprotos-defaults"], host_supported: false, // This is okay because this library is only built as a static library. The C++ // API is not guaranteed. The proto API is guaranteed to be stable via Metrics Council, // but is not authorized to be used outside of debugging. vendor_available: true, target: { android: { proto: { type: "lite", }, static_libs: [ "libprotobuf-cpp-lite", ], shared: { enabled: false, }, }, }, } // This is the full proto version of libplatformprotos. It may only // be used by test code that is not shipped on the device. cc_library { Loading apct-tests/perftests/textclassifier/run.sh +6 −2 Original line number Diff line number Diff line set -e make TextClassifierPerfTests make TextClassifierPerfTests perf-setup.sh adb install ${OUT}/testcases/TextClassifierPerfTests/arm64/TextClassifierPerfTests.apk adb shell cmd package compile -m speed -f com.android.perftests.textclassifier adb shell am instrument -w -e class android.view.textclassifier.TextClassifierPerfTest com.android.perftests.textclassifier/androidx.test.runner.AndroidJUnitRunner adb push ${OUT}/obj/EXECUTABLES/perf-setup.sh_intermediates/perf-setup.sh /data/local/tmp/ adb shell chmod +x /data/local/tmp/perf-setup.sh adb shell /data/local/tmp/perf-setup.sh adb shell am instrument -w -e package android.view.textclassifier com.android.perftests.textclassifier/androidx.test.runner.AndroidJUnitRunner No newline at end of file apct-tests/perftests/textclassifier/src/android/view/textclassifier/TextClassificationManagerPerfTest.java 0 → 100644 +74 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 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.view.textclassifier; import android.content.Context; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; import android.perftests.utils.SettingsHelper; import android.provider.Settings; import androidx.test.InstrumentationRegistry; import androidx.test.filters.LargeTest; import org.junit.After; import org.junit.Rule; import org.junit.Test; @LargeTest public class TextClassificationManagerPerfTest { @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter(); @After public void tearDown() { SettingsHelper.delete( SettingsHelper.NAMESPACE_GLOBAL, Settings.Global.TEXT_CLASSIFIER_CONSTANTS); } @Test public void testGetTextClassifier_systemTextClassifierDisabled() { Context context = InstrumentationRegistry.getTargetContext(); SettingsHelper.set( SettingsHelper.NAMESPACE_GLOBAL, Settings.Global.TEXT_CLASSIFIER_CONSTANTS, "system_textclassifier_enabled=false"); TextClassificationManager textClassificationManager = context.getSystemService(TextClassificationManager.class); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { textClassificationManager.getTextClassifier(); textClassificationManager.invalidate(); } } @Test public void testGetTextClassifier_systemTextClassifierEnabled() { Context context = InstrumentationRegistry.getTargetContext(); SettingsHelper.set( SettingsHelper.NAMESPACE_GLOBAL, Settings.Global.TEXT_CLASSIFIER_CONSTANTS, "system_textclassifier_enabled=true"); TextClassificationManager textClassificationManager = context.getSystemService(TextClassificationManager.class); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { textClassificationManager.getTextClassifier(); textClassificationManager.invalidate(); } } } apct-tests/perftests/utils/src/android/perftests/utils/SettingsHelper.java +3 −3 Original line number Diff line number Diff line Loading @@ -18,19 +18,19 @@ package android.perftests.utils; import android.content.Context; import android.provider.Settings; import android.text.TextUtils; import java.util.Objects; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Objects; /** * Provides utilities to interact with the device's {@link Settings}. */ public final class SettingsHelper { public static final String NAMESPACE_SECURE = "secure"; public static final String NAMESPACE_GLOBAL = "global"; private static int DEFAULT_TIMEOUT_MS = 5000; Loading api/current.txt +4 −6 Original line number Diff line number Diff line Loading @@ -7443,9 +7443,7 @@ package android.app.role { field public static final String ROLE_CALL_SCREENING = "android.app.role.CALL_SCREENING"; field public static final String ROLE_DIALER = "android.app.role.DIALER"; field public static final String ROLE_EMERGENCY = "android.app.role.EMERGENCY"; field public static final String ROLE_GALLERY = "android.app.role.GALLERY"; field public static final String ROLE_HOME = "android.app.role.HOME"; field public static final String ROLE_MUSIC = "android.app.role.MUSIC"; field public static final String ROLE_SMS = "android.app.role.SMS"; } Loading Loading @@ -11607,7 +11605,7 @@ package android.content.pm { method @NonNull public abstract java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceivers(@NonNull android.content.Intent, int); method @NonNull public abstract java.util.List<android.content.pm.ProviderInfo> queryContentProviders(@Nullable String, int, int); method @NonNull public abstract java.util.List<android.content.pm.InstrumentationInfo> queryInstrumentation(@NonNull String, int); method @Nullable public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentActivities(@NonNull android.content.Intent, int); method @NonNull public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentActivities(@NonNull android.content.Intent, int); method @NonNull public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentActivityOptions(@Nullable android.content.ComponentName, @Nullable android.content.Intent[], @NonNull android.content.Intent, int); method @NonNull public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentContentProviders(@NonNull android.content.Intent, int); method @NonNull public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentServices(@NonNull android.content.Intent, int); Loading Loading @@ -22661,7 +22659,7 @@ package android.location { method public double getDriftNanosPerSecond(); method @FloatRange(from=0.0f) public double getDriftUncertaintyNanosPerSecond(); method public long getElapsedRealtimeNanos(); method @IntRange(from=0) public long getElapsedRealtimeUncertaintyNanos(); method @FloatRange(from=0.0f) public double getElapsedRealtimeUncertaintyNanos(); method public long getFullBiasNanos(); method public int getHardwareClockDiscontinuityCount(); method public int getLeapSecond(); Loading Loading @@ -22865,7 +22863,7 @@ package android.location { method public float getBearing(); method public float getBearingAccuracyDegrees(); method public long getElapsedRealtimeNanos(); method public long getElapsedRealtimeUncertaintyNanos(); method public double getElapsedRealtimeUncertaintyNanos(); method public android.os.Bundle getExtras(); method public double getLatitude(); method public double getLongitude(); Loading Loading @@ -22894,7 +22892,7 @@ package android.location { method public void setBearing(float); method public void setBearingAccuracyDegrees(float); method public void setElapsedRealtimeNanos(long); method public void setElapsedRealtimeUncertaintyNanos(long); method public void setElapsedRealtimeUncertaintyNanos(double); method public void setExtras(android.os.Bundle); method public void setLatitude(double); method public void setLongitude(double); Loading
Android.bp +31 −0 Original line number Diff line number Diff line Loading @@ -319,6 +319,7 @@ java_defaults { "core/java/android/service/vr/IVrManager.aidl", "core/java/android/service/vr/IVrStateCallbacks.aidl", "core/java/android/service/watchdog/IExplicitHealthCheckService.aidl", "core/java/android/service/watchdog/PackageInfo.aidl", "core/java/android/print/ILayoutResultCallback.aidl", "core/java/android/print/IPrinterDiscoveryObserver.aidl", "core/java/android/print/IPrintDocumentAdapter.aidl", Loading Loading @@ -436,6 +437,7 @@ java_defaults { "core/java/com/android/internal/os/IShellCallback.aidl", "core/java/com/android/internal/statusbar/IStatusBar.aidl", "core/java/com/android/internal/statusbar/IStatusBarService.aidl", "core/java/com/android/internal/statusbar/RegisterStatusBarResult.aidl", "core/java/com/android/internal/textservice/ISpellCheckerService.aidl", "core/java/com/android/internal/textservice/ISpellCheckerServiceCallback.aidl", "core/java/com/android/internal/textservice/ISpellCheckerSession.aidl", Loading Loading @@ -1048,6 +1050,35 @@ cc_library { }, } // This library is meant for vendor code that needs to output protobuf. It links // against the static version of libprotobuf-cpp-lite, for which we can not guarantee // binary compatibility. cc_library { name: "libplatformprotos-static", defaults: ["libplatformprotos-defaults"], host_supported: false, // This is okay because this library is only built as a static library. The C++ // API is not guaranteed. The proto API is guaranteed to be stable via Metrics Council, // but is not authorized to be used outside of debugging. vendor_available: true, target: { android: { proto: { type: "lite", }, static_libs: [ "libprotobuf-cpp-lite", ], shared: { enabled: false, }, }, }, } // This is the full proto version of libplatformprotos. It may only // be used by test code that is not shipped on the device. cc_library { Loading
apct-tests/perftests/textclassifier/run.sh +6 −2 Original line number Diff line number Diff line set -e make TextClassifierPerfTests make TextClassifierPerfTests perf-setup.sh adb install ${OUT}/testcases/TextClassifierPerfTests/arm64/TextClassifierPerfTests.apk adb shell cmd package compile -m speed -f com.android.perftests.textclassifier adb shell am instrument -w -e class android.view.textclassifier.TextClassifierPerfTest com.android.perftests.textclassifier/androidx.test.runner.AndroidJUnitRunner adb push ${OUT}/obj/EXECUTABLES/perf-setup.sh_intermediates/perf-setup.sh /data/local/tmp/ adb shell chmod +x /data/local/tmp/perf-setup.sh adb shell /data/local/tmp/perf-setup.sh adb shell am instrument -w -e package android.view.textclassifier com.android.perftests.textclassifier/androidx.test.runner.AndroidJUnitRunner No newline at end of file
apct-tests/perftests/textclassifier/src/android/view/textclassifier/TextClassificationManagerPerfTest.java 0 → 100644 +74 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 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.view.textclassifier; import android.content.Context; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; import android.perftests.utils.SettingsHelper; import android.provider.Settings; import androidx.test.InstrumentationRegistry; import androidx.test.filters.LargeTest; import org.junit.After; import org.junit.Rule; import org.junit.Test; @LargeTest public class TextClassificationManagerPerfTest { @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter(); @After public void tearDown() { SettingsHelper.delete( SettingsHelper.NAMESPACE_GLOBAL, Settings.Global.TEXT_CLASSIFIER_CONSTANTS); } @Test public void testGetTextClassifier_systemTextClassifierDisabled() { Context context = InstrumentationRegistry.getTargetContext(); SettingsHelper.set( SettingsHelper.NAMESPACE_GLOBAL, Settings.Global.TEXT_CLASSIFIER_CONSTANTS, "system_textclassifier_enabled=false"); TextClassificationManager textClassificationManager = context.getSystemService(TextClassificationManager.class); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { textClassificationManager.getTextClassifier(); textClassificationManager.invalidate(); } } @Test public void testGetTextClassifier_systemTextClassifierEnabled() { Context context = InstrumentationRegistry.getTargetContext(); SettingsHelper.set( SettingsHelper.NAMESPACE_GLOBAL, Settings.Global.TEXT_CLASSIFIER_CONSTANTS, "system_textclassifier_enabled=true"); TextClassificationManager textClassificationManager = context.getSystemService(TextClassificationManager.class); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { textClassificationManager.getTextClassifier(); textClassificationManager.invalidate(); } } }
apct-tests/perftests/utils/src/android/perftests/utils/SettingsHelper.java +3 −3 Original line number Diff line number Diff line Loading @@ -18,19 +18,19 @@ package android.perftests.utils; import android.content.Context; import android.provider.Settings; import android.text.TextUtils; import java.util.Objects; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Objects; /** * Provides utilities to interact with the device's {@link Settings}. */ public final class SettingsHelper { public static final String NAMESPACE_SECURE = "secure"; public static final String NAMESPACE_GLOBAL = "global"; private static int DEFAULT_TIMEOUT_MS = 5000; Loading
api/current.txt +4 −6 Original line number Diff line number Diff line Loading @@ -7443,9 +7443,7 @@ package android.app.role { field public static final String ROLE_CALL_SCREENING = "android.app.role.CALL_SCREENING"; field public static final String ROLE_DIALER = "android.app.role.DIALER"; field public static final String ROLE_EMERGENCY = "android.app.role.EMERGENCY"; field public static final String ROLE_GALLERY = "android.app.role.GALLERY"; field public static final String ROLE_HOME = "android.app.role.HOME"; field public static final String ROLE_MUSIC = "android.app.role.MUSIC"; field public static final String ROLE_SMS = "android.app.role.SMS"; } Loading Loading @@ -11607,7 +11605,7 @@ package android.content.pm { method @NonNull public abstract java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceivers(@NonNull android.content.Intent, int); method @NonNull public abstract java.util.List<android.content.pm.ProviderInfo> queryContentProviders(@Nullable String, int, int); method @NonNull public abstract java.util.List<android.content.pm.InstrumentationInfo> queryInstrumentation(@NonNull String, int); method @Nullable public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentActivities(@NonNull android.content.Intent, int); method @NonNull public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentActivities(@NonNull android.content.Intent, int); method @NonNull public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentActivityOptions(@Nullable android.content.ComponentName, @Nullable android.content.Intent[], @NonNull android.content.Intent, int); method @NonNull public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentContentProviders(@NonNull android.content.Intent, int); method @NonNull public abstract java.util.List<android.content.pm.ResolveInfo> queryIntentServices(@NonNull android.content.Intent, int); Loading Loading @@ -22661,7 +22659,7 @@ package android.location { method public double getDriftNanosPerSecond(); method @FloatRange(from=0.0f) public double getDriftUncertaintyNanosPerSecond(); method public long getElapsedRealtimeNanos(); method @IntRange(from=0) public long getElapsedRealtimeUncertaintyNanos(); method @FloatRange(from=0.0f) public double getElapsedRealtimeUncertaintyNanos(); method public long getFullBiasNanos(); method public int getHardwareClockDiscontinuityCount(); method public int getLeapSecond(); Loading Loading @@ -22865,7 +22863,7 @@ package android.location { method public float getBearing(); method public float getBearingAccuracyDegrees(); method public long getElapsedRealtimeNanos(); method public long getElapsedRealtimeUncertaintyNanos(); method public double getElapsedRealtimeUncertaintyNanos(); method public android.os.Bundle getExtras(); method public double getLatitude(); method public double getLongitude(); Loading Loading @@ -22894,7 +22892,7 @@ package android.location { method public void setBearing(float); method public void setBearingAccuracyDegrees(float); method public void setElapsedRealtimeNanos(long); method public void setElapsedRealtimeUncertaintyNanos(long); method public void setElapsedRealtimeUncertaintyNanos(double); method public void setExtras(android.os.Bundle); method public void setLatitude(double); method public void setLongitude(double);