过CTA认证时,实验室报日历读取联系人无提示。修改:
+++ b//vendor/mediatek/proprietary/packages/apps/Calendar/res/values-zh-rCN/strings.xml
@@ -280,4 +280,10 @@
“每天”
“每周(每周的<xliff:g id=“DAYS_OF_WEEK”>%s</xliff:g>)”
“每月(每月的<xliff:g id=“ORDINAL_NUMBER”>%1
s
<
/
x
l
i
f
f
:
g
>
<
x
l
i
f
f
:
g
i
d
=
"
D
A
Y
O
F
W
E
E
K
"
>
s</xliff:g><xliff:g id="DAY_OF_WEEK">%2
s</xliff:g><xliff:gid="DAYOFWEEK">s</xliff:g>)”
- “安全提醒”
- “日历会尝试取得您的联系人信息以供功能正常运行”
- “允许”
- “拒绝”
- “日历被拒绝取用联系人资讯”
+++ b//vendor/mediatek/proprietary/packages/apps/Calendar/res/values/strings.xml
@@ -762,4 +762,10 @@
<!-- Do Not Translate. Sender identity for global notification synchronization. -->
<string name="notification_sender_id" translatable="false"></string>
- Security warning
- Calendar is trying to access your contacts.
- Allow
- Deny
- Calendar is denied to access contacts.
+++ b/vendor/mediatek/proprietary/packages/apps/Calendar/src/com/android/calendar/AllInOneActivity.java
@@ -100,6 +100,10 @@ import static android.provider.CalendarContract.EXTRA_EVENT_ALL_DAY;
import static android.provider.CalendarContract.EXTRA_EVENT_BEGIN_TIME;
import static android.provider.CalendarContract.EXTRA_EVENT_END_TIME;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface;
+
public class AllInOneActivity extends AbstractCalendarActivity implements EventHandler,
OnSharedPreferenceChangeListener, SearchView.OnQueryTextListener, ActionBar.TabListener,
ActionBar.OnNavigationListener, OnSuggestionListener {
@@ -634,6 +638,8 @@ public class AllInOneActivity extends AbstractCalendarActivity implements EventH
“AllInOneActivity.onCreate.restoreState”);
mBundleIcicleOncreate = icicle;
-
buildAndShowConfirmDialog(); if (!checkAndRequestPermission(CALENDAR_ONCREATE_PERMISSIONS_REQUEST_CODE)) {
@@ -646,6 +652,52 @@ public class AllInOneActivity extends AbstractCalendarActivity implements EventH
continueonCreateCalendar();
}
- ///add 日历读取联系人信息gu 20190619{{{&&&
- private final String CALENDAR_CONFIRM_PREF_NAME = “ConfirmPrefFile”;
- private final String CONFIRM_VALUE_KEY = “mtk_calendar_confirmed”;
- private void setConfirmed() {
-
SharedPreferences settings = getSharedPreferences(CALENDAR_CONFIRM_PREF_NAME, 0);
-
SharedPreferences.Editor editor = settings.edit();
-
editor.putBoolean(CONFIRM_VALUE_KEY, true);
-
editor.commit();
- }
- private boolean getConfirmed() {
-
SharedPreferences settings = getSharedPreferences(CALENDAR_CONFIRM_PREF_NAME, 0);
-
return settings.getBoolean(CONFIRM_VALUE_KEY, false);
- }
- private void buildAndShowConfirmDialog() {
-
if (!getConfirmed()) {
-
Log.d(TAG, "buildAndShowConfirmDialog()");
-
Dialog dialog = new AlertDialog.Builder(this)
-
//.setTitle(R.string.confirm_dialog_title)
-
.setMessage(R.string.confirm_dialog_msg)
-
.setPositiveButton(R.string.confirm_dialog_allow_button,
-
new DialogInterface.OnClickListener() {
-
public void onClick(DialogInterface dialog, int whichButton) {
-
setConfirmed();
-
}
-
})
-
.setNegativeButton(R.string.confirm_dialog_deny_button,
-
new DialogInterface.OnClickListener() {
-
public void onClick(DialogInterface dialog, int whichButton) {
-
Toast toast = Toast.makeText(getApplicationContext(), R.string.deny_toast_msg,
-
Toast.LENGTH_LONG);
-
toast.show();
-
finish();
-
}
-
})
-
.create();
-
dialog.setCanceledOnTouchOutside(false);
-
dialog.setCancelable(false);
-
dialog.show();
-
}
-
}
-
///&&&}}}