Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Side by Side Diff: components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GoogleCloudMessagingV2.java

Issue 2548013002: Remove redundant field initialization in Java code. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.components.gcm_driver; 5 package org.chromium.components.gcm_driver;
6 6
7 import android.app.PendingIntent; 7 import android.app.PendingIntent;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.os.Bundle; 10 import android.os.Bundle;
(...skipping 25 matching lines...) Expand all
36 private static final String ERROR_MAIN_THREAD = "MAIN_THREAD"; 36 private static final String ERROR_MAIN_THREAD = "MAIN_THREAD";
37 private static final String ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAIL ABLE"; 37 private static final String ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAIL ABLE";
38 private static final String EXTRA_DELETE = "delete"; 38 private static final String EXTRA_DELETE = "delete";
39 private static final String EXTRA_REGISTRATION_ID = "registration_id"; 39 private static final String EXTRA_REGISTRATION_ID = "registration_id";
40 private static final String EXTRA_SENDER = "sender"; 40 private static final String EXTRA_SENDER = "sender";
41 private static final String EXTRA_MESSENGER = "google.messenger"; 41 private static final String EXTRA_MESSENGER = "google.messenger";
42 private static final String EXTRA_SUBTYPE = "subtype"; 42 private static final String EXTRA_SUBTYPE = "subtype";
43 private static final String EXTRA_SUBSCRIPTION = "subscription"; 43 private static final String EXTRA_SUBSCRIPTION = "subscription";
44 44
45 private Context mContext; 45 private Context mContext;
46 private PendingIntent mAppPendingIntent = null; 46 private PendingIntent mAppPendingIntent;
47 private final Object mAppPendingIntentLock = new Object(); 47 private final Object mAppPendingIntentLock = new Object();
48 48
49 public GoogleCloudMessagingV2(Context context) { 49 public GoogleCloudMessagingV2(Context context) {
50 mContext = context; 50 mContext = context;
51 } 51 }
52 52
53 @Override 53 @Override
54 public String subscribe(String source, String subtype, @Nullable Bundle data ) 54 public String subscribe(String source, String subtype, @Nullable Bundle data )
55 throws IOException { 55 throws IOException {
56 if (data == null) { 56 if (data == null) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 Intent target = new Intent(); 188 Intent target = new Intent();
189 // Fill in the package, to prevent the intent from being used. 189 // Fill in the package, to prevent the intent from being used.
190 target.setPackage("com.google.example.invalidpackage"); 190 target.setPackage("com.google.example.invalidpackage");
191 mAppPendingIntent = PendingIntent.getBroadcast( 191 mAppPendingIntent = PendingIntent.getBroadcast(
192 mContext.getApplicationContext(), 0, target, 0); 192 mContext.getApplicationContext(), 0, target, 0);
193 } 193 }
194 } 194 }
195 intent.putExtra(INTENT_PARAM_APP, mAppPendingIntent); 195 intent.putExtra(INTENT_PARAM_APP, mAppPendingIntent);
196 } 196 }
197 } 197 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698