diff options
author | Julian Kast <julian@livio.com> | 2020-09-01 14:09:30 -0400 |
---|---|---|
committer | Julian Kast <julian@livio.com> | 2020-09-01 14:09:30 -0400 |
commit | 44a65e4a412d8c983cef0dafbb4701a489692ab1 (patch) | |
tree | dfc765448be2edec501aa2b995bf22f0013fbee3 | |
parent | 8548de0830155c981add487e9bd9f6b020110a2c (diff) | |
download | sdl_android-44a65e4a412d8c983cef0dafbb4701a489692ab1.tar.gz |
Add @RestrictTo(RestrictTo.Scope.LIBRARY)
All subManager of screenManager, BaseSubManager, lockScreenManager. Parts of ScreenManager, FileManager, PermissionManager and Video and Audio stream managers
16 files changed, 42 insertions, 0 deletions
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java index 38bc357b6..fdf21b127 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java @@ -40,6 +40,7 @@ import android.os.Handler; import android.os.Looper;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
import com.smartdevicelink.SdlConnection.SdlSession;
import com.smartdevicelink.managers.CompletionListener;
@@ -175,6 +176,7 @@ public class AudioStreamManager extends BaseAudioStreamManager { * Creates a new object of AudioStreamManager
* @param internalInterface The internal interface to the connected device.
*/
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public AudioStreamManager(@NonNull ISdl internalInterface, @NonNull Context context) {
super(internalInterface);
this.queue = new LinkedList<>();
@@ -227,6 +229,7 @@ public class AudioStreamManager extends BaseAudioStreamManager { }
@Override
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public void dispose() {
stopAudioStream(new CompletionListener() {
@Override
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java index bdd21ba45..16ff52643 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java @@ -36,6 +36,7 @@ import android.content.Context; import android.content.res.Resources; import android.net.Uri; import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.smartdevicelink.managers.file.filetypes.SdlFile; import com.smartdevicelink.proxy.interfaces.ISdl; @@ -66,6 +67,7 @@ public class FileManager extends BaseFileManager { private final WeakReference<Context> context; @Deprecated + @RestrictTo(RestrictTo.Scope.LIBRARY) public FileManager(ISdl internalInterface, Context context) { // setup @@ -79,6 +81,7 @@ public class FileManager extends BaseFileManager { * @param context an instances of Context interface to global information for application * @param fileManagerConfig an instance of the FileManagerConfig gives access to artworkRetryCount and fileRetryCount to let us if those file types can be re-upload if they fail */ + @RestrictTo(RestrictTo.Scope.LIBRARY) public FileManager(ISdl internalInterface, Context context, FileManagerConfig fileManagerConfig) { // setup super(internalInterface, fileManagerConfig); diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java index c5d567e56..de6169eea 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java @@ -38,6 +38,8 @@ import android.content.Intent; import android.content.IntentFilter; import android.graphics.Bitmap; +import androidx.annotation.RestrictTo; + import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; import com.smartdevicelink.protocol.enums.FunctionID; @@ -64,6 +66,7 @@ import java.lang.ref.WeakReference; * The LockscreenManager handles the logic of showing and hiding the lock screen. <br> * */ +@RestrictTo(RestrictTo.Scope.LIBRARY) public class LockScreenManager extends BaseSubManager { private static final String TAG = "LockScreenManager"; diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java index e3a85bb1b..7430c3143 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java @@ -33,6 +33,7 @@ package com.smartdevicelink.managers.permission; import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.smartdevicelink.proxy.interfaces.ISdl; @@ -51,6 +52,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl; * * @param internalInterface */ + @RestrictTo(RestrictTo.Scope.LIBRARY) public PermissionManager(@NonNull ISdl internalInterface) { super(internalInterface); } diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java index 5065294a9..31c6da0b1 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java @@ -33,6 +33,7 @@ package com.smartdevicelink.managers.screen; import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.proxy.interfaces.ISdl; @@ -44,6 +45,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl; */ public class ScreenManager extends BaseScreenManager { + @RestrictTo(RestrictTo.Scope.LIBRARY) public ScreenManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager) { super(internalInterface, fileManager); } diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java index b7a2e2958..5499d3a5a 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java @@ -33,6 +33,7 @@ package com.smartdevicelink.managers.screen; import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.proxy.interfaces.ISdl; @@ -42,6 +43,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl; * SoftButtonManager gives the developer the ability to control how soft buttons are displayed on the head unit.<br> * Note: This class must be accessed through the SdlManager->ScreenManager. Do not instantiate it by itself.<br> */ +@RestrictTo(RestrictTo.Scope.LIBRARY) class SoftButtonManager extends BaseSoftButtonManager { /** diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java index b5dafa5fd..9f08bef36 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java @@ -1,6 +1,8 @@ package com.smartdevicelink.managers.screen; import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; + import com.smartdevicelink.proxy.interfaces.ISdl; /** @@ -9,6 +11,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl; * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br> * */ +@RestrictTo(RestrictTo.Scope.LIBRARY) class SubscribeButtonManager extends BaseSubscribeButtonManager { SubscribeButtonManager(@NonNull ISdl internalInterface) { diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java index 82e9a5e01..7faa2c70b 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java @@ -33,6 +33,7 @@ package com.smartdevicelink.managers.screen; import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.smartdevicelink.R; import com.smartdevicelink.managers.file.FileManager; @@ -46,6 +47,7 @@ import com.smartdevicelink.proxy.rpc.enums.FileType; * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br> * */ +@RestrictTo(RestrictTo.Scope.LIBRARY) class TextAndGraphicManager extends BaseTextAndGraphicManager { TextAndGraphicManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager, @NonNull SoftButtonManager softButtonManager) { diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java index 32ff8c0eb..f0895fe22 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java @@ -33,6 +33,7 @@ package com.smartdevicelink.managers.screen.choiceset; import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.proxy.interfaces.ISdl; @@ -42,6 +43,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl; * ChoiceSetManager gives the developer the ability to control how soft choice sets are displayed on the head unit.<br> * Note: This class must be accessed through the SdlManager->ScreenManager. Do not instantiate it by itself.<br> */ +@RestrictTo(RestrictTo.Scope.LIBRARY) public class ChoiceSetManager extends BaseChoiceSetManager { /** diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java index 4a28a2792..d29312cdf 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java @@ -32,6 +32,8 @@ package com.smartdevicelink.managers.screen.menu; +import androidx.annotation.RestrictTo; + import com.smartdevicelink.managers.file.FileManager; import com.smartdevicelink.proxy.interfaces.ISdl; @@ -42,6 +44,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl; * * The MenuManager takes MenuCell objects and creates and sends all necessary RPCs to build out a menu */ +@RestrictTo(RestrictTo.Scope.LIBRARY) public class MenuManager extends BaseMenuManager { public MenuManager(ISdl internalInterface, FileManager fileManager) { diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java index a892d3a2c..afde7404d 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java @@ -32,6 +32,8 @@ package com.smartdevicelink.managers.screen.menu; +import androidx.annotation.RestrictTo; + import com.smartdevicelink.proxy.interfaces.ISdl; /** @@ -41,6 +43,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl; * * The VoiceCommandManager takes a List of VoiceCommand objects and sets them on the Head unit for you. */ +@RestrictTo(RestrictTo.Scope.LIBRARY) public class VoiceCommandManager extends BaseVoiceCommandManager { public VoiceCommandManager(ISdl internalInterface) { diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java index 81db89049..7f31cc46a 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java @@ -40,6 +40,8 @@ import android.view.Display; import android.view.InputDevice; import android.view.MotionEvent; +import androidx.annotation.RestrictTo; + import com.smartdevicelink.SdlConnection.SdlSession; import com.smartdevicelink.encoder.VirtualDisplayEncoder; import com.smartdevicelink.managers.BaseSubManager; @@ -177,6 +179,7 @@ public class VideoStreamManager extends BaseVideoStreamManager { }; // MANAGER APIs + @RestrictTo(RestrictTo.Scope.LIBRARY) public VideoStreamManager(ISdl internalInterface){ super(internalInterface); @@ -367,6 +370,7 @@ public class VideoStreamManager extends BaseVideoStreamManager { * Stops streaming, ends video streaming service and removes service listeners. */ @Override + @RestrictTo(RestrictTo.Scope.LIBRARY) public void dispose(){ stopStreaming(); diff --git a/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java b/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java index 74aebda5a..9f70b2cad 100644 --- a/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java @@ -32,6 +32,7 @@ package com.smartdevicelink.managers; import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.smartdevicelink.proxy.interfaces.ISdl; import com.smartdevicelink.transport.utl.TransportRecord; @@ -47,6 +48,7 @@ import java.util.List; * * 1. <br> */ +@RestrictTo(RestrictTo.Scope.LIBRARY) public abstract class BaseSubManager { // states - if this gets more complicated we can move elsewhere diff --git a/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java b/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java index 6056cdbf6..3b78691fc 100644 --- a/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java @@ -34,6 +34,7 @@ package com.smartdevicelink.managers.file; import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; @@ -109,6 +110,7 @@ abstract class BaseFileManager extends BaseSubManager { } @Override + @RestrictTo(RestrictTo.Scope.LIBRARY) public void start(CompletionListener listener) { // prepare manager - don't set state to ready until we have list of files retrieveRemoteFiles(); diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java b/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java index 669a34a7a..276683ef9 100644 --- a/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java @@ -33,6 +33,7 @@ package com.smartdevicelink.managers.permission; import androidx.annotation.IntDef; import androidx.annotation.NonNull; +import androidx.annotation.RestrictTo; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; @@ -146,6 +147,7 @@ abstract class BasePermissionManager extends BaseSubManager{ } @Override + @RestrictTo(RestrictTo.Scope.LIBRARY) public void start(CompletionListener listener) { checkState(); super.start(listener); @@ -289,6 +291,7 @@ abstract class BasePermissionManager extends BaseSubManager{ * Clean up everything after the manager is no longer needed */ @Override + @RestrictTo(RestrictTo.Scope.LIBRARY) public void dispose(){ super.dispose(); diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java index 80daf4d2e..0a679906c 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java @@ -33,6 +33,7 @@ package com.smartdevicelink.managers.screen; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.RestrictTo; import com.smartdevicelink.managers.BaseSubManager; import com.smartdevicelink.managers.CompletionListener; @@ -112,6 +113,7 @@ abstract class BaseScreenManager extends BaseSubManager { } @Override + @RestrictTo(RestrictTo.Scope.LIBRARY) public void start(CompletionListener listener) { super.start(listener); this.softButtonManager.start(subManagerListener); @@ -137,6 +139,7 @@ abstract class BaseScreenManager extends BaseSubManager { * <p>Called when manager is being torn down</p> */ @Override + @RestrictTo(RestrictTo.Scope.LIBRARY) public void dispose() { softButtonManager.dispose(); textAndGraphicManager.dispose(); |