-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement AssetModuleService #2506
base: master
Are you sure you want to change the base?
Conversation
…s necessary to send progress change broadcasts in real time, otherwise the progress bar will be stuck.
Hey, can this be released on some canary build? I was running waze on a device thwt don't have play services, and installed gms core but waze was unable to download some files that I think it's because of this missing implementation. I would love to test this. |
If possible, you can first check whether this service is called. At present, we only found that the game will download resource files through this service. |
… problem that some games cannot obtain sub-packaged downloaded content.
Device Sync is not related to Asset Modules, please put it in a separate pull request. |
For example, the resource data returned by League of Legends depends on the device synchronization request #2621. |
val notificationLayout = RemoteViews(context.packageName, R.layout.layout_download_notification) | ||
notificationLayout.setTextViewText( | ||
R.id.notification_title, context.getString(R.string.download_notification_attachment_file, appName) | ||
) | ||
notificationLayout.setTextViewText( | ||
R.id.notification_text, context.getString(R.string.download_notification_tips) | ||
) | ||
notificationLayout.setProgressBar(R.id.progress_bar, 100, 0, false) | ||
notificationLayout.setImageViewBitmap(R.id.app_icon, bitmap) | ||
notificationLayout.setOnClickPendingIntent(R.id.cancel_button, cancelPendingIntent) | ||
|
||
val notifyBuilder = | ||
NotificationCompat.Builder(context, CHANNEL_ID).setSmallIcon(R.drawable.ic_app_foreground).setStyle(NotificationCompat.DecoratedCustomViewStyle()) | ||
.setCustomContentView(notificationLayout).setPriority(NotificationCompat.PRIORITY_LOW).setOngoing(true).setOnlyAlertOnce(true) | ||
.setColor(ContextCompat.getColor(context, R.color.notification_color)).setColorized(true) | ||
notifyBuilderMap[moduleName] = notifyBuilder | ||
notificationLayoutMap[moduleName] = notificationLayout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason you use a custom notification layout instead of a default with setContentTitle(), setContentText(), setProgress(), setLargeIcon() and addAction()? That should cover the same content but not require a custom view with custom styling, thus better compatible with various android versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified. Previously, it was found that the styles of the notification bar on different device models were different.
The three applications were tested and can be downloaded and installed normally through the service.
e.g. com.wb.goog.mkx , com.gameloft.android.ANMP.GloftDYHM , jp.konami.pesam