Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eee99986 authored by Jiyong Park's avatar Jiyong Park
Browse files

Create the stubs lib for com.android.location.provider

com.android.location.provider.stubs is the stubs library for the shared
library com.android.location.provider. The stubs library is intended to
provide the stable set of APIs to the apps implementing location
provider.

Without the stubs library, apps had to directly link to the shared
library which is built without Android SDK and exposes private APIs that
are not intended to be used by apps. This also has been causing the
lin-type check warnings when the shared lib is used by apps built with
SDK; apps built with SDK is not allowed to link to lib built without
SDK. This has been reported as warnings but will soon be errors. Now
such apps are required to link to the stubs lib, which is built with
SDK.

While building the stubs library, following APIs are made hidden because
they are exposing private APIs from the Android platform.

1) Activity* classes are removed from the API, as they are not intended
to be used by apps since O.
2) GeocodeProvider and GeofenceProvider are removed from the API.
3) LocationProvider.mLocationManager is removed as it is exposing the
private symbol ILocationProvider
4) ProviderPropertiesUnbundle.getProviderProperties are removed from the
API as it is exposing the private symbol ProviderProperties.
5) The constructor of ProviderRequestUnbundled is removed since the
class is intended to be instantiated by the service.

Bug: 71420593
Test: m -j com.android.location.provider.stubs

Change-Id: I20aba7e9ca9c3adc75db241f37a55f0d657f3ced
parent 790befca
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -42,3 +42,25 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)

include $(BUILD_PREBUILT)

# ==== Stub library  ===========================================
include $(CLEAR_VARS)
LOCAL_MODULE := com.android.location.provider-stubs-gen
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_SRC_FILES := $(call all-java-files-under,java)
LOCAL_DROIDDOC_STUB_OUT_DIR := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/com.android.location.provider.stubs_intermediates/src
LOCAL_DROIDDOC_OPTIONS:= \
    -hide 111 -hide 113 -hide 125 -hide 126 -hide 127 -hide 128 \
    -stubpackages com.android.location.provider \
    -nodocs
LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_DROIDDOC)
com_android_nfc_extras_gen_stamp := $(full_target)

include $(CLEAR_VARS)
LOCAL_MODULE := com.android.location.provider.stubs
LOCAL_SOURCE_FILES_ALL_GENERATED := true
LOCAL_SDK_VERSION := current
LOCAL_ADDITIONAL_DEPENDENCIES := $(com_android_nfc_extras_gen_stamp)
com_android_nfc_extras_gen_stamp :=
include $(BUILD_STATIC_JAVA_LIBRARY)
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import java.util.List;

/**
 * A class representing an event for Activity changes.
 * @hide
 */
public class ActivityChangedEvent {
    private final List<ActivityRecognitionEvent> mActivityRecognitionEvents;
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.location.provider;

/**
 * A class that represents an Activity Recognition Event.
 * @hide
 */
public class ActivityRecognitionEvent {
    private final String mActivity;
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import java.util.HashSet;

/**
 * A class that exposes {@link IActivityRecognitionHardware} functionality to unbundled services.
 * @hide
 */
public final class ActivityRecognitionProvider {
    private final IActivityRecognitionHardware mService;
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.util.Log;

/**
 * A client class for interaction with an Activity-Recognition provider.
 * @hide
 */
public abstract class ActivityRecognitionProviderClient {
    private static final String TAG = "ArProviderClient";
Loading