Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecated annotation to primary BI classes #9433

Merged
merged 6 commits into from
Oct 14, 2024

Conversation

amk-stripe
Copy link
Collaborator

@amk-stripe amk-stripe commented Oct 10, 2024

Summary

Add deprecated annotation to primary BI classes

Motivation

https://jira.corp.stripe.com/browse/MOBILESDK-2461

An in-SDK heads-up about upcoming removal of BI

Testing

  • Added tests
  • Modified tests
  • Manually verified

Changelog

Basic integration

@amk-stripe amk-stripe marked this pull request as ready for review October 10, 2024 22:40
@amk-stripe amk-stripe requested review from a team as code owners October 10, 2024 22:40
Copy link
Contributor

github-actions bot commented Oct 10, 2024

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │           compressed           │         uncompressed         
          ├───────────┬───────────┬────────┼───────────┬───────────┬──────
 APK      │ old       │ new       │ diff   │ old       │ new       │ diff 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼──────
      dex │   3.9 MiB │   3.9 MiB │ -240 B │   8.6 MiB │   8.6 MiB │ +4 B 
     arsc │   2.3 MiB │   2.3 MiB │    0 B │   2.3 MiB │   2.3 MiB │  0 B 
 manifest │   5.1 KiB │   5.1 KiB │    0 B │  25.6 KiB │  25.6 KiB │  0 B 
      res │ 933.6 KiB │ 933.6 KiB │    0 B │   1.5 MiB │   1.5 MiB │  0 B 
   native │   2.6 MiB │   2.6 MiB │    0 B │     6 MiB │     6 MiB │  0 B 
    asset │   2.9 MiB │   2.9 MiB │    0 B │   2.9 MiB │   2.9 MiB │  0 B 
    other │   196 KiB │   196 KiB │   +5 B │ 430.6 KiB │ 430.6 KiB │  0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼──────
    total │  12.8 MiB │  12.8 MiB │ -235 B │  21.7 MiB │  21.7 MiB │ +4 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 42653 │ 42653 │ 0 (+1 -1) 
   types │ 14149 │ 14149 │ 0 (+0 -0) 
 classes │ 11775 │ 11775 │ 0 (+0 -0) 
 methods │ 60444 │ 60444 │ 0 (+0 -0) 
  fields │ 40076 │ 40076 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6252 │ 6252 │  0
APK
    compressed     │   uncompressed   │                        
──────────┬────────┼───────────┬──────┤                        
 size     │ diff   │ size      │ diff │ path                   
──────────┼────────┼───────────┼──────┼────────────────────────
  3.9 MiB │ -240 B │   8.6 MiB │ +4 B │ ∆ classes.dex          
  1.2 KiB │   +3 B │   1.2 KiB │  0 B │ ∆ META-INF/CERT.RSA    
 50.1 KiB │   +3 B │ 118.2 KiB │  0 B │ ∆ META-INF/MANIFEST.MF 
 53.4 KiB │   -1 B │ 118.3 KiB │  0 B │ ∆ META-INF/CERT.SF     
──────────┼────────┼───────────┼──────┼────────────────────────
    4 MiB │ -235 B │   8.8 MiB │ +4 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   42653 │ 42653 │ 0 (+1 -1) 
  
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"014f6f8","r8-mode":"full","version":"8.5.35"}
  
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"3314f55","r8-mode":"full","version":"8.5.35"}

@@ -27,6 +27,10 @@ import kotlin.coroutines.CoroutineContext
*
* See [Creating ephemeral keys](https://stripe.com/docs/mobile/android/standard#creating-ephemeral-keys)
*/
@Deprecated(
"Please use Mobile Payment Element instead. If you already using CustomerSession, learn how to migrate" +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this string as a constant, and reference it in all of these?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep! Done, thanks

@@ -22,6 +22,7 @@ internal class ActivityScenarioFactory(
)
}

@Suppress("Deprecated")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we test this in PaymentSheet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question! We aren't actually testing the activity itself, we are just using it to test out our functions that take in an activity as a parameter, e.g. the FlowControllerFactory constructor. We should be using an example activity for that, rather than using the BI activities. I will follow up and update those tests

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amk-stripe amk-stripe merged commit 559cb63 into master Oct 14, 2024
16 checks passed
@amk-stripe amk-stripe deleted the add-bi-deprecation-warnings branch October 14, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants