diff options
author | volzhs <volzhs@gmail.com> | 2016-05-25 22:19:37 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2016-05-25 22:19:37 +0900 |
commit | e5d16eca466aa50b57a127d660499591f16f2255 (patch) | |
tree | 4dd1a2b50a9a0dfd59e3d2898944d4b7785c439c /platform | |
parent | ff67c256f52b904bdabe17e755194149da9b219f (diff) |
Add comments for NotificationCompat to support API < 16
Diffstat (limited to 'platform')
3 files changed, 5 insertions, 3 deletions
diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template index 411f778934..b0630d9a3a 100644 --- a/platform/android/build.gradle.template +++ b/platform/android/build.gradle.template @@ -17,7 +17,7 @@ allprojects { } 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$$ } diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java index c754754ff5..73e6f83bec 100644 --- a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java +++ b/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; 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 mCurrentNotificationBuilder; private CharSequence mLabel; @@ -186,7 +187,7 @@ public class DownloadNotification implements IDownloaderClient { void setTimeRemaining(long timeRemaining); - NotificationCompat.Builder updateNotification(Context c); + NotificationCompat.Builder updateNotification(Context c); } /** diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java index ab1d0ff84a..390bde96e9 100644 --- a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java +++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java @@ -60,7 +60,8 @@ public class V14CustomNotification implements DownloadNotification.ICustomNotifi @Override 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); if (mTotalKB > 0 && -1 != mCurrentKB) { builder.setProgress((int) (mTotalKB >> 8), (int) (mCurrentKB >> 8), false); |