LOCAL_PRIVILEGED_MODULE := true
#LOCAL_CERTIFICATE := shared
+LOCAL_REQUIRED_MODULES := AnalyticsService HardwareCollector
LOCAL_OVERRIDES_PACKAGES := Home Launcher2
include $(BUILD_PACKAGE)
<FrameLayout
android:id="@+id/cling_content"
- android:layout_width="360dp"
+ android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/cling_bg" />
android:fontFamily="sans-serif-medium"
android:paddingLeft="36dp"
android:paddingRight="36dp"
- android:text="@string/workspace_cling_longpress_title"
+ android:text="@string/android_x86_intro"
android:textColor="#E1000000"
- android:textSize="20sp" />
+ android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="36dp"
android:paddingRight="36dp"
- android:text="@string/workspace_cling_longpress_description"
+ android:text="@string/android_x86_analytics"
+ android:textColor="#99000000"
+ android:textSize="16sp" />
+
+ <CheckBox
+ android:id="@+id/collect_hw_info"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="6dp"
+ android:layout_marginLeft="32dp"
+ android:paddingLeft="4dp"
+ android:text="@string/hw_info"
+ android:textColor="#99000000"
+ android:textSize="16sp" />
+
+ <CheckBox
+ android:id="@+id/collect_apps_usage"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="32dp"
+ android:paddingLeft="4dp"
+ android:text="@string/apps_usage"
android:textColor="#99000000"
android:textSize="16sp" />
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginRight="12dp"
- android:layout_marginTop="27dp"
+ android:layout_marginTop="6dp"
android:fontFamily="sans-serif-medium"
android:paddingLeft="24dp"
android:paddingRight="24dp"
<string name="migration_cling_description" msgid="2752413805582227644">"要导入旧的主屏幕中的图标和文件夹吗?"</string>
<string name="migration_cling_copy_apps" msgid="946331230090919440">"复制图标"</string>
<string name="migration_cling_use_default" msgid="2626475813981258626">"使用全新配置"</string>
- <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"壁纸、小部件和设置"</string>
- <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"触摸并按住背景,即可进行个性化设置"</string>
+ <string name="android_x86_intro" msgid="9173998993909018310">"Android-x86 是一个由志愿者维护的开源项目。我们想要收集一些匿名信息以改善项目。"</string>
+ <string name="android_x86_analytics" msgid="4119994475505235248">"我同意提供以下匿名信息:"</string>
+ <string name="hw_info">"硬件信息"</string>
+ <string name="apps_usage">"應用信息"</string>
<string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"知道了"</string>
<string name="folder_opened" msgid="94695026776264709">"文件夹已打开,大小为<xliff:g id="WIDTH">%1$d</xliff:g>×<xliff:g id="HEIGHT">%2$d</xliff:g>"</string>
<string name="folder_tap_to_close" msgid="1884479294466410023">"触摸可关闭文件夹"</string>
<string name="migration_cling_description" msgid="2752413805582227644">"要從舊主畫面匯入圖示和資料夾嗎?"</string>
<string name="migration_cling_copy_apps" msgid="946331230090919440">"複製圖示"</string>
<string name="migration_cling_use_default" msgid="2626475813981258626">"重新開始"</string>
- <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"桌布、小工具和設定"</string>
- <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"輕觸並按住背景即可自訂"</string>
+ <string name="android_x86_intro" msgid="9173998993909018310">"Android-x86 是一個由志願者所維護的開放原始碼計劃。我們希望收集一些匿名資料以改善計劃。"</string>
+ <string name="android_x86_analytics" msgid="4119994475505235248">"我同意提供以下匿名資訊:"</string>
+ <string name="hw_info">"硬體資訊"</string>
+ <string name="apps_usage">"應用程式資訊"</string>
<string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"知道了"</string>
<string name="folder_opened" msgid="94695026776264709">"資料夾已開啟 (<xliff:g id="WIDTH">%1$d</xliff:g> x <xliff:g id="HEIGHT">%2$d</xliff:g>)"</string>
<string name="folder_tap_to_close" msgid="1884479294466410023">"輕觸即可關閉資料夾"</string>
<string name="migration_cling_description" msgid="2752413805582227644">"要從舊的主螢幕匯入圖示和資料夾嗎?"</string>
<string name="migration_cling_copy_apps" msgid="946331230090919440">"複製圖示"</string>
<string name="migration_cling_use_default" msgid="2626475813981258626">"重新開始"</string>
- <string name="workspace_cling_longpress_title" msgid="9173998993909018310">"桌布、小工具和設定"</string>
- <string name="workspace_cling_longpress_description" msgid="4119994475505235248">"輕觸並按住背景即可自訂"</string>
+ <string name="android_x86_intro" msgid="9173998993909018310">"Android-x86 是一個由志願者所維護的開放原始碼計劃。我們希望收集一些匿名資料以改善計劃。"</string>
+ <string name="android_x86_analytics" msgid="4119994475505235248">"我同意提供以下匿名資訊:"</string>
+ <string name="hw_info">"硬體資訊"</string>
+ <string name="apps_usage">"應用程式資訊"</string>
<string name="workspace_cling_longpress_dismiss" msgid="368660286867640874">"知道了"</string>
<string name="folder_opened" msgid="94695026776264709">"資料夾已開啟 (<xliff:g id="WIDTH">%1$d</xliff:g> x <xliff:g id="HEIGHT">%2$d</xliff:g>)"</string>
<string name="folder_tap_to_close" msgid="1884479294466410023">"輕觸即可關閉資料夾"</string>
<string name="migration_cling_copy_apps">COPY ICONS</string>
<!-- The description of the button to use the default launcher layout [CHAR_LIMIT=30] -->
<string name="migration_cling_use_default">START FRESH</string>
- <!-- The title text for workspace longpress action [CHAR_LIMIT=40] -->
- <string name="workspace_cling_longpress_title">Wallpapers, widgets, & settings</string>
- <!-- The description of how to use the workspace [CHAR_LIMIT=70] -->
- <string name="workspace_cling_longpress_description">Touch & hold background to customize</string>
+ <!-- The Android-x86 project introduction [CHAR_LIMIT=140] -->
+ <string name="android_x86_intro">Android-x86 is an open source project maintained by volunteers. To improve the project, we\'d like to collect some anonymous data from you.</string>
+ <!-- The description of anonymous data collection [CHAR_LIMIT=70] -->
+ <string name="android_x86_analytics">I agree to send the anonymous data:</string>
+ <!-- The description of the checkbox to agree [CHAR_LIMIT=30] -->
+ <string name="hw_info">Hardware information</string>
+ <string name="apps_usage">Apps usage</string>
<!-- The description of the button to dismiss the cling [CHAR_LIMIT=30] -->
<string name="workspace_cling_longpress_dismiss">GOT IT</string>
import android.view.ViewGroup;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.accessibility.AccessibilityManager;
+import android.widget.CheckBox;
+import java.lang.reflect.Method;
import com.android.launcher3.util.Thunk;
// New Secure Setting in L
private static final String SKIP_FIRST_USE_HINTS = "skip_first_use_hints";
+ private static final String PROPERTY_HW_STATISTICS = "persist.sys.hw_statistics";
+ private static final String PROPERTY_APPS_STATISTICS = "persist.sys.apps_statistics";
+ private CheckBox mCollectHwInfo;
+ private CheckBox mCollectAppsUsage;
+
@Thunk Launcher mLauncher;
private LayoutInflater mInflater;
@Thunk boolean mIsVisible;
mInflater.inflate(showWelcome ? R.layout.longpress_cling_welcome_content
: R.layout.longpress_cling_content, content);
content.findViewById(R.id.cling_dismiss_longpress_info).setOnClickListener(this);
+ mCollectHwInfo = (CheckBox) content.findViewById(R.id.collect_hw_info);
+ mCollectAppsUsage = (CheckBox) content.findViewById(R.id.collect_apps_usage);
+ mCollectHwInfo.setChecked(true);
+ mCollectAppsUsage.setChecked(true);
if (TAG_CROP_TOP_AND_SIDES.equals(content.getTag())) {
Drawable bg = new BorderCropDrawable(mLauncher.getResources().getDrawable(R.drawable.cling_bg),
} else {
cling.animate().alpha(0).setDuration(duration).withEndAction(cleanUpClingCb);
}
+ try {
+ Class<?> c = Class.forName("android.os.SystemProperties");
+ Method m = c.getMethod("set", String.class, String.class);
+ m.invoke(null, PROPERTY_HW_STATISTICS, Boolean.toString(mCollectHwInfo.isChecked()));
+ m.invoke(null, PROPERTY_APPS_STATISTICS, Boolean.toString(mCollectAppsUsage.isChecked()));
+ } catch (Exception e) {
+ }
}
}
}
public boolean shouldShowFirstRunOrMigrationClings() {
+ try {
+ Class<?> c = Class.forName("android.os.SystemProperties");
+ Method m = c.getMethod("get", String.class, String.class);
+ if (((String)m.invoke(null, PROPERTY_HW_STATISTICS, "")).isEmpty()) {
+ return true;
+ }
+ } catch (Exception e) {
+ }
SharedPreferences sharedPrefs = mLauncher.getSharedPrefs();
return areClingsEnabled() &&
!sharedPrefs.getBoolean(WORKSPACE_CLING_DISMISSED_KEY, false) &&