Skip to content

Commit

Permalink
Clean up unused methods. (#4043)
Browse files Browse the repository at this point in the history
* Cleaned up some unused methods in CommonNotificationBuilder.
* Also changed to explicitly save the result of sendIntent() in FcmBroadcastProcessor but not use it since we're blocking on the result of the Task, and added a comment to that effect.
  • Loading branch information
gsakakihara authored Aug 30, 2022
1 parent 42c8d72 commit 46293c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,30 +109,6 @@ static DisplayNotificationInfo createNotificationInfo(
manifestMetadata);
}

/**
* Legacy method that creates a DisplayNotificationInfo from NotificationParams that allows
* specifying components so the calling Context can be different from the Context used for the
* notification (resources, etc.).
*/
public static DisplayNotificationInfo createNotificationInfo(
Context context,
String pkgName,
NotificationParams params,
String channelId,
Resources appResources,
PackageManager appPackageManager,
Bundle manifestMetadata) {
return createNotificationInfo(
context,
context,
params,
channelId,
manifestMetadata,
pkgName,
appResources,
appPackageManager);
}

/**
* Creates a DisplayNotificationInfo from NotificationParams that allows specifying a calling
* Context to be used for creating PendingIntents and one Context that the notification is
Expand All @@ -147,27 +123,6 @@ public static DisplayNotificationInfo createNotificationInfo(
String pkgName = appContext.getPackageName();
Resources appResources = appContext.getResources();
PackageManager appPackageManager = appContext.getPackageManager();
return createNotificationInfo(
callingContext,
appContext,
params,
channelId,
manifestMetadata,
pkgName,
appResources,
appPackageManager);
}

public static DisplayNotificationInfo createNotificationInfo(
Context callingContext,
Context appContext,
NotificationParams params,
String channelId,
Bundle manifestMetadata,
String pkgName,
Resources appResources,
PackageManager appPackageManager) {

NotificationCompat.Builder builder = new NotificationCompat.Builder(appContext, channelId);

String title =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ private static Task<Integer> bindToMessagingService(Context context, Intent inte
WakeLockHolder.sendWakefulServiceIntent(
context, getServiceConnection(context, ServiceStarter.ACTION_MESSAGING_EVENT), intent);
} else {
getServiceConnection(context, ServiceStarter.ACTION_MESSAGING_EVENT).sendIntent(intent);
// Ignore result since we're no longer blocking on the service handling the intent.
Task<Void> unused =
getServiceConnection(context, ServiceStarter.ACTION_MESSAGING_EVENT).sendIntent(intent);
}

return Tasks.forResult(ServiceStarter.SUCCESS);
Expand Down

0 comments on commit 46293c9

Please sign in to comment.