use of android.content.LocusId in project robolectric by robolectric.
the class ShadowContentCaptureManagerTest method getContentCaptureConditions_withContentCaptureConditions.
@Test
public void getContentCaptureConditions_withContentCaptureConditions() {
Set<ContentCaptureCondition> contentCaptureConditions = new HashSet<>();
contentCaptureConditions.add(new ContentCaptureCondition(new LocusId("fake locusId"), 0));
instance.setContentCaptureConditions(contentCaptureConditions);
assertThat(instance.getContentCaptureConditions()).isEqualTo(contentCaptureConditions);
}
use of android.content.LocusId in project android_packages_apps_404Launcher by P-404.
the class RecentsView method updateLocusId.
/**
* Update the current activity locus id to show the enabled state of Overview
*/
public void updateLocusId() {
String locusId = "Overview";
if (mOverviewStateEnabled && mActivity.isStarted()) {
locusId += "|ENABLED";
} else {
locusId += "|DISABLED";
}
final LocusId id = new LocusId(locusId);
// Set locus context is a binder call, don't want it to happen during a transition
UI_HELPER_EXECUTOR.post(() -> mActivity.setLocusContext(id, Bundle.EMPTY));
}
use of android.content.LocusId in project android_packages_apps_Launcher3 by crdroidandroid.
the class RecentsView method updateLocusId.
/**
* Update the current activity locus id to show the enabled state of Overview
*/
public void updateLocusId() {
String locusId = "Overview";
if (mOverviewStateEnabled && mActivity.isStarted()) {
locusId += "|ENABLED";
} else {
locusId += "|DISABLED";
}
final LocusId id = new LocusId(locusId);
// Set locus context is a binder call, don't want it to happen during a transition
UI_HELPER_EXECUTOR.post(() -> mActivity.setLocusContext(id, Bundle.EMPTY));
}
use of android.content.LocusId in project security-certification-resources by android.
the class MainActivity method setupLocusTest.
/**
* Sets up the device for the ACCESS_LOCUS_ID_USAGE_STATS test.
*
* <p>The ACCESS_LOCUS_ID_USAGE_STATS permission allows an app to query for locus events
* created by other apps. This method generates a locus event to ensure there is an event
* on the device for which the permission test can query. For additional details about locus
* events see <a href="https://developer.android.com/reference/android/content/LocusId">
* LocusId</a>.
*/
private void setupLocusTest() {
// permission was introduced in Android 11.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
LocusId locusId = new LocusId("ACCESS_LOCUS_ID_USAGE_STATS_test");
setLocusContext(locusId, null);
}
}
use of android.content.LocusId in project android_packages_apps_Launcher3 by ArrowOS.
the class RecentsView method updateLocusId.
/**
* Update the current activity locus id to show the enabled state of Overview
*/
public void updateLocusId() {
String locusId = "Overview";
if (mOverviewStateEnabled && mActivity.isStarted()) {
locusId += "|ENABLED";
} else {
locusId += "|DISABLED";
}
final LocusId id = new LocusId(locusId);
// Set locus context is a binder call, don't want it to happen during a transition
UI_HELPER_EXECUTOR.post(() -> mActivity.setLocusContext(id, Bundle.EMPTY));
}
Aggregations