1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.tradefed.clearcut;
17 
18 import com.android.asuite.clearcut.Common.UserType;
19 
20 /** Utility to create the notice message. */
21 public class NoticeMessageUtil {
22 
23     private static final String INTERNAL_AGREEMENT = "https://cla.developers.google.com/";
24     private static final String EXTERNAL_AGREEMENT = "https://opensource.google.com/docs/cla/";
25     private static final String ANONYMOUS = "anonymous ";
26 
27     private static final String NOTICE_MESSAGE =
28             "==================\nNotice:\n"
29                     + "We collect %susage statistics in accordance with our Content Licenses "
30                     + "(https://source.android.com/setup/start/licenses), Contributor License "
31                     + "Agreement (%s), Privacy Policy "
32                     + "(https://policies.google.com/privacy) and Terms of Service "
33                     + "(https://policies.google.com/terms)."
34                     + "\n==================";
35 
NoticeMessageUtil()36     private NoticeMessageUtil() {}
37 
38     /** Returns the notice message based on the user type (internal vs external). */
getNoticeMessage(UserType type)39     public static String getNoticeMessage(UserType type) {
40         if (UserType.EXTERNAL.equals(type)) {
41             return String.format(NOTICE_MESSAGE, ANONYMOUS, EXTERNAL_AGREEMENT);
42         } else {
43             return String.format(NOTICE_MESSAGE, "", INTERNAL_AGREEMENT);
44         }
45     }
46 }
47