Skip to content

Commit 46293c9

Browse files
authored
Clean up unused methods. (#4043)
* 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.
1 parent 42c8d72 commit 46293c9

File tree

2 files changed

+3
-46
lines changed

2 files changed

+3
-46
lines changed

firebase-messaging/src/main/java/com/google/firebase/messaging/CommonNotificationBuilder.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -109,30 +109,6 @@ static DisplayNotificationInfo createNotificationInfo(
109109
manifestMetadata);
110110
}
111111

112-
/**
113-
* Legacy method that creates a DisplayNotificationInfo from NotificationParams that allows
114-
* specifying components so the calling Context can be different from the Context used for the
115-
* notification (resources, etc.).
116-
*/
117-
public static DisplayNotificationInfo createNotificationInfo(
118-
Context context,
119-
String pkgName,
120-
NotificationParams params,
121-
String channelId,
122-
Resources appResources,
123-
PackageManager appPackageManager,
124-
Bundle manifestMetadata) {
125-
return createNotificationInfo(
126-
context,
127-
context,
128-
params,
129-
channelId,
130-
manifestMetadata,
131-
pkgName,
132-
appResources,
133-
appPackageManager);
134-
}
135-
136112
/**
137113
* Creates a DisplayNotificationInfo from NotificationParams that allows specifying a calling
138114
* Context to be used for creating PendingIntents and one Context that the notification is
@@ -147,27 +123,6 @@ public static DisplayNotificationInfo createNotificationInfo(
147123
String pkgName = appContext.getPackageName();
148124
Resources appResources = appContext.getResources();
149125
PackageManager appPackageManager = appContext.getPackageManager();
150-
return createNotificationInfo(
151-
callingContext,
152-
appContext,
153-
params,
154-
channelId,
155-
manifestMetadata,
156-
pkgName,
157-
appResources,
158-
appPackageManager);
159-
}
160-
161-
public static DisplayNotificationInfo createNotificationInfo(
162-
Context callingContext,
163-
Context appContext,
164-
NotificationParams params,
165-
String channelId,
166-
Bundle manifestMetadata,
167-
String pkgName,
168-
Resources appResources,
169-
PackageManager appPackageManager) {
170-
171126
NotificationCompat.Builder builder = new NotificationCompat.Builder(appContext, channelId);
172127

173128
String title =

firebase-messaging/src/main/java/com/google/firebase/messaging/FcmBroadcastProcessor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ private static Task<Integer> bindToMessagingService(Context context, Intent inte
122122
WakeLockHolder.sendWakefulServiceIntent(
123123
context, getServiceConnection(context, ServiceStarter.ACTION_MESSAGING_EVENT), intent);
124124
} else {
125-
getServiceConnection(context, ServiceStarter.ACTION_MESSAGING_EVENT).sendIntent(intent);
125+
// Ignore result since we're no longer blocking on the service handling the intent.
126+
Task<Void> unused =
127+
getServiceConnection(context, ServiceStarter.ACTION_MESSAGING_EVENT).sendIntent(intent);
126128
}
127129

128130
return Tasks.forResult(ServiceStarter.SUCCESS);

0 commit comments

Comments
 (0)