Remove-binary-blob-integrations.patch 193 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242
  1. From: csagan5 <32685696+csagan5@users.noreply.github.com>
  2. Date: Mon, 5 Apr 2021 21:37:12 +0200
  3. Subject: Remove binary blob integrations
  4. Remove dependency on com.google.android.gms.auth
  5. kill GCM
  6. Remove dependency on com.google.android.gcm
  7. Remove dependency on com.google.android.gms.gcm
  8. It also disables Snippets, auto-update of offline pages and launching browser from background service.
  9. The snippets are already disabled in native codes, this will disable it on Java level.
  10. Remove dependency on com.google.android.play
  11. Remove dependency on vision, clearcut and phenotype
  12. Remove dependency on flags, places and stats
  13. Remove dependency on fido, iid, instantapps, location
  14. Remove dependency on com.google.android.gms.cast
  15. Remove dependency on auth, signin, dynamic and tasks
  16. Remove google_services_gcm
  17. ungoogled-chromium: Disable GCM
  18. Disable Google Cloud Messaging (GCM) client
  19. Parts of this patch were developed by csagan5, uazo and others.
  20. ---
  21. ...em_webview_bundle.AndroidManifest.expected | 5 -
  22. chrome/android/BUILD.gn | 37 --
  23. chrome/android/chrome_java_sources.gni | 5 -
  24. chrome/android/java/AndroidManifest.xml | 68 ---
  25. .../org/chromium/chrome/browser/AppHooks.java | 14 +-
  26. .../browser/PlayServicesVersionInfo.java | 12 +-
  27. .../ChromeBackgroundTaskFactory.java | 3 -
  28. .../ExternalNavigationDelegateImpl.java | 8 +-
  29. .../gcore/ChromeGoogleApiClientImpl.java | 25 +-
  30. .../browser/gcore/GoogleApiClientHelper.java | 82 +--
  31. .../instantapps/InstantAppsHandler.java | 57 +-
  32. .../browser/omaha/UpdateStatusProvider.java | 10 +-
  33. .../modules/chrome_feature_modules.gni | 3 -
  34. chrome/browser/BUILD.gn | 2 -
  35. chrome/browser/language/android/BUILD.gn | 2 -
  36. .../language/AppLanguagePromoDialog.java | 23 -
  37. .../AppLanguagePreferenceDelegate.java | 8 -
  38. .../language/settings/LanguageSettings.java | 6 -
  39. .../prefetch/prefetch_service_factory.cc | 16 -
  40. .../browser/password_manager/android/BUILD.gn | 2 -
  41. .../push_messaging_service_factory.cc | 8 +-
  42. chrome/browser/ui/BUILD.gn | 3 -
  43. .../webui/chrome_web_ui_controller_factory.cc | 3 -
  44. chrome/test/android/BUILD.gn | 2 -
  45. components/background_task_scheduler/BUILD.gn | 5 -
  46. .../internal/BUILD.gn | 10 -
  47. .../BackgroundTaskGcmTaskService.java | 160 ------
  48. ...ackgroundTaskSchedulerFactoryInternal.java | 6 +-
  49. ...kgroundTaskSchedulerGcmNetworkManager.java | 257 ---------
  50. .../component_updater/UpdateScheduler.java | 1 -
  51. components/externalauth/android/BUILD.gn | 3 -
  52. .../externalauth/ExternalAuthUtils.java | 18 +-
  53. .../UserRecoverableErrorHandler.java | 7 -
  54. components/gcm_driver/gcm_client_impl.cc | 4 +
  55. .../gcm_driver/instance_id/android/BUILD.gn | 3 -
  56. .../instance_id/InstanceIDBridge.java | 47 +-
  57. .../media_router/browser/android/BUILD.gn | 9 -
  58. .../media_router/BrowserMediaRouter.java | 18 +-
  59. .../media_router/CastSessionUtil.java | 35 --
  60. .../components/media_router/MediaSink.java | 44 +-
  61. .../media_router/MediaStatusBridge.java | 40 +-
  62. .../caf/BaseNotificationController.java | 52 --
  63. .../caf/BaseSessionController.java | 100 +---
  64. .../caf/CafBaseMediaRouteProvider.java | 114 +---
  65. .../caf/CafMediaRouteProvider.java | 16 -
  66. .../media_router/caf/CafMessageHandler.java | 97 +---
  67. .../media_router/caf/CastMediaSource.java | 10 +-
  68. .../media_router/caf/CastOptionsProvider.java | 22 +-
  69. .../caf/CastSessionController.java | 84 ---
  70. .../media_router/caf/CastUtils.java | 8 -
  71. .../CafExpandedControllerActivity.java | 41 +-
  72. .../CafRemotingMediaRouteProvider.java | 5 +-
  73. .../remoting/FlingingControllerAdapter.java | 74 ---
  74. .../caf/remoting/RemotingMediaSource.java | 8 +-
  75. .../remoting/RemotingSessionController.java | 26 -
  76. .../test/android/cast_emulator/BUILD.gn | 1 -
  77. components/module_installer/android/BUILD.gn | 2 -
  78. components/signin/public/android/BUILD.gn | 4 -
  79. components/webauthn/android/BUILD.gn | 5 -
  80. .../webauthn/AuthenticatorImpl.java | 31 +-
  81. .../push_messaging/push_messaging_manager.cc | 2 +-
  82. content/public/android/BUILD.gn | 4 -
  83. content/public/common/content_features.cc | 2 +-
  84. content/test/BUILD.gn | 4 -
  85. device/BUILD.gn | 3 -
  86. remoting/android/client_java_tmpl.gni | 3 -
  87. services/BUILD.gn | 9 -
  88. services/device/geolocation/BUILD.gn | 3 -
  89. services/shape_detection/BUILD.gn | 4 -
  90. third_party/android_deps/BUILD.gn | 540 +-----------------
  91. .../preconditions/javatests/BUILD.gn | 1 -
  92. .../gms/ChromiumPlayServicesAvailability.java | 10 +-
  93. 72 files changed, 63 insertions(+), 2293 deletions(-)
  94. delete mode 100644 components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskGcmTaskService.java
  95. delete mode 100644 components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerGcmNetworkManager.java
  96. diff --git a/android_webview/expectations/system_webview_bundle.AndroidManifest.expected b/android_webview/expectations/system_webview_bundle.AndroidManifest.expected
  97. --- a/android_webview/expectations/system_webview_bundle.AndroidManifest.expected
  98. +++ b/android_webview/expectations/system_webview_bundle.AndroidManifest.expected
  99. @@ -18,10 +18,6 @@
  100. android:label="Android System WebView"
  101. android:multiArch="true"
  102. android:use32bitAbi="true">
  103. - <activity # DIFF-ANCHOR: ea1a94af
  104. - android:name="com.google.android.gms.common.api.GoogleApiActivity"
  105. - android:exported="false"
  106. - android:theme="@android:style/Theme.Translucent.NoTitleBar">
  107. </activity> # DIFF-ANCHOR: ea1a94af
  108. <activity # DIFF-ANCHOR: a4438884
  109. android:name="org.chromium.android_webview.devui.MainActivity"
  110. @@ -65,7 +61,6 @@
  111. android:visibleToInstantApps="true">
  112. </activity-alias> # DIFF-ANCHOR: b7cc06e9
  113. <meta-data android:name="$PACKAGE.WebViewLibrary" android:value="libwebviewchromium.so"/>
  114. - <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
  115. <meta-data android:name="org.chromium.content.browser.NUM_PRIVILEGED_SERVICES" android:value="0"/>
  116. <meta-data android:name="org.chromium.content.browser.NUM_SANDBOXED_SERVICES" android:value="40"/>
  117. <provider # DIFF-ANCHOR: a5e78e63
  118. diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
  119. --- a/chrome/android/BUILD.gn
  120. +++ b/chrome/android/BUILD.gn
  121. @@ -309,20 +309,10 @@ android_library("chrome_java") {
  122. ":chrome_public_apk_template_resources",
  123. ":update_proto_java",
  124. ":usage_stats_proto_java",
  125. - "$google_play_services_package:google_play_services_auth_base_java",
  126. - "$google_play_services_package:google_play_services_base_java",
  127. - "$google_play_services_package:google_play_services_basement_java",
  128. - "$google_play_services_package:google_play_services_cast_framework_java",
  129. - "$google_play_services_package:google_play_services_cast_java",
  130. - "$google_play_services_package:google_play_services_fido_java",
  131. - "$google_play_services_package:google_play_services_gcm_java",
  132. - "$google_play_services_package:google_play_services_iid_java",
  133. - "$google_play_services_package:google_play_services_tasks_java",
  134. "//base:base_java",
  135. "//cc:cc_java",
  136. "//chrome/android/features/keyboard_accessory:public_java",
  137. "//chrome/android/features/start_surface:public_java",
  138. - "//chrome/android/modules/cablev2_authenticator/public:java",
  139. "//chrome/android/modules/image_editor/provider:java",
  140. "//chrome/android/modules/stack_unwinder/provider:java",
  141. "//chrome/android/webapk/libs/client:client_java",
  142. @@ -579,7 +569,6 @@ android_library("chrome_java") {
  143. "//third_party/android_data_chart:android_data_chart_java",
  144. "//third_party/android_deps:android_support_v7_appcompat_java",
  145. "//third_party/android_deps:chromium_play_services_availability_java",
  146. - "//third_party/android_deps:com_google_android_play_core_java",
  147. "//third_party/android_deps:com_google_code_findbugs_jsr305_java",
  148. "//third_party/android_deps:com_google_guava_listenablefuture_java",
  149. "//third_party/android_deps:dagger_java",
  150. @@ -904,11 +893,6 @@ junit_binary("chrome_junit_tests") {
  151. ":chrome_java",
  152. ":chrome_public_android_manifest",
  153. ":delegate_public_impl_java",
  154. - "$google_play_services_package:google_play_services_base_java",
  155. - "$google_play_services_package:google_play_services_basement_java",
  156. - "$google_play_services_package:google_play_services_cast_framework_java",
  157. - "$google_play_services_package:google_play_services_cast_java",
  158. - "$google_play_services_package:google_play_services_fido_java",
  159. "//base:base_java",
  160. "//base:base_java_test_support",
  161. "//base:base_junit_test_support",
  162. @@ -1273,14 +1257,6 @@ android_library("chrome_test_java") {
  163. ":chrome_test_util_java",
  164. ":chrome_test_util_jni",
  165. ":delegate_public_impl_java",
  166. - "$google_play_services_package:google_play_services_base_java",
  167. - "$google_play_services_package:google_play_services_basement_java",
  168. - "$google_play_services_package:google_play_services_cast_framework_java",
  169. - "$google_play_services_package:google_play_services_cast_java",
  170. - "$google_play_services_package:google_play_services_fido_java",
  171. - "$google_play_services_package:google_play_services_gcm_java",
  172. - "$google_play_services_package:google_play_services_iid_java",
  173. - "$google_play_services_package:google_play_services_tasks_java",
  174. "//base:base_java",
  175. "//base:base_java_test_support",
  176. "//base/test:test_support_java",
  177. @@ -2331,7 +2307,6 @@ android_library("browser_java_test_support") {
  178. ]
  179. deps = [
  180. ":chrome_java",
  181. - "$google_play_services_package:google_play_services_gcm_java",
  182. "//base:base_java",
  183. "//base:base_java_test_support",
  184. "//base:jni_java",
  185. @@ -2478,9 +2453,7 @@ android_library("base_monochrome_module_java") {
  186. android_library("base_module_java") {
  187. sources = [
  188. "../browser/attribution_reporting/android/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionReportingProvider.java",
  189. - "java/src/com/google/ipc/invalidation/ticl/android2/channel/GcmRegistrationTaskService.java",
  190. "java/src/org/chromium/chrome/app/TrichromeZygotePreload.java",
  191. - "java/src/org/chromium/chrome/browser/ChromeBackgroundService.java",
  192. "java/src/org/chromium/chrome/browser/ChromeBackupAgent.java",
  193. "java/src/org/chromium/chrome/browser/DeferredStartupHandler.java",
  194. "java/src/org/chromium/chrome/browser/base/DexFixer.java",
  195. @@ -2491,8 +2464,6 @@ android_library("base_module_java") {
  196. "java/src/org/chromium/chrome/browser/base/SplitCompatBackupAgent.java",
  197. "java/src/org/chromium/chrome/browser/base/SplitCompatContentProvider.java",
  198. "java/src/org/chromium/chrome/browser/base/SplitCompatCustomTabsService.java",
  199. - "java/src/org/chromium/chrome/browser/base/SplitCompatGcmListenerService.java",
  200. - "java/src/org/chromium/chrome/browser/base/SplitCompatGcmTaskService.java",
  201. "java/src/org/chromium/chrome/browser/base/SplitCompatIntentService.java",
  202. "java/src/org/chromium/chrome/browser/base/SplitCompatJobService.java",
  203. "java/src/org/chromium/chrome/browser/base/SplitCompatMinidumpUploadJobService.java",
  204. @@ -2519,16 +2490,10 @@ android_library("base_module_java") {
  205. "java/src/org/chromium/chrome/browser/photo_picker/DecoderService.java",
  206. "java/src/org/chromium/chrome/browser/prerender/ChromePrerenderService.java",
  207. "java/src/org/chromium/chrome/browser/provider/ChromeBrowserProvider.java",
  208. - "java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java",
  209. - "java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundService.java",
  210. - "java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java",
  211. "java/src/org/chromium/chrome/browser/tracing/TracingNotificationService.java",
  212. ]
  213. deps = [
  214. ":chrome_base_module_resources",
  215. - "$google_play_services_package:google_firebase_firebase_iid_java",
  216. - "$google_play_services_package:google_firebase_firebase_messaging_java",
  217. - "$google_play_services_package:google_play_services_gcm_java",
  218. "//base:base_java",
  219. "//chrome/browser/download/android:file_provider_java",
  220. "//chrome/browser/flags:java",
  221. @@ -2541,7 +2506,6 @@ android_library("base_module_java") {
  222. "//components/media_router/browser/android:cast_options_provider_java",
  223. "//components/minidump_uploader:minidump_uploader_java",
  224. "//components/module_installer/android:module_installer_java",
  225. - "//third_party/android_deps:com_google_android_play_core_java",
  226. "//third_party/androidx:androidx_annotation_annotation_java",
  227. "//third_party/androidx:androidx_collection_collection_java",
  228. "//third_party/androidx:androidx_fragment_fragment_java",
  229. @@ -2563,7 +2527,6 @@ android_library("base_module_java") {
  230. # Deps to pull services into base module.
  231. # TODO(crbug.com/1126301): Consider moving these to the chrome module to
  232. # reduce base dex size.
  233. - "$google_play_services_package:google_play_services_cast_framework_java",
  234. "//components/background_task_scheduler:background_task_scheduler_java",
  235. "//components/payments/content/android:service_java",
  236. "//third_party/androidx:androidx_browser_browser_java",
  237. diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
  238. --- a/chrome/android/chrome_java_sources.gni
  239. +++ b/chrome/android/chrome_java_sources.gni
  240. @@ -16,7 +16,6 @@ chrome_java_sources = [
  241. "java/src/org/chromium/chrome/browser/ChromeActionModeHandler.java",
  242. "java/src/org/chromium/chrome/browser/ChromeActivitySessionTracker.java",
  243. "java/src/org/chromium/chrome/browser/ChromeApplicationImpl.java",
  244. - "java/src/org/chromium/chrome/browser/ChromeBackgroundServiceImpl.java",
  245. "java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java",
  246. "java/src/org/chromium/chrome/browser/ChromeBackupWatcher.java",
  247. "java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java",
  248. @@ -1014,10 +1013,6 @@ chrome_java_sources = [
  249. "java/src/org/chromium/chrome/browser/searchwidget/SearchType.java",
  250. "java/src/org/chromium/chrome/browser/searchwidget/SearchWidgetProvider.java",
  251. "java/src/org/chromium/chrome/browser/send_tab_to_self/SendTabToSelfShareActivity.java",
  252. - "java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerServiceImpl.java",
  253. - "java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundServiceImpl.java",
  254. - "java/src/org/chromium/chrome/browser/services/gcm/GCMBackgroundTask.java",
  255. - "java/src/org/chromium/chrome/browser/services/gcm/GcmUma.java",
  256. "java/src/org/chromium/chrome/browser/settings/MainSettings.java",
  257. "java/src/org/chromium/chrome/browser/settings/SettingsActivity.java",
  258. "java/src/org/chromium/chrome/browser/settings/SettingsLauncherImpl.java",
  259. diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
  260. --- a/chrome/android/java/AndroidManifest.xml
  261. +++ b/chrome/android/java/AndroidManifest.xml
  262. @@ -100,21 +100,16 @@ by a child template that "extends" this file.
  263. <permission android:name="{{ manifest_package }}.permission.CHILD_SERVICE" android:protectionLevel="signature" />
  264. <permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" android:protectionLevel="signatureOrSystem" />
  265. <permission android:name="{{ manifest_package }}.TOS_ACKED" android:protectionLevel="signatureOrSystem" />
  266. - <!-- Only chrome can receive the messages and registration result -->
  267. - <permission android:name="{{ manifest_package }}.permission.C2D_MESSAGE"
  268. - android:protectionLevel="signature" />
  269. <permission android:name="{{ manifest_package }}.permission.DEBUG"
  270. android:label="Debug web pages"
  271. android:protectionLevel="signature" />
  272. <permission android:name="{{ manifest_package }}.permission.TRANSLATE"
  273. android:protectionLevel="signature" />
  274. - <uses-permission android:name="{{ manifest_package }}.permission.C2D_MESSAGE" />
  275. <uses-permission android:name="{{ manifest_package }}.permission.READ_WRITE_BOOKMARK_FOLDERS" />
  276. <uses-permission android:name="{{ manifest_package }}.TOS_ACKED" />
  277. <uses-permission android:name="com.chrome.permission.DEVICE_EXTRAS" />
  278. - <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
  279. <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
  280. {% block extra_uses_permissions %}
  281. @@ -752,16 +747,6 @@ by a child template that "extends" this file.
  282. </intent-filter>
  283. </activity>
  284. - <activity android:name="org.chromium.components.media_router.caf.remoting.CafExpandedControllerActivity"
  285. - android:theme="@style/Theme.Chromium.Activity"
  286. - android:label="Chrome.CafExpandedControllerActivity"
  287. - android:hardwareAccelerated="true"
  288. - android:launchMode="singleTask"
  289. - android:noHistory="true"
  290. - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize"
  291. - android:excludeFromRecents="true">
  292. - </activity>
  293. -
  294. <!-- This activity is used to restart the main Chrome process. Should never be exported. -->
  295. <activity android:name="org.chromium.chrome.browser.BrowserRestartActivity"
  296. android:launchMode="singleInstance"
  297. @@ -825,15 +810,6 @@ by a child template that "extends" this file.
  298. </intent-filter>
  299. </activity>
  300. - <!-- Activity for dispatching intents to Instant Apps. -->
  301. - <activity
  302. - android:name="org.chromium.chrome.browser.instantapps.AuthenticatedProxyActivity"
  303. - android:exported="false"
  304. - android:theme="@style/Theme.BrowserUI.NoDisplay"
  305. - android:noHistory="true"
  306. - android:excludeFromRecents="true">
  307. - </activity>
  308. -
  309. <activity
  310. android:name="org.chromium.chrome.browser.vr.VrCancelAnimationActivity"
  311. android:exported="false"
  312. @@ -1002,26 +978,6 @@ by a child template that "extends" this file.
  313. android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize"
  314. android:hardwareAccelerated="false" />
  315. - <!-- GcmTaskService for registration for Invalidations. Not actually implemented anymore. -->
  316. - <service android:name="com.google.ipc.invalidation.ticl.android2.channel.GcmRegistrationTaskService"
  317. - android:exported="true"
  318. - android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE" >
  319. - <intent-filter>
  320. - <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY"/>
  321. - </intent-filter>
  322. - </service>
  323. - <!-- GcmListenerService for messages from GCM. -->
  324. - <service android:name="org.chromium.chrome.browser.services.gcm.ChromeGcmListenerService"
  325. - android:exported="false" >
  326. - <intent-filter>
  327. - <action android:name="com.google.firebase.MESSAGING_EVENT" />
  328. - </intent-filter>
  329. - </service>
  330. - <service android:name="org.chromium.chrome.browser.services.gcm.GCMBackgroundService"
  331. - android:exported="false"/>
  332. - <service android:name="org.chromium.chrome.browser.services.gcm.InvalidationGcmUpstreamSender"
  333. - android:exported="false"/>
  334. -
  335. <!-- Android Notification service listener -->
  336. <service android:name="org.chromium.chrome.browser.notifications.NotificationService"
  337. android:exported="false"/>
  338. @@ -1045,28 +1001,10 @@ by a child template that "extends" this file.
  339. android:exported="false"
  340. android:permission="android.permission.BIND_JOB_SERVICE"/>
  341. - <!-- Background Task Scheduler GCM task service -->
  342. - <service android:name="org.chromium.components.background_task_scheduler.internal.BackgroundTaskGcmTaskService"
  343. - android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"
  344. - android:exported="true">
  345. - <intent-filter>
  346. - <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY" />
  347. - </intent-filter>
  348. - </service>
  349. -
  350. <!-- Background Task Scheduler alarm receiver -->
  351. <receiver android:name="org.chromium.components.background_task_scheduler.internal.BackgroundTaskBroadcastReceiver"
  352. android:exported="false" />
  353. - <!-- GcmTaskService implementation to wake Chrome on scheduled events -->
  354. - <service android:name="org.chromium.chrome.browser.ChromeBackgroundService"
  355. - android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"
  356. - android:exported="true">
  357. - <intent-filter>
  358. - <action android:name="com.google.android.gms.gcm.ACTION_TASK_READY" />
  359. - </intent-filter>
  360. - </service>
  361. -
  362. <service android:name="org.chromium.chrome.browser.prerender.ChromePrerenderService"
  363. android:exported="true"
  364. tools:ignore="ExportedService" />
  365. @@ -1276,12 +1214,6 @@ by a child template that "extends" this file.
  366. <meta-data android:name="com.google.ar.core" android:value="optional" />
  367. {% endif %}
  368. - <!-- Cast support -->
  369. - <meta-data
  370. - android:name=
  371. - "com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
  372. - android:value="org.chromium.components.media_router.caf.CastOptionsProvider"/>
  373. -
  374. <!-- These providers are declared in the base module to give the chrome
  375. split preloader more time to work. -->
  376. <provider android:name="org.chromium.chrome.browser.util.ChromeFileProvider"
  377. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
  378. --- a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
  379. +++ b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
  380. @@ -10,9 +10,6 @@ import android.content.pm.PackageManager;
  381. import androidx.annotation.Nullable;
  382. import androidx.annotation.VisibleForTesting;
  383. -import com.google.android.gms.common.ConnectionResult;
  384. -import com.google.android.gms.common.GoogleApiAvailability;
  385. -
  386. import org.chromium.base.ContextUtils;
  387. import org.chromium.base.annotations.CalledByNative;
  388. import org.chromium.chrome.browser.customtabs.CustomTabsConnection;
  389. @@ -275,16 +272,7 @@ public abstract class AppHooks {
  390. * same as {@link GoogleApiAvailability#isGooglePlayServicesAvailable()}.
  391. */
  392. public int isGoogleApiAvailableWithMinApkVersion(int minApkVersion) {
  393. - try {
  394. - PackageInfo gmsPackageInfo =
  395. - ContextUtils.getApplicationContext().getPackageManager().getPackageInfo(
  396. - GoogleApiAvailability.GOOGLE_PLAY_SERVICES_PACKAGE, /* flags= */ 0);
  397. - int apkVersion = gmsPackageInfo.versionCode;
  398. - if (apkVersion >= minApkVersion) return ConnectionResult.SUCCESS;
  399. - } catch (PackageManager.NameNotFoundException e) {
  400. - return ConnectionResult.SERVICE_MISSING;
  401. - }
  402. - return ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED;
  403. + return 1; /* SERVICE_MISSING*/
  404. }
  405. /**
  406. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/PlayServicesVersionInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/PlayServicesVersionInfo.java
  407. --- a/chrome/android/java/src/org/chromium/chrome/browser/PlayServicesVersionInfo.java
  408. +++ b/chrome/android/java/src/org/chromium/chrome/browser/PlayServicesVersionInfo.java
  409. @@ -7,8 +7,6 @@ package org.chromium.chrome.browser;
  410. import android.content.Context;
  411. import android.content.pm.PackageManager;
  412. -import com.google.android.gms.common.GoogleApiAvailability;
  413. -
  414. import org.chromium.base.ContextUtils;
  415. import org.chromium.base.annotations.CalledByNative;
  416. import org.chromium.components.externalauth.ExternalAuthUtils;
  417. @@ -29,7 +27,7 @@ public class PlayServicesVersionInfo {
  418. public static String getGmsInfo() {
  419. Context context = ContextUtils.getApplicationContext();
  420. - final long sdkVersion = GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE;
  421. + final long sdkVersion = 12600000;
  422. final long installedGmsVersion = getApkVersionNumber(context);
  423. final String accessType;
  424. @@ -53,12 +51,6 @@ public class PlayServicesVersionInfo {
  425. * package is not found.
  426. */
  427. public static int getApkVersionNumber(Context context) {
  428. - try {
  429. - return context.getPackageManager()
  430. - .getPackageInfo(GoogleApiAvailability.GOOGLE_PLAY_SERVICES_PACKAGE, 0)
  431. - .versionCode;
  432. - } catch (PackageManager.NameNotFoundException e) {
  433. - return 0;
  434. - }
  435. + return 0;
  436. }
  437. }
  438. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/ChromeBackgroundTaskFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/ChromeBackgroundTaskFactory.java
  439. --- a/chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/ChromeBackgroundTaskFactory.java
  440. +++ b/chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/ChromeBackgroundTaskFactory.java
  441. @@ -17,7 +17,6 @@ import org.chromium.chrome.browser.offlinepages.OfflineBackgroundTask;
  442. import org.chromium.chrome.browser.offlinepages.measurements.OfflineMeasurementsBackgroundTask;
  443. import org.chromium.chrome.browser.offlinepages.prefetch.PrefetchBackgroundTask;
  444. import org.chromium.chrome.browser.omaha.OmahaService;
  445. -import org.chromium.chrome.browser.services.gcm.GCMBackgroundTask;
  446. import org.chromium.chrome.browser.webapps.WebApkUpdateTask;
  447. import org.chromium.components.background_task_scheduler.BackgroundTask;
  448. import org.chromium.components.background_task_scheduler.BackgroundTaskFactory;
  449. @@ -58,8 +57,6 @@ public class ChromeBackgroundTaskFactory implements BackgroundTaskFactory {
  450. switch (taskId) {
  451. case TaskIds.OMAHA_JOB_ID:
  452. return new OmahaService();
  453. - case TaskIds.GCM_BACKGROUND_TASK_JOB_ID:
  454. - return new GCMBackgroundTask();
  455. case TaskIds.OFFLINE_PAGES_BACKGROUND_JOB_ID:
  456. return new OfflineBackgroundTask();
  457. case TaskIds.OFFLINE_PAGES_PREFETCH_JOB_ID:
  458. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
  459. --- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
  460. +++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
  461. @@ -204,12 +204,8 @@ public class ExternalNavigationDelegateImpl implements ExternalNavigationDelegat
  462. @Override
  463. public void maybeAdjustInstantAppExtras(Intent intent, boolean isIntentToInstantApp) {
  464. - if (isIntentToInstantApp) {
  465. - intent.putExtra(InstantAppsHandler.IS_GOOGLE_SEARCH_REFERRER, true);
  466. - } else {
  467. - // Make sure this extra is not sent unless we've done the verification.
  468. - intent.removeExtra(InstantAppsHandler.IS_GOOGLE_SEARCH_REFERRER);
  469. - }
  470. + // Always remove this extra
  471. + intent.removeExtra(InstantAppsHandler.IS_GOOGLE_SEARCH_REFERRER);
  472. }
  473. @Override
  474. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java
  475. --- a/chrome/android/java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java
  476. +++ b/chrome/android/java/src/org/chromium/chrome/browser/gcore/ChromeGoogleApiClientImpl.java
  477. @@ -6,9 +6,6 @@ package org.chromium.chrome.browser.gcore;
  478. import android.content.Context;
  479. -import com.google.android.gms.common.ConnectionResult;
  480. -import com.google.android.gms.common.api.GoogleApiClient;
  481. -
  482. import org.chromium.base.Log;
  483. import org.chromium.base.TraceEvent;
  484. import org.chromium.components.externalauth.ExternalAuthUtils;
  485. @@ -22,7 +19,6 @@ public class ChromeGoogleApiClientImpl implements ChromeGoogleApiClient {
  486. private static final String TAG = "Icing";
  487. private final Context mApplicationContext;
  488. - private final GoogleApiClient mClient;
  489. private final ExternalAuthUtils mExternalAuthUtils;
  490. /**
  491. @@ -32,10 +28,9 @@ public class ChromeGoogleApiClientImpl implements ChromeGoogleApiClient {
  492. * @param requireFirstPartyBuild true if the given client can only be used in a first-party
  493. * build.
  494. */
  495. - public ChromeGoogleApiClientImpl(Context context, GoogleApiClient client,
  496. + public ChromeGoogleApiClientImpl(Context context,
  497. boolean requireFirstPartyBuild) {
  498. mApplicationContext = context.getApplicationContext();
  499. - mClient = client;
  500. mExternalAuthUtils = ExternalAuthUtils.getInstance();
  501. if (requireFirstPartyBuild && !mExternalAuthUtils.isChromeGoogleSigned()) {
  502. throw new IllegalStateException("GoogleApiClient requires first-party build");
  503. @@ -44,7 +39,6 @@ public class ChromeGoogleApiClientImpl implements ChromeGoogleApiClient {
  504. @Override
  505. public void disconnect() {
  506. - mClient.disconnect();
  507. }
  508. @Override
  509. @@ -60,24 +54,11 @@ public class ChromeGoogleApiClientImpl implements ChromeGoogleApiClient {
  510. @Override
  511. public boolean connectWithTimeout(long timeout) {
  512. TraceEvent.begin("ChromeGoogleApiClientImpl:connectWithTimeout");
  513. - try {
  514. - ConnectionResult result = mClient.blockingConnect(timeout, TimeUnit.MILLISECONDS);
  515. - if (!result.isSuccess()) {
  516. - Log.e(TAG, "Connection to GmsCore unsuccessful. Error %d", result.getErrorCode());
  517. - } else {
  518. - Log.d(TAG, "Connection to GmsCore successful.");
  519. - }
  520. - return result.isSuccess();
  521. - } finally {
  522. - TraceEvent.end("ChromeGoogleApiClientImpl:connectWithTimeout");
  523. - }
  524. + TraceEvent.end("ChromeGoogleApiClientImpl:connectWithTimeout");
  525. + return false;
  526. }
  527. public Context getApplicationContext() {
  528. return mApplicationContext;
  529. }
  530. -
  531. - public GoogleApiClient getApiClient() {
  532. - return mClient;
  533. - }
  534. }
  535. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java
  536. --- a/chrome/android/java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java
  537. +++ b/chrome/android/java/src/org/chromium/chrome/browser/gcore/GoogleApiClientHelper.java
  538. @@ -7,11 +7,6 @@ package org.chromium.chrome.browser.gcore;
  539. import android.os.Bundle;
  540. import android.os.Handler;
  541. -import com.google.android.gms.common.ConnectionResult;
  542. -import com.google.android.gms.common.api.GoogleApiClient;
  543. -import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
  544. -import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
  545. -
  546. import org.chromium.base.ApplicationStatus;
  547. import org.chromium.base.ApplicationStatus.ApplicationStateListener;
  548. import org.chromium.base.Log;
  549. @@ -67,29 +62,15 @@ import org.chromium.base.ThreadUtils;
  550. * }
  551. * </pre>
  552. */
  553. -public class GoogleApiClientHelper
  554. - implements OnConnectionFailedListener, ConnectionCallbacks {
  555. +public class GoogleApiClientHelper {
  556. private static final String TAG = "GCore";
  557. private int mResolutionAttempts;
  558. private boolean mWasConnectedBefore;
  559. private final Handler mHandler = new Handler(ThreadUtils.getUiThreadLooper());
  560. - private final GoogleApiClient mClient;
  561. private long mDisconnectionDelayMs;
  562. private Runnable mPendingDisconnect;
  563. - /**
  564. - * Creates a helper and enrolls it in the various connection management features.
  565. - * See the class documentation for {@link GoogleApiClientHelper} for more information.
  566. - *
  567. - * @param client The client to wrap.
  568. - */
  569. - public GoogleApiClientHelper(GoogleApiClient client) {
  570. - mClient = client;
  571. - enableConnectionRetrying(true);
  572. - enableLifecycleManagement(true);
  573. - }
  574. -
  575. /**
  576. * Opts in or out of lifecycle management. The client's connection will be closed and reopened
  577. * when Chrome goes in and out of background.
  578. @@ -116,13 +97,6 @@ public class GoogleApiClientHelper
  579. * Enabling or disabling it while it is already enabled or disabled has no effect.
  580. */
  581. public void enableConnectionRetrying(boolean enabled) {
  582. - if (enabled) {
  583. - mClient.registerConnectionCallbacks(this);
  584. - mClient.registerConnectionFailedListener(this);
  585. - } else {
  586. - mClient.unregisterConnectionCallbacks(this);
  587. - mClient.unregisterConnectionFailedListener(this);
  588. - }
  589. }
  590. /**
  591. @@ -155,21 +129,11 @@ public class GoogleApiClientHelper
  592. // Cancel and reschedule the disconnection if we are in the background. We do it early to
  593. // avoid race conditions between a disconnect on the UI thread and the connect below.
  594. if (!ApplicationStatus.hasVisibleActivities()) scheduleDisconnection();
  595. -
  596. - // The client might be disconnected if we were idle in the background for too long.
  597. - if (!mClient.isConnected() && !mClient.isConnecting()) {
  598. - Log.d(TAG, "Reconnecting the client.");
  599. - mClient.connect();
  600. - }
  601. }
  602. void restoreConnectedState() {
  603. // If we go back to the foreground before a delayed disconnect happens, cancel it.
  604. cancelPendingDisconnection();
  605. -
  606. - if (mWasConnectedBefore) {
  607. - mClient.connect();
  608. - }
  609. }
  610. /**
  611. @@ -192,12 +156,6 @@ public class GoogleApiClientHelper
  612. }
  613. private void disconnect() {
  614. - if (mClient.isConnected() || mClient.isConnecting()) {
  615. - mWasConnectedBefore = true;
  616. - }
  617. -
  618. - // We always call disconnect to abort possibly pending connection requests.
  619. - mClient.disconnect();
  620. }
  621. private void cancelPendingDisconnection() {
  622. @@ -207,43 +165,7 @@ public class GoogleApiClientHelper
  623. mPendingDisconnect = null;
  624. }
  625. - @Override
  626. - public void onConnectionFailed(ConnectionResult result) {
  627. - if (!isErrorRecoverableByRetrying(result.getErrorCode())) {
  628. - Log.d(TAG, "Not retrying managed client connection. Unrecoverable error: %d",
  629. - result.getErrorCode());
  630. - return;
  631. - }
  632. -
  633. - if (mResolutionAttempts < ConnectedTask.RETRY_NUMBER_LIMIT) {
  634. - Log.d(TAG, "Retrying managed client connection. attempt %d/%d - errorCode: %d",
  635. - mResolutionAttempts, ConnectedTask.RETRY_NUMBER_LIMIT, result.getErrorCode());
  636. - mResolutionAttempts += 1;
  637. -
  638. - mHandler.postDelayed(new Runnable() {
  639. - @Override
  640. - public void run() {
  641. - mClient.connect();
  642. - }
  643. - }, ConnectedTask.CONNECTION_RETRY_TIME_MS);
  644. - }
  645. - }
  646. -
  647. - @Override
  648. - public void onConnected(Bundle connectionHint) {
  649. - mResolutionAttempts = 0;
  650. - }
  651. -
  652. - @Override
  653. - public void onConnectionSuspended(int cause) {
  654. - // GoogleApiClient handles retrying on suspension itself. Logging in case it didn't succeed
  655. - // for some reason.
  656. - Log.w(TAG, "Managed client connection suspended. Cause: %d", cause);
  657. - }
  658. -
  659. private static boolean isErrorRecoverableByRetrying(int errorCode) {
  660. - return errorCode == ConnectionResult.INTERNAL_ERROR
  661. - || errorCode == ConnectionResult.NETWORK_ERROR
  662. - || errorCode == ConnectionResult.SERVICE_UPDATING;
  663. + return false;
  664. }
  665. }
  666. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
  667. --- a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
  668. +++ b/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsHandler.java
  669. @@ -41,31 +41,10 @@ public class InstantAppsHandler {
  670. // TODO(mariakhomenko): Use system once we roll to O SDK.
  671. private static final int FLAG_DO_NOT_LAUNCH = 0x00000200;
  672. - // TODO(mariakhomenko): Depend directly on the constants once we roll to v8 libraries.
  673. - private static final String DO_NOT_LAUNCH_EXTRA =
  674. - "com.google.android.gms.instantapps.DO_NOT_LAUNCH_INSTANT_APP";
  675. -
  676. - protected static final String IS_REFERRER_TRUSTED_EXTRA =
  677. - "com.google.android.gms.instantapps.IS_REFERRER_TRUSTED";
  678. -
  679. - protected static final String IS_USER_CONFIRMED_LAUNCH_EXTRA =
  680. - "com.google.android.gms.instantapps.IS_USER_CONFIRMED_LAUNCH";
  681. -
  682. - protected static final String TRUSTED_REFERRER_PKG_EXTRA =
  683. - "com.google.android.gms.instantapps.TRUSTED_REFERRER_PKG";
  684. -
  685. + // this is kept to always remove it from intents
  686. public static final String IS_GOOGLE_SEARCH_REFERRER =
  687. "com.google.android.gms.instantapps.IS_GOOGLE_SEARCH_REFERRER";
  688. - private static final String BROWSER_LAUNCH_REASON =
  689. - "com.google.android.gms.instantapps.BROWSER_LAUNCH_REASON";
  690. -
  691. - private static final String SUPERVISOR_PKG = "com.google.android.instantapps.supervisor";
  692. -
  693. - private static final String[] SUPERVISOR_START_ACTIONS = {
  694. - "com.google.android.instantapps.START", "com.google.android.instantapps.nmr1.INSTALL",
  695. - "com.google.android.instantapps.nmr1.VIEW"};
  696. -
  697. // Only two possible call sources for fallback intents, set boundary at n+1.
  698. private static final int SOURCE_BOUNDARY = 3;
  699. @@ -85,14 +64,6 @@ public class InstantAppsHandler {
  700. * @return Whether the given intent is going to open an Instant App.
  701. */
  702. public static boolean isIntentToInstantApp(Intent intent) {
  703. - if (SUPERVISOR_PKG.equals(intent.getPackage())) return true;
  704. -
  705. - String intentAction = intent.getAction();
  706. - for (String action : SUPERVISOR_START_ACTIONS) {
  707. - if (action.equals(intentAction)) {
  708. - return true;
  709. - }
  710. - }
  711. return false;
  712. }
  713. @@ -127,20 +98,6 @@ public class InstantAppsHandler {
  714. * @param intent The current intent.
  715. */
  716. private void maybeRecordFallbackStats(Intent intent) {
  717. - Long startTime = IntentUtils.safeGetLongExtra(intent, INSTANT_APP_START_TIME_EXTRA, 0);
  718. - if (startTime > 0) {
  719. - RecordHistogram.recordTimesHistogram("Android.InstantApps.FallbackDuration",
  720. - SystemClock.elapsedRealtime() - startTime);
  721. - intent.removeExtra(INSTANT_APP_START_TIME_EXTRA);
  722. - }
  723. - int callSource = IntentUtils.safeGetIntExtra(intent, BROWSER_LAUNCH_REASON, 0);
  724. - if (callSource > 0 && callSource < SOURCE_BOUNDARY) {
  725. - RecordHistogram.recordEnumeratedHistogram(
  726. - "Android.InstantApps.CallSource", callSource, SOURCE_BOUNDARY);
  727. - intent.removeExtra(BROWSER_LAUNCH_REASON);
  728. - } else if (callSource >= SOURCE_BOUNDARY) {
  729. - Log.e(TAG, "Unexpected call source constant for Instant Apps: " + callSource);
  730. - }
  731. }
  732. /**
  733. @@ -175,14 +132,6 @@ public class InstantAppsHandler {
  734. return false;
  735. }
  736. - if (IntentUtils.safeGetBooleanExtra(intent, DO_NOT_LAUNCH_EXTRA, false)
  737. - || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
  738. - && (intent.getFlags() & FLAG_DO_NOT_LAUNCH) != 0)) {
  739. - maybeRecordFallbackStats(intent);
  740. - Log.i(TAG, "Not handling with Instant Apps (DO_NOT_LAUNCH_EXTRA)");
  741. - return false;
  742. - }
  743. -
  744. if (IntentUtils.safeGetBooleanExtra(
  745. intent, IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, false)
  746. || IntentUtils.safeHasExtra(intent, WebappConstants.EXTRA_SOURCE)
  747. @@ -207,7 +156,6 @@ public class InstantAppsHandler {
  748. }
  749. Intent callbackIntent = new Intent(intent);
  750. - callbackIntent.putExtra(DO_NOT_LAUNCH_EXTRA, true);
  751. callbackIntent.putExtra(INSTANT_APP_START_TIME_EXTRA, startTime);
  752. return tryLaunchingInstantApp(context, intent, isCustomTabsIntent, callbackIntent);
  753. @@ -309,12 +257,9 @@ public class InstantAppsHandler {
  754. Intent iaIntent = data.getIntent();
  755. if (data.getReferrer() != null) {
  756. iaIntent.putExtra(Intent.EXTRA_REFERRER, data.getReferrer());
  757. - iaIntent.putExtra(IS_REFERRER_TRUSTED_EXTRA, true);
  758. }
  759. Context appContext = ContextUtils.getApplicationContext();
  760. - iaIntent.putExtra(TRUSTED_REFERRER_PKG_EXTRA, appContext.getPackageName());
  761. - iaIntent.putExtra(IS_USER_CONFIRMED_LAUNCH_EXTRA, true);
  762. try {
  763. appContext.startActivity(iaIntent);
  764. diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
  765. --- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
  766. +++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
  767. @@ -17,8 +17,6 @@ import androidx.annotation.IntDef;
  768. import androidx.annotation.NonNull;
  769. import androidx.annotation.Nullable;
  770. -import com.google.android.gms.common.GooglePlayServicesUtil;
  771. -
  772. import org.chromium.base.BuildInfo;
  773. import org.chromium.base.Callback;
  774. import org.chromium.base.ContextUtils;
  775. @@ -328,13 +326,7 @@ public class UpdateStatusProvider {
  776. }
  777. private boolean isGooglePlayStoreAvailable(Context context) {
  778. - try {
  779. - context.getPackageManager().getPackageInfo(
  780. - GooglePlayServicesUtil.GOOGLE_PLAY_STORE_PACKAGE, 0);
  781. - } catch (PackageManager.NameNotFoundException e) {
  782. - return false;
  783. - }
  784. - return true;
  785. + return false;
  786. }
  787. private long getSize(StatFs statFs) {
  788. diff --git a/chrome/android/modules/chrome_feature_modules.gni b/chrome/android/modules/chrome_feature_modules.gni
  789. --- a/chrome/android/modules/chrome_feature_modules.gni
  790. +++ b/chrome/android/modules/chrome_feature_modules.gni
  791. @@ -8,8 +8,6 @@ import(
  792. import("//chrome/android/features/dev_ui/dev_ui_module.gni")
  793. import("//chrome/android/features/tab_ui/tab_ui_module.gni")
  794. import("//chrome/android/modules/buildflags.gni")
  795. -import(
  796. - "//chrome/android/modules/cablev2_authenticator/cablev2_authenticator_module.gni")
  797. import("//chrome/android/modules/extra_icu/extra_icu_module.gni")
  798. import("//chrome/android/modules/stack_unwinder/stack_unwinder_module.gni")
  799. import("//chrome/android/modules/test_dummy/test_dummy_module.gni")
  800. @@ -66,7 +64,6 @@ if (!disable_autofill_assistant_dfm) {
  801. if (!disable_tab_ui_dfm) {
  802. monochrome_module_descs += [ tab_ui_module_desc ]
  803. }
  804. -monochrome_module_descs += [ cablev2_authenticator_module_desc ]
  805. # Modules shipped in Trichrome (Android Q+).
  806. trichrome_module_descs = monochrome_module_descs
  807. diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
  808. --- a/chrome/browser/BUILD.gn
  809. +++ b/chrome/browser/BUILD.gn
  810. @@ -6594,8 +6594,6 @@ static_library("browser") {
  811. "offline_pages/offliner_helper.h",
  812. "offline_pages/offliner_user_data.cc",
  813. "offline_pages/offliner_user_data.h",
  814. - "offline_pages/prefetch/gcm_token.cc",
  815. - "offline_pages/prefetch/gcm_token.h",
  816. "offline_pages/prefetch/offline_metrics_collector_impl.cc",
  817. "offline_pages/prefetch/offline_metrics_collector_impl.h",
  818. "offline_pages/prefetch/offline_prefetch_download_client.cc",
  819. diff --git a/chrome/browser/language/android/BUILD.gn b/chrome/browser/language/android/BUILD.gn
  820. --- a/chrome/browser/language/android/BUILD.gn
  821. +++ b/chrome/browser/language/android/BUILD.gn
  822. @@ -9,13 +9,11 @@ android_library("base_module_java") {
  823. sources = [
  824. "java/src/org/chromium/chrome/browser/language/AppLocaleUtils.java",
  825. "java/src/org/chromium/chrome/browser/language/GlobalAppLocaleController.java",
  826. - "java/src/org/chromium/chrome/browser/language/LanguageSplitInstaller.java",
  827. ]
  828. deps = [
  829. "//base:base_java",
  830. "//chrome/browser/preferences:java",
  831. "//components/language/android:language_bridge_java",
  832. - "//third_party/android_deps:com_google_android_play_core_java",
  833. "//third_party/androidx:androidx_annotation_annotation_java",
  834. "//ui/android:ui_no_recycler_view_java",
  835. ]
  836. diff --git a/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/AppLanguagePromoDialog.java b/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/AppLanguagePromoDialog.java
  837. --- a/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/AppLanguagePromoDialog.java
  838. +++ b/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/AppLanguagePromoDialog.java
  839. @@ -451,12 +451,6 @@ public class AppLanguagePromoDialog {
  840. mLoadingModal.set(ModalDialogProperties.CUSTOM_VIEW, customView);
  841. - // Only show the modal if the selected language is not installed.
  842. - if (!LanguageSplitInstaller.getInstance().isLanguageSplitInstalled(
  843. - selectedLanguage.getCode())) {
  844. - mModalDialogManager.showDialog(mLoadingModal, ModalDialogManager.ModalDialogType.APP);
  845. - }
  846. -
  847. boolean isSelectedCurrentUI = AppLocaleUtils.isAppLanguagePref(selectedLanguage.getCode());
  848. if (!isSelectedCurrentUI) {
  849. // Only record isTopLanguage if the app language has changed.
  850. @@ -464,23 +458,6 @@ public class AppLanguagePromoDialog {
  851. }
  852. AndroidLanguageMetricsBridge.reportAppLanguagePromptLanguage(
  853. selectedLanguage.isSystemDefault() ? "" : selectedLanguage.getCode());
  854. -
  855. - // Create call back for after language split install completes.
  856. - AppLocaleUtils.setAppLanguagePref(selectedLanguage.getCode(), (success) -> {
  857. - if (success) {
  858. - if (!isSelectedCurrentUI) {
  859. - // Only restart if the new language is different than the current UI.
  860. - mRestartAction.restart();
  861. - }
  862. - } else {
  863. - // The loading language modal will always already be shown if a download fails.
  864. - CharSequence failedText = mActivity.getResources().getString(
  865. - R.string.languages_split_failed, selectedLanguage.getDisplayName());
  866. - messageView.setText(failedText);
  867. - mLoadingModal.set(ModalDialogProperties.POSITIVE_BUTTON_TEXT,
  868. - mActivity.getText(R.string.ok).toString());
  869. - }
  870. - });
  871. }
  872. /**
  873. diff --git a/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/AppLanguagePreferenceDelegate.java b/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/AppLanguagePreferenceDelegate.java
  874. --- a/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/AppLanguagePreferenceDelegate.java
  875. +++ b/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/AppLanguagePreferenceDelegate.java
  876. @@ -87,14 +87,6 @@ public class AppLanguagePreferenceDelegate {
  877. // Disable preference so a second downloaded cannot be started while one is in progress.
  878. mPreference.setEnabled(false);
  879. -
  880. - AppLocaleUtils.setAppLanguagePref(code, (success) -> {
  881. - if (success) {
  882. - languageSplitDownloadComplete();
  883. - } else {
  884. - languageSplitDownloadFailed();
  885. - }
  886. - });
  887. }
  888. /**
  889. diff --git a/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java b/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java
  890. --- a/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java
  891. +++ b/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java
  892. @@ -19,7 +19,6 @@ import org.chromium.base.Log;
  893. import org.chromium.chrome.browser.flags.ChromeFeatureList;
  894. import org.chromium.chrome.browser.language.AppLocaleUtils;
  895. import org.chromium.chrome.browser.language.GlobalAppLocaleController;
  896. -import org.chromium.chrome.browser.language.LanguageSplitInstaller;
  897. import org.chromium.chrome.browser.language.R;
  898. import org.chromium.chrome.browser.preferences.Pref;
  899. import org.chromium.chrome.browser.preferences.PrefChangeRegistrar;
  900. @@ -101,11 +100,6 @@ public class LanguageSettings extends PreferenceFragmentCompat
  901. * translate target language, and detailed translate preferences.
  902. */
  903. private void createDetailedPreferences(Bundle savedInstanceState, String rootKey) {
  904. - // Log currently installed language splits.
  905. - String installedLanguages =
  906. - TextUtils.join(",", LanguageSplitInstaller.getInstance().getInstalledLanguages());
  907. - Log.i(TAG, TextUtils.concat("Installed Languages: ", installedLanguages).toString());
  908. -
  909. SettingsUtils.addPreferencesFromResource(this, R.xml.languages_detailed_preferences);
  910. setupAppLanguageSection();
  911. diff --git a/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc b/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc
  912. --- a/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc
  913. +++ b/chrome/browser/offline_pages/prefetch/prefetch_service_factory.cc
  914. @@ -18,7 +18,6 @@
  915. #include "chrome/browser/image_fetcher/image_fetcher_service_factory.h"
  916. #include "chrome/browser/net/system_network_context_manager.h"
  917. #include "chrome/browser/offline_pages/offline_page_model_factory.h"
  918. -#include "chrome/browser/offline_pages/prefetch/gcm_token.h"
  919. #include "chrome/browser/offline_pages/prefetch/offline_metrics_collector_impl.h"
  920. #include "chrome/browser/offline_pages/prefetch/prefetch_background_task_handler_impl.h"
  921. #include "chrome/browser/profiles/profile.h"
  922. @@ -68,21 +67,6 @@ void SwitchToFullBrowserImageFetcher(PrefetchServiceImpl* prefetch_service,
  923. }
  924. void OnProfileCreated(PrefetchServiceImpl* prefetch_service, Profile* profile) {
  925. - if (IsPrefetchingOfflinePagesEnabled()) {
  926. - // Trigger an update of the cached GCM token. This needs to be post tasked
  927. - // because otherwise leads to circular dependency between
  928. - // PrefetchServiceFactory and GCMProfileServiceFactory. See
  929. - // https://crbug.com/944952
  930. - // Update is not a priority so make sure it happens after the critical
  931. - // startup path.
  932. - content::GetUIThreadTaskRunner({base::TaskPriority::BEST_EFFORT})
  933. - ->PostTask(FROM_HERE,
  934. - base::BindOnce(
  935. - &GetGCMToken, profile, kPrefetchingOfflinePagesAppId,
  936. - base::BindOnce(&PrefetchServiceImpl::GCMTokenReceived,
  937. - prefetch_service->GetWeakPtr())));
  938. - }
  939. -
  940. SwitchToFullBrowserImageFetcher(prefetch_service, profile->GetProfileKey());
  941. }
  942. diff --git a/chrome/browser/password_manager/android/BUILD.gn b/chrome/browser/password_manager/android/BUILD.gn
  943. --- a/chrome/browser/password_manager/android/BUILD.gn
  944. +++ b/chrome/browser/password_manager/android/BUILD.gn
  945. @@ -50,7 +50,6 @@ android_library("java") {
  946. ":android_backend_java_enums",
  947. ":java_resources",
  948. ":settings_interface_java",
  949. - "$google_play_services_package:google_play_services_basement_java",
  950. "//base:base_java",
  951. "//chrome/browser/device_reauth/android:java",
  952. "//chrome/browser/flags:java",
  953. @@ -117,7 +116,6 @@ junit_binary("password_manager_junit_tests") {
  954. deps = [
  955. ":android_backend_java_enums",
  956. ":java",
  957. - "$google_play_services_package:google_play_services_basement_java",
  958. "//base:base_java",
  959. "//base:base_java_test_support",
  960. "//base:base_junit_test_support",
  961. diff --git a/chrome/browser/push_messaging/push_messaging_service_factory.cc b/chrome/browser/push_messaging/push_messaging_service_factory.cc
  962. --- a/chrome/browser/push_messaging/push_messaging_service_factory.cc
  963. +++ b/chrome/browser/push_messaging/push_messaging_service_factory.cc
  964. @@ -28,13 +28,7 @@
  965. // static
  966. PushMessagingServiceImpl* PushMessagingServiceFactory::GetForProfile(
  967. content::BrowserContext* context) {
  968. - // The Push API is not currently supported in incognito mode.
  969. - // See https://crbug.com/401439.
  970. - if (context->IsOffTheRecord())
  971. - return nullptr;
  972. -
  973. - return static_cast<PushMessagingServiceImpl*>(
  974. - GetInstance()->GetServiceForBrowserContext(context, true));
  975. + return nullptr;
  976. }
  977. // static
  978. diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
  979. --- a/chrome/browser/ui/BUILD.gn
  980. +++ b/chrome/browser/ui/BUILD.gn
  981. @@ -254,8 +254,6 @@ static_library("ui") {
  982. "webui/flags/flags_ui.h",
  983. "webui/flags/flags_ui_handler.cc",
  984. "webui/flags/flags_ui_handler.h",
  985. - "webui/gcm_internals_ui.cc",
  986. - "webui/gcm_internals_ui.h",
  987. "webui/internals/internals_ui.cc",
  988. "webui/internals/internals_ui.h",
  989. "webui/interstitials/interstitial_ui.cc",
  990. @@ -483,7 +481,6 @@ static_library("ui") {
  991. "//components/feedback/content",
  992. "//components/find_in_page",
  993. "//components/flags_ui",
  994. - "//components/gcm_driver",
  995. "//components/google/core/common",
  996. "//components/heap_profiling/multi_process",
  997. "//components/history/content/browser",
  998. diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
  999. --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
  1000. +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
  1001. @@ -37,7 +37,6 @@
  1002. #include "chrome/browser/ui/webui/engagement/site_engagement_ui.h"
  1003. #include "chrome/browser/ui/webui/federated_learning/floc_internals_ui.h"
  1004. #include "chrome/browser/ui/webui/flags/flags_ui.h"
  1005. -#include "chrome/browser/ui/webui/gcm_internals_ui.h"
  1006. #include "chrome/browser/ui/webui/image_editor/image_editor_ui.h"
  1007. #include "chrome/browser/ui/webui/internals/internals_ui.h"
  1008. #include "chrome/browser/ui/webui/interstitials/interstitial_ui.h"
  1009. @@ -632,8 +631,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
  1010. return &NewWebUI<FlagsUI>;
  1011. if (url.host_piece() == chrome::kChromeUIFlocInternalsHost)
  1012. return &NewWebUI<FlocInternalsUI>;
  1013. - if (url.host_piece() == chrome::kChromeUIGCMInternalsHost)
  1014. - return &NewWebUI<GCMInternalsUI>;
  1015. if (url.host_piece() == chrome::kChromeUIInternalsHost)
  1016. return &NewWebUI<InternalsUI>;
  1017. if (url.host_piece() == chrome::kChromeUIInterstitialHost)
  1018. diff --git a/chrome/test/android/BUILD.gn b/chrome/test/android/BUILD.gn
  1019. --- a/chrome/test/android/BUILD.gn
  1020. +++ b/chrome/test/android/BUILD.gn
  1021. @@ -307,8 +307,6 @@ android_library("chrome_java_test_support") {
  1022. ]
  1023. deps = [
  1024. - "$google_play_services_package:google_play_services_base_java",
  1025. - "$google_play_services_package:google_play_services_basement_java",
  1026. "//base:base_java",
  1027. "//base:base_java_test_support",
  1028. "//chrome/android:base_module_java",
  1029. diff --git a/components/background_task_scheduler/BUILD.gn b/components/background_task_scheduler/BUILD.gn
  1030. --- a/components/background_task_scheduler/BUILD.gn
  1031. +++ b/components/background_task_scheduler/BUILD.gn
  1032. @@ -121,11 +121,6 @@ if (is_android) {
  1033. deps = [
  1034. ":background_task_scheduler_task_ids_java",
  1035. - "$google_play_services_package:google_play_services_auth_base_java",
  1036. - "$google_play_services_package:google_play_services_base_java",
  1037. - "$google_play_services_package:google_play_services_basement_java",
  1038. - "$google_play_services_package:google_play_services_gcm_java",
  1039. - "$google_play_services_package:google_play_services_tasks_java",
  1040. "internal:internal_java",
  1041. "internal:proto_java",
  1042. "//base:base_java",
  1043. diff --git a/components/background_task_scheduler/internal/BUILD.gn b/components/background_task_scheduler/internal/BUILD.gn
  1044. --- a/components/background_task_scheduler/internal/BUILD.gn
  1045. +++ b/components/background_task_scheduler/internal/BUILD.gn
  1046. @@ -11,12 +11,10 @@ if (is_android) {
  1047. android_library("internal_java") {
  1048. sources = [
  1049. "android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskBroadcastReceiver.java",
  1050. - "android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskGcmTaskService.java",
  1051. "android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskJobService.java",
  1052. "android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerAlarmManager.java",
  1053. "android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerDelegate.java",
  1054. "android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerFactoryInternal.java",
  1055. - "android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerGcmNetworkManager.java",
  1056. "android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerImpl.java",
  1057. "android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerJobService.java",
  1058. "android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerPrefs.java",
  1059. @@ -27,10 +25,6 @@ if (is_android) {
  1060. deps = [
  1061. ":proto_java",
  1062. - "$google_play_services_package:google_play_services_base_java",
  1063. - "$google_play_services_package:google_play_services_basement_java",
  1064. - "$google_play_services_package:google_play_services_gcm_java",
  1065. - "$google_play_services_package:google_play_services_tasks_java",
  1066. "//base:base_java",
  1067. "//components/background_task_scheduler:background_task_scheduler_task_ids_java",
  1068. "//components/background_task_scheduler:public_java",
  1069. @@ -98,10 +92,6 @@ if (is_android) {
  1070. deps = [
  1071. ":internal_java",
  1072. - "$google_play_services_package:google_play_services_base_java",
  1073. - "$google_play_services_package:google_play_services_basement_java",
  1074. - "$google_play_services_package:google_play_services_gcm_java",
  1075. - "$google_play_services_package:google_play_services_tasks_java",
  1076. "//base:base_java",
  1077. "//base:base_java_test_support",
  1078. "//components/background_task_scheduler:background_task_scheduler_task_ids_java",
  1079. diff --git a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskGcmTaskService.java b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskGcmTaskService.java
  1080. deleted file mode 100644
  1081. --- a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskGcmTaskService.java
  1082. +++ /dev/null
  1083. @@ -1,160 +0,0 @@
  1084. -// Copyright 2017 The Chromium Authors. All rights reserved.
  1085. -// Use of this source code is governed by a BSD-style license that can be
  1086. -// found in the LICENSE file.
  1087. -
  1088. -package org.chromium.components.background_task_scheduler.internal;
  1089. -
  1090. -import android.os.Build;
  1091. -
  1092. -import androidx.annotation.VisibleForTesting;
  1093. -
  1094. -import com.google.android.gms.gcm.GcmNetworkManager;
  1095. -import com.google.android.gms.gcm.GcmTaskService;
  1096. -import com.google.android.gms.gcm.TaskParams;
  1097. -
  1098. -import org.chromium.base.ContextUtils;
  1099. -import org.chromium.base.Log;
  1100. -import org.chromium.base.ThreadUtils;
  1101. -import org.chromium.components.background_task_scheduler.BackgroundTask;
  1102. -import org.chromium.components.background_task_scheduler.TaskParameters;
  1103. -
  1104. -import java.util.concurrent.CountDownLatch;
  1105. -import java.util.concurrent.TimeUnit;
  1106. -import java.util.concurrent.atomic.AtomicBoolean;
  1107. -
  1108. -/** Delegates calls out to various tasks that need to run in the background. */
  1109. -public class BackgroundTaskGcmTaskService extends GcmTaskService {
  1110. - private static final String TAG = "BkgrdTaskGcmTS";
  1111. -
  1112. - private BackgroundTaskSchedulerGcmNetworkManager.Clock mClock = System::currentTimeMillis;
  1113. -
  1114. - @VisibleForTesting
  1115. - void setClockForTesting(BackgroundTaskSchedulerGcmNetworkManager.Clock clock) {
  1116. - mClock = clock;
  1117. - }
  1118. -
  1119. - /** Class that waits for the processing to be done. */
  1120. - private static class Waiter {
  1121. - // Wakelock is only held for 3 minutes by default for GcmTaskService.
  1122. - private static final long MAX_TIMEOUT_SECONDS = 179;
  1123. - private final CountDownLatch mLatch;
  1124. - private long mWaiterTimeoutSeconds;
  1125. - private boolean mIsRescheduleNeeded;
  1126. - private boolean mHasTaskTimedOut;
  1127. -
  1128. - public Waiter(long waiterTimeoutSeconds) {
  1129. - mLatch = new CountDownLatch(1);
  1130. - mWaiterTimeoutSeconds = Math.min(waiterTimeoutSeconds, MAX_TIMEOUT_SECONDS);
  1131. - }
  1132. -
  1133. - /** Start waiting for the processing to finish. */
  1134. - public void startWaiting() {
  1135. - try {
  1136. - mHasTaskTimedOut = !mLatch.await(mWaiterTimeoutSeconds, TimeUnit.SECONDS);
  1137. - } catch (InterruptedException e) {
  1138. - Log.d(TAG, "Waiter interrupted while waiting.");
  1139. - }
  1140. - }
  1141. -
  1142. - /** Called to finish waiting. */
  1143. - public void onWaitDone(boolean needsRescheduling) {
  1144. - mIsRescheduleNeeded = needsRescheduling;
  1145. - mLatch.countDown();
  1146. - }
  1147. -
  1148. - /** @return Whether last task timed out. */
  1149. - public boolean hasTaskTimedOut() {
  1150. - return mHasTaskTimedOut;
  1151. - }
  1152. -
  1153. - /** @return Whether task needs to be rescheduled. */
  1154. - public boolean isRescheduleNeeded() {
  1155. - return mIsRescheduleNeeded;
  1156. - }
  1157. - }
  1158. -
  1159. - private static class TaskFinishedCallbackGcmTaskService
  1160. - implements BackgroundTask.TaskFinishedCallback {
  1161. - private final Waiter mWaiter;
  1162. -
  1163. - public TaskFinishedCallbackGcmTaskService(Waiter waiter) {
  1164. - mWaiter = waiter;
  1165. - }
  1166. -
  1167. - @Override
  1168. - public void taskFinished(final boolean needsReschedule) {
  1169. - ThreadUtils.runOnUiThreadBlocking(new Runnable() {
  1170. - @Override
  1171. - public void run() {
  1172. - mWaiter.onWaitDone(needsReschedule);
  1173. - }
  1174. - });
  1175. - }
  1176. - }
  1177. -
  1178. - @Override
  1179. - public int onRunTask(TaskParams params) {
  1180. - final TaskParameters taskParams =
  1181. - BackgroundTaskSchedulerGcmNetworkManager.getTaskParametersFromTaskParams(params);
  1182. -
  1183. - final BackgroundTask backgroundTask =
  1184. - BackgroundTaskSchedulerFactoryInternal.getBackgroundTaskFromTaskId(
  1185. - taskParams.getTaskId());
  1186. - if (backgroundTask == null) {
  1187. - Log.w(TAG, "Failed to start task. Could not instantiate BackgroundTask class.");
  1188. - // Cancel task if the BackgroundTask class is not found anymore. We assume this means
  1189. - // that the task has been deprecated.
  1190. - BackgroundTaskSchedulerFactoryInternal.getScheduler().cancel(
  1191. - ContextUtils.getApplicationContext(), taskParams.getTaskId());
  1192. - return GcmNetworkManager.RESULT_FAILURE;
  1193. - }
  1194. -
  1195. - if (BackgroundTaskSchedulerGcmNetworkManager.didTaskExpire(
  1196. - params, mClock.currentTimeMillis())) {
  1197. - BackgroundTaskSchedulerUma.getInstance().reportTaskExpired(taskParams.getTaskId());
  1198. - return GcmNetworkManager.RESULT_FAILURE;
  1199. - }
  1200. -
  1201. - final Waiter waiter = new Waiter(Waiter.MAX_TIMEOUT_SECONDS);
  1202. -
  1203. - final AtomicBoolean taskNeedsBackgroundProcessing = new AtomicBoolean();
  1204. - ThreadUtils.runOnUiThreadBlocking(new Runnable() {
  1205. - @Override
  1206. - public void run() {
  1207. - BackgroundTaskSchedulerUma.getInstance().reportTaskStarted(taskParams.getTaskId());
  1208. - taskNeedsBackgroundProcessing.set(
  1209. - backgroundTask.onStartTask(ContextUtils.getApplicationContext(), taskParams,
  1210. - new TaskFinishedCallbackGcmTaskService(waiter)));
  1211. - }
  1212. - });
  1213. -
  1214. - if (!taskNeedsBackgroundProcessing.get()) return GcmNetworkManager.RESULT_SUCCESS;
  1215. -
  1216. - waiter.startWaiting();
  1217. -
  1218. - if (waiter.isRescheduleNeeded()) return GcmNetworkManager.RESULT_RESCHEDULE;
  1219. - if (!waiter.hasTaskTimedOut()) return GcmNetworkManager.RESULT_SUCCESS;
  1220. -
  1221. - final AtomicBoolean taskNeedsRescheduling = new AtomicBoolean();
  1222. - ThreadUtils.runOnUiThreadBlocking(new Runnable() {
  1223. - @Override
  1224. - public void run() {
  1225. - BackgroundTaskSchedulerUma.getInstance().reportTaskStopped(taskParams.getTaskId());
  1226. - taskNeedsRescheduling.set(backgroundTask.onStopTask(
  1227. - ContextUtils.getApplicationContext(), taskParams));
  1228. - }
  1229. - });
  1230. -
  1231. - if (taskNeedsRescheduling.get()) return GcmNetworkManager.RESULT_RESCHEDULE;
  1232. -
  1233. - return GcmNetworkManager.RESULT_SUCCESS;
  1234. - }
  1235. -
  1236. - @Override
  1237. - public void onInitializeTasks() {
  1238. - // Ignore the event on OSs supporting JobScheduler.
  1239. - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) return;
  1240. - BackgroundTaskSchedulerFactoryInternal.getScheduler().reschedule(
  1241. - ContextUtils.getApplicationContext());
  1242. - }
  1243. -}
  1244. diff --git a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerFactoryInternal.java b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerFactoryInternal.java
  1245. --- a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerFactoryInternal.java
  1246. +++ b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerFactoryInternal.java
  1247. @@ -21,11 +21,7 @@ public final class BackgroundTaskSchedulerFactoryInternal {
  1248. private static BackgroundTaskFactory sBackgroundTaskFactory;
  1249. static BackgroundTaskSchedulerDelegate getSchedulerDelegateForSdk(int sdkInt) {
  1250. - if (sdkInt >= Build.VERSION_CODES.M) {
  1251. - return new BackgroundTaskSchedulerJobService();
  1252. - } else {
  1253. - return new BackgroundTaskSchedulerGcmNetworkManager();
  1254. - }
  1255. + return new BackgroundTaskSchedulerJobService();
  1256. }
  1257. /**
  1258. diff --git a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerGcmNetworkManager.java b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerGcmNetworkManager.java
  1259. deleted file mode 100644
  1260. --- a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerGcmNetworkManager.java
  1261. +++ /dev/null
  1262. @@ -1,257 +0,0 @@
  1263. -// Copyright 2017 The Chromium Authors. All rights reserved.
  1264. -// Use of this source code is governed by a BSD-style license that can be
  1265. -// found in the LICENSE file.
  1266. -
  1267. -package org.chromium.components.background_task_scheduler.internal;
  1268. -
  1269. -import android.content.Context;
  1270. -import android.os.Bundle;
  1271. -
  1272. -import androidx.annotation.NonNull;
  1273. -import androidx.annotation.VisibleForTesting;
  1274. -
  1275. -import com.google.android.gms.gcm.GcmNetworkManager;
  1276. -import com.google.android.gms.gcm.OneoffTask;
  1277. -import com.google.android.gms.gcm.PeriodicTask;
  1278. -import com.google.android.gms.gcm.Task;
  1279. -import com.google.android.gms.gcm.TaskParams;
  1280. -
  1281. -import org.chromium.base.Log;
  1282. -import org.chromium.base.ThreadUtils;
  1283. -import org.chromium.components.background_task_scheduler.TaskInfo;
  1284. -import org.chromium.components.background_task_scheduler.TaskParameters;
  1285. -import org.chromium.gms.ChromiumPlayServicesAvailability;
  1286. -
  1287. -import java.util.concurrent.TimeUnit;
  1288. -
  1289. -/**
  1290. - * An implementation of {@link BackgroundTaskSchedulerDelegate} that uses the Play Services
  1291. - * {@link GcmNetworkManager} to schedule jobs.
  1292. - */
  1293. -class BackgroundTaskSchedulerGcmNetworkManager implements BackgroundTaskSchedulerDelegate {
  1294. - private static final String TAG = "BkgrdTaskSchedGcmNM";
  1295. -
  1296. - /** Delta time for expiration checks, after the end time. */
  1297. - static final long DEADLINE_DELTA_MS = 1000;
  1298. -
  1299. - /** Clock to use so we can mock time in tests. */
  1300. - public interface Clock { long currentTimeMillis(); }
  1301. -
  1302. - private static Clock sClock = System::currentTimeMillis;
  1303. -
  1304. - @VisibleForTesting
  1305. - static void setClockForTesting(Clock clock) {
  1306. - sClock = clock;
  1307. - }
  1308. -
  1309. - /**
  1310. - * Checks if a task expired, based on the current time of the service.
  1311. - *
  1312. - * @param taskParams parameters sent to the service, which contain the scheduling information
  1313. - * regarding expiration.
  1314. - * @param currentTimeMs the current time of the service.
  1315. - * @return true if the task expired and false otherwise.
  1316. - */
  1317. - static boolean didTaskExpire(TaskParams taskParams, long currentTimeMs) {
  1318. - Bundle extras = taskParams.getExtras();
  1319. - if (extras == null || !extras.containsKey(BACKGROUND_TASK_SCHEDULE_TIME_KEY)) {
  1320. - return false;
  1321. - }
  1322. -
  1323. - long scheduleTimeMs = extras.getLong(BACKGROUND_TASK_SCHEDULE_TIME_KEY);
  1324. - if (extras.containsKey(BACKGROUND_TASK_END_TIME_KEY)) {
  1325. - long endTimeMs =
  1326. - extras.getLong(BackgroundTaskSchedulerDelegate.BACKGROUND_TASK_END_TIME_KEY);
  1327. - return TaskInfo.OneOffInfo.getExpirationStatus(
  1328. - scheduleTimeMs, endTimeMs, currentTimeMs);
  1329. - } else {
  1330. - long intervalTimeMs = extras.getLong(BACKGROUND_TASK_INTERVAL_TIME_KEY);
  1331. -
  1332. - // If flex is never set, it is given a default value of 10% of the period time, as
  1333. - // per the GcmNetworkManager behaviour. This default value is set in
  1334. - // https://developers.google.com/android/reference/com/google/android/gms/gcm/PeriodicTask.
  1335. - double defaultFlexAsFractionOfInterval = 0.1f;
  1336. -
  1337. - long flexTimeMs = extras.getLong(BACKGROUND_TASK_FLEX_TIME_KEY,
  1338. - /*defaultValue=*/(long) (defaultFlexAsFractionOfInterval * intervalTimeMs));
  1339. -
  1340. - return TaskInfo.PeriodicInfo.getExpirationStatus(
  1341. - scheduleTimeMs, intervalTimeMs, flexTimeMs, currentTimeMs);
  1342. - }
  1343. - }
  1344. -
  1345. - /**
  1346. - * Retrieves the {@link TaskParameters} from the {@link TaskParams}, which are passed as
  1347. - * one of the keys. Only values valid for {@link android.os.BaseBundle} are supported, and other
  1348. - * values are stripped at the time when the task is scheduled.
  1349. - *
  1350. - * @param taskParams the {@link TaskParams} to extract the {@link TaskParameters} from.
  1351. - * @return the {@link TaskParameters} for the current job.
  1352. - */
  1353. - static TaskParameters getTaskParametersFromTaskParams(@NonNull TaskParams taskParams) {
  1354. - int taskId;
  1355. - try {
  1356. - taskId = Integer.parseInt(taskParams.getTag());
  1357. - } catch (NumberFormatException e) {
  1358. - Log.e(TAG, "Cound not parse task ID from task tag: " + taskParams.getTag());
  1359. - return null;
  1360. - }
  1361. -
  1362. - TaskParameters.Builder builder = TaskParameters.create(taskId);
  1363. -
  1364. - Bundle extras = taskParams.getExtras();
  1365. - Bundle taskExtras = extras.getBundle(BACKGROUND_TASK_EXTRAS_KEY);
  1366. - builder.addExtras(taskExtras);
  1367. -
  1368. - return builder.build();
  1369. - }
  1370. -
  1371. - @VisibleForTesting
  1372. - static Task createTaskFromTaskInfo(@NonNull TaskInfo taskInfo) {
  1373. - Bundle taskExtras = new Bundle();
  1374. - taskExtras.putBundle(BACKGROUND_TASK_EXTRAS_KEY, taskInfo.getExtras());
  1375. -
  1376. - TaskBuilderVisitor taskBuilderVisitor = new TaskBuilderVisitor(taskExtras);
  1377. - taskInfo.getTimingInfo().accept(taskBuilderVisitor);
  1378. - Task.Builder builder = taskBuilderVisitor.getBuilder();
  1379. -
  1380. - builder.setPersisted(taskInfo.isPersisted())
  1381. - .setRequiredNetwork(getGcmNetworkManagerNetworkTypeFromTypeFromTaskNetworkType(
  1382. - taskInfo.getRequiredNetworkType()))
  1383. - .setRequiresCharging(taskInfo.requiresCharging())
  1384. - .setService(BackgroundTaskGcmTaskService.class)
  1385. - .setTag(taskIdToTaskTag(taskInfo.getTaskId()))
  1386. - .setUpdateCurrent(taskInfo.shouldUpdateCurrent());
  1387. -
  1388. - return builder.build();
  1389. - }
  1390. -
  1391. - private static class TaskBuilderVisitor implements TaskInfo.TimingInfoVisitor {
  1392. - private Task.Builder mBuilder;
  1393. - private final Bundle mTaskExtras;
  1394. -
  1395. - TaskBuilderVisitor(Bundle taskExtras) {
  1396. - mTaskExtras = taskExtras;
  1397. - }
  1398. -
  1399. - // Only valid after a TimingInfo object was visited.
  1400. - Task.Builder getBuilder() {
  1401. - return mBuilder;
  1402. - }
  1403. -
  1404. - @Override
  1405. - public void visit(TaskInfo.OneOffInfo oneOffInfo) {
  1406. - if (oneOffInfo.expiresAfterWindowEndTime()) {
  1407. - mTaskExtras.putLong(BACKGROUND_TASK_SCHEDULE_TIME_KEY, sClock.currentTimeMillis());
  1408. - mTaskExtras.putLong(BACKGROUND_TASK_END_TIME_KEY, oneOffInfo.getWindowEndTimeMs());
  1409. - }
  1410. -
  1411. - OneoffTask.Builder builder = new OneoffTask.Builder();
  1412. - long windowStartSeconds = oneOffInfo.hasWindowStartTimeConstraint()
  1413. - ? TimeUnit.MILLISECONDS.toSeconds(oneOffInfo.getWindowStartTimeMs())
  1414. - : 0;
  1415. - long windowEndTimeMs = oneOffInfo.getWindowEndTimeMs();
  1416. - if (oneOffInfo.expiresAfterWindowEndTime()) {
  1417. - windowEndTimeMs += DEADLINE_DELTA_MS;
  1418. - }
  1419. - builder.setExecutionWindow(
  1420. - windowStartSeconds, TimeUnit.MILLISECONDS.toSeconds(windowEndTimeMs));
  1421. - builder.setExtras(mTaskExtras);
  1422. - mBuilder = builder;
  1423. - }
  1424. -
  1425. - @Override
  1426. - public void visit(TaskInfo.PeriodicInfo periodicInfo) {
  1427. - if (periodicInfo.expiresAfterWindowEndTime()) {
  1428. - mTaskExtras.putLong(BACKGROUND_TASK_SCHEDULE_TIME_KEY, sClock.currentTimeMillis());
  1429. - mTaskExtras.putLong(
  1430. - BACKGROUND_TASK_INTERVAL_TIME_KEY, periodicInfo.getIntervalMs());
  1431. - if (periodicInfo.hasFlex()) {
  1432. - mTaskExtras.putLong(BACKGROUND_TASK_FLEX_TIME_KEY, periodicInfo.getFlexMs());
  1433. - }
  1434. - }
  1435. -
  1436. - PeriodicTask.Builder builder = new PeriodicTask.Builder();
  1437. - builder.setPeriod(TimeUnit.MILLISECONDS.toSeconds(periodicInfo.getIntervalMs()));
  1438. - if (periodicInfo.hasFlex()) {
  1439. - builder.setFlex(TimeUnit.MILLISECONDS.toSeconds(periodicInfo.getFlexMs()));
  1440. - }
  1441. - builder.setExtras(mTaskExtras);
  1442. - mBuilder = builder;
  1443. - }
  1444. -
  1445. - @Override
  1446. - public void visit(TaskInfo.ExactInfo exactInfo) {
  1447. - throw new RuntimeException("Exact tasks should not be scheduled with "
  1448. - + "GcmNetworkManager.");
  1449. - }
  1450. - }
  1451. -
  1452. - private static int getGcmNetworkManagerNetworkTypeFromTypeFromTaskNetworkType(
  1453. - @TaskInfo.NetworkType int networkType) {
  1454. - switch (networkType) {
  1455. - // This is correct: GcmNM ANY means no network is guaranteed.
  1456. - case TaskInfo.NetworkType.NONE:
  1457. - return Task.NETWORK_STATE_ANY;
  1458. - case TaskInfo.NetworkType.ANY:
  1459. - return Task.NETWORK_STATE_CONNECTED;
  1460. - case TaskInfo.NetworkType.UNMETERED:
  1461. - return Task.NETWORK_STATE_UNMETERED;
  1462. - default:
  1463. - assert false;
  1464. - }
  1465. - return Task.NETWORK_STATE_ANY;
  1466. - }
  1467. -
  1468. - @Override
  1469. - public boolean schedule(Context context, @NonNull TaskInfo taskInfo) {
  1470. - ThreadUtils.assertOnUiThread();
  1471. -
  1472. - GcmNetworkManager gcmNetworkManager = getGcmNetworkManager(context);
  1473. - if (gcmNetworkManager == null) {
  1474. - Log.e(TAG, "GcmNetworkManager is not available.");
  1475. - return false;
  1476. - }
  1477. -
  1478. - try {
  1479. - Task task = createTaskFromTaskInfo(taskInfo);
  1480. - gcmNetworkManager.schedule(task);
  1481. - } catch (IllegalArgumentException e) {
  1482. - String gcmErrorMessage = e.getMessage() == null ? "null." : e.getMessage();
  1483. - Log.e(TAG,
  1484. - "GcmNetworkManager failed to schedule task, gcm message: " + gcmErrorMessage);
  1485. - return false;
  1486. - }
  1487. -
  1488. - return true;
  1489. - }
  1490. -
  1491. - @Override
  1492. - public void cancel(Context context, int taskId) {
  1493. - ThreadUtils.assertOnUiThread();
  1494. -
  1495. - GcmNetworkManager gcmNetworkManager = getGcmNetworkManager(context);
  1496. - if (gcmNetworkManager == null) {
  1497. - Log.e(TAG, "GcmNetworkManager is not available.");
  1498. - return;
  1499. - }
  1500. -
  1501. - try {
  1502. - gcmNetworkManager.cancelTask(
  1503. - taskIdToTaskTag(taskId), BackgroundTaskGcmTaskService.class);
  1504. - } catch (IllegalArgumentException e) {
  1505. - Log.e(TAG, "GcmNetworkManager failed to cancel task.");
  1506. - }
  1507. - }
  1508. -
  1509. - private GcmNetworkManager getGcmNetworkManager(Context context) {
  1510. - if (ChromiumPlayServicesAvailability.isGooglePlayServicesAvailable(context)) {
  1511. - return GcmNetworkManager.getInstance(context);
  1512. - }
  1513. - return null;
  1514. - }
  1515. -
  1516. - private static String taskIdToTaskTag(int taskId) {
  1517. - return Integer.toString(taskId);
  1518. - }
  1519. -}
  1520. diff --git a/components/component_updater/android/java/src/org/chromium/components/component_updater/UpdateScheduler.java b/components/component_updater/android/java/src/org/chromium/components/component_updater/UpdateScheduler.java
  1521. --- a/components/component_updater/android/java/src/org/chromium/components/component_updater/UpdateScheduler.java
  1522. +++ b/components/component_updater/android/java/src/org/chromium/components/component_updater/UpdateScheduler.java
  1523. @@ -14,7 +14,6 @@ import org.chromium.components.background_task_scheduler.BackgroundTask.TaskFini
  1524. import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerFactory;
  1525. import org.chromium.components.background_task_scheduler.TaskIds;
  1526. import org.chromium.components.background_task_scheduler.TaskInfo;
  1527. -import org.chromium.gms.ChromiumPlayServicesAvailability;
  1528. /** Java-side implementation of the component update scheduler using the BackgroundTaskScheduler. */
  1529. @JNINamespace("component_updater")
  1530. diff --git a/components/externalauth/android/BUILD.gn b/components/externalauth/android/BUILD.gn
  1531. --- a/components/externalauth/android/BUILD.gn
  1532. +++ b/components/externalauth/android/BUILD.gn
  1533. @@ -27,8 +27,6 @@ android_library("google_delegate_public_impl_java") {
  1534. android_library("java") {
  1535. deps = [
  1536. ":google_delegate_java",
  1537. - "$google_play_services_package:google_play_services_base_java",
  1538. - "$google_play_services_package:google_play_services_basement_java",
  1539. "//base:base_java",
  1540. "//components/embedder_support/android:util_java",
  1541. "//content/public/android:content_java",
  1542. @@ -49,7 +47,6 @@ android_library("junit") {
  1543. deps = [
  1544. ":java",
  1545. - "$google_play_services_package:google_play_services_basement_java",
  1546. "//base:base_java",
  1547. "//base:base_java_test_support",
  1548. "//base:base_junit_test_support",
  1549. diff --git a/components/externalauth/android/java/src/org/chromium/components/externalauth/ExternalAuthUtils.java b/components/externalauth/android/java/src/org/chromium/components/externalauth/ExternalAuthUtils.java
  1550. --- a/components/externalauth/android/java/src/org/chromium/components/externalauth/ExternalAuthUtils.java
  1551. +++ b/components/externalauth/android/java/src/org/chromium/components/externalauth/ExternalAuthUtils.java
  1552. @@ -15,16 +15,12 @@ import android.text.TextUtils;
  1553. import androidx.annotation.VisibleForTesting;
  1554. import androidx.annotation.WorkerThread;
  1555. -import com.google.android.gms.common.ConnectionResult;
  1556. -import com.google.android.gms.common.GoogleApiAvailability;
  1557. -
  1558. import org.chromium.base.ContextUtils;
  1559. import org.chromium.base.Log;
  1560. import org.chromium.base.StrictModeContext;
  1561. import org.chromium.base.task.PostTask;
  1562. import org.chromium.components.embedder_support.util.Origin;
  1563. import org.chromium.content_public.browser.UiThreadTaskTraits;
  1564. -import org.chromium.gms.ChromiumPlayServicesAvailability;
  1565. /**
  1566. * Utility class for external authentication tools.
  1567. @@ -170,9 +166,7 @@ public class ExternalAuthUtils {
  1568. * when it is updating.
  1569. */
  1570. public boolean isGooglePlayServicesMissing(final Context context) {
  1571. - final int resultCode = checkGooglePlayServicesAvailable(context);
  1572. - return (resultCode == ConnectionResult.SERVICE_MISSING
  1573. - || resultCode == ConnectionResult.SERVICE_INVALID);
  1574. + return true;
  1575. }
  1576. /**
  1577. @@ -189,7 +183,6 @@ public class ExternalAuthUtils {
  1578. public boolean canUseGooglePlayServices(final UserRecoverableErrorHandler errorHandler) {
  1579. Context context = ContextUtils.getApplicationContext();
  1580. final int resultCode = checkGooglePlayServicesAvailable(context);
  1581. - if (resultCode == ConnectionResult.SUCCESS) return true;
  1582. // resultCode is some kind of error.
  1583. Log.v(TAG, "Unable to use Google Play Services: %s", describeError(resultCode));
  1584. if (isUserRecoverableError(resultCode)) {
  1585. @@ -260,10 +253,7 @@ public class ExternalAuthUtils {
  1586. * @return The code produced by calling the external code
  1587. */
  1588. protected int checkGooglePlayServicesAvailable(final Context context) {
  1589. - // TODO(crbug.com/577190): Temporarily allowing disk access until more permanent fix is in.
  1590. - try (StrictModeContext ignored = StrictModeContext.allowDiskWrites()) {
  1591. - return ChromiumPlayServicesAvailability.getGooglePlayServicesConnectionResult(context);
  1592. - }
  1593. + return 1; /*SERVICE_MISSING*/
  1594. }
  1595. /**
  1596. @@ -274,7 +264,7 @@ public class ExternalAuthUtils {
  1597. * @return true If the code represents a user-recoverable error
  1598. */
  1599. protected boolean isUserRecoverableError(final int errorCode) {
  1600. - return GoogleApiAvailability.getInstance().isUserResolvableError(errorCode);
  1601. + return false;
  1602. }
  1603. /**
  1604. @@ -284,7 +274,7 @@ public class ExternalAuthUtils {
  1605. * @return a textual description of the error code
  1606. */
  1607. protected String describeError(final int errorCode) {
  1608. - return GoogleApiAvailability.getInstance().getErrorString(errorCode);
  1609. + return "";
  1610. }
  1611. /**
  1612. diff --git a/components/externalauth/android/java/src/org/chromium/components/externalauth/UserRecoverableErrorHandler.java b/components/externalauth/android/java/src/org/chromium/components/externalauth/UserRecoverableErrorHandler.java
  1613. --- a/components/externalauth/android/java/src/org/chromium/components/externalauth/UserRecoverableErrorHandler.java
  1614. +++ b/components/externalauth/android/java/src/org/chromium/components/externalauth/UserRecoverableErrorHandler.java
  1615. @@ -9,8 +9,6 @@ import android.app.Dialog;
  1616. import android.content.Context;
  1617. import android.content.DialogInterface;
  1618. -import com.google.android.gms.common.GoogleApiAvailability;
  1619. -
  1620. import org.chromium.base.ThreadUtils;
  1621. import org.chromium.base.metrics.RecordUserAction;
  1622. @@ -89,7 +87,6 @@ public abstract class UserRecoverableErrorHandler {
  1623. if (!sNotificationShown.getAndSet(true)) {
  1624. return;
  1625. }
  1626. - GoogleApiAvailability.getInstance().showErrorNotification(context, errorCode);
  1627. }
  1628. }
  1629. @@ -182,11 +179,7 @@ public abstract class UserRecoverableErrorHandler {
  1630. cancelDialog();
  1631. }
  1632. if (mDialog == null) {
  1633. - mDialog = GoogleApiAvailability.getInstance().getErrorDialog(
  1634. - mActivity, errorCode, NO_RESPONSE_REQUIRED);
  1635. mErrorCode = errorCode;
  1636. -
  1637. - DialogUserActionRecorder.createAndAttachToDialog(mDialog);
  1638. }
  1639. // This can happen if |errorCode| is ConnectionResult.SERVICE_INVALID.
  1640. if (mDialog != null && !mDialog.isShowing()) {
  1641. diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
  1642. --- a/components/gcm_driver/gcm_client_impl.cc
  1643. +++ b/components/gcm_driver/gcm_client_impl.cc
  1644. @@ -465,6 +465,7 @@ void GCMClientImpl::StartGCM() {
  1645. void GCMClientImpl::InitializeMCSClient() {
  1646. DCHECK(network_connection_tracker_);
  1647. + return;
  1648. std::vector<GURL> endpoints;
  1649. endpoints.push_back(gservices_settings_.GetMCSMainEndpoint());
  1650. GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint();
  1651. @@ -659,6 +660,7 @@ void GCMClientImpl::AddHeartbeatInterval(const std::string& scope,
  1652. int interval_ms) {
  1653. DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
  1654. DCHECK(mcs_client_);
  1655. + return;
  1656. mcs_client_->AddHeartbeatInterval(scope, interval_ms);
  1657. }
  1658. @@ -670,6 +672,7 @@ void GCMClientImpl::RemoveHeartbeatInterval(const std::string& scope) {
  1659. void GCMClientImpl::StartCheckin() {
  1660. DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
  1661. + return;
  1662. // Make sure no checkin is in progress.
  1663. if (checkin_request_)
  1664. @@ -747,6 +750,7 @@ void GCMClientImpl::SetGServicesSettingsCallback(bool success) {
  1665. void GCMClientImpl::SchedulePeriodicCheckin() {
  1666. DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
  1667. + return;
  1668. // Make sure no checkin is in progress.
  1669. if (checkin_request_.get() || !device_checkin_info_.accounts_set)
  1670. diff --git a/components/gcm_driver/instance_id/android/BUILD.gn b/components/gcm_driver/instance_id/android/BUILD.gn
  1671. --- a/components/gcm_driver/instance_id/android/BUILD.gn
  1672. +++ b/components/gcm_driver/instance_id/android/BUILD.gn
  1673. @@ -15,7 +15,6 @@ generate_jni("test_support_jni_headers") {
  1674. android_library("instance_id_driver_java") {
  1675. deps = [
  1676. - "$google_play_services_package:google_play_services_iid_java",
  1677. "//base:base_java",
  1678. "//components/gcm_driver/android:gcm_driver_java",
  1679. "//third_party/androidx:androidx_annotation_annotation_java",
  1680. @@ -27,14 +26,12 @@ android_library("instance_id_driver_java") {
  1681. sources = [
  1682. "java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java",
  1683. - "java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDWithSubtype.java",
  1684. ]
  1685. }
  1686. android_library("instance_id_driver_test_support_java") {
  1687. deps = [
  1688. ":instance_id_driver_java",
  1689. - "$google_play_services_package:google_play_services_iid_java",
  1690. "//base:base_java",
  1691. ]
  1692. diff --git a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java
  1693. --- a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java
  1694. +++ b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java
  1695. @@ -27,7 +27,6 @@ public class InstanceIDBridge {
  1696. * Underlying InstanceIDWithSubtype. May be shared by multiple InstanceIDBridges. Must be
  1697. * initialized on a background thread.
  1698. */
  1699. - private InstanceIDWithSubtype mInstanceID;
  1700. private static boolean sBlockOnAsyncTasksForTesting;
  1701. @@ -72,7 +71,7 @@ public class InstanceIDBridge {
  1702. new BridgeAsyncTask<String>() {
  1703. @Override
  1704. protected String doBackgroundWork() {
  1705. - return mInstanceID.getId();
  1706. + return "";
  1707. }
  1708. @Override
  1709. protected void sendResultToNative(String id) {
  1710. @@ -88,7 +87,7 @@ public class InstanceIDBridge {
  1711. new BridgeAsyncTask<Long>() {
  1712. @Override
  1713. protected Long doBackgroundWork() {
  1714. - return mInstanceID.getCreationTime();
  1715. + return 0L;
  1716. }
  1717. @Override
  1718. protected void sendResultToNative(Long creationTime) {
  1719. @@ -110,21 +109,7 @@ public class InstanceIDBridge {
  1720. new BridgeAsyncTask<String>() {
  1721. @Override
  1722. protected String doBackgroundWork() {
  1723. - try {
  1724. - // TODO(crbug.com/1247170): Migrate stored LazySubscriptionsManager data to
  1725. - // SubscriptionFlagManager.
  1726. - LazySubscriptionsManager.storeLazinessInformation(
  1727. - LazySubscriptionsManager.buildSubscriptionUniqueId(
  1728. - mSubtype, authorizedEntity),
  1729. - (flags & InstanceIDFlags.IS_LAZY) == InstanceIDFlags.IS_LAZY);
  1730. - SubscriptionFlagManager.setFlags(
  1731. - SubscriptionFlagManager.buildSubscriptionUniqueId(
  1732. - mSubtype, authorizedEntity),
  1733. - flags);
  1734. - return mInstanceID.getToken(authorizedEntity, scope);
  1735. - } catch (IOException ex) {
  1736. return "";
  1737. - }
  1738. }
  1739. @Override
  1740. protected void sendResultToNative(String token) {
  1741. @@ -141,21 +126,7 @@ public class InstanceIDBridge {
  1742. new BridgeAsyncTask<Boolean>() {
  1743. @Override
  1744. protected Boolean doBackgroundWork() {
  1745. - try {
  1746. - mInstanceID.deleteToken(authorizedEntity, scope);
  1747. - String subscriptionId = LazySubscriptionsManager.buildSubscriptionUniqueId(
  1748. - mSubtype, authorizedEntity);
  1749. - if (LazySubscriptionsManager.isSubscriptionLazy(subscriptionId)) {
  1750. - LazySubscriptionsManager.deletePersistedMessagesForSubscriptionId(
  1751. - subscriptionId);
  1752. - }
  1753. - SubscriptionFlagManager.clearFlags(
  1754. - SubscriptionFlagManager.buildSubscriptionUniqueId(
  1755. - mSubtype, authorizedEntity));
  1756. - return true;
  1757. - } catch (IOException ex) {
  1758. - return false;
  1759. - }
  1760. + return false;
  1761. }
  1762. @Override
  1763. protected void sendResultToNative(Boolean success) {
  1764. @@ -171,12 +142,7 @@ public class InstanceIDBridge {
  1765. new BridgeAsyncTask<Boolean>() {
  1766. @Override
  1767. protected Boolean doBackgroundWork() {
  1768. - try {
  1769. - mInstanceID.deleteInstanceID();
  1770. - return true;
  1771. - } catch (IOException ex) {
  1772. - return false;
  1773. - }
  1774. + return true;
  1775. }
  1776. @Override
  1777. protected void sendResultToNative(Boolean success) {
  1778. @@ -206,11 +172,6 @@ public class InstanceIDBridge {
  1779. @Override
  1780. @SuppressWarnings("NoSynchronizedThisCheck") // Only used/accessible by native.
  1781. protected Result doInBackground() {
  1782. - synchronized (InstanceIDBridge.this) {
  1783. - if (mInstanceID == null) {
  1784. - mInstanceID = InstanceIDWithSubtype.getInstance(mSubtype);
  1785. - }
  1786. - }
  1787. return doBackgroundWork();
  1788. }
  1789. @Override
  1790. diff --git a/components/media_router/browser/android/BUILD.gn b/components/media_router/browser/android/BUILD.gn
  1791. --- a/components/media_router/browser/android/BUILD.gn
  1792. +++ b/components/media_router/browser/android/BUILD.gn
  1793. @@ -11,10 +11,6 @@ android_library("java") {
  1794. resources_package = "org.chromium.components.media_router"
  1795. deps = [
  1796. ":java_resources",
  1797. - "$google_play_services_package:google_play_services_base_java",
  1798. - "$google_play_services_package:google_play_services_basement_java",
  1799. - "$google_play_services_package:google_play_services_cast_framework_java",
  1800. - "$google_play_services_package:google_play_services_cast_java",
  1801. "//base:base_java",
  1802. "//components/browser_ui/media/android:java",
  1803. "//content/public/android:content_java",
  1804. @@ -75,8 +71,6 @@ android_library("java") {
  1805. android_library("cast_options_provider_java") {
  1806. sources = [ "java/src/org/chromium/components/media_router/caf/CastOptionsProvider.java" ]
  1807. deps = [
  1808. - "$google_play_services_package:google_play_services_cast_framework_java",
  1809. - "$google_play_services_package:google_play_services_cast_java",
  1810. ]
  1811. }
  1812. @@ -142,9 +136,6 @@ java_library("junit") {
  1813. deps = [
  1814. ":java",
  1815. ":test_support_java",
  1816. - "$google_play_services_package:google_play_services_basement_java",
  1817. - "$google_play_services_package:google_play_services_cast_framework_java",
  1818. - "$google_play_services_package:google_play_services_cast_java",
  1819. "//base:base_java",
  1820. "//base:base_java_test_support",
  1821. "//base:base_junit_test_support",
  1822. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/BrowserMediaRouter.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/BrowserMediaRouter.java
  1823. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/BrowserMediaRouter.java
  1824. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/BrowserMediaRouter.java
  1825. @@ -10,9 +10,6 @@ import androidx.annotation.Nullable;
  1826. import androidx.annotation.VisibleForTesting;
  1827. import androidx.mediarouter.media.MediaRouter;
  1828. -import com.google.android.gms.common.ConnectionResult;
  1829. -import com.google.android.gms.common.GoogleApiAvailability;
  1830. -
  1831. import org.chromium.base.ContextUtils;
  1832. import org.chromium.base.Log;
  1833. import org.chromium.base.StrictModeContext;
  1834. @@ -42,20 +39,7 @@ public class BrowserMediaRouter implements MediaRouteManager {
  1835. new MediaRouteProvider.Factory() {
  1836. @Override
  1837. public void addProviders(MediaRouteManager manager) {
  1838. - int googleApiAvailabilityResult =
  1839. - GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
  1840. - ContextUtils.getApplicationContext(),
  1841. - MIN_GOOGLE_PLAY_SERVICES_APK_VERSION);
  1842. - if (googleApiAvailabilityResult != ConnectionResult.SUCCESS) {
  1843. - GoogleApiAvailability.getInstance().showErrorNotification(
  1844. - ContextUtils.getApplicationContext(), googleApiAvailabilityResult);
  1845. - return;
  1846. - }
  1847. - MediaRouteProvider cafProvider = CafMediaRouteProvider.create(manager);
  1848. - manager.addMediaRouteProvider(cafProvider);
  1849. - MediaRouteProvider remotingProvider =
  1850. - CafRemotingMediaRouteProvider.create(manager);
  1851. - manager.addMediaRouteProvider(remotingProvider);
  1852. + return;
  1853. }
  1854. };
  1855. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/CastSessionUtil.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/CastSessionUtil.java
  1856. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/CastSessionUtil.java
  1857. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/CastSessionUtil.java
  1858. @@ -4,9 +4,6 @@
  1859. package org.chromium.components.media_router;
  1860. -import com.google.android.gms.cast.CastDevice;
  1861. -import com.google.android.gms.cast.RemoteMediaPlayer;
  1862. -
  1863. import org.chromium.components.browser_ui.media.MediaNotificationInfo;
  1864. import org.chromium.services.media_session.MediaMetadata;
  1865. @@ -18,36 +15,4 @@ public class CastSessionUtil {
  1866. // The value is borrowed from the Android Cast SDK code to match their behavior.
  1867. public static final double MIN_VOLUME_LEVEL_DELTA = 1e-7;
  1868. -
  1869. - /**
  1870. - * Builds a MediaMetadata from the given CastDevice and MediaPlayer, and sets it on the builder
  1871. - */
  1872. - public static void setNotificationMetadata(MediaNotificationInfo.Builder builder,
  1873. - CastDevice castDevice, RemoteMediaPlayer mediaPlayer) {
  1874. - MediaMetadata notificationMetadata = new MediaMetadata("", "", "");
  1875. - builder.setMetadata(notificationMetadata);
  1876. -
  1877. - if (castDevice != null) notificationMetadata.setTitle(castDevice.getFriendlyName());
  1878. -
  1879. - if (mediaPlayer == null) return;
  1880. -
  1881. - com.google.android.gms.cast.MediaInfo info = mediaPlayer.getMediaInfo();
  1882. - if (info == null) return;
  1883. -
  1884. - com.google.android.gms.cast.MediaMetadata metadata = info.getMetadata();
  1885. - if (metadata == null) return;
  1886. -
  1887. - String title = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_TITLE);
  1888. - if (title != null) notificationMetadata.setTitle(title);
  1889. -
  1890. - String artist = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ARTIST);
  1891. - if (artist == null) {
  1892. - artist = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ALBUM_ARTIST);
  1893. - }
  1894. - if (artist != null) notificationMetadata.setArtist(artist);
  1895. -
  1896. - String album =
  1897. - metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ALBUM_TITLE);
  1898. - if (album != null) notificationMetadata.setAlbum(album);
  1899. - }
  1900. }
  1901. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/MediaSink.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/MediaSink.java
  1902. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/MediaSink.java
  1903. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/MediaSink.java
  1904. @@ -8,41 +8,24 @@ import androidx.annotation.Nullable;
  1905. import androidx.mediarouter.media.MediaRouter;
  1906. import androidx.mediarouter.media.MediaRouter.RouteInfo;
  1907. -import com.google.android.gms.cast.CastDevice;
  1908. -
  1909. /**
  1910. * A common descriptor of a device that can present some URI.
  1911. */
  1912. public class MediaSink {
  1913. private static final String CAST_SINK_URN_PREFIX = "urn:x-org.chromium:media:sink:cast-";
  1914. - private final String mId;
  1915. - private final String mName;
  1916. - private final CastDevice mDevice;
  1917. -
  1918. - /**
  1919. - * Constructor.
  1920. - * @param id A unique identifier of the sink.
  1921. - * @param name A user friendly name of the sink.
  1922. - * @param device {@link CastDevice} corresponding to this sink.
  1923. - */
  1924. - public MediaSink(String id, String name, CastDevice device) {
  1925. - mId = id;
  1926. - mName = name;
  1927. - mDevice = device;
  1928. - }
  1929. /**
  1930. * @return The unique identifier of the sink.
  1931. */
  1932. public String getId() {
  1933. - return mId;
  1934. + return "";
  1935. }
  1936. /**
  1937. * @return The user friendly name of the sink.
  1938. */
  1939. public String getName() {
  1940. - return mName;
  1941. + return "";
  1942. }
  1943. /**
  1944. @@ -52,17 +35,8 @@ public class MediaSink {
  1945. return CAST_SINK_URN_PREFIX + getId();
  1946. }
  1947. - public CastDevice getDevice() {
  1948. - return mDevice;
  1949. - }
  1950. -
  1951. @Override
  1952. public boolean equals(Object o) {
  1953. - if (o == this) return true;
  1954. - if (o instanceof MediaSink) {
  1955. - MediaSink other = (MediaSink) o;
  1956. - return mId.equals(other.getId()) && mName.equals(other.getName());
  1957. - }
  1958. return false;
  1959. }
  1960. @@ -70,23 +44,15 @@ public class MediaSink {
  1961. public int hashCode() {
  1962. final int prime = 31;
  1963. int result = 1;
  1964. - result = prime * result + ((mId == null) ? 0 : mId.hashCode());
  1965. - result = prime * result + ((mName == null) ? 0 : mName.hashCode());
  1966. return result;
  1967. }
  1968. - @Override
  1969. - public String toString() {
  1970. - return String.format("MediaSink: %s, %s", getId(), getName());
  1971. - }
  1972. -
  1973. /**
  1974. * @param route The route information provided by Android.
  1975. * @return A new MediaSink instance corresponding to the specified {@link RouteInfo}.
  1976. */
  1977. public static MediaSink fromRoute(MediaRouter.RouteInfo route) {
  1978. - return new MediaSink(
  1979. - route.getId(), route.getName(), CastDevice.getFromBundle(route.getExtras()));
  1980. + return null;
  1981. }
  1982. /**
  1983. @@ -97,10 +63,6 @@ public class MediaSink {
  1984. */
  1985. @Nullable
  1986. public static MediaSink fromSinkId(String sinkId, MediaRouter router) {
  1987. - for (MediaRouter.RouteInfo route : router.getRoutes()) {
  1988. - MediaSink sink = MediaSink.fromRoute(route);
  1989. - if (sink.getId().equals(sinkId)) return sink;
  1990. - }
  1991. return null;
  1992. }
  1993. }
  1994. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/MediaStatusBridge.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/MediaStatusBridge.java
  1995. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/MediaStatusBridge.java
  1996. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/MediaStatusBridge.java
  1997. @@ -4,10 +4,6 @@
  1998. package org.chromium.components.media_router;
  1999. -import com.google.android.gms.cast.MediaInfo;
  2000. -import com.google.android.gms.cast.MediaMetadata;
  2001. -import com.google.android.gms.cast.MediaStatus;
  2002. -
  2003. import org.chromium.base.annotations.CalledByNative;
  2004. import org.chromium.base.annotations.JNINamespace;
  2005. @@ -17,11 +13,6 @@ import org.chromium.base.annotations.JNINamespace;
  2006. */
  2007. @JNINamespace("media_router")
  2008. public class MediaStatusBridge {
  2009. - private MediaStatus mStatus;
  2010. -
  2011. - public MediaStatusBridge(MediaStatus status) {
  2012. - mStatus = status;
  2013. - }
  2014. /**
  2015. * Gets the play state of the stream. Return values are defined as such:
  2016. @@ -34,7 +25,7 @@ public class MediaStatusBridge {
  2017. */
  2018. @CalledByNative
  2019. public int playerState() {
  2020. - return mStatus.getPlayerState();
  2021. + return 0;
  2022. }
  2023. /**
  2024. @@ -48,7 +39,7 @@ public class MediaStatusBridge {
  2025. */
  2026. @CalledByNative
  2027. public int idleReason() {
  2028. - return mStatus.getIdleReason();
  2029. + return 0;
  2030. }
  2031. /**
  2032. @@ -57,13 +48,7 @@ public class MediaStatusBridge {
  2033. */
  2034. @CalledByNative
  2035. public String title() {
  2036. - MediaInfo info = mStatus.getMediaInfo();
  2037. - if (info == null) return "";
  2038. -
  2039. - MediaMetadata metadata = info.getMetadata();
  2040. - if (metadata == null) return "";
  2041. -
  2042. - return metadata.getString(MediaMetadata.KEY_TITLE);
  2043. + return "";
  2044. }
  2045. /**
  2046. @@ -71,7 +56,7 @@ public class MediaStatusBridge {
  2047. */
  2048. @CalledByNative
  2049. public boolean canPlayPause() {
  2050. - return mStatus.isMediaCommandSupported(MediaStatus.COMMAND_PAUSE);
  2051. + return false;
  2052. }
  2053. /**
  2054. @@ -79,7 +64,7 @@ public class MediaStatusBridge {
  2055. */
  2056. @CalledByNative
  2057. public boolean canMute() {
  2058. - return mStatus.isMediaCommandSupported(MediaStatus.COMMAND_TOGGLE_MUTE);
  2059. + return false;
  2060. }
  2061. /**
  2062. @@ -87,7 +72,7 @@ public class MediaStatusBridge {
  2063. */
  2064. @CalledByNative
  2065. public boolean canSetVolume() {
  2066. - return mStatus.isMediaCommandSupported(MediaStatus.COMMAND_SET_VOLUME);
  2067. + return false;
  2068. }
  2069. /**
  2070. @@ -95,7 +80,7 @@ public class MediaStatusBridge {
  2071. */
  2072. @CalledByNative
  2073. public boolean canSeek() {
  2074. - return mStatus.isMediaCommandSupported(MediaStatus.COMMAND_SEEK);
  2075. + return false;
  2076. }
  2077. /**
  2078. @@ -103,7 +88,7 @@ public class MediaStatusBridge {
  2079. */
  2080. @CalledByNative
  2081. public boolean isMuted() {
  2082. - return mStatus.isMute();
  2083. + return false;
  2084. }
  2085. /**
  2086. @@ -113,7 +98,7 @@ public class MediaStatusBridge {
  2087. */
  2088. @CalledByNative
  2089. public double volume() {
  2090. - return mStatus.getStreamVolume();
  2091. + return 0.0;
  2092. }
  2093. /**
  2094. @@ -122,10 +107,7 @@ public class MediaStatusBridge {
  2095. */
  2096. @CalledByNative
  2097. public long duration() {
  2098. - MediaInfo info = mStatus.getMediaInfo();
  2099. - if (info == null) return 0;
  2100. -
  2101. - return info.getStreamDuration();
  2102. + return 0;
  2103. }
  2104. /**
  2105. @@ -133,6 +115,6 @@ public class MediaStatusBridge {
  2106. */
  2107. @CalledByNative
  2108. public long currentTime() {
  2109. - return mStatus.getStreamPosition();
  2110. + return 0;
  2111. }
  2112. }
  2113. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/BaseNotificationController.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/BaseNotificationController.java
  2114. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/BaseNotificationController.java
  2115. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/BaseNotificationController.java
  2116. @@ -6,10 +6,6 @@ package org.chromium.components.media_router.caf;
  2117. import android.content.Intent;
  2118. -import com.google.android.gms.cast.CastDevice;
  2119. -import com.google.android.gms.cast.MediaStatus;
  2120. -import com.google.android.gms.cast.framework.media.RemoteMediaClient;
  2121. -
  2122. import org.chromium.components.browser_ui.media.MediaNotificationInfo;
  2123. import org.chromium.components.browser_ui.media.MediaNotificationListener;
  2124. import org.chromium.components.browser_ui.media.MediaNotificationManager;
  2125. @@ -62,20 +58,6 @@ public abstract class BaseNotificationController
  2126. public void onStatusUpdated() {
  2127. if (mNotificationBuilder == null) return;
  2128. if (!mSessionController.isConnected()) return;
  2129. -
  2130. - MediaStatus mediaStatus = mSessionController.getRemoteMediaClient().getMediaStatus();
  2131. - if (mediaStatus == null) return;
  2132. -
  2133. - int playerState = mediaStatus.getPlayerState();
  2134. - if (playerState == MediaStatus.PLAYER_STATE_PAUSED
  2135. - || playerState == MediaStatus.PLAYER_STATE_PLAYING) {
  2136. - mNotificationBuilder.setPaused(playerState != MediaStatus.PLAYER_STATE_PLAYING);
  2137. - mNotificationBuilder.setActions(
  2138. - MediaNotificationInfo.ACTION_STOP | MediaNotificationInfo.ACTION_PLAY_PAUSE);
  2139. - } else {
  2140. - mNotificationBuilder.setActions(MediaNotificationInfo.ACTION_STOP);
  2141. - }
  2142. - MediaRouterClient.getInstance().showNotification(mNotificationBuilder.build());
  2143. }
  2144. /** Called when media metadata updated. */
  2145. @@ -91,30 +73,6 @@ public abstract class BaseNotificationController
  2146. mNotificationBuilder.setMetadata(notificationMetadata);
  2147. if (!mSessionController.isConnected()) return;
  2148. -
  2149. - CastDevice castDevice = mSessionController.getSession().getCastDevice();
  2150. - if (castDevice != null) notificationMetadata.setTitle(castDevice.getFriendlyName());
  2151. -
  2152. - RemoteMediaClient remoteMediaClient = mSessionController.getRemoteMediaClient();
  2153. -
  2154. - com.google.android.gms.cast.MediaInfo info = remoteMediaClient.getMediaInfo();
  2155. - if (info == null) return;
  2156. -
  2157. - com.google.android.gms.cast.MediaMetadata metadata = info.getMetadata();
  2158. - if (metadata == null) return;
  2159. -
  2160. - String title = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_TITLE);
  2161. - if (title != null) notificationMetadata.setTitle(title);
  2162. -
  2163. - String artist = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ARTIST);
  2164. - if (artist == null) {
  2165. - artist = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ALBUM_ARTIST);
  2166. - }
  2167. - if (artist != null) notificationMetadata.setArtist(artist);
  2168. -
  2169. - String album =
  2170. - metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ALBUM_TITLE);
  2171. - if (album != null) notificationMetadata.setAlbum(album);
  2172. }
  2173. /////////////////////////////////////////////////////////////////////////////////////////////
  2174. @@ -122,20 +80,10 @@ public abstract class BaseNotificationController
  2175. @Override
  2176. public void onPlay(int actionSource) {
  2177. - if (!mSessionController.isConnected()) return;
  2178. -
  2179. - mSessionController.getRemoteMediaClient().play();
  2180. - MediaRouteUmaRecorder.recordCastNotificationControlsAction(
  2181. - MediaRouteUmaRecorder.CastNotificationControls.RESUME);
  2182. }
  2183. @Override
  2184. public void onPause(int actionSource) {
  2185. - if (!mSessionController.isConnected()) return;
  2186. -
  2187. - mSessionController.getRemoteMediaClient().pause();
  2188. - MediaRouteUmaRecorder.recordCastNotificationControlsAction(
  2189. - MediaRouteUmaRecorder.CastNotificationControls.PAUSE);
  2190. }
  2191. @Override
  2192. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/BaseSessionController.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/BaseSessionController.java
  2193. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/BaseSessionController.java
  2194. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/BaseSessionController.java
  2195. @@ -6,12 +6,7 @@ package org.chromium.components.media_router.caf;
  2196. import androidx.annotation.Nullable;
  2197. -import com.google.android.gms.cast.CastDevice;
  2198. -import com.google.android.gms.cast.framework.CastSession;
  2199. -import com.google.android.gms.cast.framework.media.RemoteMediaClient;
  2200. -
  2201. import org.chromium.base.Log;
  2202. -import org.chromium.components.media_router.CastSessionUtil;
  2203. import org.chromium.components.media_router.FlingingController;
  2204. import org.chromium.components.media_router.MediaSink;
  2205. import org.chromium.components.media_router.MediaSource;
  2206. @@ -42,15 +37,12 @@ public abstract class BaseSessionController {
  2207. void onMetadataUpdated();
  2208. }
  2209. - private CastSession mCastSession;
  2210. private final CafBaseMediaRouteProvider mProvider;
  2211. private CreateRouteRequestInfo mRouteCreationInfo;
  2212. - private final RemoteMediaClient.Callback mRemoteMediaClientCallback;
  2213. private final List<Callback> mCallbacks = new ArrayList<>();
  2214. public BaseSessionController(CafBaseMediaRouteProvider provider) {
  2215. mProvider = provider;
  2216. - mRemoteMediaClientCallback = new RemoteMediaClientCallback();
  2217. }
  2218. public void addCallback(Callback callback) {
  2219. @@ -63,9 +55,6 @@ public abstract class BaseSessionController {
  2220. public void requestSessionLaunch() {
  2221. mRouteCreationInfo = mProvider.getPendingCreateRouteRequestInfo();
  2222. - CastUtils.getCastContext().setReceiverApplicationId(
  2223. - mRouteCreationInfo.source.getApplicationId());
  2224. -
  2225. // When the user clicks a route on the MediaRouteChooserDialog, we intercept the click event
  2226. // and do not select the route. Instead the route selection is postponed to here. This will
  2227. // trigger CAF to launch the session.
  2228. @@ -84,69 +73,22 @@ public abstract class BaseSessionController {
  2229. return mRouteCreationInfo;
  2230. }
  2231. - public CastSession getSession() {
  2232. - return mCastSession;
  2233. - }
  2234. -
  2235. - public RemoteMediaClient getRemoteMediaClient() {
  2236. - return isConnected() ? mCastSession.getRemoteMediaClient() : null;
  2237. - }
  2238. -
  2239. public abstract BaseNotificationController getNotificationController();
  2240. public void endSession() {
  2241. - CastUtils.getCastContext().getSessionManager().endCurrentSession(/* stopCasting= */ true);
  2242. - CastUtils.getCastContext().setReceiverApplicationId(null);
  2243. }
  2244. public List<String> getCapabilities() {
  2245. List<String> capabilities = new ArrayList<>();
  2246. - if (mCastSession == null || !mCastSession.isConnected()) return capabilities;
  2247. - CastDevice device = mCastSession.getCastDevice();
  2248. - if (device.hasCapability(CastDevice.CAPABILITY_AUDIO_IN)) {
  2249. - capabilities.add("audio_in");
  2250. - }
  2251. - if (device.hasCapability(CastDevice.CAPABILITY_AUDIO_OUT)) {
  2252. - capabilities.add("audio_out");
  2253. - }
  2254. - if (device.hasCapability(CastDevice.CAPABILITY_VIDEO_IN)) {
  2255. - capabilities.add("video_in");
  2256. - }
  2257. - if (device.hasCapability(CastDevice.CAPABILITY_VIDEO_OUT)) {
  2258. - capabilities.add("video_out");
  2259. - }
  2260. return capabilities;
  2261. }
  2262. public boolean isConnected() {
  2263. - return mCastSession != null && mCastSession.isConnected();
  2264. + return false;
  2265. }
  2266. private void updateRemoteMediaClient(String message) {
  2267. if (!isConnected()) return;
  2268. -
  2269. - mCastSession.getRemoteMediaClient().onMessageReceived(
  2270. - mCastSession.getCastDevice(), CastSessionUtil.MEDIA_NAMESPACE, message);
  2271. - }
  2272. -
  2273. - /** Attaches the controller to the current {@link CastSession}. */
  2274. - public void attachToCastSession(CastSession session) {
  2275. - mCastSession = session;
  2276. - RemoteMediaClient uncheckedRemoteMediaClient = mCastSession.getRemoteMediaClient();
  2277. - if (uncheckedRemoteMediaClient != null) {
  2278. - uncheckedRemoteMediaClient.registerCallback(mRemoteMediaClientCallback);
  2279. - }
  2280. - }
  2281. -
  2282. - /** Detaches the controller from any {@link CastSession}. */
  2283. - public void detachFromCastSession() {
  2284. - if (mCastSession == null) return;
  2285. -
  2286. - RemoteMediaClient uncheckedRemoteMediaClient = mCastSession.getRemoteMediaClient();
  2287. - if (uncheckedRemoteMediaClient != null) {
  2288. - uncheckedRemoteMediaClient.unregisterCallback(mRemoteMediaClientCallback);
  2289. - }
  2290. - mCastSession = null;
  2291. }
  2292. /** Called when session started. */
  2293. @@ -163,50 +105,12 @@ public abstract class BaseSessionController {
  2294. return mProvider;
  2295. }
  2296. - /**
  2297. - * All sub-classes need to register this method to listen to messages of the namespaces they are
  2298. - * interested in.
  2299. - */
  2300. - protected void onMessageReceived(CastDevice castDevice, String namespace, String message) {
  2301. - Log.d(TAG,
  2302. - "Received message from Cast device: namespace=\"" + namespace + "\" message=\""
  2303. - + message + "\"");
  2304. - if (CastSessionUtil.MEDIA_NAMESPACE.equals(namespace)) {
  2305. - updateRemoteMediaClient(message);
  2306. - }
  2307. - }
  2308. -
  2309. - private class RemoteMediaClientCallback extends RemoteMediaClient.Callback {
  2310. - @Override
  2311. - public void onStatusUpdated() {
  2312. - BaseSessionController.this.onStatusUpdated();
  2313. - }
  2314. -
  2315. - @Override
  2316. - public void onMetadataUpdated() {
  2317. - BaseSessionController.this.onMetadataUpdated();
  2318. - }
  2319. - }
  2320. -
  2321. - protected void onStatusUpdated() {
  2322. - notifyCallback((Callback callback) -> callback.onStatusUpdated());
  2323. - }
  2324. -
  2325. - protected void onMetadataUpdated() {
  2326. - notifyCallback((Callback callback) -> callback.onMetadataUpdated());
  2327. - }
  2328. -
  2329. - @Nullable
  2330. - public FlingingController getFlingingController() {
  2331. - return null;
  2332. - }
  2333. -
  2334. /**
  2335. * Helper message to get the session ID of the attached session. For stubbing in tests as
  2336. * {@link CastSession#getSessionId()} is final.
  2337. */
  2338. public String getSessionId() {
  2339. - return isConnected() ? getSession().getSessionId() : null;
  2340. + return null;
  2341. }
  2342. private void notifyCallback(NotifyCallbackAction action) {
  2343. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafBaseMediaRouteProvider.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafBaseMediaRouteProvider.java
  2344. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafBaseMediaRouteProvider.java
  2345. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafBaseMediaRouteProvider.java
  2346. @@ -12,10 +12,6 @@ import androidx.mediarouter.media.MediaRouteSelector;
  2347. import androidx.mediarouter.media.MediaRouter;
  2348. import androidx.mediarouter.media.MediaRouter.RouteInfo;
  2349. -import com.google.android.gms.cast.framework.CastSession;
  2350. -import com.google.android.gms.cast.framework.SessionManagerListener;
  2351. -import com.google.android.gms.cast.framework.media.RemoteMediaClient;
  2352. -
  2353. import org.chromium.base.Log;
  2354. import org.chromium.components.media_router.DiscoveryCallback;
  2355. import org.chromium.components.media_router.DiscoveryDelegate;
  2356. @@ -39,7 +35,7 @@ import java.util.Set;
  2357. * A base provider containing common implementation for CAF-based {@link MediaRouteProvider}s.
  2358. */
  2359. public abstract class CafBaseMediaRouteProvider
  2360. - implements MediaRouteProvider, DiscoveryDelegate, SessionManagerListener<CastSession> {
  2361. + implements MediaRouteProvider, DiscoveryDelegate {
  2362. private static final String TAG = "CafMR";
  2363. protected static final List<MediaSink> NO_SINKS = Collections.emptyList();
  2364. @@ -155,7 +151,6 @@ public abstract class CafBaseMediaRouteProvider
  2365. // current session and clean up the routes (can't wait for session ending as the signal
  2366. // might be delayed).
  2367. sessionController().endSession();
  2368. - handleSessionEnd();
  2369. }
  2370. if (mPendingCreateRouteRequestInfo != null) {
  2371. cancelPendingRequest("Request replaced");
  2372. @@ -184,9 +179,6 @@ public abstract class CafBaseMediaRouteProvider
  2373. mManager.onCreateRouteRequestError("The sink does not exist", nativeRequestId);
  2374. }
  2375. - CastUtils.getCastContext().getSessionManager().addSessionManagerListener(
  2376. - this, CastSession.class);
  2377. -
  2378. mPendingCreateRouteRequestInfo = new CreateRouteRequestInfo(source, sink, presentationId,
  2379. origin, tabId, isOffTheRecord, nativeRequestId, targetRouteInfo);
  2380. @@ -213,110 +205,6 @@ public abstract class CafBaseMediaRouteProvider
  2381. removeRoute(routeId, /* error= */ null);
  2382. }
  2383. - ///////////////////////////////////////////////////////
  2384. - // SessionManagerListener implementation begin
  2385. - ///////////////////////////////////////////////////////
  2386. -
  2387. - @Override
  2388. - public final void onSessionStarting(CastSession session) {
  2389. - // The session is not connected yet at this point so this is no-op.
  2390. - }
  2391. -
  2392. - @Override
  2393. - public void onSessionStartFailed(CastSession session, int error) {
  2394. - removeAllRoutes("Launch error");
  2395. - cancelPendingRequest("Launch error");
  2396. - }
  2397. -
  2398. - @Override
  2399. - public void onSessionStarted(CastSession session, String sessionId) {
  2400. - Log.d(TAG, "onSessionStarted");
  2401. -
  2402. - if (session != CastUtils.getCastContext().getSessionManager().getCurrentCastSession()) {
  2403. - // Sometimes the session start signal might come in for an earlier launch request, which
  2404. - // should be ignored.
  2405. - return;
  2406. - }
  2407. -
  2408. - if (session == sessionController().getSession() || mPendingCreateRouteRequestInfo == null) {
  2409. - // Early return for any possible case that the session start signal comes in twice for
  2410. - // the same session.
  2411. - return;
  2412. - }
  2413. - handleSessionStart(session, sessionId);
  2414. - }
  2415. -
  2416. - @Override
  2417. - public final void onSessionResumed(CastSession session, boolean wasSuspended) {
  2418. - sessionController().attachToCastSession(session);
  2419. - }
  2420. -
  2421. - @Override
  2422. - public final void onSessionResuming(CastSession session, String sessionId) {}
  2423. -
  2424. - @Override
  2425. - public final void onSessionResumeFailed(CastSession session, int error) {}
  2426. -
  2427. - @Override
  2428. - public final void onSessionEnding(CastSession session) {
  2429. - RemoteMediaClient client = session.getRemoteMediaClient();
  2430. - if (client != null) {
  2431. - MediaRouteUmaRecorder.castEndedTimeRemaining(
  2432. - client.getApproximateStreamPosition(), client.getStreamDuration());
  2433. - }
  2434. - handleSessionEnd();
  2435. - }
  2436. -
  2437. - @Override
  2438. - public final void onSessionEnded(CastSession session, int error) {
  2439. - Log.d(TAG, "Session ended with error code " + error);
  2440. - RemoteMediaClient client = session.getRemoteMediaClient();
  2441. - if (client != null) {
  2442. - MediaRouteUmaRecorder.castEndedTimeRemaining(
  2443. - client.getApproximateStreamPosition(), client.getStreamDuration());
  2444. - }
  2445. - handleSessionEnd();
  2446. - }
  2447. -
  2448. - @Override
  2449. - public final void onSessionSuspended(CastSession session, int reason) {
  2450. - sessionController().detachFromCastSession();
  2451. - }
  2452. -
  2453. - ///////////////////////////////////////////////////////
  2454. - // SessionManagerListener implementation end
  2455. - ///////////////////////////////////////////////////////
  2456. -
  2457. - protected void handleSessionStart(CastSession session, String sessionId) {
  2458. - sessionController().attachToCastSession(session);
  2459. - sessionController().onSessionStarted();
  2460. -
  2461. - MediaSink sink = mPendingCreateRouteRequestInfo.sink;
  2462. - MediaSource source = mPendingCreateRouteRequestInfo.source;
  2463. - MediaRoute route = new MediaRoute(
  2464. - sink.getId(), source.getSourceId(), mPendingCreateRouteRequestInfo.presentationId);
  2465. - addRoute(route, mPendingCreateRouteRequestInfo.origin, mPendingCreateRouteRequestInfo.tabId,
  2466. - mPendingCreateRouteRequestInfo.nativeRequestId, /* wasLaunched= */ true);
  2467. -
  2468. - mPendingCreateRouteRequestInfo = null;
  2469. - }
  2470. -
  2471. - private void handleSessionEnd() {
  2472. - if (mPendingCreateRouteRequestInfo != null) {
  2473. - // The Cast SDK notifies about session ending when a route is unselected, even when
  2474. - // there's no current session. Because CastSessionController unselects the route to set
  2475. - // the receiver app ID, this needs to be guarded by a pending request null check to make
  2476. - // sure the listener is not unregistered during a session relaunch.
  2477. - return;
  2478. - }
  2479. - sessionController().onSessionEnded();
  2480. - sessionController().detachFromCastSession();
  2481. - getAndroidMediaRouter().selectRoute(getAndroidMediaRouter().getDefaultRoute());
  2482. - terminateAllRoutes();
  2483. - CastUtils.getCastContext().getSessionManager().removeSessionManagerListener(
  2484. - this, CastSession.class);
  2485. - }
  2486. -
  2487. private void cancelPendingRequest(String error) {
  2488. if (mPendingCreateRouteRequestInfo == null) return;
  2489. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafMediaRouteProvider.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafMediaRouteProvider.java
  2490. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafMediaRouteProvider.java
  2491. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafMediaRouteProvider.java
  2492. @@ -11,8 +11,6 @@ import androidx.annotation.Nullable;
  2493. import androidx.annotation.VisibleForTesting;
  2494. import androidx.mediarouter.media.MediaRouter;
  2495. -import com.google.android.gms.cast.framework.CastSession;
  2496. -
  2497. import org.chromium.base.Log;
  2498. import org.chromium.components.media_router.BrowserMediaRouter;
  2499. import org.chromium.components.media_router.ClientRecord;
  2500. @@ -147,20 +145,6 @@ public class CafMediaRouteProvider extends CafBaseMediaRouteProvider {
  2501. return mMessageHandler;
  2502. }
  2503. - @Override
  2504. - protected void handleSessionStart(CastSession session, String sessionId) {
  2505. - super.handleSessionStart(session, sessionId);
  2506. -
  2507. - for (ClientRecord clientRecord : mClientIdToRecords.values()) {
  2508. - // Should be exactly one instance of MediaRoute/ClientRecord at this moment.
  2509. - mMessageHandler.sendReceiverActionToClient(clientRecord.routeId,
  2510. - sessionController().getSink(), clientRecord.clientId, "cast");
  2511. - }
  2512. -
  2513. - mMessageHandler.onSessionStarted();
  2514. - sessionController().getSession().getRemoteMediaClient().requestStatus();
  2515. - }
  2516. -
  2517. @Override
  2518. protected void addRoute(
  2519. MediaRoute route, String origin, int tabId, int nativeRequestId, boolean wasLaunched) {
  2520. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafMessageHandler.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafMessageHandler.java
  2521. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafMessageHandler.java
  2522. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CafMessageHandler.java
  2523. @@ -13,10 +13,6 @@ import android.util.SparseArray;
  2524. import androidx.annotation.VisibleForTesting;
  2525. import androidx.collection.ArrayMap;
  2526. -import com.google.android.gms.cast.ApplicationMetadata;
  2527. -import com.google.android.gms.common.api.PendingResult;
  2528. -import com.google.android.gms.common.api.Status;
  2529. -
  2530. import org.json.JSONArray;
  2531. import org.json.JSONException;
  2532. import org.json.JSONObject;
  2533. @@ -345,49 +341,7 @@ public class CafMessageHandler {
  2534. final int sequenceNumber) throws JSONException {
  2535. if (volumeMessage == null) return false;
  2536. if (!mSessionController.isConnected()) return false;
  2537. - boolean shouldWaitForVolumeChange = false;
  2538. - try {
  2539. - if (!volumeMessage.isNull("muted")) {
  2540. - boolean newMuted = volumeMessage.getBoolean("muted");
  2541. - if (mSessionController.getSession().isMute() != newMuted) {
  2542. - mSessionController.getSession().setMute(newMuted);
  2543. - shouldWaitForVolumeChange = true;
  2544. - }
  2545. - }
  2546. - if (!volumeMessage.isNull("level")) {
  2547. - double newLevel = volumeMessage.getDouble("level");
  2548. - double currentLevel = mSessionController.getSession().getVolume();
  2549. - if (!Double.isNaN(currentLevel)
  2550. - && Math.abs(currentLevel - newLevel)
  2551. - > CastSessionUtil.MIN_VOLUME_LEVEL_DELTA) {
  2552. - mSessionController.getSession().setVolume(newLevel);
  2553. - shouldWaitForVolumeChange = true;
  2554. - }
  2555. - }
  2556. - } catch (IOException | IllegalStateException e) {
  2557. - Log.e(TAG, "Failed to send volume command: " + e);
  2558. - return false;
  2559. - }
  2560. -
  2561. - // For each successful volume message we need to respond with an empty "v2_message" so the
  2562. - // Cast Web SDK can call the success callback of the page. If we expect the volume to change
  2563. - // as the result of the command, we're relying on {@link Cast.CastListener#onVolumeChanged}
  2564. - // to get called by the Android Cast SDK when the receiver status is updated. We keep the
  2565. - // sequence number until then. If the volume doesn't change as the result of the command, we
  2566. - // won't get notified by the Android SDK
  2567. - if (shouldWaitForVolumeChange) {
  2568. - mVolumeRequests.add(new RequestRecord(clientId, sequenceNumber));
  2569. - } else {
  2570. - // It's usually bad to have request and response on the same call stack so post the
  2571. - // response to the Android message loop.
  2572. - mHandler.post(new Runnable() {
  2573. - @Override
  2574. - public void run() {
  2575. - onVolumeChanged(clientId, sequenceNumber);
  2576. - }
  2577. - });
  2578. - }
  2579. - return true;
  2580. + return false;
  2581. }
  2582. @VisibleForTesting
  2583. @@ -675,19 +629,11 @@ public class CafMessageHandler {
  2584. try {
  2585. // "volume" is a part of "receiver" initialized below.
  2586. JSONObject jsonVolume = new JSONObject();
  2587. - jsonVolume.put("level", mSessionController.getSession().getVolume());
  2588. - jsonVolume.put("muted", mSessionController.getSession().isMute());
  2589. // "receiver" is a part of "message" initialized below.
  2590. JSONObject jsonReceiver = new JSONObject();
  2591. - jsonReceiver.put(
  2592. - "label", mSessionController.getSession().getCastDevice().getDeviceId());
  2593. - jsonReceiver.put("friendlyName",
  2594. - mSessionController.getSession().getCastDevice().getFriendlyName());
  2595. jsonReceiver.put("capabilities", toJSONArray(mSessionController.getCapabilities()));
  2596. jsonReceiver.put("volume", jsonVolume);
  2597. - jsonReceiver.put(
  2598. - "isActiveInput", mSessionController.getSession().getActiveInputState());
  2599. jsonReceiver.put("displayStatus", null);
  2600. jsonReceiver.put("receiverType", "cast");
  2601. @@ -700,23 +646,14 @@ public class CafMessageHandler {
  2602. JSONObject jsonMessage = new JSONObject();
  2603. jsonMessage.put("sessionId", mSessionController.getSessionId());
  2604. - jsonMessage.put("statusText", mSessionController.getSession().getApplicationStatus());
  2605. jsonMessage.put("receiver", jsonReceiver);
  2606. jsonMessage.put("namespaces", jsonNamespaces);
  2607. jsonMessage.put("media", toJSONArray(new ArrayList<>()));
  2608. jsonMessage.put("status", "connected");
  2609. jsonMessage.put("transportId", "web-4");
  2610. - ApplicationMetadata applicationMetadata =
  2611. - mSessionController.getSession().getApplicationMetadata();
  2612. - if (applicationMetadata != null) {
  2613. - jsonMessage.put("appId", applicationMetadata.getApplicationId());
  2614. - } else {
  2615. - jsonMessage.put("appId",
  2616. - mSessionController.getRouteCreationInfo().source.getApplicationId());
  2617. - }
  2618. - jsonMessage.put("displayName",
  2619. - mSessionController.getSession().getCastDevice().getFriendlyName());
  2620. + jsonMessage.put("appId",
  2621. + mSessionController.getRouteCreationInfo().source.getApplicationId());
  2622. return jsonMessage.toString();
  2623. } catch (JSONException e) {
  2624. @@ -797,32 +734,6 @@ public class CafMessageHandler {
  2625. boolean sendStringCastMessage(
  2626. String message, String namespace, String clientId, int sequenceNumber) {
  2627. if (!mSessionController.isConnected()) return false;
  2628. -
  2629. - PendingResult<Status> pendingResult =
  2630. - mSessionController.getSession().sendMessage(namespace, message);
  2631. - if (!TextUtils.equals(namespace, CastSessionUtil.MEDIA_NAMESPACE)) {
  2632. - // Media commands wait for the media status update as a result.
  2633. - pendingResult.setResultCallback(
  2634. - (Status result) -> onSendAppMessageResult(result, clientId, sequenceNumber));
  2635. - }
  2636. - return true;
  2637. - }
  2638. -
  2639. - /**
  2640. - * Notifies a client that an app message has been sent.
  2641. - * @param clientId The client id the message is sent from.
  2642. - * @param sequenceNumber The sequence number of the message.
  2643. - */
  2644. - void onSendAppMessageResult(Status result, String clientId, int sequenceNumber) {
  2645. - if (!result.isSuccess()) {
  2646. - // TODO(avayvod): should actually report back to the page.
  2647. - // See https://crbug.com/550445.
  2648. - Log.e(TAG, "Failed to send the message: " + result);
  2649. - return;
  2650. - }
  2651. -
  2652. - // App messages wait for the empty message with the sequence
  2653. - // number.
  2654. - sendEnclosedMessageToClient(clientId, "app_message", null, sequenceNumber);
  2655. + return false;
  2656. }
  2657. }
  2658. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastMediaSource.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastMediaSource.java
  2659. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastMediaSource.java
  2660. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastMediaSource.java
  2661. @@ -9,8 +9,6 @@ import android.net.Uri;
  2662. import androidx.annotation.Nullable;
  2663. import androidx.mediarouter.media.MediaRouteSelector;
  2664. -import com.google.android.gms.cast.CastMediaControlIntent;
  2665. -
  2666. import org.chromium.components.media_router.MediaSource;
  2667. import java.util.Arrays;
  2668. @@ -106,13 +104,7 @@ public class CastMediaSource implements MediaSource {
  2669. */
  2670. @Override
  2671. public MediaRouteSelector buildRouteSelector() {
  2672. - try {
  2673. - return new MediaRouteSelector.Builder()
  2674. - .addControlCategory(CastMediaControlIntent.categoryForCast(mApplicationId))
  2675. - .build();
  2676. - } catch (IllegalArgumentException e) {
  2677. - return null;
  2678. - }
  2679. + return null;
  2680. }
  2681. /**
  2682. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastOptionsProvider.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastOptionsProvider.java
  2683. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastOptionsProvider.java
  2684. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastOptionsProvider.java
  2685. @@ -6,28 +6,8 @@ package org.chromium.components.media_router.caf;
  2686. import android.content.Context;
  2687. -import com.google.android.gms.cast.LaunchOptions;
  2688. -import com.google.android.gms.cast.framework.CastOptions;
  2689. -import com.google.android.gms.cast.framework.OptionsProvider;
  2690. -import com.google.android.gms.cast.framework.SessionProvider;
  2691. -
  2692. import java.util.List;
  2693. /** {@link OptionsProvider} implementation for Chrome MR. */
  2694. -public class CastOptionsProvider implements OptionsProvider {
  2695. - @Override
  2696. - public CastOptions getCastOptions(Context context) {
  2697. - return new CastOptions.Builder()
  2698. - .setCastMediaOptions(null)
  2699. - .setEnableReconnectionService(false)
  2700. - .setLaunchOptions(new LaunchOptions.Builder().setRelaunchIfRunning(true).build())
  2701. - .setResumeSavedSession(false)
  2702. - .setStopReceiverApplicationWhenEndingSession(true)
  2703. - .build();
  2704. - }
  2705. -
  2706. - @Override
  2707. - public List<SessionProvider> getAdditionalSessionProviders(Context context) {
  2708. - return null;
  2709. - }
  2710. +public class CastOptionsProvider {
  2711. }
  2712. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastSessionController.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastSessionController.java
  2713. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastSessionController.java
  2714. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastSessionController.java
  2715. @@ -7,11 +7,6 @@ package org.chromium.components.media_router.caf;
  2716. import androidx.annotation.NonNull;
  2717. import androidx.annotation.VisibleForTesting;
  2718. -import com.google.android.gms.cast.ApplicationMetadata;
  2719. -import com.google.android.gms.cast.Cast;
  2720. -import com.google.android.gms.cast.CastDevice;
  2721. -import com.google.android.gms.cast.framework.CastSession;
  2722. -
  2723. import org.chromium.base.Log;
  2724. import java.util.ArrayList;
  2725. @@ -24,12 +19,10 @@ public class CastSessionController extends BaseSessionController {
  2726. private static final String TAG = "CafSessionCtrl";
  2727. private List<String> mNamespaces = new ArrayList<String>();
  2728. - private CastListener mCastListener;
  2729. private CafNotificationController mNotificationController;
  2730. public CastSessionController(CafBaseMediaRouteProvider provider) {
  2731. super(provider);
  2732. - mCastListener = new CastListener();
  2733. mNotificationController = new CafNotificationController(this);
  2734. }
  2735. @@ -37,30 +30,6 @@ public class CastSessionController extends BaseSessionController {
  2736. return mNamespaces;
  2737. }
  2738. - /**
  2739. - * Init nested fields for testing. The reason is that nested classes are bound to the original
  2740. - * instance instead of the spyed instance.
  2741. - */
  2742. - void initNestedFieldsForTesting() {
  2743. - mCastListener = new CastListener();
  2744. - }
  2745. -
  2746. - @Override
  2747. - public void attachToCastSession(CastSession session) {
  2748. - super.attachToCastSession(session);
  2749. - getSession().addCastListener(mCastListener);
  2750. - updateNamespaces();
  2751. - }
  2752. -
  2753. - @Override
  2754. - public void detachFromCastSession() {
  2755. - if (getSession() == null) return;
  2756. -
  2757. - mNamespaces.clear();
  2758. - getSession().removeCastListener(mCastListener);
  2759. - super.detachFromCastSession();
  2760. - }
  2761. -
  2762. @Override
  2763. public void onSessionEnded() {
  2764. getMessageHandler().onSessionEnded();
  2765. @@ -72,24 +41,6 @@ public class CastSessionController extends BaseSessionController {
  2766. return mNotificationController;
  2767. }
  2768. - private class CastListener extends Cast.Listener {
  2769. - @Override
  2770. - public void onApplicationStatusChanged() {
  2771. - CastSessionController.this.onApplicationStatusChanged();
  2772. - }
  2773. -
  2774. - @Override
  2775. - public void onApplicationMetadataChanged(ApplicationMetadata metadata) {
  2776. - CastSessionController.this.onApplicationStatusChanged();
  2777. - }
  2778. -
  2779. - @Override
  2780. - public void onVolumeChanged() {
  2781. - CastSessionController.this.onApplicationStatusChanged();
  2782. - getMessageHandler().onVolumeChanged();
  2783. - }
  2784. - }
  2785. -
  2786. private void onApplicationStatusChanged() {
  2787. updateNamespaces();
  2788. @@ -100,53 +51,18 @@ public class CastSessionController extends BaseSessionController {
  2789. @VisibleForTesting
  2790. void updateNamespaces() {
  2791. if (!isConnected()) return;
  2792. -
  2793. - if (getSession().getApplicationMetadata() == null
  2794. - || getSession().getApplicationMetadata().getSupportedNamespaces() == null) {
  2795. - return;
  2796. - }
  2797. -
  2798. - Set<String> namespacesToAdd =
  2799. - new HashSet<>(getSession().getApplicationMetadata().getSupportedNamespaces());
  2800. - Set<String> namespacesToRemove = new HashSet<String>(mNamespaces);
  2801. -
  2802. - namespacesToRemove.removeAll(namespacesToAdd);
  2803. - namespacesToAdd.removeAll(mNamespaces);
  2804. -
  2805. - for (String namespace : namespacesToRemove) unregisterNamespace(namespace);
  2806. - for (String namespace : namespacesToAdd) registerNamespace(namespace);
  2807. }
  2808. private void registerNamespace(String namespace) {
  2809. assert !mNamespaces.contains(namespace);
  2810. if (!isConnected()) return;
  2811. -
  2812. - try {
  2813. - getSession().setMessageReceivedCallbacks(namespace, this::onMessageReceived);
  2814. - mNamespaces.add(namespace);
  2815. - } catch (Exception e) {
  2816. - Log.e(TAG, "Failed to register namespace listener for %s", namespace, e);
  2817. - }
  2818. }
  2819. private void unregisterNamespace(String namespace) {
  2820. assert mNamespaces.contains(namespace);
  2821. if (!isConnected()) return;
  2822. -
  2823. - try {
  2824. - getSession().removeMessageReceivedCallbacks(namespace);
  2825. - mNamespaces.remove(namespace);
  2826. - } catch (Exception e) {
  2827. - Log.e(TAG, "Failed to remove the namespace listener for %s", namespace, e);
  2828. - }
  2829. - }
  2830. -
  2831. - @Override
  2832. - protected void onMessageReceived(CastDevice castDevice, String namespace, String message) {
  2833. - super.onMessageReceived(castDevice, namespace, message);
  2834. - getMessageHandler().onMessageReceived(namespace, message);
  2835. }
  2836. @NonNull
  2837. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastUtils.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastUtils.java
  2838. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastUtils.java
  2839. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/CastUtils.java
  2840. @@ -4,18 +4,10 @@
  2841. package org.chromium.components.media_router.caf;
  2842. -import com.google.android.gms.cast.framework.CastContext;
  2843. -
  2844. import org.chromium.components.media_router.MediaRouterClient;
  2845. /** Utility methods for Cast. */
  2846. public class CastUtils {
  2847. - /** Helper method to return the {@link CastContext} instance. */
  2848. - public static CastContext getCastContext() {
  2849. - return CastContext.getSharedInstance(
  2850. - MediaRouterClient.getInstance().getContextForRemoting());
  2851. - }
  2852. -
  2853. /**
  2854. * Compares two origins. Empty origin strings correspond to unique origins in
  2855. * url::Origin.
  2856. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/CafExpandedControllerActivity.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/CafExpandedControllerActivity.java
  2857. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/CafExpandedControllerActivity.java
  2858. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/CafExpandedControllerActivity.java
  2859. @@ -45,60 +45,35 @@ public class CafExpandedControllerActivity
  2860. private MediaController.Delegate mControllerDelegate = new MediaController.Delegate() {
  2861. @Override
  2862. public void play() {
  2863. - if (!mSessionController.isConnected()) return;
  2864. -
  2865. - mSessionController.getSession().getRemoteMediaClient().play();
  2866. - MediaRouteUmaRecorder.recordFullscreenControlsAction(
  2867. - MediaRouteUmaRecorder.FullScreenControls.RESUME);
  2868. }
  2869. @Override
  2870. public void pause() {
  2871. - if (!mSessionController.isConnected()) return;
  2872. -
  2873. - mSessionController.getSession().getRemoteMediaClient().pause();
  2874. - MediaRouteUmaRecorder.recordFullscreenControlsAction(
  2875. - MediaRouteUmaRecorder.FullScreenControls.PAUSE);
  2876. }
  2877. @Override
  2878. public long getDuration() {
  2879. - if (!mSessionController.isConnected()) return 0;
  2880. - return mSessionController.getFlingingController().getDuration();
  2881. + return 0;
  2882. }
  2883. @Override
  2884. public long getPosition() {
  2885. - if (!mSessionController.isConnected()) return 0;
  2886. - return mSessionController.getFlingingController().getApproximateCurrentTime();
  2887. + return 0;
  2888. }
  2889. @Override
  2890. public void seekTo(long pos) {
  2891. - if (!mSessionController.isConnected()) return;
  2892. -
  2893. - mSessionController.getSession().getRemoteMediaClient().seek(pos);
  2894. - MediaRouteUmaRecorder.recordFullscreenControlsAction(
  2895. - MediaRouteUmaRecorder.FullScreenControls.SEEK);
  2896. }
  2897. @Override
  2898. public boolean isPlaying() {
  2899. - if (!mSessionController.isConnected()) return false;
  2900. -
  2901. - return mSessionController.getSession().getRemoteMediaClient().isPlaying();
  2902. + return false;
  2903. }
  2904. @Override
  2905. public long getActionFlags() {
  2906. long flags =
  2907. PlaybackStateCompat.ACTION_REWIND | PlaybackStateCompat.ACTION_FAST_FORWARD;
  2908. - if (mSessionController.isConnected()
  2909. - && mSessionController.getSession().getRemoteMediaClient().isPlaying()) {
  2910. - flags |= PlaybackStateCompat.ACTION_PAUSE;
  2911. - } else {
  2912. - flags |= PlaybackStateCompat.ACTION_PLAY;
  2913. - }
  2914. return flags;
  2915. }
  2916. };
  2917. @@ -187,20 +162,10 @@ public class CafExpandedControllerActivity
  2918. private void updateUi() {
  2919. if (!mSessionController.isConnected()) return;
  2920. - String deviceName = mSessionController.getSession().getCastDevice().getFriendlyName();
  2921. - String titleText = "";
  2922. - if (deviceName != null) {
  2923. - titleText = getResources().getString(R.string.cast_casting_video, deviceName);
  2924. - }
  2925. - mTitleView.setText(titleText);
  2926. -
  2927. mMediaController.refresh();
  2928. mMediaController.updateProgress();
  2929. cancelProgressUpdateTask();
  2930. - if (mSessionController.getSession().getRemoteMediaClient().isPlaying()) {
  2931. - scheduleProgressUpdateTask();
  2932. - }
  2933. }
  2934. private void scheduleProgressUpdateTask() {
  2935. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/CafRemotingMediaRouteProvider.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/CafRemotingMediaRouteProvider.java
  2936. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/CafRemotingMediaRouteProvider.java
  2937. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/CafRemotingMediaRouteProvider.java
  2938. @@ -49,9 +49,6 @@ public class CafRemotingMediaRouteProvider extends CafBaseMediaRouteProvider {
  2939. @Override
  2940. public void detachRoute(String routeId) {
  2941. super.detachRoute(routeId);
  2942. - MediaRouteUmaRecorder.recordRemoteSessionTimeWithoutMediaElementPercentage(
  2943. - mSessionController.getFlingingController().getApproximateCurrentTime(),
  2944. - mSessionController.getFlingingController().getDuration());
  2945. }
  2946. @Override
  2947. @@ -74,6 +71,6 @@ public class CafRemotingMediaRouteProvider extends CafBaseMediaRouteProvider {
  2948. if (!mRoutes.containsKey(routeId)) return null;
  2949. - return sessionController().getFlingingController();
  2950. + return null;
  2951. }
  2952. }
  2953. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/FlingingControllerAdapter.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/FlingingControllerAdapter.java
  2954. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/FlingingControllerAdapter.java
  2955. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/FlingingControllerAdapter.java
  2956. @@ -4,11 +4,6 @@
  2957. package org.chromium.components.media_router.caf.remoting;
  2958. -import com.google.android.gms.cast.MediaInfo;
  2959. -import com.google.android.gms.cast.MediaStatus;
  2960. -import com.google.android.gms.cast.framework.media.RemoteMediaClient;
  2961. -import com.google.android.gms.common.api.Result;
  2962. -
  2963. import org.chromium.base.Log;
  2964. import org.chromium.components.media_router.FlingingController;
  2965. import org.chromium.components.media_router.MediaController;
  2966. @@ -69,14 +64,6 @@ public class FlingingControllerAdapter implements FlingingController, MediaContr
  2967. /** Starts loading the media URL, from the given position. */
  2968. public void load(long position) {
  2969. if (!mSessionController.isConnected()) return;
  2970. -
  2971. - mLoaded = true;
  2972. -
  2973. - MediaInfo mediaInfo = new MediaInfo.Builder(mMediaUrl)
  2974. - .setContentType("*/*")
  2975. - .setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
  2976. - .build();
  2977. - mSessionController.getRemoteMediaClient().load(mediaInfo, /* autoplay= */ true, position);
  2978. }
  2979. ////////////////////////////////////////////
  2980. @@ -91,89 +78,28 @@ public class FlingingControllerAdapter implements FlingingController, MediaContr
  2981. load(/* position= */ 0);
  2982. return;
  2983. }
  2984. -
  2985. - mSessionController.getRemoteMediaClient().play().setResultCallback(
  2986. - this::onMediaCommandResult);
  2987. }
  2988. @Override
  2989. public void pause() {
  2990. if (!mSessionController.isConnected()) return;
  2991. - mSessionController.getRemoteMediaClient().pause().setResultCallback(
  2992. - this::onMediaCommandResult);
  2993. }
  2994. @Override
  2995. public void setMute(boolean mute) {
  2996. if (!mSessionController.isConnected()) return;
  2997. - mSessionController.getRemoteMediaClient().setStreamMute(mute).setResultCallback(
  2998. - this::onMediaCommandResult);
  2999. }
  3000. @Override
  3001. public void setVolume(double volume) {
  3002. if (!mSessionController.isConnected()) return;
  3003. - mSessionController.getRemoteMediaClient().setStreamVolume(volume).setResultCallback(
  3004. - this::onMediaCommandResult);
  3005. }
  3006. @Override
  3007. public void seek(long position) {
  3008. - if (!mSessionController.isConnected()) return;
  3009. -
  3010. - if (!mLoaded) {
  3011. - load(position);
  3012. - return;
  3013. - }
  3014. -
  3015. - mSessionController.getRemoteMediaClient().seek(position).setResultCallback(
  3016. - this::onMediaCommandResult);
  3017. - mStreamPositionExtrapolator.onSeek(position);
  3018. }
  3019. ////////////////////////////////////////////
  3020. // MediaController implementation end
  3021. ////////////////////////////////////////////
  3022. -
  3023. - public void onStatusUpdated() {
  3024. - if (mMediaStatusObserver == null) return;
  3025. -
  3026. - RemoteMediaClient remoteMediaClient = mSessionController.getRemoteMediaClient();
  3027. -
  3028. - MediaStatus mediaStatus = remoteMediaClient.getMediaStatus();
  3029. - if (mediaStatus != null) {
  3030. - mHasEverReceivedValidMediaSession = true;
  3031. - if (mediaStatus.getPlayerState() == MediaStatus.PLAYER_STATE_IDLE
  3032. - && mediaStatus.getIdleReason() == MediaStatus.IDLE_REASON_FINISHED) {
  3033. - mLoaded = false;
  3034. - mStreamPositionExtrapolator.onFinish();
  3035. - } else {
  3036. - mStreamPositionExtrapolator.update(remoteMediaClient.getStreamDuration(),
  3037. - remoteMediaClient.getApproximateStreamPosition(),
  3038. - remoteMediaClient.isPlaying(), mediaStatus.getPlaybackRate());
  3039. - }
  3040. -
  3041. - mMediaStatusObserver.onMediaStatusUpdate(new MediaStatusBridge(mediaStatus));
  3042. -
  3043. - } else if (mHasEverReceivedValidMediaSession) {
  3044. - // We can receive a null |mediaStatus| while we are in the process of loading the video.
  3045. - // We should wait until we receive one valid media status before considering the video
  3046. - // unloaded. Otherwise, the first call to seek or play will reload the video.
  3047. - // See b/144325733.
  3048. - mLoaded = false;
  3049. - mStreamPositionExtrapolator.clear();
  3050. - }
  3051. - }
  3052. -
  3053. - private void onMediaCommandResult(Result result) {
  3054. - // When multiple API calls are made in quick succession, "Results have already been set"
  3055. - // IllegalStateExceptions might be thrown from GMS code. We prefer to catch the exception
  3056. - // and noop it, than to crash. This might lead to some API calls never getting their
  3057. - // onResult() called, so we should not rely on onResult() being called for every API call.
  3058. - // See https://crbug.com/853923.
  3059. - if (!result.getStatus().isSuccess()) {
  3060. - Log.e(TAG, "Error when sending command. Status code: %d",
  3061. - result.getStatus().getStatusCode());
  3062. - }
  3063. - }
  3064. }
  3065. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/RemotingMediaSource.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/RemotingMediaSource.java
  3066. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/RemotingMediaSource.java
  3067. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/RemotingMediaSource.java
  3068. @@ -13,8 +13,6 @@ import android.util.Base64;
  3069. import androidx.annotation.Nullable;
  3070. import androidx.mediarouter.media.MediaRouteSelector;
  3071. -import com.google.android.gms.cast.CastMediaControlIntent;
  3072. -
  3073. import org.chromium.base.ContextUtils;
  3074. import org.chromium.base.Log;
  3075. import org.chromium.components.media_router.MediaSource;
  3076. @@ -84,9 +82,7 @@ public class RemotingMediaSource implements MediaSource {
  3077. */
  3078. @Override
  3079. public MediaRouteSelector buildRouteSelector() {
  3080. - return new MediaRouteSelector.Builder()
  3081. - .addControlCategory(CastMediaControlIntent.categoryForCast(getApplicationId()))
  3082. - .build();
  3083. + return null;
  3084. }
  3085. /**
  3086. @@ -113,7 +109,7 @@ public class RemotingMediaSource implements MediaSource {
  3087. sApplicationId = (customAppId != null && !customAppId.isEmpty())
  3088. ? customAppId
  3089. - : CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID;
  3090. + : "CC1AD845"; /*DEFAULT_MEDIA_RECEIVER_APPLICATION_ID*/
  3091. }
  3092. return sApplicationId;
  3093. diff --git a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/RemotingSessionController.java b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/RemotingSessionController.java
  3094. --- a/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/RemotingSessionController.java
  3095. +++ b/components/media_router/browser/android/java/src/org/chromium/components/media_router/caf/remoting/RemotingSessionController.java
  3096. @@ -4,8 +4,6 @@
  3097. package org.chromium.components.media_router.caf.remoting;
  3098. -import com.google.android.gms.cast.framework.CastSession;
  3099. -
  3100. import org.chromium.base.Log;
  3101. import org.chromium.components.media_router.CastSessionUtil;
  3102. import org.chromium.components.media_router.caf.BaseNotificationController;
  3103. @@ -33,19 +31,6 @@ public class RemotingSessionController extends BaseSessionController {
  3104. sInstance = new WeakReference<>(this);
  3105. }
  3106. - @Override
  3107. - public void attachToCastSession(CastSession session) {
  3108. - super.attachToCastSession(session);
  3109. -
  3110. - try {
  3111. - getSession().setMessageReceivedCallbacks(
  3112. - CastSessionUtil.MEDIA_NAMESPACE, this::onMessageReceived);
  3113. - } catch (Exception e) {
  3114. - Log.e(TAG, "Failed to register namespace listener for %s",
  3115. - CastSessionUtil.MEDIA_NAMESPACE, e);
  3116. - }
  3117. - }
  3118. -
  3119. @Override
  3120. public void onSessionStarted() {
  3121. super.onSessionStarted();
  3122. @@ -53,17 +38,6 @@ public class RemotingSessionController extends BaseSessionController {
  3123. mFlingingControllerAdapter = new FlingingControllerAdapter(this, source.getMediaUrl());
  3124. }
  3125. - @Override
  3126. - protected void onStatusUpdated() {
  3127. - mFlingingControllerAdapter.onStatusUpdated();
  3128. - super.onStatusUpdated();
  3129. - }
  3130. -
  3131. - @Override
  3132. - public FlingingControllerAdapter getFlingingController() {
  3133. - return mFlingingControllerAdapter;
  3134. - }
  3135. -
  3136. @Override
  3137. public BaseNotificationController getNotificationController() {
  3138. return mNotificationController;
  3139. diff --git a/components/media_router/test/android/cast_emulator/BUILD.gn b/components/media_router/test/android/cast_emulator/BUILD.gn
  3140. --- a/components/media_router/test/android/cast_emulator/BUILD.gn
  3141. +++ b/components/media_router/test/android/cast_emulator/BUILD.gn
  3142. @@ -20,7 +20,6 @@ android_library("cast_emulator_java") {
  3143. "src/org/chromium/components/media_router/cast_emulator/router/DummyRoutePublisher.java",
  3144. ]
  3145. deps = [
  3146. - "$google_play_services_package:google_play_services_cast_java",
  3147. "//base:base_java",
  3148. "//third_party/android_deps:android_support_v7_appcompat_java",
  3149. "//third_party/androidx:androidx_mediarouter_mediarouter_java",
  3150. diff --git a/components/module_installer/android/BUILD.gn b/components/module_installer/android/BUILD.gn
  3151. --- a/components/module_installer/android/BUILD.gn
  3152. +++ b/components/module_installer/android/BUILD.gn
  3153. @@ -34,7 +34,6 @@ android_library("module_installer_java") {
  3154. deps = [
  3155. "//base:base_java",
  3156. "//components/crash/android:java",
  3157. - "//third_party/android_deps:com_google_android_play_core_java",
  3158. "//third_party/androidx:androidx_annotation_annotation_java",
  3159. ]
  3160. @@ -58,7 +57,6 @@ junit_binary("module_installer_junit_tests") {
  3161. "//base:base_java",
  3162. "//base:base_java_test_support",
  3163. "//base:base_junit_test_support",
  3164. - "//third_party/android_deps:com_google_android_play_core_java",
  3165. "//third_party/hamcrest:hamcrest_java",
  3166. ]
  3167. }
  3168. diff --git a/components/signin/public/android/BUILD.gn b/components/signin/public/android/BUILD.gn
  3169. --- a/components/signin/public/android/BUILD.gn
  3170. +++ b/components/signin/public/android/BUILD.gn
  3171. @@ -2,8 +2,6 @@ import("//build/config/android/rules.gni")
  3172. android_library("java") {
  3173. deps = [
  3174. - "$google_play_services_package:google_play_services_auth_base_java",
  3175. - "$google_play_services_package:google_play_services_base_java",
  3176. "//base:base_java",
  3177. "//components/externalauth/android:java",
  3178. "//net/android:net_java",
  3179. @@ -24,7 +22,6 @@ android_library("java") {
  3180. "java/src/org/chromium/components/signin/AccountManagerFacade.java",
  3181. "java/src/org/chromium/components/signin/AccountManagerFacadeImpl.java",
  3182. "java/src/org/chromium/components/signin/AccountManagerFacadeProvider.java",
  3183. - "java/src/org/chromium/components/signin/AccountRenameChecker.java",
  3184. "java/src/org/chromium/components/signin/AccountRestrictionPatternReceiver.java",
  3185. "java/src/org/chromium/components/signin/AccountUtils.java",
  3186. "java/src/org/chromium/components/signin/AccountsChangeObserver.java",
  3187. @@ -137,7 +134,6 @@ java_library("junit") {
  3188. deps = [
  3189. ":java",
  3190. ":signin_java_test_support",
  3191. - "$google_play_services_package:google_play_services_auth_base_java",
  3192. "//base:base_java",
  3193. "//base:base_java_test_support",
  3194. "//base:base_junit_test_support",
  3195. diff --git a/components/webauthn/android/BUILD.gn b/components/webauthn/android/BUILD.gn
  3196. --- a/components/webauthn/android/BUILD.gn
  3197. +++ b/components/webauthn/android/BUILD.gn
  3198. @@ -15,9 +15,6 @@ android_library("java") {
  3199. sources = [
  3200. "java/src/org/chromium/components/webauthn/AuthenticatorFactory.java",
  3201. "java/src/org/chromium/components/webauthn/AuthenticatorImpl.java",
  3202. - "java/src/org/chromium/components/webauthn/Fido2ApiHandler.java",
  3203. - "java/src/org/chromium/components/webauthn/Fido2CredentialRequest.java",
  3204. - "java/src/org/chromium/components/webauthn/Fido2Helper.java",
  3205. "java/src/org/chromium/components/webauthn/FidoErrorResponseCallback.java",
  3206. "java/src/org/chromium/components/webauthn/GetAssertionResponseCallback.java",
  3207. "java/src/org/chromium/components/webauthn/InternalAuthenticator.java",
  3208. @@ -26,8 +23,6 @@ android_library("java") {
  3209. ]
  3210. annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
  3211. deps = [
  3212. - "$google_play_services_package:google_play_services_fido_java",
  3213. - "$google_play_services_package:google_play_services_tasks_java",
  3214. "//base:base_java",
  3215. "//base:jni_java",
  3216. "//components/externalauth/android:java",
  3217. diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/AuthenticatorImpl.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/AuthenticatorImpl.java
  3218. --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/AuthenticatorImpl.java
  3219. +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/AuthenticatorImpl.java
  3220. @@ -95,17 +95,7 @@ public class AuthenticatorImpl implements Authenticator {
  3221. mMakeCredentialCallback = callback;
  3222. mIsOperationPending = true;
  3223. - Context context = ContextUtils.getApplicationContext();
  3224. - if (PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME)
  3225. - < Fido2ApiHandler.GMSCORE_MIN_VERSION) {
  3226. - onError(AuthenticatorStatus.NOT_IMPLEMENTED);
  3227. - return;
  3228. - }
  3229. -
  3230. - Fido2ApiHandler.getInstance().makeCredential(options, mRenderFrameHost, mOrigin,
  3231. - (status, response)
  3232. - -> onRegisterResponse(status, response),
  3233. - status -> onError(status));
  3234. + onError(AuthenticatorStatus.NOT_IMPLEMENTED);
  3235. }
  3236. @Override
  3237. @@ -118,16 +108,7 @@ public class AuthenticatorImpl implements Authenticator {
  3238. mGetAssertionCallback = callback;
  3239. mIsOperationPending = true;
  3240. - Context context = ContextUtils.getApplicationContext();
  3241. -
  3242. - if (PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME)
  3243. - < Fido2ApiHandler.GMSCORE_MIN_VERSION) {
  3244. - onError(AuthenticatorStatus.NOT_IMPLEMENTED);
  3245. - return;
  3246. - }
  3247. -
  3248. - Fido2ApiHandler.getInstance().getAssertion(options, mRenderFrameHost, mOrigin, mPayment,
  3249. - (status, response) -> onSignResponse(status, response), status -> onError(status));
  3250. + onError(AuthenticatorStatus.NOT_IMPLEMENTED);
  3251. }
  3252. @Override
  3253. @@ -152,16 +133,8 @@ public class AuthenticatorImpl implements Authenticator {
  3254. return;
  3255. }
  3256. - if (PackageUtils.getPackageVersion(context, GMSCORE_PACKAGE_NAME)
  3257. - < Fido2ApiHandler.GMSCORE_MIN_VERSION) {
  3258. decoratedCallback.call(false);
  3259. return;
  3260. - }
  3261. -
  3262. - mIsUserVerifyingPlatformAuthenticatorAvailableCallbackQueue.add(decoratedCallback);
  3263. - Fido2ApiHandler.getInstance().isUserVerifyingPlatformAuthenticatorAvailable(
  3264. - mRenderFrameHost,
  3265. - isUvpaa -> onIsUserVerifyingPlatformAuthenticatorAvailableResponse(isUvpaa));
  3266. }
  3267. @Override
  3268. diff --git a/content/browser/push_messaging/push_messaging_manager.cc b/content/browser/push_messaging/push_messaging_manager.cc
  3269. --- a/content/browser/push_messaging/push_messaging_manager.cc
  3270. +++ b/content/browser/push_messaging/push_messaging_manager.cc
  3271. @@ -757,7 +757,7 @@ void PushMessagingManager::GetSubscriptionInfo(
  3272. }
  3273. PushMessagingService* PushMessagingManager::GetService() {
  3274. - return render_process_host_.GetBrowserContext()->GetPushMessagingService();
  3275. + return nullptr;
  3276. }
  3277. } // namespace content
  3278. diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
  3279. --- a/content/public/android/BUILD.gn
  3280. +++ b/content/public/android/BUILD.gn
  3281. @@ -136,10 +136,6 @@ android_library("content_main_dex_java") {
  3282. android_library("content_full_java") {
  3283. deps = [
  3284. ":content_main_dex_java",
  3285. - "$google_play_services_package:google_play_services_auth_api_phone_java",
  3286. - "$google_play_services_package:google_play_services_base_java",
  3287. - "$google_play_services_package:google_play_services_basement_java",
  3288. - "$google_play_services_package:google_play_services_tasks_java",
  3289. "//base:base_java",
  3290. "//build:chromeos_buildflags",
  3291. "//components/download/public/common:public_java",
  3292. diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
  3293. --- a/content/public/common/content_features.cc
  3294. +++ b/content/public/common/content_features.cc
  3295. @@ -958,7 +958,7 @@ const base::Feature kWebAssemblyTrapHandler {
  3296. // Controls whether the WebAuthentication API is enabled:
  3297. // https://w3c.github.io/webauthn
  3298. const base::Feature kWebAuth{"WebAuthentication",
  3299. - base::FEATURE_ENABLED_BY_DEFAULT};
  3300. + base::FEATURE_DISABLED_BY_DEFAULT};
  3301. // Controls whether WebAuthn assertion transport is enabled.
  3302. const base::Feature kWebAuthAuthenticatorAttachment{
  3303. diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
  3304. --- a/content/test/BUILD.gn
  3305. +++ b/content/test/BUILD.gn
  3306. @@ -2868,10 +2868,6 @@ if (is_android) {
  3307. testonly = true
  3308. sources = content_java_sources_needing_jni
  3309. deps = [
  3310. - "$google_play_services_package:google_play_services_auth_api_phone_java",
  3311. - "$google_play_services_package:google_play_services_base_java",
  3312. - "$google_play_services_package:google_play_services_basement_java",
  3313. - "$google_play_services_package:google_play_services_tasks_java",
  3314. "//base:base_java",
  3315. "//content/public/android:content_java",
  3316. "//ui/android:ui_full_java",
  3317. diff --git a/device/BUILD.gn b/device/BUILD.gn
  3318. --- a/device/BUILD.gn
  3319. +++ b/device/BUILD.gn
  3320. @@ -447,9 +447,6 @@ if (is_android) {
  3321. "gamepad/android/junit/src/org/chromium/device/gamepad/GamepadMappingsTest.java",
  3322. ]
  3323. deps = [
  3324. - "$google_play_services_package:google_play_services_base_java",
  3325. - "$google_play_services_package:google_play_services_basement_java",
  3326. - "$google_play_services_package:google_play_services_location_java",
  3327. "//base:base_java",
  3328. "//base:base_java_test_support",
  3329. "//base:base_junit_test_support",
  3330. diff --git a/remoting/android/client_java_tmpl.gni b/remoting/android/client_java_tmpl.gni
  3331. --- a/remoting/android/client_java_tmpl.gni
  3332. +++ b/remoting/android/client_java_tmpl.gni
  3333. @@ -104,9 +104,6 @@ template("remoting_android_client_java_tmpl") {
  3334. if (defined(invoker.play_services_package)) {
  3335. deps += [
  3336. - "${invoker.play_services_package}:google_play_services_auth_base_java",
  3337. - "${invoker.play_services_package}:google_play_services_base_java",
  3338. - "${invoker.play_services_package}:google_play_services_basement_java",
  3339. ]
  3340. }
  3341. diff --git a/services/BUILD.gn b/services/BUILD.gn
  3342. --- a/services/BUILD.gn
  3343. +++ b/services/BUILD.gn
  3344. @@ -114,11 +114,6 @@ if (is_android) {
  3345. "shape_detection/android/junit/src/org/chromium/shape_detection/BitmapUtilsTest.java",
  3346. ]
  3347. deps = [
  3348. - "$google_play_services_package:google_play_services_base_java",
  3349. - "$google_play_services_package:google_play_services_basement_java",
  3350. - "$google_play_services_package:google_play_services_location_java",
  3351. - "$google_play_services_package:google_play_services_vision_common_java",
  3352. - "$google_play_services_package:google_play_services_vision_java",
  3353. "//base:base_java",
  3354. "//base:base_java_test_support",
  3355. "//base:base_junit_test_support",
  3356. @@ -147,10 +142,6 @@ if (is_android) {
  3357. "shape_detection/android/javatests/src/org/chromium/shape_detection/TextDetectionImplTest.java",
  3358. ]
  3359. deps = [
  3360. - "$google_play_services_package:google_play_services_base_java",
  3361. - "$google_play_services_package:google_play_services_basement_java",
  3362. - "$google_play_services_package:google_play_services_vision_common_java",
  3363. - "$google_play_services_package:google_play_services_vision_java",
  3364. "//base:base_java",
  3365. "//base:base_java_test_support",
  3366. "//mojo/public/java:base_java",
  3367. diff --git a/services/device/geolocation/BUILD.gn b/services/device/geolocation/BUILD.gn
  3368. --- a/services/device/geolocation/BUILD.gn
  3369. +++ b/services/device/geolocation/BUILD.gn
  3370. @@ -163,9 +163,6 @@ if (is_android) {
  3371. deps = [
  3372. ":geolocation_jni_headers",
  3373. - "$google_play_services_package:google_play_services_base_java",
  3374. - "$google_play_services_package:google_play_services_basement_java",
  3375. - "$google_play_services_package:google_play_services_location_java",
  3376. "//base:base_java",
  3377. "//components/location/android:location_java",
  3378. "//services/device/public/java:geolocation_java",
  3379. diff --git a/services/shape_detection/BUILD.gn b/services/shape_detection/BUILD.gn
  3380. --- a/services/shape_detection/BUILD.gn
  3381. +++ b/services/shape_detection/BUILD.gn
  3382. @@ -107,10 +107,6 @@ if (is_android) {
  3383. ]
  3384. deps = [
  3385. - "$google_play_services_package:google_play_services_base_java",
  3386. - "$google_play_services_package:google_play_services_basement_java",
  3387. - "$google_play_services_package:google_play_services_vision_common_java",
  3388. - "$google_play_services_package:google_play_services_vision_java",
  3389. "//base:base_java",
  3390. "//mojo/public/java:base_java",
  3391. "//mojo/public/java:bindings_java",
  3392. diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn
  3393. --- a/third_party/android_deps/BUILD.gn
  3394. +++ b/third_party/android_deps/BUILD.gn
  3395. @@ -68,7 +68,6 @@ if (!limit_android_deps) {
  3396. ":org_robolectric_shadowapi_java",
  3397. ":org_robolectric_shadows_framework_java",
  3398. ":org_robolectric_shadows_multidex_java",
  3399. - ":org_robolectric_shadows_playservices_java",
  3400. ":org_robolectric_utils_java",
  3401. ":org_robolectric_utils_reflector_java",
  3402. @@ -93,7 +92,7 @@ if (!limit_android_deps) {
  3403. android_library("chromium_play_services_availability_java") {
  3404. sources = [ "util/org/chromium/gms/ChromiumPlayServicesAvailability.java" ]
  3405. - deps = [ "$google_play_services_package:google_play_services_base_java" ]
  3406. + deps = [ ]
  3407. }
  3408. android_library("chromium_play_services_availability_shadows_java") {
  3409. @@ -1030,210 +1029,6 @@ if (!limit_android_deps) {
  3410. resource_overlay = true
  3411. }
  3412. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3413. - android_aar_prebuilt("google_play_services_auth_java") {
  3414. - aar_path = "libs/com_google_android_gms_play_services_auth/play-services-auth-17.0.0.aar"
  3415. - info_path = "libs/com_google_android_gms_play_services_auth/com_google_android_gms_play_services_auth.info"
  3416. - deps = [
  3417. - ":google_play_services_auth_api_phone_java",
  3418. - ":google_play_services_auth_base_java",
  3419. - ":google_play_services_base_java",
  3420. - ":google_play_services_basement_java",
  3421. - ":google_play_services_tasks_java",
  3422. - "//third_party/androidx:androidx_fragment_fragment_java",
  3423. - "//third_party/androidx:androidx_loader_loader_java",
  3424. - ]
  3425. - }
  3426. -
  3427. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3428. - android_aar_prebuilt("google_play_services_auth_api_phone_java") {
  3429. - aar_path = "libs/com_google_android_gms_play_services_auth_api_phone/play-services-auth-api-phone-17.5.0.aar"
  3430. - info_path = "libs/com_google_android_gms_play_services_auth_api_phone/com_google_android_gms_play_services_auth_api_phone.info"
  3431. - deps = [
  3432. - ":google_play_services_base_java",
  3433. - ":google_play_services_basement_java",
  3434. - ":google_play_services_tasks_java",
  3435. - ]
  3436. - }
  3437. -
  3438. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3439. - android_aar_prebuilt("google_play_services_auth_base_java") {
  3440. - aar_path = "libs/com_google_android_gms_play_services_auth_base/play-services-auth-base-17.0.0.aar"
  3441. - info_path = "libs/com_google_android_gms_play_services_auth_base/com_google_android_gms_play_services_auth_base.info"
  3442. - deps = [
  3443. - ":google_play_services_base_java",
  3444. - ":google_play_services_basement_java",
  3445. - ":google_play_services_tasks_java",
  3446. - "//third_party/androidx:androidx_collection_collection_java",
  3447. - ]
  3448. - }
  3449. -
  3450. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3451. - android_aar_prebuilt("google_play_services_base_java") {
  3452. - aar_path = "libs/com_google_android_gms_play_services_base/play-services-base-17.5.0.aar"
  3453. - info_path = "libs/com_google_android_gms_play_services_base/com_google_android_gms_play_services_base.info"
  3454. - deps = [
  3455. - ":google_play_services_basement_java",
  3456. - ":google_play_services_tasks_java",
  3457. - "//third_party/androidx:androidx_collection_collection_java",
  3458. - "//third_party/androidx:androidx_core_core_java",
  3459. - "//third_party/androidx:androidx_fragment_fragment_java",
  3460. - ]
  3461. - bytecode_rewriter_target =
  3462. - "//build/android/bytecode:fragment_activity_replacer"
  3463. - }
  3464. -
  3465. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3466. - android_aar_prebuilt("google_play_services_basement_java") {
  3467. - aar_path = "libs/com_google_android_gms_play_services_basement/play-services-basement-17.5.0.aar"
  3468. - info_path = "libs/com_google_android_gms_play_services_basement/com_google_android_gms_play_services_basement.info"
  3469. - deps = [
  3470. - "//third_party/androidx:androidx_collection_collection_java",
  3471. - "//third_party/androidx:androidx_core_core_java",
  3472. - "//third_party/androidx:androidx_fragment_fragment_java",
  3473. - ]
  3474. -
  3475. - jar_excluded_patterns = []
  3476. - if (!enable_java_asserts) {
  3477. - # Omit the file since we use our own copy.
  3478. - jar_excluded_patterns +=
  3479. - [ "com/google/android/gms/common/internal/Preconditions.class" ]
  3480. - deps += [ "//third_party/android_deps/local_modifications/preconditions:gms_stub_preconditions_java" ]
  3481. - }
  3482. -
  3483. - # https://crbug.com/989505
  3484. - jar_excluded_patterns += [ "META-INF/proguard/*" ]
  3485. - input_jars_paths = [ "$android_sdk/optional/org.apache.http.legacy.jar" ]
  3486. - bytecode_rewriter_target =
  3487. - "//build/android/bytecode:fragment_activity_replacer"
  3488. - }
  3489. -
  3490. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3491. - android_aar_prebuilt("google_play_services_cast_java") {
  3492. - aar_path = "libs/com_google_android_gms_play_services_cast/play-services-cast-17.0.0.aar"
  3493. - info_path = "libs/com_google_android_gms_play_services_cast/com_google_android_gms_play_services_cast.info"
  3494. - deps = [
  3495. - ":google_play_services_base_java",
  3496. - ":google_play_services_basement_java",
  3497. - ":google_play_services_flags_java",
  3498. - ":google_play_services_tasks_java",
  3499. - "//third_party/androidx:androidx_core_core_java",
  3500. - "//third_party/androidx:androidx_mediarouter_mediarouter_java",
  3501. - ]
  3502. - }
  3503. -
  3504. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3505. - android_aar_prebuilt("google_play_services_cast_framework_java") {
  3506. - aar_path = "libs/com_google_android_gms_play_services_cast_framework/play-services-cast-framework-17.0.0.aar"
  3507. - info_path = "libs/com_google_android_gms_play_services_cast_framework/com_google_android_gms_play_services_cast_framework.info"
  3508. - deps = [
  3509. - ":google_play_services_base_java",
  3510. - ":google_play_services_basement_java",
  3511. - ":google_play_services_cast_java",
  3512. - "//third_party/androidx:androidx_appcompat_appcompat_java",
  3513. - "//third_party/androidx:androidx_collection_collection_java",
  3514. - "//third_party/androidx:androidx_core_core_java",
  3515. - "//third_party/androidx:androidx_fragment_fragment_java",
  3516. - "//third_party/androidx:androidx_media_media_java",
  3517. - "//third_party/androidx:androidx_mediarouter_mediarouter_java",
  3518. - "//third_party/androidx:androidx_recyclerview_recyclerview_java",
  3519. - ]
  3520. - }
  3521. -
  3522. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3523. - android_aar_prebuilt("google_play_services_fido_java") {
  3524. - aar_path = "libs/com_google_android_gms_play_services_fido/play-services-fido-19.0.0-beta.aar"
  3525. - info_path = "libs/com_google_android_gms_play_services_fido/com_google_android_gms_play_services_fido.info"
  3526. - deps = [
  3527. - ":google_play_services_base_java",
  3528. - ":google_play_services_basement_java",
  3529. - ":google_play_services_tasks_java",
  3530. - ]
  3531. - }
  3532. -
  3533. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3534. - android_aar_prebuilt("google_play_services_gcm_java") {
  3535. - aar_path = "libs/com_google_android_gms_play_services_gcm/play-services-gcm-17.0.0.aar"
  3536. - info_path = "libs/com_google_android_gms_play_services_gcm/com_google_android_gms_play_services_gcm.info"
  3537. - deps = [
  3538. - ":google_play_services_base_java",
  3539. - ":google_play_services_basement_java",
  3540. - ":google_play_services_iid_java",
  3541. - ":google_play_services_stats_java",
  3542. - "//third_party/androidx:androidx_collection_collection_java",
  3543. - "//third_party/androidx:androidx_core_core_java",
  3544. - "//third_party/androidx:androidx_legacy_legacy_support_core_utils_java",
  3545. - ]
  3546. - }
  3547. -
  3548. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3549. - android_aar_prebuilt("google_play_services_iid_java") {
  3550. - aar_path = "libs/com_google_android_gms_play_services_iid/play-services-iid-17.0.0.aar"
  3551. - info_path = "libs/com_google_android_gms_play_services_iid/com_google_android_gms_play_services_iid.info"
  3552. - deps = [
  3553. - ":google_play_services_base_java",
  3554. - ":google_play_services_basement_java",
  3555. - ":google_play_services_stats_java",
  3556. - ":google_play_services_tasks_java",
  3557. - "//third_party/androidx:androidx_collection_collection_java",
  3558. - "//third_party/androidx:androidx_core_core_java",
  3559. - ]
  3560. - }
  3561. -
  3562. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3563. - android_aar_prebuilt("google_play_services_instantapps_java") {
  3564. - aar_path = "libs/com_google_android_gms_play_services_instantapps/play-services-instantapps-17.0.0.aar"
  3565. - info_path = "libs/com_google_android_gms_play_services_instantapps/com_google_android_gms_play_services_instantapps.info"
  3566. - deps = [
  3567. - ":google_play_services_base_java",
  3568. - ":google_play_services_basement_java",
  3569. - ":google_play_services_tasks_java",
  3570. - ]
  3571. - }
  3572. -
  3573. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3574. - android_aar_prebuilt("google_play_services_location_java") {
  3575. - aar_path = "libs/com_google_android_gms_play_services_location/play-services-location-17.0.0.aar"
  3576. - info_path = "libs/com_google_android_gms_play_services_location/com_google_android_gms_play_services_location.info"
  3577. - deps = [
  3578. - ":google_play_services_base_java",
  3579. - ":google_play_services_basement_java",
  3580. - ":google_play_services_places_placereport_java",
  3581. - ":google_play_services_tasks_java",
  3582. - ]
  3583. - }
  3584. -
  3585. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3586. - android_aar_prebuilt("google_play_services_tasks_java") {
  3587. - aar_path = "libs/com_google_android_gms_play_services_tasks/play-services-tasks-17.2.0.aar"
  3588. - info_path = "libs/com_google_android_gms_play_services_tasks/com_google_android_gms_play_services_tasks.info"
  3589. - deps = [ ":google_play_services_basement_java" ]
  3590. - }
  3591. -
  3592. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3593. - android_aar_prebuilt("google_play_services_vision_java") {
  3594. - aar_path = "libs/com_google_android_gms_play_services_vision/play-services-vision-18.0.0.aar"
  3595. - info_path = "libs/com_google_android_gms_play_services_vision/com_google_android_gms_play_services_vision.info"
  3596. - deps = [
  3597. - ":google_play_services_base_java",
  3598. - ":google_play_services_basement_java",
  3599. - ":google_play_services_vision_common_java",
  3600. - ]
  3601. - }
  3602. -
  3603. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3604. - android_aar_prebuilt("google_play_services_vision_common_java") {
  3605. - aar_path = "libs/com_google_android_gms_play_services_vision_common/play-services-vision-common-18.0.0.aar"
  3606. - info_path = "libs/com_google_android_gms_play_services_vision_common/com_google_android_gms_play_services_vision_common.info"
  3607. - deps = [
  3608. - ":google_play_services_base_java",
  3609. - ":google_play_services_basement_java",
  3610. - ":google_play_services_clearcut_java",
  3611. - ":google_play_services_flags_java",
  3612. - ":google_play_services_phenotype_java",
  3613. - ]
  3614. - }
  3615. -
  3616. # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3617. android_aar_prebuilt("com_google_android_material_material_java") {
  3618. aar_path =
  3619. @@ -1269,60 +1064,6 @@ if (!limit_android_deps) {
  3620. proguard_configs = [ "material_design.flags" ]
  3621. }
  3622. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3623. - android_aar_prebuilt("com_google_android_play_core_java") {
  3624. - aar_path = "libs/com_google_android_play_core/core-1.10.0.aar"
  3625. - info_path =
  3626. - "libs/com_google_android_play_core/com_google_android_play_core.info"
  3627. - }
  3628. -
  3629. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3630. - android_aar_prebuilt("google_firebase_firebase_iid_java") {
  3631. - aar_path = "libs/com_google_firebase_firebase_iid/firebase-iid-21.0.1.aar"
  3632. - info_path = "libs/com_google_firebase_firebase_iid/com_google_firebase_firebase_iid.info"
  3633. - deps = [
  3634. - ":google_firebase_firebase_common_java",
  3635. - ":google_firebase_firebase_components_java",
  3636. - ":google_firebase_firebase_iid_interop_java",
  3637. - ":google_firebase_firebase_installations_interop_java",
  3638. - ":google_firebase_firebase_installations_java",
  3639. - ":google_play_services_basement_java",
  3640. - ":google_play_services_cloud_messaging_java",
  3641. - ":google_play_services_stats_java",
  3642. - ":google_play_services_tasks_java",
  3643. - "//third_party/androidx:androidx_collection_collection_java",
  3644. - "//third_party/androidx:androidx_core_core_java",
  3645. - "//third_party/androidx:androidx_legacy_legacy_support_core_utils_java",
  3646. - ]
  3647. - }
  3648. -
  3649. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3650. - android_aar_prebuilt("google_firebase_firebase_messaging_java") {
  3651. - aar_path = "libs/com_google_firebase_firebase_messaging/firebase-messaging-21.0.1.aar"
  3652. - info_path = "libs/com_google_firebase_firebase_messaging/com_google_firebase_firebase_messaging.info"
  3653. - deps = [
  3654. - ":google_android_datatransport_transport_api_java",
  3655. - ":google_firebase_firebase_common_java",
  3656. - ":google_firebase_firebase_components_java",
  3657. - ":google_firebase_firebase_encoders_java",
  3658. - ":google_firebase_firebase_encoders_json_java",
  3659. - ":google_firebase_firebase_iid_java",
  3660. - ":google_firebase_firebase_installations_interop_java",
  3661. - ":google_firebase_firebase_installations_java",
  3662. - ":google_firebase_firebase_measurement_connector_java",
  3663. - ":google_play_services_basement_java",
  3664. - ":google_play_services_cloud_messaging_java",
  3665. - ":google_play_services_stats_java",
  3666. - ":google_play_services_tasks_java",
  3667. - "//third_party/androidx:androidx_collection_collection_java",
  3668. - "//third_party/androidx:androidx_core_core_java",
  3669. - ]
  3670. -
  3671. - # We removed the datatransport dependency to reduce binary size.
  3672. - # The library works without it as it's only used for logging.
  3673. - enable_bytecode_checks = false
  3674. - }
  3675. -
  3676. # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3677. java_prebuilt("com_google_guava_guava_android_java") {
  3678. jar_path = "libs/com_google_guava_guava_android/guava-31.0-android.jar"
  3679. @@ -1471,19 +1212,6 @@ if (!limit_android_deps) {
  3680. bypass_platform_checks = true
  3681. }
  3682. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3683. - java_prebuilt("org_robolectric_shadows_playservices_java") {
  3684. - jar_path = "libs/org_robolectric_shadows_playservices/shadows-playservices-4.3.1.jar"
  3685. - output_name = "org_robolectric_shadows_playservices"
  3686. - enable_bytecode_checks = false
  3687. - testonly = true
  3688. - deps = [
  3689. - ":com_google_guava_guava_java",
  3690. - ":org_robolectric_annotations_java",
  3691. - ]
  3692. - bypass_platform_checks = true
  3693. - }
  3694. -
  3695. # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3696. java_prebuilt("org_robolectric_utils_java") {
  3697. jar_path = "libs/org_robolectric_utils/utils-4.3.1.jar"
  3698. @@ -1860,272 +1588,6 @@ if (!limit_android_deps) {
  3699. deps = [ "//third_party/androidx:androidx_annotation_annotation_java" ]
  3700. }
  3701. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3702. - android_aar_prebuilt("google_play_services_clearcut_java") {
  3703. - aar_path = "libs/com_google_android_gms_play_services_clearcut/play-services-clearcut-17.0.0.aar"
  3704. - info_path = "libs/com_google_android_gms_play_services_clearcut/com_google_android_gms_play_services_clearcut.info"
  3705. -
  3706. - # To remove visibility constraint, add this dependency to
  3707. - # //third_party/android_deps/build.gradle.
  3708. - visibility = [
  3709. - ":*",
  3710. - "//third_party/androidx:*",
  3711. - ]
  3712. - deps = [
  3713. - ":google_play_services_base_java",
  3714. - ":google_play_services_basement_java",
  3715. - ":google_play_services_phenotype_java",
  3716. - ":google_play_services_tasks_java",
  3717. - "//third_party/androidx:androidx_core_core_java",
  3718. - ]
  3719. - }
  3720. -
  3721. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3722. - android_aar_prebuilt("google_play_services_cloud_messaging_java") {
  3723. - aar_path = "libs/com_google_android_gms_play_services_cloud_messaging/play-services-cloud-messaging-16.0.0.aar"
  3724. - info_path = "libs/com_google_android_gms_play_services_cloud_messaging/com_google_android_gms_play_services_cloud_messaging.info"
  3725. -
  3726. - # To remove visibility constraint, add this dependency to
  3727. - # //third_party/android_deps/build.gradle.
  3728. - visibility = [
  3729. - ":*",
  3730. - "//third_party/androidx:*",
  3731. - ]
  3732. - deps = [
  3733. - ":google_play_services_basement_java",
  3734. - ":google_play_services_tasks_java",
  3735. - ]
  3736. - }
  3737. -
  3738. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3739. - android_aar_prebuilt("google_play_services_flags_java") {
  3740. - aar_path = "libs/com_google_android_gms_play_services_flags/play-services-flags-17.0.0.aar"
  3741. - info_path = "libs/com_google_android_gms_play_services_flags/com_google_android_gms_play_services_flags.info"
  3742. -
  3743. - # To remove visibility constraint, add this dependency to
  3744. - # //third_party/android_deps/build.gradle.
  3745. - visibility = [
  3746. - ":*",
  3747. - "//third_party/androidx:*",
  3748. - ]
  3749. - deps = [
  3750. - ":google_play_services_base_java",
  3751. - ":google_play_services_basement_java",
  3752. - ]
  3753. - }
  3754. -
  3755. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3756. - android_aar_prebuilt("google_play_services_phenotype_java") {
  3757. - aar_path = "libs/com_google_android_gms_play_services_phenotype/play-services-phenotype-17.0.0.aar"
  3758. - info_path = "libs/com_google_android_gms_play_services_phenotype/com_google_android_gms_play_services_phenotype.info"
  3759. -
  3760. - # To remove visibility constraint, add this dependency to
  3761. - # //third_party/android_deps/build.gradle.
  3762. - visibility = [
  3763. - ":*",
  3764. - "//third_party/androidx:*",
  3765. - ]
  3766. - deps = [
  3767. - ":google_play_services_base_java",
  3768. - ":google_play_services_basement_java",
  3769. - ":google_play_services_tasks_java",
  3770. - "//third_party/androidx:androidx_core_core_java",
  3771. - ]
  3772. - }
  3773. -
  3774. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3775. - android_aar_prebuilt("google_play_services_places_placereport_java") {
  3776. - aar_path = "libs/com_google_android_gms_play_services_places_placereport/play-services-places-placereport-17.0.0.aar"
  3777. - info_path = "libs/com_google_android_gms_play_services_places_placereport/com_google_android_gms_play_services_places_placereport.info"
  3778. -
  3779. - # To remove visibility constraint, add this dependency to
  3780. - # //third_party/android_deps/build.gradle.
  3781. - visibility = [
  3782. - ":*",
  3783. - "//third_party/androidx:*",
  3784. - ]
  3785. - deps = [ ":google_play_services_basement_java" ]
  3786. - }
  3787. -
  3788. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3789. - android_aar_prebuilt("google_play_services_stats_java") {
  3790. - aar_path = "libs/com_google_android_gms_play_services_stats/play-services-stats-17.0.0.aar"
  3791. - info_path = "libs/com_google_android_gms_play_services_stats/com_google_android_gms_play_services_stats.info"
  3792. -
  3793. - # To remove visibility constraint, add this dependency to
  3794. - # //third_party/android_deps/build.gradle.
  3795. - visibility = [
  3796. - ":*",
  3797. - "//third_party/androidx:*",
  3798. - ]
  3799. - deps = [
  3800. - ":google_play_services_basement_java",
  3801. - "//third_party/androidx:androidx_legacy_legacy_support_core_utils_java",
  3802. - ]
  3803. - }
  3804. -
  3805. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3806. - java_prebuilt("google_firebase_firebase_annotations_java") {
  3807. - jar_path = "libs/com_google_firebase_firebase_annotations/firebase-annotations-16.0.0.jar"
  3808. - output_name = "com_google_firebase_firebase_annotations"
  3809. - supports_android = true
  3810. -
  3811. - # To remove visibility constraint, add this dependency to
  3812. - # //third_party/android_deps/build.gradle.
  3813. - visibility = [
  3814. - ":*",
  3815. - "//third_party/androidx:*",
  3816. - ]
  3817. - }
  3818. -
  3819. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3820. - android_aar_prebuilt("google_firebase_firebase_common_java") {
  3821. - aar_path =
  3822. - "libs/com_google_firebase_firebase_common/firebase-common-19.5.0.aar"
  3823. - info_path = "libs/com_google_firebase_firebase_common/com_google_firebase_firebase_common.info"
  3824. -
  3825. - # To remove visibility constraint, add this dependency to
  3826. - # //third_party/android_deps/build.gradle.
  3827. - visibility = [
  3828. - ":*",
  3829. - "//third_party/androidx:*",
  3830. - ]
  3831. - deps = [
  3832. - ":google_firebase_firebase_components_java",
  3833. - ":google_play_services_basement_java",
  3834. - ":google_play_services_tasks_java",
  3835. - ]
  3836. -
  3837. - # Ignore missing kotlin.KotlinVersion definition in
  3838. - # com.google.firebase.platforminfo.KotlinDetector.
  3839. - enable_bytecode_checks = false
  3840. - }
  3841. -
  3842. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3843. - android_aar_prebuilt("google_firebase_firebase_components_java") {
  3844. - aar_path = "libs/com_google_firebase_firebase_components/firebase-components-16.1.0.aar"
  3845. - info_path = "libs/com_google_firebase_firebase_components/com_google_firebase_firebase_components.info"
  3846. -
  3847. - # To remove visibility constraint, add this dependency to
  3848. - # //third_party/android_deps/build.gradle.
  3849. - visibility = [
  3850. - ":*",
  3851. - "//third_party/androidx:*",
  3852. - ]
  3853. - deps = [
  3854. - ":google_firebase_firebase_annotations_java",
  3855. - "//third_party/androidx:androidx_annotation_annotation_java",
  3856. - ]
  3857. -
  3858. - # Can't find com.google.firebase.components.Component$ComponentType.
  3859. - enable_bytecode_checks = false
  3860. - }
  3861. -
  3862. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3863. - java_prebuilt("google_firebase_firebase_encoders_java") {
  3864. - jar_path = "libs/com_google_firebase_firebase_encoders/firebase-encoders-16.1.0.jar"
  3865. - output_name = "com_google_firebase_firebase_encoders"
  3866. - supports_android = true
  3867. -
  3868. - # To remove visibility constraint, add this dependency to
  3869. - # //third_party/android_deps/build.gradle.
  3870. - visibility = [
  3871. - ":*",
  3872. - "//third_party/androidx:*",
  3873. - ]
  3874. - deps = [ "//third_party/androidx:androidx_annotation_annotation_java" ]
  3875. - }
  3876. -
  3877. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3878. - android_aar_prebuilt("google_firebase_firebase_encoders_json_java") {
  3879. - aar_path = "libs/com_google_firebase_firebase_encoders_json/firebase-encoders-json-17.1.0.aar"
  3880. - info_path = "libs/com_google_firebase_firebase_encoders_json/com_google_firebase_firebase_encoders_json.info"
  3881. -
  3882. - # To remove visibility constraint, add this dependency to
  3883. - # //third_party/android_deps/build.gradle.
  3884. - visibility = [
  3885. - ":*",
  3886. - "//third_party/androidx:*",
  3887. - ]
  3888. - deps = [
  3889. - ":google_firebase_firebase_encoders_java",
  3890. - "//third_party/androidx:androidx_annotation_annotation_java",
  3891. - ]
  3892. - }
  3893. -
  3894. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3895. - android_aar_prebuilt("google_firebase_firebase_iid_interop_java") {
  3896. - aar_path = "libs/com_google_firebase_firebase_iid_interop/firebase-iid-interop-17.0.0.aar"
  3897. - info_path = "libs/com_google_firebase_firebase_iid_interop/com_google_firebase_firebase_iid_interop.info"
  3898. -
  3899. - # To remove visibility constraint, add this dependency to
  3900. - # //third_party/android_deps/build.gradle.
  3901. - visibility = [
  3902. - ":*",
  3903. - "//third_party/androidx:*",
  3904. - ]
  3905. - deps = [
  3906. - ":google_play_services_base_java",
  3907. - ":google_play_services_basement_java",
  3908. - ]
  3909. - }
  3910. -
  3911. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3912. - android_aar_prebuilt("google_firebase_firebase_installations_java") {
  3913. - aar_path = "libs/com_google_firebase_firebase_installations/firebase-installations-16.3.5.aar"
  3914. - info_path = "libs/com_google_firebase_firebase_installations/com_google_firebase_firebase_installations.info"
  3915. -
  3916. - # To remove visibility constraint, add this dependency to
  3917. - # //third_party/android_deps/build.gradle.
  3918. - visibility = [
  3919. - ":*",
  3920. - "//third_party/androidx:*",
  3921. - ]
  3922. - deps = [
  3923. - ":google_firebase_firebase_common_java",
  3924. - ":google_firebase_firebase_components_java",
  3925. - ":google_firebase_firebase_installations_interop_java",
  3926. - ":google_play_services_tasks_java",
  3927. - ]
  3928. -
  3929. - # Can't find com.google.auto.value.AutoValue$Builder.
  3930. - enable_bytecode_checks = false
  3931. - }
  3932. -
  3933. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3934. - android_aar_prebuilt("google_firebase_firebase_installations_interop_java") {
  3935. - aar_path = "libs/com_google_firebase_firebase_installations_interop/firebase-installations-interop-16.0.1.aar"
  3936. - info_path = "libs/com_google_firebase_firebase_installations_interop/com_google_firebase_firebase_installations_interop.info"
  3937. -
  3938. - # To remove visibility constraint, add this dependency to
  3939. - # //third_party/android_deps/build.gradle.
  3940. - visibility = [
  3941. - ":*",
  3942. - "//third_party/androidx:*",
  3943. - ]
  3944. - deps = [
  3945. - ":google_firebase_firebase_annotations_java",
  3946. - ":google_play_services_tasks_java",
  3947. - ]
  3948. -
  3949. - # Can't find com.google.auto.value.AutoValue$Builder.
  3950. - enable_bytecode_checks = false
  3951. - }
  3952. -
  3953. - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3954. - android_aar_prebuilt("google_firebase_firebase_measurement_connector_java") {
  3955. - aar_path = "libs/com_google_firebase_firebase_measurement_connector/firebase-measurement-connector-18.0.0.aar"
  3956. - info_path = "libs/com_google_firebase_firebase_measurement_connector/com_google_firebase_firebase_measurement_connector.info"
  3957. -
  3958. - # To remove visibility constraint, add this dependency to
  3959. - # //third_party/android_deps/build.gradle.
  3960. - visibility = [
  3961. - ":*",
  3962. - "//third_party/androidx:*",
  3963. - ]
  3964. - deps = [ ":google_play_services_basement_java" ]
  3965. - }
  3966. -
  3967. # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
  3968. java_prebuilt("com_squareup_javawriter_java") {
  3969. jar_path = "libs/com_squareup_javawriter/javawriter-2.1.1.jar"
  3970. diff --git a/third_party/android_deps/local_modifications/preconditions/javatests/BUILD.gn b/third_party/android_deps/local_modifications/preconditions/javatests/BUILD.gn
  3971. --- a/third_party/android_deps/local_modifications/preconditions/javatests/BUILD.gn
  3972. +++ b/third_party/android_deps/local_modifications/preconditions/javatests/BUILD.gn
  3973. @@ -8,7 +8,6 @@ android_library("javatests") {
  3974. testonly = true
  3975. sources = [ "org/chromium/preconditions/PreconditionsTest.java" ]
  3976. deps = [
  3977. - "$google_play_services_package:google_play_services_basement_java",
  3978. "//base:base_java",
  3979. "//base:base_java_test_support",
  3980. "//base/test:test_support_java",
  3981. diff --git a/third_party/android_deps/util/org/chromium/gms/ChromiumPlayServicesAvailability.java b/third_party/android_deps/util/org/chromium/gms/ChromiumPlayServicesAvailability.java
  3982. --- a/third_party/android_deps/util/org/chromium/gms/ChromiumPlayServicesAvailability.java
  3983. +++ b/third_party/android_deps/util/org/chromium/gms/ChromiumPlayServicesAvailability.java
  3984. @@ -5,9 +5,6 @@ package org.chromium.gms;
  3985. import android.content.Context;
  3986. -import com.google.android.gms.common.ConnectionResult;
  3987. -import com.google.android.gms.common.GoogleApiAvailability;
  3988. -
  3989. // Refer to go/doubledown-play-services#new-apis for more detail.
  3990. public final class ChromiumPlayServicesAvailability {
  3991. /**
  3992. @@ -30,9 +27,7 @@ public final class ChromiumPlayServicesAvailability {
  3993. * PM/UX.
  3994. */
  3995. public static boolean isGooglePlayServicesAvailable(final Context context) {
  3996. - return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
  3997. - context, GMS_VERSION_NUMBER)
  3998. - == ConnectionResult.SUCCESS;
  3999. + return false;
  4000. }
  4001. /**
  4002. @@ -50,7 +45,6 @@ public final class ChromiumPlayServicesAvailability {
  4003. * PM/UX.
  4004. */
  4005. public static int getGooglePlayServicesConnectionResult(final Context context) {
  4006. - return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(
  4007. - context, GMS_VERSION_NUMBER);
  4008. + return 16; // API_UNAVAILABLE
  4009. }
  4010. }
  4011. --
  4012. 2.20.1