15
15
// </copyright>
16
16
17
17
namespace GooglePlayServices {
18
+ using Google ;
18
19
using Google . JarResolver ;
19
20
using System ;
20
21
using System . Diagnostics ;
@@ -182,10 +183,10 @@ public static long ConvertVersionStringToInteger(string versionString,
182
183
try {
183
184
componentInteger = Convert . ToInt64 ( component ) ;
184
185
} catch ( FormatException ) {
185
- PlayServicesSupport . Log (
186
+ PlayServicesResolver . Log (
186
187
String . Format ( "Unable to convert version string {0} to " +
187
188
"integer value" , versionString ) ,
188
- level : PlayServicesSupport . LogLevel . Warning ) ;
189
+ level : LogLevel . Warning ) ;
189
190
return 0 ;
190
191
}
191
192
versionInteger += ( componentInteger * currentMultiplier ) ;
@@ -241,9 +242,9 @@ public static AndroidSdkPackage ReadFromSourceProperties(string sdkDirectory,
241
242
try {
242
243
propertiesText = File . ReadAllText ( propertiesPath ) ;
243
244
} catch ( Exception e ) {
244
- PlayServicesSupport . Log ( String . Format ( "Unable to read {0}\n {1}\n " ,
245
+ PlayServicesResolver . Log ( String . Format ( "Unable to read {0}\n {1}\n " ,
245
246
propertiesPath , e . ToString ( ) ) ,
246
- verbose : true ) ;
247
+ level : LogLevel . Verbose ) ;
247
248
return null ;
248
249
}
249
250
// Unfortunately the package name is simply based upon the path within the SDK.
@@ -405,10 +406,11 @@ public static void QueryPackages(string toolPath, string toolArguments,
405
406
Action < CommandLine . Result > complete ) {
406
407
var window = CommandLineDialog . CreateCommandLineDialog (
407
408
"Querying Android SDK packages" ) ;
408
- PlayServicesSupport . Log ( String . Format ( "Query Android SDK packages\n " +
409
- "\n " +
410
- "{0} {1}\n " ,
411
- toolPath , toolArguments ) , verbose : true ) ;
409
+ PlayServicesResolver . Log ( String . Format ( "Query Android SDK packages\n " +
410
+ "\n " +
411
+ "{0} {1}\n " ,
412
+ toolPath , toolArguments ) ,
413
+ level : LogLevel . Verbose ) ;
412
414
window . summaryText = "Getting Installed Android SDK packages." ;
413
415
window . modal = false ;
414
416
window . progressTitle = window . summaryText ;
@@ -418,7 +420,7 @@ public static void QueryPackages(string toolPath, string toolArguments,
418
420
( CommandLine . Result result ) => {
419
421
window . Close ( ) ;
420
422
if ( result . exitCode != 0 ) {
421
- PlayServicesSupport . Log ( String . Format ( PACKAGES_MISSING , result . message ) ) ;
423
+ PlayServicesResolver . Log ( String . Format ( PACKAGES_MISSING , result . message ) ) ;
422
424
}
423
425
complete ( result ) ;
424
426
} ,
@@ -443,10 +445,11 @@ public static void InstallPackages(
443
445
HashSet < AndroidSdkPackageNameVersion > packages ,
444
446
string licenseQuestion , string licenseAgree , string licenseDecline ,
445
447
Regex licenseTextHeader , Action < bool > complete ) {
446
- PlayServicesSupport . Log ( String . Format ( "Install Android SDK packages\n " +
447
- "\n " +
448
- "{0} {1}\n " ,
449
- toolPath , toolArguments ) , verbose : true ) ;
448
+ PlayServicesResolver . Log ( String . Format ( "Install Android SDK packages\n " +
449
+ "\n " +
450
+ "{0} {1}\n " ,
451
+ toolPath , toolArguments ) ,
452
+ level : LogLevel . Verbose ) ;
450
453
// Display the license retrieval dialog.
451
454
DisplayInstallLicenseDialog (
452
455
toolPath , toolArguments , true ,
@@ -507,16 +510,15 @@ private static void LogInstallLicenseResult(
507
510
"Aborted installation of the following packages:\n " :
508
511
"Android package installation failed.\n \n " +
509
512
"Failed when installing the following packages:\n " ;
510
- PlayServicesSupport . Log (
513
+ PlayServicesResolver . Log (
511
514
String . Format (
512
515
"{0}\n " +
513
516
"{1}\n \n " +
514
517
"{2}\n " ,
515
518
succeeded ? "Successfully installed Android packages.\n \n " : failedMessage ,
516
519
AndroidSdkPackageNameVersion . ListToString ( packages ) ,
517
520
toolResult . message ) ,
518
- level : succeeded ? PlayServicesSupport . LogLevel . Info :
519
- PlayServicesSupport . LogLevel . Warning ) ;
521
+ level : succeeded ? LogLevel . Info : LogLevel . Warning ) ;
520
522
}
521
523
}
522
524
@@ -544,8 +546,8 @@ private static void DisplayInstallLicenseDialog(
544
546
window . autoScrollToBottom = true ;
545
547
CommandLine . IOHandler ioHandler = null ;
546
548
if ( licenseResponder != null ) ioHandler = licenseResponder . AggregateLine ;
547
- PlayServicesSupport . Log ( String . Format ( "{0} {1}" , toolPath , toolArguments ) ,
548
- verbose : true ) ;
549
+ PlayServicesResolver . Log ( String . Format ( "{0} {1}" , toolPath , toolArguments ) ,
550
+ level : LogLevel . Verbose ) ;
549
551
window . RunAsync (
550
552
toolPath , toolArguments ,
551
553
( CommandLine . Result result ) => {
@@ -919,8 +921,9 @@ public void InstallPackages(HashSet<AndroidSdkPackageNameVersion> packages,
919
921
packagesString ) ,
920
922
"Yes" , cancel : "No" ) ;
921
923
if ( ! installPackage ) {
922
- PlayServicesSupport . Log ( "User cancelled installation of Android SDK tools package." ,
923
- level : PlayServicesSupport . LogLevel . Warning ) ;
924
+ PlayServicesResolver . Log (
925
+ "User cancelled installation of Android SDK tools package." ,
926
+ level : LogLevel . Warning ) ;
924
927
complete ( false ) ;
925
928
return ;
926
929
}
@@ -945,7 +948,7 @@ internal class AndroidSdkManager {
945
948
/// <returns>String with the path to the tool if found, null otherwise.</returns>
946
949
private static string FindAndroidSdkTool ( string toolName , string sdkPath = null ) {
947
950
if ( String . IsNullOrEmpty ( sdkPath ) ) {
948
- PlayServicesSupport . Log ( String . Format (
951
+ PlayServicesResolver . Log ( String . Format (
949
952
"{0}\n " +
950
953
"Falling back to searching for the Android SDK tool {1} in the system path." ,
951
954
PlayServicesSupport . AndroidSdkConfigurationError , toolName ) ) ;
@@ -974,7 +977,7 @@ private static string FindAndroidSdkTool(string toolName, string sdkPath = null)
974
977
/// </summary>
975
978
/// <param name="complete">Action called with null.</param>
976
979
private static void CreateFailed ( Action < IAndroidSdkManager > complete ) {
977
- PlayServicesSupport . Log ( String . Format (
980
+ PlayServicesResolver . Log ( String . Format (
978
981
"Unable to find either the {0} or {1} command line tool.\n \n " +
979
982
"It is not possible to query or install Android SDK packages.\n " +
980
983
"To resolve this issue, open the Android Package Manager" +
0 commit comments