Skip to content

Commit 1eafc5a

Browse files
authored
Changes from API review (#4675)
1 parent 6f6b7cb commit 1eafc5a

File tree

18 files changed

+110
-100
lines changed

18 files changed

+110
-100
lines changed

firebase-appdistribution-api/src/main/java/com/google/firebase/appdistribution/FirebaseAppDistribution.java

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package com.google.firebase.appdistribution;
1616

17-
import android.app.Activity;
1817
import android.net.Uri;
1918
import androidx.annotation.NonNull;
2019
import androidx.annotation.Nullable;
@@ -125,12 +124,12 @@ public interface FirebaseAppDistribution {
125124
* <li>Starts a full screen activity for the tester to compose and submit the feedback
126125
* </ol>
127126
*
128-
* @param infoTextResourceId string resource ID of text that will be shown to the tester before
127+
* @param additionalFormText string resource ID of text that will be shown to the tester before
129128
* they submit feedback. If you’re a customer who would like to provide notice to your testers
130129
* about collection and processing of their feedback data, you can use this text to provide
131130
* such notice.
132131
*/
133-
void startFeedback(@StringRes int infoTextResourceId);
132+
void startFeedback(@StringRes int additionalFormText);
134133

135134
/**
136135
* Takes a screenshot, and starts an activity to collect and submit feedback from the tester.
@@ -143,11 +142,11 @@ public interface FirebaseAppDistribution {
143142
* <li>Starts a full screen activity for the tester to compose and submit the feedback
144143
* </ol>
145144
*
146-
* @param infoText text that will be shown to the tester before they submit feedback. If you’re a
147-
* customer who would like to provide notice to your testers about collection and processing
148-
* of their feedback data, you can use this text to provide such notice.
145+
* @param additionalFormText text that will be shown to the tester before they submit feedback. If
146+
* you’re a customer who would like to provide notice to your testers about collection and
147+
* processing of their feedback data, you can use this text to provide such notice.
149148
*/
150-
void startFeedback(@NonNull CharSequence infoText);
149+
void startFeedback(@NonNull CharSequence additionalFormText);
151150

152151
/**
153152
* Starts an activity to collect and submit feedback from the tester, along with the given
@@ -160,14 +159,14 @@ public interface FirebaseAppDistribution {
160159
* <li>Starts a full screen activity for the tester to compose and submit the feedback
161160
* </ol>
162161
*
163-
* @param infoTextResourceId string resource ID of text that will be shown to the tester before
162+
* @param additionalFormText string resource ID of text that will be shown to the tester before
164163
* they submit feedback. If you’re a customer who would like to provide notice to your testers
165164
* about collection and processing of their feedback data, you can use this text to provide
166165
* such notice.
167166
* @param screenshot URI to a bitmap containing a screenshot that will be included with the
168167
* report, or null to not include a screenshot
169168
*/
170-
void startFeedback(@StringRes int infoTextResourceId, @Nullable Uri screenshot);
169+
void startFeedback(@StringRes int additionalFormText, @Nullable Uri screenshot);
171170

172171
/**
173172
* Starts an activity to collect and submit feedback from the tester, along with the given
@@ -180,13 +179,13 @@ public interface FirebaseAppDistribution {
180179
* <li>Starts a full screen activity for the tester to compose and submit the feedback
181180
* </ol>
182181
*
183-
* @param infoText text that will be shown to the tester before they submit feedback. If you’re a
184-
* customer who would like to provide notice to your testers about collection and processing
185-
* of their feedback data, you can use this text to provide such notice.
182+
* @param additionalFormText text that will be shown to the tester before they submit feedback. If
183+
* you’re a customer who would like to provide notice to your testers about collection and
184+
* processing of their feedback data, you can use this text to provide such notice.
186185
* @param screenshot URI to a bitmap containing a screenshot that will be included with the
187186
* report, or null to not include a screenshot
188187
*/
189-
void startFeedback(@NonNull CharSequence infoText, @Nullable Uri screenshot);
188+
void startFeedback(@NonNull CharSequence additionalFormText, @Nullable Uri screenshot);
190189

191190
/**
192191
* Displays a notification that, when tapped, will take a screenshot of the current activity, then
@@ -207,7 +206,7 @@ public interface FirebaseAppDistribution {
207206
* <li>Starts a full screen activity for the tester to compose and submit the feedback
208207
* </ol>
209208
*
210-
* @param infoTextResourceId string resource ID of text that will be shown to the tester before
209+
* @param additionalFormText string resource ID of text that will be shown to the tester before
211210
* they submit feedback. If you’re a customer who would like to provide notice to your testers
212211
* about collection and processing of their feedback data, you can use this text to provide
213212
* such notice.
@@ -216,7 +215,7 @@ public interface FirebaseAppDistribution {
216215
* be changed except by the user.
217216
*/
218217
void showFeedbackNotification(
219-
@StringRes int infoTextResourceId, @NonNull InterruptionLevel interruptionLevel);
218+
@StringRes int additionalFormText, @NonNull InterruptionLevel interruptionLevel);
220219

221220
/**
222221
* Displays a notification that, when tapped, will take a screenshot of the current activity, then
@@ -237,22 +236,17 @@ void showFeedbackNotification(
237236
* <li>Starts a full screen activity for the tester to compose and submit the feedback
238237
* </ol>
239238
*
240-
* @param infoText text that will be shown to the tester before they submit feedback. If you’re a
241-
* customer who would like to provide notice to your testers about collection and processing
242-
* of their feedback data, you can use this text to provide such notice.
239+
* @param additionalFormText text that will be shown to the tester before they submit feedback. If
240+
* you’re a customer who would like to provide notice to your testers about collection and
241+
* processing of their feedback data, you can use this text to provide such notice.
243242
* @param interruptionLevel the level of interruption for the feedback notification. On platforms
244243
* below Android 8, this corresponds to a notification channel importance and once set cannot
245244
* be changed except by the user.
246245
*/
247246
void showFeedbackNotification(
248-
@NonNull CharSequence infoText, @NonNull InterruptionLevel interruptionLevel);
247+
@NonNull CharSequence additionalFormText, @NonNull InterruptionLevel interruptionLevel);
249248

