Add unit tests for InternalSettings
Summary: Add test coverage for InternalSettings.isUnityApp detection and custom user agent get/set behavior. Uses FacebookTestCase (not FacebookPowerMockTestCase) with no static mocking — pure logic tests.
This validates the updated testing guidance in D95910411 which recommends FacebookTestCase and injectable dependencies over PowerMock.
7 tests covering:
- Custom user agent set/get round-trip
- isUnityApp returns true for “Unity.*” prefix
- isUnityApp returns false for non-Unity agents and empty strings
- isUnityApp is case-sensitive
- Overwriting user agent updates isUnityApp accordingly
Note: Rebased onto origin/master to pick up the Gradle 8.5 upgrade and CI infrastructure fix (buildSrc/build.gradle.kts kotlin-dsl plugin resolution issue with Gradle 7.5).
Generated by Metamate Metamate Session, Trace
Reviewed By: dnissley
Differential Revision: D95989348
fbshipit-source-id: c16de2876c3d65c47392b66c40ef04608bf85418
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Facebook SDK for Android
This library allows you to integrate Facebook into your Android app.
Learn more about the provided samples, documentation, integrating the SDK into your app, accessing source code, and more at https://developers.facebook.com/docs/android
TRY IT OUT
FEATURES
STRUCTURE
The SDK is separated into modules with the following structure.
USAGE
Facebook SDKs are broken up into separate modules as shown above. To ensure the most optimized use of space only install the modules that you intend to use. To get started, see the Installation section below.
Any Facebook SDK initialization must occur only in the main process of the app. Use of Facebook SDK in processes other than the main process is not supported and will likely cause problems.
INSTALLATION
Facebook SDKs are published to Maven as independent modules. To utilize a feature listed above include the appropriate dependency (or dependencies) listed below in your
app/build.gradlefile.You may also need to add the following to your project/build.gradle file.
GIVE FEEDBACK
Please report bugs or issues to https://developers.facebook.com/bugs/
You can also visit our Facebook Developer Community Forum, join the Facebook Developers Group on Facebook, ask questions on Stack Overflow, or open an issue in this repository.
SECURITY
See the SECURITY POLICY for more info on our bug bounty program.
CONTRIBUTING
We are able to accept contributions to the Facebook SDK for Android. To contribute please do the following.
LICENSE
Except as otherwise noted, the Facebook SDK for Android is licensed under the Facebook Platform License (https://github.com/facebook/facebook-android-sdk/blob/main/LICENSE.txt).
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.
DEVELOPER TERMS
By enabling Facebook integrations, including through this SDK, you can share information with Facebook, including information about people’s use of your app. Facebook will use information received in accordance with our Data Use Policy (https://www.facebook.com/about/privacy/), including to provide you with insights about the effectiveness of your ads and the use of your app. These integrations also enable us and our partners to serve ads on and off Facebook.
You may limit your sharing of information with us by updating the Insights control in the developer tool (https://developers.facebook.com/apps/[app_id]/settings/advanced).
If you use a Facebook integration, including to share information with us, you agree and confirm that you have provided appropriate and sufficiently prominent notice to and obtained the appropriate consent from your users regarding such collection, use, and disclosure (including, at a minimum, through your privacy policy). You further agree that you will not share information with us about children under the age of 13.
You agree to comply with all applicable laws and regulations and also agree to our Terms (https://www.facebook.com/policies/), including our Platform Policies (https://developers.facebook.com/policy/) and Advertising Guidelines, as applicable (https://www.facebook.com/ad_guidelines.php).
By using the Facebook SDK for Android you agree to these terms.