From c84aad9250e4b7b9ff0f8ac57e2389cd29c8b52a Mon Sep 17 00:00:00 2001 From: Garo Bournoutian <128516918+gbournou@users.noreply.github.com> Date: Mon, 14 Aug 2023 10:59:07 -0700 Subject: [PATCH] Deprecate SbUserGetSignedIn SB API (#1211) b/271930936 --- .../docs/reference/starboard/modules/event.md | 4 ++-- .../docs/reference/starboard/modules/user.md | 18 ------------------ starboard/CHANGELOG.md | 3 +++ starboard/elf_loader/exported_symbols.cc | 2 ++ starboard/event.h | 4 ++-- starboard/nplb/user_get_current_test.cc | 11 +++++++++++ starboard/nplb/user_get_signed_in_test.cc | 4 ++++ starboard/shared/nouser/user_get_signed_in.cc | 4 ++++ starboard/shared/stub/user_get_signed_in.cc | 4 ++++ starboard/user.h | 2 ++ 10 files changed, 34 insertions(+), 22 deletions(-) diff --git a/cobalt/site/docs/reference/starboard/modules/event.md b/cobalt/site/docs/reference/starboard/modules/event.md index 58cb1f4d1390..803306c91930 100644 --- a/cobalt/site/docs/reference/starboard/modules/event.md +++ b/cobalt/site/docs/reference/starboard/modules/event.md @@ -159,8 +159,8 @@ the type of the value pointed to by that data argument, if any. * `kSbEventTypeUser` A user change event, which means a new user signed-in or signed-out, or the - current user changed. No data argument, call SbUserGetSignedIn() and - SbUserGetCurrent() to get the latest changes. + current user changed. No data argument, call SbUserGetCurrent() to get the + latest changes. * `kSbEventTypeLink` A navigational link has come from the system, and the application should diff --git a/cobalt/site/docs/reference/starboard/modules/user.md b/cobalt/site/docs/reference/starboard/modules/user.md index 406e695c4a2e..5efecf801b31 100644 --- a/cobalt/site/docs/reference/starboard/modules/user.md +++ b/cobalt/site/docs/reference/starboard/modules/user.md @@ -104,24 +104,6 @@ The property for which the data is requested. int SbUserGetPropertySize(SbUser user, SbUserPropertyId property_id) ``` -### SbUserGetSignedIn ### - -Gets a list of up to `users_size` signed-in users and places the results in -`out_users`. The return value identifies the actual number of signed-in users, -which may be greater or less than `users_size`. - -It is expected that there will be a unique `SbUser` per signed-in user and that -the referenced objects will persist for the lifetime of the app. - -`out_users`: Handles for the retrieved users. `users_size`: The maximum number -of signed-in users to retrieve. - -#### Declaration #### - -``` -int SbUserGetSignedIn(SbUser *out_users, int users_size) -``` - ### SbUserIsValid ### Returns whether the given user handle is valid. diff --git a/starboard/CHANGELOG.md b/starboard/CHANGELOG.md index 1fe1e585d6ba..f5dfa8f51058 100644 --- a/starboard/CHANGELOG.md +++ b/starboard/CHANGELOG.md @@ -16,6 +16,9 @@ can be found in the comments of the "Experimental Feature Defines" section of ## Version 16 +### Removed SbUserGetSignedIn +The API is no longer used and has been deprecated. + ### Removed SbByteSwapS16, SbByteSwapS32, SbByteSwapS64, SbByteSwapU16, SbByteSwapU32, and SbByteSwapU64 The APIs defined in `starboard/byte_swap.h` are no longer used and have been deprecated. diff --git a/starboard/elf_loader/exported_symbols.cc b/starboard/elf_loader/exported_symbols.cc index 058a3be16448..5010540d2f80 100644 --- a/starboard/elf_loader/exported_symbols.cc +++ b/starboard/elf_loader/exported_symbols.cc @@ -350,7 +350,9 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(SbUserGetCurrent); REGISTER_SYMBOL(SbUserGetProperty); REGISTER_SYMBOL(SbUserGetPropertySize); +#if SB_API_VERSION < 16 REGISTER_SYMBOL(SbUserGetSignedIn); +#endif REGISTER_SYMBOL(SbWindowBlurOnScreenKeyboard); REGISTER_SYMBOL(SbWindowCreate); REGISTER_SYMBOL(SbWindowDestroy); diff --git a/starboard/event.h b/starboard/event.h index 17056e00f38e..40675fc3ac31 100644 --- a/starboard/event.h +++ b/starboard/event.h @@ -182,8 +182,8 @@ typedef enum SbEventType { kSbEventTypeInput, // A user change event, which means a new user signed-in or signed-out, or the - // current user changed. No data argument, call SbUserGetSignedIn() and - // SbUserGetCurrent() to get the latest changes. + // current user changed. No data argument, call SbUserGetCurrent() to get the + // latest changes. kSbEventTypeUser, // A navigational link has come from the system, and the application should diff --git a/starboard/nplb/user_get_current_test.cc b/starboard/nplb/user_get_current_test.cc index b620df23f987..c3bb02d4608a 100644 --- a/starboard/nplb/user_get_current_test.cc +++ b/starboard/nplb/user_get_current_test.cc @@ -19,6 +19,8 @@ namespace starboard { namespace nplb { namespace { +#if SB_API_VERSION < 16 + TEST(SbUserGetCurrentTest, SunnyDay) { SbUser users[10] = {0}; int result = SbUserGetSignedIn(users, SB_ARRAY_SIZE_INT(users)); @@ -32,6 +34,15 @@ TEST(SbUserGetCurrentTest, SunnyDay) { } } +#else + +TEST(SbUserGetCurrentTest, SunnyDay) { + SbUser current = SbUserGetCurrent(); + EXPECT_NE(kSbUserInvalid, current); +} + +#endif + } // namespace } // namespace nplb } // namespace starboard diff --git a/starboard/nplb/user_get_signed_in_test.cc b/starboard/nplb/user_get_signed_in_test.cc index 267244dfe7e6..f062f843d3d5 100644 --- a/starboard/nplb/user_get_signed_in_test.cc +++ b/starboard/nplb/user_get_signed_in_test.cc @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if SB_API_VERSION < 16 + #include "starboard/user.h" #include "testing/gtest/include/gtest/gtest.h" @@ -57,3 +59,5 @@ TEST(SbUserGetSignedInTest, NullUsers) { } // namespace } // namespace nplb } // namespace starboard + +#endif diff --git a/starboard/shared/nouser/user_get_signed_in.cc b/starboard/shared/nouser/user_get_signed_in.cc index 3e2cc7235566..726ffd8cc602 100644 --- a/starboard/shared/nouser/user_get_signed_in.cc +++ b/starboard/shared/nouser/user_get_signed_in.cc @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if SB_API_VERSION < 16 + #include "starboard/user.h" #include "starboard/shared/nouser/user_internal.h" @@ -25,3 +27,5 @@ int SbUserGetSignedIn(SbUser* out_users, int users_size) { return 1; } + +#endif diff --git a/starboard/shared/stub/user_get_signed_in.cc b/starboard/shared/stub/user_get_signed_in.cc index 938a8166425b..7fbfcc36ba50 100644 --- a/starboard/shared/stub/user_get_signed_in.cc +++ b/starboard/shared/stub/user_get_signed_in.cc @@ -12,8 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if SB_API_VERSION < 16 + #include "starboard/user.h" int SbUserGetSignedIn(SbUser* out_users, int users_size) { return 0; } + +#endif diff --git a/starboard/user.h b/starboard/user.h index 8a096356a21b..d2084b6963f4 100644 --- a/starboard/user.h +++ b/starboard/user.h @@ -73,7 +73,9 @@ static SB_C_INLINE bool SbUserIsValid(SbUser user) { // // |out_users|: Handles for the retrieved users. // |users_size|: The maximum number of signed-in users to retrieve. +#if SB_API_VERSION < 16 SB_EXPORT int SbUserGetSignedIn(SbUser* out_users, int users_size); +#endif // Gets the current primary user, if one exists. This is the user that is // determined, in a platform-specific way, to be the primary user controlling