250-
/**
251-
* Hides the notification shown with {@link #showFeedbackNotification}.
252-
*
253-
* <p>This should be called in the {@link Activity#onDestroy} of the activity that showed the
254-
* notification.
255-
*/
249+
/** Hides the notification shown with {@link #showFeedbackNotification}. */
256250
void cancelFeedbackNotification();
257251

258252
/** Gets the singleton {@link FirebaseAppDistribution} instance. */

firebase-appdistribution-api/src/main/java/com/google/firebase/appdistribution/internal/FirebaseAppDistributionProxy.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,35 +77,35 @@ public UpdateTask updateApp() {
7777
}
7878

7979
@Override
80-
public void startFeedback(@StringRes int infoTextResourceId) {
81-
delegate.startFeedback(infoTextResourceId);
80+
public void startFeedback(@StringRes int additionalFormText) {
81+
delegate.startFeedback(additionalFormText);
8282
}
8383

8484
@Override
85-
public void startFeedback(@NonNull CharSequence infoText) {
86-
delegate.startFeedback(infoText);
85+
public void startFeedback(@NonNull CharSequence additionalFormText) {
86+
delegate.startFeedback(additionalFormText);
8787
}
8888

8989
@Override
90-
public void startFeedback(@StringRes int infoTextResourceId, @Nullable Uri screenshotUri) {
91-
delegate.startFeedback(infoTextResourceId, screenshotUri);
90+
public void startFeedback(@StringRes int additionalFormText, @Nullable Uri screenshotUri) {
91+
delegate.startFeedback(additionalFormText, screenshotUri);
9292
}
9393

9494
@Override
95-
public void startFeedback(@NonNull CharSequence infoText, @Nullable Uri screenshotUri) {
96-
delegate.startFeedback(infoText, screenshotUri);
95+
public void startFeedback(@NonNull CharSequence additionalFormText, @Nullable Uri screenshotUri) {
96+
delegate.startFeedback(additionalFormText, screenshotUri);
9797
}
9898

9999
@Override
100100
public void showFeedbackNotification(
101-
@StringRes int infoTextResourceId, @NonNull InterruptionLevel interruptionLevel) {
102-
delegate.showFeedbackNotification(infoTextResourceId, interruptionLevel);
101+
@StringRes int additionalFormText, @NonNull InterruptionLevel interruptionLevel) {
102+
delegate.showFeedbackNotification(additionalFormText, interruptionLevel);
103103
}
104104

105105
@Override
106106
public void showFeedbackNotification(
107-
@NonNull CharSequence infoText, @NonNull InterruptionLevel interruptionLevel) {
108-
delegate.showFeedbackNotification(infoText, interruptionLevel);
107+
@NonNull CharSequence additionalFormText, @NonNull InterruptionLevel interruptionLevel) {
108+
delegate.showFeedbackNotification(additionalFormText, interruptionLevel);
109109
}
110110

111111
@Override

firebase-appdistribution-api/src/main/java/com/google/firebase/appdistribution/internal/FirebaseAppDistributionStub.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,25 @@ public UpdateTask updateApp() {
7878
}
7979

8080
@Override
81-
public void startFeedback(@StringRes int infoTextResourceId) {}
81+
public void startFeedback(@StringRes int additionalFormText) {}
8282

8383
@Override
84-
public void startFeedback(@NonNull CharSequence infoText) {}
84+
public void startFeedback(@NonNull CharSequence additionalFormText) {}
8585

8686
@Override
87-
public void startFeedback(@StringRes int infoTextResourceId, @Nullable Uri screenshotUri) {}
87+
public void startFeedback(@StringRes int additionalFormText, @Nullable Uri screenshotUri) {}
8888

8989
@Override
90-
public void startFeedback(@NonNull CharSequence infoText, @Nullable Uri screenshotUri) {}
90+
public void startFeedback(
91+
@NonNull CharSequence additionalFormText, @Nullable Uri screenshotUri) {}
9192

9293
@Override
9394
public void showFeedbackNotification(
94-
@StringRes int infoTextResourceId, @NonNull InterruptionLevel interruptionLevel) {}
95+
@StringRes int additionalFormText, @NonNull InterruptionLevel interruptionLevel) {}
9596

9697
@Override
9798
public void showFeedbackNotification(
98-
@NonNull CharSequence infoText, @NonNull InterruptionLevel interruptionLevel) {}
99+
@NonNull CharSequence additionalFormText, @NonNull InterruptionLevel interruptionLevel) {}
99100

100101
@Override
101102
public void cancelFeedbackNotification() {}

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FeedbackActivity.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public class FeedbackActivity extends AppCompatActivity {
4949

5050
public static final String RELEASE_NAME_KEY =
5151
"com.google.firebase.appdistribution.FeedbackActivity.RELEASE_NAME";
52-
public static final String INFO_TEXT_KEY =
53-
"com.google.firebase.appdistribution.FeedbackActivity.INFO_TEXT";
52+
public static final String ADDITIONAL_FORM_TEXT_KEY =
53+
"com.google.firebase.appdistribution.FeedbackActivity.ADDITIONAL_FORM_TEXT";
5454
public static final String SCREENSHOT_URI_KEY =
5555
"com.google.firebase.appdistribution.FeedbackActivity.SCREENSHOT_URI";
5656
public static final String FEEDBACK_TRIGGER_KEY =
@@ -64,7 +64,7 @@ public class FeedbackActivity extends AppCompatActivity {
6464
@Inject @UiThread Executor uiThreadExecutor;
6565

6666
@Nullable private String releaseName; // in development-mode the releaseName might be null
67-
private CharSequence infoText;
67+
private CharSequence additionalFormText;
6868
@Nullable private Uri screenshotUri;
6969
private FeedbackTrigger feedbackTrigger;
7070

@@ -77,7 +77,7 @@ protected void onCreate(Bundle savedInstanceState) {
7777

7878
if (savedInstanceState != null) {
7979
releaseName = savedInstanceState.getString(RELEASE_NAME_KEY);
80-
infoText = savedInstanceState.getCharSequence(INFO_TEXT_KEY);
80+
additionalFormText = savedInstanceState.getCharSequence(ADDITIONAL_FORM_TEXT_KEY);
8181
feedbackTrigger =
8282
FeedbackTrigger.fromString(savedInstanceState.getString(FEEDBACK_TRIGGER_KEY));
8383
String screenshotUriString = savedInstanceState.getString(SCREENSHOT_URI_KEY);
@@ -86,7 +86,7 @@ protected void onCreate(Bundle savedInstanceState) {
8686
}
8787
} else {
8888
releaseName = getIntent().getStringExtra(RELEASE_NAME_KEY);
89-
infoText = getIntent().getCharSequenceExtra(INFO_TEXT_KEY);
89+
additionalFormText = getIntent().getCharSequenceExtra(ADDITIONAL_FORM_TEXT_KEY);
9090
feedbackTrigger =
9191
FeedbackTrigger.fromString(getIntent().getStringExtra(FEEDBACK_TRIGGER_KEY));
9292
if (getIntent().hasExtra(SCREENSHOT_URI_KEY)) {
@@ -100,7 +100,7 @@ protected void onCreate(Bundle savedInstanceState) {
100100
@Override
101101
protected void onSaveInstanceState(@NonNull Bundle outState) {
102102
outState.putString(RELEASE_NAME_KEY, releaseName);
103-
outState.putCharSequence(INFO_TEXT_KEY, infoText);
103+
outState.putCharSequence(ADDITIONAL_FORM_TEXT_KEY, additionalFormText);
104104
outState.putString(SCREENSHOT_URI_KEY, screenshotUri.toString());
105105
outState.putString(FEEDBACK_TRIGGER_KEY, feedbackTrigger.toString());
106106
super.onSaveInstanceState(outState);
@@ -110,9 +110,9 @@ private void setupView() {
110110
setTheme(R.style.FeedbackTheme);
111111
setContentView(R.layout.activity_feedback);
112112

113-
TextView infoTextView = this.findViewById(R.id.infoText);
114-
infoTextView.setText(infoText);
115-
infoTextView.setMovementMethod(LinkMovementMethod.getInstance());
113+
TextView additionalFormTextView = this.findViewById(R.id.additionalFormText);
114+
additionalFormTextView.setText(additionalFormText);
115+
additionalFormTextView.setMovementMethod(LinkMovementMethod.getInstance());
116116

117117
findViewById(R.id.backButton).setOnClickListener(v -> finish());
118118
findViewById(R.id.sendButton).setOnClickListener(this::submitFeedback);
@@ -146,7 +146,6 @@ private void setupScreenshot() {
146146
v -> imageView.setVisibility(checkBox.isChecked() ? VISIBLE : GONE));
147147
});
148148
} else {
149-
LogWrapper.e(TAG, "No screenshot available");
150149
runOnUiThread(
151150
() -> {
152151
CheckBox checkBox = findViewById(R.id.screenshotCheckBox);
@@ -186,7 +185,7 @@ private Bitmap readScreenshot(@Nullable Uri uri) {
186185
return null;
187186
}
188187
if (bitmap == null) {
189-
LogWrapper.e(TAG, "Could not decode screenshot image: " + uri);
188+
LogWrapper.e(TAG, "Could not decode screenshot image from URI: " + uri);
190189
}
191190
return bitmap;
192191
}

0 commit comments

Comments
 (0)