Browse Source

Add comments for NotificationCompat to support API < 16

volzhs 9 years ago
parent
commit
e5d16eca46

+ 1 - 1
platform/android/build.gradle.template

@@ -17,7 +17,7 @@ allprojects {
 }
 }
 
 
 dependencies {
 dependencies {
-	compile 'com.android.support:support-v4:23.+'
+	compile 'com.android.support:support-v4:23.+'  // can be removed if minSdkVersion 16 and modify DownloadNotification.java & V14CustomNotification.java
 	$$GRADLE_DEPENDENCIES$$    
 	$$GRADLE_DEPENDENCIES$$    
 }
 }
 
 

+ 2 - 1
platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java

@@ -49,6 +49,7 @@ public class DownloadNotification implements IDownloaderClient {
 
 
     private IDownloaderClient mClientProxy;
     private IDownloaderClient mClientProxy;
     final ICustomNotification mCustomNotification;
     final ICustomNotification mCustomNotification;
+    // NotificationCompat.Builder is used to support API < 16. This can be changed to Notification.Builder if minimum API >= 16.
     private NotificationCompat.Builder mNotificationBuilder;
     private NotificationCompat.Builder mNotificationBuilder;
     private NotificationCompat.Builder mCurrentNotificationBuilder;
     private NotificationCompat.Builder mCurrentNotificationBuilder;
     private CharSequence mLabel;
     private CharSequence mLabel;
@@ -186,7 +187,7 @@ public class DownloadNotification implements IDownloaderClient {
 
 
         void setTimeRemaining(long timeRemaining);
         void setTimeRemaining(long timeRemaining);
 
 
-		NotificationCompat.Builder updateNotification(Context c);
+        NotificationCompat.Builder updateNotification(Context c);
     }
     }
 
 
     /**
     /**

+ 2 - 1
platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java

@@ -60,7 +60,8 @@ public class V14CustomNotification implements DownloadNotification.ICustomNotifi
 
 
     @Override
     @Override
     public NotificationCompat.Builder updateNotification(Context c) {
     public NotificationCompat.Builder updateNotification(Context c) {
-		NotificationCompat.Builder builder = new NotificationCompat.Builder(c);
+        // NotificationCompat.Builder is used to support API < 16. This can be changed to Notification.Builder if minimum API >= 16.
+        NotificationCompat.Builder builder = new NotificationCompat.Builder(c);
         builder.setContentTitle(mTitle);
         builder.setContentTitle(mTitle);
         if (mTotalKB > 0 && -1 != mCurrentKB) {
         if (mTotalKB > 0 && -1 != mCurrentKB) {
             builder.setProgress((int) (mTotalKB >> 8), (int) (mCurrentKB >> 8), false);
             builder.setProgress((int) (mTotalKB >> 8), (int) (mCurrentKB >> 8), false);