一:圖庫中的照片全屏顯
(packages/apps/Gallery2/)
第一種:
- diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
- index 0592bf4..e2667d3 100755
- --- a/src/com/android/gallery3d/app/PhotoPage.java
- +++ b/src/com/android/gallery3d/app/PhotoPage.java
- @@ -39,6 +39,9 @@ import android.content.pm.ResolveInfo;
- import android.content.res.Configuration;
- import android.graphics.Rect;
- import android.net.Uri;
- +import android.view.WindowManager;
- +import android.view.Window;
- +import android.graphics.Color;
- import android.nfc.NfcAdapter;
- import android.nfc.NfcAdapter.CreateBeamUrisCallback;
- import android.nfc.NfcEvent;
- @@ -1237,6 +1240,9 @@ public abstract class PhotoPage extends ActivityState implements
- if (mShowBars) return;
- mShowBars = true;
- mOrientationManager.unlockOrientation();
- + Window win = mActivity.getWindow();
- + win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- + win.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
- mActionBar.show();
- mActivity.getGLRoot().setLightsOutMode(false);
- /// M: [FEATURE.MODIFY] automatic layer visibility change @{
- @@ -1260,7 +1266,21 @@ public abstract class PhotoPage extends ActivityState implements
- if (!mShowBars) return;
- mShowBars = false;
- mActionBar.hide();
- - mActivity.getGLRoot().setLightsOutMode(true);
- + Window win = mActivity.getWindow();
- + win.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
- + int flags = (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- +
- + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
- +
- + | View.SYSTEM_UI_FLAG_FULLSCREEN
- +
- + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
- +
- + | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
- +
- + win.getDecorView().setSystemUiVisibility(flags);
- + win.setNavigationBarColor(Color.TRANSPARENT);
- + //mActivity.getGLRoot().setLightsOutMode(true);
- mHandler.removeMessages(MSG_HIDE_BARS);
- refreshBottomControlsWhenReady();
- }
- @@ -2168,6 +2188,9 @@ public abstract class PhotoPage extends ActivityState implements
- mSensorManager.registerListener(this, proxmitySensor, SensorManager.SENSOR_DELAY_NORMAL);
- }
- // End of Vanzo:hanshengpeng
- + Window win = mActivity.getWindow();
- + win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- + win.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
- if (mMuteVideo != null) {
- mMuteVideo.setMuteHasPaused(false);
- mMuteVideo.needPlayMuteVideo();
- @@ -2252,6 +2275,9 @@ public abstract class PhotoPage extends ActivityState implements
- mScreenNailSet = null;
- mScreenNailItem = null;
- }
- + Window win = mActivity.getWindow();
- + win.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- + win.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
- mActivity.getGLRoot().setOrientationSource(null);
- if (mBottomControls != null) mBottomControls.cleanup();
-
第二種:
- diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
- index 0df2170..9b522cd 100755
- --- a/src/com/android/gallery3d/app/PhotoPage.java
- +++ b/src/com/android/gallery3d/app/PhotoPage.java
- @@ -116,6 +116,9 @@ import com.mediatek.galleryframework.base.BottomControlLayer;
- import com.mediatek.galleryframework.base.PhotoPageBottomViewControls;
- import com.mediatek.galleryframework.base.LayerManager;
- import com.mediatek.galleryframework.base.MediaData;
- +import android.view.WindowManager;
- +import android.view.Window;
- +import android.graphics.Color;
- /* Vanzo:hanshengpeng on: Sun, 24 Jan 2016 14:44:43 +0800
- */
- import android.os.SystemProperties;
- @@ -1183,6 +1186,8 @@ public abstract class PhotoPage extends ActivityState implements
- if (mShowBars) return;
- mShowBars = true;
- mOrientationManager.unlockOrientation();
- + Window win = mActivity.getWindow();
- + win.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- mActionBar.show();
- mActivity.getGLRoot().setLightsOutMode(false);
- /// M: [FEATURE.MODIFY] automatic layer visibility change @{
- @@ -1206,6 +1211,9 @@ public abstract class PhotoPage extends ActivityState implements
- if (!mShowBars) return;
- mShowBars = false;
- mActionBar.hide();
- + Window win = mActivity.getWindow();
- + win.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- + win.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
- mActivity.getGLRoot().setLightsOutMode(true);
- mHandler.removeMessages(MSG_HIDE_BARS);
- refreshBottomControlsWhenReady();
- @@ -2165,6 +2173,7 @@ public abstract class PhotoPage extends ActivityState implements
- mScreenNailSet = null;
- mScreenNailItem = null;
- }
- +
- mActivity.getGLRoot().setOrientationSource(null);
- if (mBottomControls != null) mBottomControls.cleanup();
-
二:默認壁紙不自動生成到壁紙列表中
(packages/apps/Launcher3/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java)
- diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
- index e299302..5ac7b2b 100755
- --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
- +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
- @@ -1059,11 +1059,15 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
-
- if (partner == null || !partner.hideDefaultWallpaper()) {
- // Add an entry for the default wallpaper (stored in system resources)
- +/*
- + * TODO: replace this line with your comment
- WallpaperTileInfo defaultWallpaperInfo = Utilities.ATLEAST_KITKAT
- ? getDefaultWallpaper() : getPreKKDefaultWallpaperInfo();
- if (defaultWallpaperInfo != null) {
- bundled.add(0, defaultWallpaperInfo);
- }
- + */
- +// End of Vanzo:yujianpeng
- }
- return bundled;
- }
三:wifi默認關閉
(packages/apps/Launcher3/)
- diff --git a/AndroidManifest.xml b/AndroidManifest.xml
- index df22272..8929289 100755
- --- a/AndroidManifest.xml
- +++ b/AndroidManifest.xml
- @@ -70,6 +70,8 @@
- <uses-permission android:name="com.android.launcher3.permission.RECEIVE_FIRST_LOAD_BROADCAST" />
- <!-- M: hide apps activity requires this permission to get package size. -->
- <uses-permission android:name="android.permission.GET_PACKAGE_SIZE"/>
- + <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
- + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
- <!-- M: ALSP02141215, android security patch. -->
- <uses-permission android:name="android.permission.GET_TASKS" />
- <!-- M: ALSP02241595, add MANAGE_USERS permission. -->
- diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
- index 9366659..7c30d9d 100644
- --- a/src/com/android/launcher3/Launcher.java
- +++ b/src/com/android/launcher3/Launcher.java
- @@ -146,6 +146,9 @@ import android.hardware.SensorEvent;
- import android.hardware.SensorEventListener;
- import android.hardware.SensorManager;
- import com.android.featureoption.FeatureOption;
- +import android.net.NetworkInfo;
- +import android.net.wifi.WifiManager;
- +import android.net.ConnectivityManager;
- // End of Vanzo:hanshengpeng
-
- /**
- @@ -5163,6 +5166,18 @@ public class Launcher extends Activity
- editor.apply();
- }
-
- + private void closeWifiGps() {
- + // Intent sh = new Intent("com.android.settings.location.CLOSE");
- + //sendBroadcast(sh);
- + final WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
- + ConnectivityManager con = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
- + NetworkInfo netWork = con.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
- + if (wifiManager == null || netWork.isConnected()) {
- + return;
- + }
- + wifiManager.setWifiEnabled(false);
- + }
- +
- @Thunk void showFirstRunClings() {
- // The two first run cling paths are mutually exclusive, if the launcher is preinstalled
- // on the device, then we always show the first run cling experience (or if there is no
- @@ -5175,6 +5190,7 @@ public class Launcher extends Activity
- } else {
- launcherClings.showLongPressCling(true);
- }
- + closeWifiGps();
- }
- }
-
四:手機插入SD卡時,默認存儲器爲SD卡
(packages/apps/Settings/)
- diff --git a/AndroidManifest.xml b/AndroidManifest.xml
- index c8b252a..bed2c41 100644
- --- a/AndroidManifest.xml
- +++ b/AndroidManifest.xml
- @@ -3173,6 +3173,12 @@ add fp control
- </intent-filter>
- </receiver>
- <!-- End of Vanzo:fenghaitao -->
- -
- + <receiver android:name=".UsbBroadCastReceiver">
- + <intent-filter android:priority="1000">
- + <action android:name="android.intent.action.MEDIA_MOUNTED"/>
- + <action android:name="android.intent.action.MEDIA_EJECT" />
- + <data android:scheme="file"/>
- + </intent-filter>
- + </receiver>
- </application>
- </manifest>
- diff --git a/src/com/android/settings/UsbBroadCastReceiver.java b/src/com/android/settings/UsbBroadCastReceiver.java
- new file mode 100644
- index 0000000..b578167
- --- /dev/null
- +++ b/src/com/android/settings/UsbBroadCastReceiver.java
- @@ -0,0 +1,26 @@
- +package com.android.settings;
- +
- +import android.content.BroadcastReceiver;
- +import android.content.Context;
- +import android.content.Intent;
- +import android.provider.Settings;
- +import android.util.Log;
- +import android.os.storage.IMountService;
- +import com.mediatek.storage.StorageManagerEx;
- +
- +public class UsbBroadCastReceiver extends BroadcastReceiver {
- + String TAG = "UsbBroadCastReceiver";
- + String ExternalStoragePath = StorageManagerEx.getExternalStoragePath();
- +
- +
- + public void onReceive(Context context, Intent intent) {
- +
- + Log.i(TAG,"receive change request");
- + if (Intent.ACTION_MEDIA_MOUNTED.equals(intent.getAction())) {
- + StorageManagerEx.setDefaultPath(ExternalStoragePath);
- + }
- + }
- +
- +}
五:GPS默認節電模式
(packages/apps/Settings/src/com/android/settings/location/LocationSettings.java)
- diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java
- index 3b71e79..3324c4d 100644
- --- a/src/com/android/settings/location/LocationSettings.java
- +++ b/src/com/android/settings/location/LocationSettings.java
- @@ -385,7 +385,7 @@ public class LocationSettings extends LocationSettingsBase
- @Override
- public void onSwitchChanged(Switch switchView, boolean isChecked) {
- if (isChecked) {
- - setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_HIGH_ACCURACY);
- + setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_BATTERY_SAVING);
- } else {
- setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_OFF);
- }
六:更改在線壁紙名稱
(packages/apps/Settings/src/com/android/settings/WallpaperTypeSettings.java)
- diff --git a/src/com/android/settings/WallpaperTypeSettings.java b/src/com/android/settings/WallpaperTypeSettings.java
- index 9046bfb..138167c 100644
- --- a/src/com/android/settings/WallpaperTypeSettings.java
- +++ b/src/com/android/settings/WallpaperTypeSettings.java
- @@ -31,6 +31,8 @@ import com.android.settings.search.SearchIndexableRaw;
-
- import java.util.ArrayList;
- import java.util.List;
- +import java.util.Locale;
-
- public class WallpaperTypeSettings extends SettingsPreferenceFragment implements Indexable {
-
- @@ -70,7 +72,14 @@ public class WallpaperTypeSettings extends SettingsPreferenceFragment implements
- pref.setIntent(prefIntent);
- CharSequence label = info.loadLabel(pm);
- if (label == null) label = info.activityInfo.packageName;
- - pref.setTitle(label);
- + String locale = Locale.getDefault().getLanguage();
- + if("es".equals(locale )&&label.equals("Online Wallpaper")){
- + pref.setTitle("Fondo de pantalla en línea");
- + }else{
- + pref.setTitle(label);
- + }
- parent.addPreference(pref);
- }
- }
七:相機默認防閃做到60
(vendor/mediatek/proprietary/packages/apps/Camera/res/values/arrays.xml)
- diff --git a/mediatek/proprietary/packages/apps/Camera/res/values/arrays.xml b/mediatek/proprietary/packages/apps/Camera/res/values/arrays.xml
- index 607f6a0..a01f714 100755
- --- a/mediatek/proprietary/packages/apps/Camera/res/values/arrays.xml
- +++ b/mediatek/proprietary/packages/apps/Camera/res/values/arrays.xml
- @@ -684,6 +684,7 @@ add 16M 16_9
- </string-array>
- <!-- Default antibanding setting.-->
- <string-array name="pref_camera_antibanding_default_array" translatable="false">
- + <item>60hz</item>
- <item>auto</item>
- <item>off</item>
- <item>50hz</item>
八:文件管理改變可用空間到4.16G和總容量8G
(vendor/mediatek/proprietary/packages/apps/FileManager/src/com/mediatek/filemanager/FileInfoAdapter.java)
- diff --git a/mediatek/proprietary/packages/apps/FileManager/src/com/mediatek/filemanager/FileInfoAdapter.java b/mediatek/proprietary/packages/apps/FileManager/src/com/mediatek/filemanager/FileInfoAdapter.java
- index 47b8813..ccceac6 100644
- --- a/mediatek/proprietary/packages/apps/FileManager/src/com/mediatek/filemanager/FileInfoAdapter.java
- +++ b/mediatek/proprietary/packages/apps/FileManager/src/com/mediatek/filemanager/FileInfoAdapter.java
- @@ -47,7 +47,7 @@ import android.view.ViewGroup;
- import android.widget.BaseAdapter;
- import android.widget.ImageView;
- import android.widget.TextView;
- import com.mediatek.filemanager.service.FileManagerService;
- import com.mediatek.filemanager.utils.FileUtils;
- import com.mediatek.filemanager.utils.LogUtils;
- @@ -319,8 +319,10 @@ public class FileInfoAdapter extends BaseAdapter {
- if (fileInfo.isDirectory()) {
- if (MountPointManager.getInstance().isMountPoint(fileInfo.getFileAbsolutePath())) {
- StringBuilder sb = new StringBuilder();
- - String freeSpaceString = FileUtils.sizeToString(MountPointManager.getInstance().getMountPointFreeSpace(fileInfo.getFileAbsolutePath()));
- - String totalSpaces = FileUtils.sizeToString(MountPointManager.getInstance().getMountPointTotalSpace(fileInfo.getFileAbsolutePath()));
- + //String freeSpaceString = FileUtils.sizeToString(MountPointManager.getInstance().getMountPointFreeSpace(fileInfo.getFileAbsolutePath()));
- + String freeSpaceString = "4.16 GB";
- + //String totalSpaces = FileUtils.sizeToString(MountPointManager.getInstance().getMountPointTotalSpace(fileInfo.getFileAbsolutePath()));
- + String totalSpaces = "8.00 GB";
- LogUtils.d(TAG, "setSizeText, file name = " + fileInfo.getFileName()
- + ",file path = " + fileInfo.getFileAbsolutePath());
- LogUtils.d(TAG, "setSizeText, freeSpace = " + MountPointManager.getInstance().getMountPointFreeSpace(fileInfo.getFileAbsolutePath()) + ",totalSpace = "
九:添加內存信息
(vendor/mediatek/proprietary/packages/apps/EngineerMode/src/com/mediatek/engineermode/DeviceInfoSettings.java)
- diff --git a/mediatek/proprietary/packages/apps/EngineerMode/src/com/mediatek/engineermode/DeviceInfoSettings.java b/mediatek/proprietary/packages/apps/EngineerMode/src/com/mediatek/engineermode/DeviceInfoSettings.java
- index 4a1252a..ffdfd0d 100755
- --- a/mediatek/proprietary/packages/apps/EngineerMode/src/com/mediatek/engineermode/DeviceInfoSettings.java
- +++ b/mediatek/proprietary/packages/apps/EngineerMode/src/com/mediatek/engineermode/DeviceInfoSettings.java
- @@ -69,6 +69,8 @@ public class DeviceInfoSettings extends Activity {
- addRow(name,value);
- line = reader.readLine();
- }
- + addRow("RAM:","KINGSTON 1GB");
- + addRow("ROM:","KINGSTON 8GB");
- }
-
- reader.close();
十:默認瀏覽器--------本地瀏覽器設爲默認瀏覽,打開鏈接(消費提示音等)不會彈出選擇瀏覽器提示框,默認搜索引擎----Google
(frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java)
- diff --git a/base/services/core/java/com/android/server/pm/PackageManagerService.java b/base/services/core/java/com/android/server/pm/PackageManagerService.java
- index bf86b54..f640a8b 100644
- --- a/base/services/core/java/com/android/server/pm/PackageManagerService.java
- +++ b/base/services/core/java/com/android/server/pm/PackageManagerService.java
- @@ -2632,11 +2632,55 @@ public class PackageManagerService extends IPackageManager.Stub {
- // are all flushed. Not really needed, but keeps things nice and
- // tidy.
- Runtime.getRuntime().gc();
- -
- + setDefaultBrowser();
- // Expose private service for system components to use.
- LocalServices.addService(PackageManagerInternal.class, new PackageManagerInternalImpl());
- }
-
- + private final void setDefaultBrowser(){
- + Log.d("debug_default","setDefaultBrowser is called.");
- + if(!isFirstBoot()) {
- + Log.d("debug_default","not first boot, return");
- + return;
- + }
- + String str1 = "android.intent.category.DEFAULT";
- + String str2 = "android.intent.category.BROWSABLE";
- + String str3 = "android.intent.action.VIEW";
- + //intent filter
- + IntentFilter filter = new IntentFilter(str3);
- + filter.addCategory(str1);
- + filter.addCategory(str2);
- + filter.addDataScheme("http");
- + //intent
- + Intent intent = new Intent(str3);
- + intent.addCategory(str2);
- + intent.addCategory(str1);
- + Uri uri = Uri.parse("http://");
- + intent.setDataAndType(uri, null);
- + ComponentName component = new ComponentName("com.android.browser","com.android.browser.BrowserActivity");
- + List<ResolveInfo> resolveInfoList = queryIntentActivities(intent,intent.getType(),PackageManager.GET_INTENT_FILTERS, 0);
- + int size = resolveInfoList.size();
- + ComponentName[] arrayOfComponentName = new ComponentName[size];
- + boolean no_UC = true;
- + for (int i = 0; i < size; i++)
- + {
- + ActivityInfo activityInfo = resolveInfoList.get(i).activityInfo;
- + String packageName = activityInfo.packageName;
- + String className = activityInfo.name;
- + if (packageName.equals("com.android.browser")) no_UC = false;
- + ComponentName componentName = new ComponentName(packageName, className);
- + arrayOfComponentName[i] = componentName;
- + }
- + if (no_UC){
- + Log.d("debug_default","no uc package");
- + return;
- + }else{
- + Log.d("debug_default","uc package is in, set it as Preferred.");
- + }
- + addPreferredActivity2(filter,IntentFilter.MATCH_CATEGORY_SCHEME, arrayOfComponentName,component);
- + Log.d("debug_default","add UC to PreferredActivity");
- + }
- +
- @Override
- public boolean isFirstBoot() {
- return !mRestoredSettings;
- @@ -15747,7 +15791,7 @@ public class PackageManagerService extends IPackageManager.Stub {
- synchronized (mPackages) {
- filter.dump(new LogPrinter(Log.INFO, TAG), " ");
- mSettings.editPreferredActivitiesLPw(0).addFilter(new PreferredActivity(filter, match, set, activity, true));
- - scheduleWriteSettingsLocked();
- + mSettings.writePackageRestrictionsLPr(0);
- }
- }
- // End of
十一:瀏覽器正下載時,點擊取消或者中止下載,需要彈出警告:Are you sure to delete it?/¿estás seguro para eliminarlo?
(frameworks/)
- diff --git a/base/packages/DocumentsUI/res/values-en-rUS/strings.xml b/base/packages/DocumentsUI/res/values-en-rUS/strings.xml
- index 1170162..e4c52af 100755
- --- a/base/packages/DocumentsUI/res/values-en-rUS/strings.xml
- +++ b/base/packages/DocumentsUI/res/values-en-rUS/strings.xml
- @@ -103,4 +103,8 @@
- <string name="menu_advanced_hide" product="default">Hide SD card</string>
- <string name="menu_file_size_show">Show file size</string>
- <string name="menu_file_size_hide">Hide file size</string>
- -</resources>
- \ No newline at end of file
- + <string name="custom_tips">"Tips"</string>
- + <string name="message">"Are you sure to delete it?"</string>
- + <string name="confirm">"yes"</string>
- + <string name="cancel">"no"</string>
- +</resources>
- diff --git a/base/packages/DocumentsUI/res/values-es-rUS/strings.xml b/base/packages/DocumentsUI/res/values-es-rUS/strings.xml
- index 12a62ea..932d5bb 100644
- --- a/base/packages/DocumentsUI/res/values-es-rUS/strings.xml
- +++ b/base/packages/DocumentsUI/res/values-es-rUS/strings.xml
- @@ -16,6 +16,10 @@
-
- <resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- + <string name="custom_tips">"Consejos"</string>
- + <string name="message">"¿estás seguro para eliminarlo?"</string>
- + <string name="confirm">"si"</string>
- + <string name="cancel">"no"</string>
- <string name="app_label" msgid="2783841764617238354">"Documentos"</string>
- <string name="title_open" msgid="4353228937663917801">"Abrir desde"</string>
- <string name="title_save" msgid="2433679664882857999">"Guardar en"</string>
- diff --git a/base/packages/DocumentsUI/res/values-zh-rCN/strings.xml b/base/packages/DocumentsUI/res/values-zh-rCN/strings.xml
- index 643921c..8b6bff2 100644
- --- a/base/packages/DocumentsUI/res/values-zh-rCN/strings.xml
- +++ b/base/packages/DocumentsUI/res/values-zh-rCN/strings.xml
- @@ -16,6 +16,10 @@
-
- <resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- + <string name="custom_tips">"提示"</string>
- + <string name="message">"您確定要刪除嗎?"</string>
- + <string name="confirm">"刪除"</string>
- + <string name="cancel">"取消"</string>
- <string name="app_label" msgid="2783841764617238354">"文檔"</string>
- <string name="title_open" msgid="4353228937663917801">"打開文件"</string>
- <string name="title_save" msgid="2433679664882857999">"保存文件"</string>
- diff --git a/base/packages/DocumentsUI/res/values/strings.xml b/base/packages/DocumentsUI/res/values/strings.xml
- index 23c61fa..fcfa7ab 100755
- --- a/base/packages/DocumentsUI/res/values/strings.xml
- +++ b/base/packages/DocumentsUI/res/values/strings.xml
- @@ -137,4 +137,8 @@
- <string name="retry">Retry</string>
- <!-- Contents of the copying failure alert dialog. [CHAR LIMIT=48] -->
- <string name="copy_failure_alert_content">These files weren\'t copied: <xliff:g id="list">%1$s</xliff:g></string>
- + <string name="custom_tips">Tips</string>
- + <string name="message">Are you sure to delete it?</string>
- + <string name="confirm">yes</string>
- + <string name="cancel">no</string>
- </resources>
- diff --git a/base/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java b/base/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
- index 9ae6e29..540f459 100755
- --- a/base/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
- +++ b/base/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java
- @@ -36,6 +36,7 @@ import static com.android.documentsui.model.DocumentInfo.getCursorString;
- import android.app.Activity;
- import android.app.ActivityManager;
- import android.app.ActivityManager.RunningTaskInfo;
- +import android.app.AlertDialog;
- import android.app.Fragment;
- import android.app.FragmentManager;
- import android.app.FragmentTransaction;
- @@ -45,6 +46,7 @@ import android.content.ContentProviderClient;
- import android.content.ContentResolver;
- import android.content.ContentValues;
- import android.content.Context;
- +import android.content.DialogInterface;
- import android.content.Intent;
- import android.content.Loader;
- import android.content.res.Resources;
- @@ -107,6 +109,7 @@ import com.mediatek.common.documentsui.IDocumentsUIExtension;
- /// M: Add to support drm
- import com.mediatek.drm.OmaDrmStore;
- import com.mediatek.drm.OmaDrmUtils;
- +import android.widget.Toast;
-
- /**
- * Display the documents inside a single directory.
- @@ -633,10 +636,12 @@ public class DirectoryFragment extends Fragment {
- return true;
- }
-
- + private ArrayList<DocumentInfo> docs;
- @Override
- public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
- final SparseBooleanArray checked = mCurrentView.getCheckedItemPositions();
- - final ArrayList<DocumentInfo> docs = Lists.newArrayList();
- + //final ArrayList<DocumentInfo> docs = Lists.newArrayList();
- + docs = Lists.newArrayList();
- final int size = checked.size();
- final int id = item.getItemId();
- for (int i = 0; i < size; i++) {
- @@ -685,10 +690,11 @@ public class DirectoryFragment extends Fragment {
-
- } else if (id == R.id.menu_delete) {
- /// M: remove state @{
- - final State state = getDisplayState(DirectoryFragment.this);
- - state.dirState.remove(mStateKey);
- + // final State state = getDisplayState(DirectoryFragment.this);
- + // state.dirState.remove(mStateKey);
- /// @}
- - onDeleteDocuments(docs);
- + deleteDialog();
- + // onDeleteDocuments(docs);
- mode.finish();
- return true;
-
- @@ -709,7 +715,24 @@ public class DirectoryFragment extends Fragment {
- return false;
- }
- }
- -
- + private void deleteDialog(){
- + new AlertDialog.Builder(getActivity())
- + .setTitle(R.string.custom_tips)
- + .setMessage(R.string.message)
- + .setPositiveButton(R.string.confirm,
- + new DialogInterface.OnClickListener() {
- +
- + @Override
- + public void onClick(DialogInterface arg0, int arg1) {
- + // TODO Auto-generated method stub
- + final State state = getDisplayState(DirectoryFragment.this);
- + state.dirState.remove(mStateKey);
- + onDeleteDocuments(docs);
- + }
- + })
- + .setNegativeButton(R.string.cancel,null).show();
- +
- + }
- @Override
- public void onDestroyActionMode(ActionMode mode) {
- /// M: restore action mode @{
十二:改關機時間長短
(frameworks/base/services/core/java/com/android/server/power/ShutdownThread.java)
- diff --git a/base/services/core/java/com/android/server/power/ShutdownThread.java b/base/services/core/java/com/android/server/power/ShutdownThread.java
- index 710bcc2..9f8be2e 100644
- --- a/base/services/core/java/com/android/server/power/ShutdownThread.java
- +++ b/base/services/core/java/com/android/server/power/ShutdownThread.java
- @@ -143,7 +143,7 @@ public final class ShutdownThread extends Thread {
- private static int mShutdownFlow;
-
- // Shutdown Animation
- - private static final int MIN_SHUTDOWN_ANIMATION_PLAY_TIME = 5 * 1000;
- + private static final int MIN_SHUTDOWN_ANIMATION_PLAY_TIME = 10 * 1000;
- // CU/CMCC operator require 3-5s
- private static long beginAnimationTime = 0;
- private static long endAnimationTime = 0;
- @@ -159,7 +159,7 @@ public final class ShutdownThread extends Thread {
- * 2: bypass radio off
- * 3: bypass both
- * */
- -
- + private static int screen_turn_off_time = 10 * 1000;
- private static final boolean mSpew = true; //debug enable
-
- private static IBootAnimExt mIBootAnim = null; // for boot animation
- @@ -526,7 +526,7 @@ public final class ShutdownThread extends Thread {
-
- beginAnimationTime = 0;
- boolean mShutOffAnimation = configShutdownAnimation(context);
- - int screenTurnOffTime = getScreenTurnOffTime(context);
- + int screenTurnOffTime = screen_turn_off_time;
- synchronized (mEnableAnimatingSync) {
- if (mEnableAnimating) {
- if (mShutOffAnimation) {
十三:wifi熱點上限數
(frameworks/base/core/java/android/provider/Settings.java)
- diff --git a/base/core/java/android/provider/Settings.java b/base/core/java/android/provider/Settings.java
- index 4169d8c..78c167d 100644
- --- a/base/core/java/android/provider/Settings.java
- +++ b/base/core/java/android/provider/Settings.java
- @@ -3528,7 +3528,7 @@ public final class Settings {
- * Wifi hotspot default client number
- * @hide
- */
- - public static final int WIFI_HOTSPOT_DEFAULT_CLIENT_NUM = 6;
- + public static final int WIFI_HOTSPOT_DEFAULT_CLIENT_NUM = 5;
-
- /**
- * The max client num of hotspot
十四:默認打開CB(小區廣播)消息
(modems/lwtg/custom/service/nvram/nvram_cust_pack.c)
- diff --git a/lwtg/custom/service/nvram/nvram_cust_pack.c b/lwtg/custom/service/nvram/nvram_cust_pack.c
- index fd1f347..9d9ad3a 100644
- --- a/lwtg/custom/service/nvram/nvram_cust_pack.c
- +++ b/lwtg/custom/service/nvram/nvram_cust_pack.c
- @@ -1016,7 +1016,7 @@ kal_uint8 const COMMON_NVRAM_EF_SMSAL_COMMON_PARAM_DEFAULT[] =
- #ifdef __UE_SIMULATOR__
- 0x01, 0x01, /* CB setting - ON */
- #else
- - 0x00, 0x01, /* CB setting */
- + 0x01, 0x01, /* CB setting */
- #endif
- 0xFF, /* AT default profile ID.0xFF:invalid profile ID and SMSAL auto select profile id */
- 0x00, /* First Octet */
十五:
進入工程模式,進入 "*#*#3646633#*#*"-->engineer mode---->Telephony---》Fast Dormancy--》ConfigFD--》默認選擇第三項(Turn on R8 FD&Turn off Legacy FD)。(如附件 是在MTK平臺下)
(modems/lwtg/custom/service/nvram/nvram_data_items.c)
- diff --git a/lwtg/custom/service/nvram/nvram_data_items.c b/lwtg/custom/service/nvram/nvram_data_items.c
- index c8ba4d6..bcb406c 100644
- --- a/lwtg/custom/service/nvram/nvram_data_items.c
- +++ b/lwtg/custom/service/nvram/nvram_data_items.c
- @@ -3393,6 +3393,7 @@ typedef enum
- * Define necessary default values for each logical data item.
- */
-
- +static kal_uint8 const NVRAM_EF_PS_CONFORMANCE_TESTMODE_REVISE_DEFAULT[] ={ 0x00, 0x00, 0x40, 0x00 };
- kal_uint8 const NVRAM_EF_ZERO_DEFAULT[] = { 0x00 };
- kal_uint8 const NVRAM_EF_FF_DEFAULT[] = { 0xFF };
-
- @@ -10685,7 +10686,7 @@ ltable_entry_struct logical_data_item_table_core[] =
- #ifdef __UE_SIMULATOR__
- NVRAM_NORMAL(NVRAM_EF_PS_CONFORMANCE_TESTMODE_DEFAULT),
- #else
- - NVRAM_NORMAL(NVRAM_EF_ZERO_DEFAULT),
- + NVRAM_NORMAL(NVRAM_EF_PS_CONFORMANCE_TESTMODE_REVISE_DEFAULT),
- #endif
- NVRAM_CATEGORY_USER,
- NVRAM_ATTR_AVERAGE,
- diff --git a/lwtg/interface/service/nvram/nvram_editor_data_item.h b/lwtg/interface/service/nvram/nvram_editor_data_item.h
- index 6bca59b..f69ff68 100644
- --- a/lwtg/interface/service/nvram/nvram_editor_data_item.h
- +++ b/lwtg/interface/service/nvram/nvram_editor_data_item.h
- @@ -2776,7 +2776,7 @@
- #endif
-
-
- -#define NVRAM_EF_PS_CONFORMANCE_TESTMODE_LID_VERNO "000"
- +#define NVRAM_EF_PS_CONFORMANCE_TESTMODE_LID_VERNO "001"
- #define NVRAM_EF_MOBILE_BROADBAND_PROVISION_CONTEXT_LID_VERNO "000" //__MOBILE_BROADBAND_PROVISION_CONTEXT__
- #define NVRAM_EF_MSQ_LIST_LID_VERNO "001" //__MEDIATEK_SMART_QOS__ (MSQ)
-
十六:
通訊錄新建聯繫人默認保存在sim卡(點擊新建,彈出兩個選項sim,phone,默認選sim)
(packages/apps/Contacts/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java)
- diff --git a/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java b/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
- index 00d1fbc..6e4c882 100644
- --- a/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
- +++ b/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java
- @@ -135,21 +135,19 @@ public class ContactEditorAccountsChangedActivity extends Activity {
- if (numAccounts >= 2) {
- // When the user has 2+ writable accounts, show a list of accounts so the user can pick
- // which account to create a contact in.
- - setContentView(R.layout.contact_editor_accounts_changed_activity_with_picker);
- -
- - final TextView textView = (TextView) findViewById(R.id.text);
- /// M:
- - textView.setText(getString(R.string.store_contact_to));
- -
- - final Button button = (Button) findViewById(R.id.add_account_button);
- - button.setText(getString(R.string.add_new_account));
- - button.setOnClickListener(mAddAccountClickListener);
- -
- - final ListView accountListView = (ListView) findViewById(R.id.account_list);
- mAccountListAdapter = new AccountsListAdapter(this,
- AccountListFilter.ACCOUNTS_CONTACT_WRITABLE);
- - accountListView.setAdapter(mAccountListAdapter);
- - accountListView.setOnItemClickListener(mAccountListItemClickListener);
- + String accountType = mAccountListAdapter.getItem(0).type.toString();
- + if (AccountTypeUtils.isAccountTypeIccCard(accountType)) {
- + AccountWithDataSet ads = mAccountListAdapter.getItem(0);
- +
- + mSubId = SubInfoUtils.getInvalidSubId();
- + if (ads instanceof AccountWithDataSetEx) {
- + mSubId = ((AccountWithDataSetEx) ads).getSubId();
- + }
- + checkPHBStateAndSaveAccount(0);
- + }
- } else if (numAccounts == 1) {
- // If the user has 1 writable account we will just show the user a message with 2
- // possible action buttons.
十七:第一次開機是如果無sim卡加提示
(packages/apps/Launcher3/)
- diff --git a/AndroidManifest.xml b/AndroidManifest.xml
- index 73f01e2..0b12bea 100644
- --- a/AndroidManifest.xml
- +++ b/AndroidManifest.xml
- @@ -64,6 +64,7 @@
- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
- <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
- <uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
- + <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
- <uses-permission android:name="com.android.launcher3.permission.READ_SETTINGS" />
- <uses-permission android:name="com.android.launcher3.permission.WRITE_SETTINGS" />
- <uses-permission android:name="com.android.launcher3.permission.RECEIVE_LAUNCH_BROADCASTS" />
- diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
- index 8a0ce6a..b959c93 100644
- --- a/src/com/android/launcher3/Launcher.java
- +++ b/src/com/android/launcher3/Launcher.java
- @@ -33,7 +33,9 @@ import android.annotation.TargetApi;
- import android.app.Activity;
- import android.app.ActivityManager;
- import android.app.ActivityOptions;
- +import android.app.Dialog;
- import android.app.AlertDialog;
- +import android.app.AlertDialog.Builder;
- import android.app.SearchManager;
- import android.app.Service;
- import android.appwidget.AppWidgetHostView;
- @@ -102,6 +104,7 @@ import android.view.animation.OvershootInterpolator;
- import android.view.inputmethod.InputMethodManager;
- import android.widget.Advanceable;
- import android.widget.FrameLayout;
- +import android.telephony.TelephonyManager;
- import android.widget.ImageView;
- import android.widget.TextView;
- import android.widget.Toast;
- @@ -498,6 +501,7 @@ public class Launcher extends Activity
- ///M.
-
- private String mCurrentQsbPkgName;
- + private TelephonyManager telMgr;
- + private int first_boot = 0;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- @@ -522,6 +526,17 @@ public class Launcher extends Activity
-
- super.onCreate(savedInstanceState);
- +<span style="white-space:pre"> </span> if(<span style="font-family:Verdana, sans-serif;">first_boot </span><span style="font-family:Verdana, sans-serif;">== </span><span style="font-family:Verdana, sans-serif;">0</span><span style="font-family:Verdana, sans-serif;">){</span><span style="font-family:Verdana, sans-serif;">
- </span>+ telMgr = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
- + Log.i("rmy", "telMgr()="+telMgr.getSimState());
- + if (telMgr.getSimState() == telMgr.SIM_STATE_READY) {
- + <span style="white-space:pre"> </span>Log.i("rmy", "良好");
- + } else if (telMgr.getSimState() == telMgr.SIM_STATE_ABSENT) {
- + Log.i("rmy", "無SIM卡");
- + checkSimDialog(this);
- + } else {
- + Log.i("rmy", "SIM卡被鎖定或未知的狀態");
- + }
- +<span style="white-space:pre"> </span> }
- LauncherAppState.setApplicationContext(getApplicationContext());
- LauncherAppState app = LauncherAppState.getInstance();
-
- @@ -649,6 +664,21 @@ public class Launcher extends Activity
- }
- }
-
- + private void checkSimDialog(final Context context) {
- + AlertDialog.Builder simDialog = new AlertDialog.Builder(context);
- + simDialog.setTitle("Preguntar");
- + simDialog.setMessage("SIM invalida");
- + simDialog.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
- + @Override
- + public void onClick(DialogInterface dialog, int which) {
- + dialog.dismiss();
- + }
- + });
- + AlertDialog dialog = simDialog.create();
- + dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
- + dialog.show();
- + }
- +
- @Override
- public void onSettingsChanged(String settings, boolean value) {
- if (Utilities.ALLOW_ROTATION_PREFERENCE_KEY.equals(settings)) {
十八:
wifi要內置兩個名字分別爲MOVISTAR WIFI and VIVO-WIFI 的無線網。安全類型爲802.1XEAP.密碼爲空。 類似用戶進入wifi界面,手機創建一個wifi後的效果。如附件圖片
(packages/apps/Settings/)
- diff --git a/src/com/android/settings/net/DataUsageMeteredSettings.java b/src/com/android/settings/net/DataUsageMeteredSettings.java
- index ec1dd38..56ab5e8 100644
- --- a/src/com/android/settings/net/DataUsageMeteredSettings.java
- +++ b/src/com/android/settings/net/DataUsageMeteredSettings.java
- @@ -118,6 +118,11 @@ public class DataUsageMeteredSettings extends SettingsPreferenceFragment impleme
- final NetworkTemplate template = NetworkTemplate.buildTemplateWifi(networkId);
- final MeteredPreference pref = new MeteredPreference(context, template);
- pref.setTitle(removeDoubleQuotes(networkId));
- + if (networkId.contains("MOVISTAR WIFI")) {
- + pref.setTitle("MOVISTAR WIFI");
- + } else if (networkId.contains("VIVO WIFI")) {
- + pref.setTitle("VIVO WIFI");
- + }
- return pref;
- }
-
- @@ -207,6 +212,11 @@ public class DataUsageMeteredSettings extends SettingsPreferenceFragment impleme
-
- data = new SearchIndexableRaw(context);
- data.title = removeDoubleQuotes(networkId);
- + if (networkId.contains("MOVISTAR WIFI")) {
- + data.title = "MOVISTAR WIFI";
- + } else if (networkId.contains("VIVO WIFI")) {
- + data.title = "VIVO WIFI";
- + }
- data.screenTitle = res.getString(R.string.data_usage_menu_metered);
- result.add(data);
- }
- diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
- index 8a241be..e91613c 100644
- --- a/src/com/android/settings/wifi/WifiConfigController.java
- +++ b/src/com/android/settings/wifi/WifiConfigController.java
- @@ -328,6 +328,10 @@ public class WifiConfigController implements TextWatcher,
- }
- if (mAccessPoint.isSaved() || mAccessPoint.isActive()) {
- mConfigUi.setForgetButton(res.getString(R.string.wifi_forget));
- + if (!mAccessPoint.toString().contains("MOVISTAR WIFI")
- + && !mAccessPoint.toString().contains("VIVO WIFI")) {
- + mConfigUi.setForgetButton(res.getString(R.string.wifi_forget));
- + }
- }
- }
- }
- diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
- index 03ab864..c0eb2d1 100644
- --- a/src/com/android/settings/wifi/WifiSettings.java
- +++ b/src/com/android/settings/wifi/WifiSettings.java
- @@ -758,7 +758,8 @@ public class WifiSettings extends RestrictedSettingsFragment
- int index = 0;
- for (AccessPoint accessPoint : accessPoints) {
- // Ignore access points that are out of range.
- - if (accessPoint.getLevel() != -1) {
- + if (accessPoint.getLevel() != -1 || accessPoint.toString().contains("MOVISTAR WIFI")
- + || accessPoint.toString().contains("VIVO WIFI")) {
- hasAvailableAccessPoints = true;
- if (accessPoint.getTag() != null) {
- final Preference pref = (Preference) accessPoint.getTag();
(vendor/mediatek/proprietary/hardware/connectivity/wlan/config/mtk-wpa_supplicant-overlay.conf)
- diff --git a/mediatek/proprietary/hardware/connectivity/wlan/config/mtk-wpa_supplicant-overlay.conf b/mediatek/proprietary/hardware/connectivity/wlan/config/mtk-wpa_supplicant-overlay.conf
- index f6b7121..4d5d52b 100644
- --- a/mediatek/proprietary/hardware/connectivity/wlan/config/mtk-wpa_supplicant-overlay.conf
- +++ b/mediatek/proprietary/hardware/connectivity/wlan/config/mtk-wpa_supplicant-overlay.conf
- @@ -1,3 +1,20 @@
- p2p_no_group_iface=1
- driver_param=use_p2p_group_interface=1
- wowlan_triggers=disconnect
- +overlay_loaded=1
- +network={
- + ssid="MOVISTAR WIFI"
- + key_mgmt=WPA-EAP IEEE8021X
- + eap=SIM
- + disabled=1
- + priority=1
- + read_only=1
- + }
- +network={
- + ssid="VIVO WIFI"
- + key_mgmt=WPA-EAP IEEE8021X
- + eap=SIM
- + disabled=1
- + priority=1
- + read_only=1
- + }
十九:
主菜單--》設置--》語言和輸入法--》Android keyboard 右邊的設置圖標---》show correction suggestions--》改成默認選中always hide
(packages/inputmethods/)
- diff --git a/LatinIME/java/res/xml/prefs_screen_correction.xml b/LatinIME/java/res/xml/prefs_screen_correction.xml
- index a943dc1..1653b0f 100644
- --- a/LatinIME/java/res/xml/prefs_screen_correction.xml
- +++ b/LatinIME/java/res/xml/prefs_screen_correction.xml
- @@ -51,7 +51,7 @@
- android:key="show_suggestions"
- android:summary="@string/prefs_show_suggestions_summary"
- android:title="@string/prefs_show_suggestions"
- - android:defaultValue="true"
- + android:defaultValue="false"
- android:persistent="true" />
- <CheckBoxPreference
- android:key="pref_key_use_personalized_dicts"
- diff --git a/LatinIME/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/LatinIME/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
- index 1833cfb..748e424 100755
- --- a/LatinIME/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
- +++ b/LatinIME/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
- @@ -312,7 +312,7 @@ public class SettingsValues {
- .putBoolean(Settings.PREF_SHOW_SUGGESTIONS, !alwaysHide)
- .apply();
- }
- - return prefs.getBoolean(Settings.PREF_SHOW_SUGGESTIONS, true);
- + return prefs.getBoolean(Settings.PREF_SHOW_SUGGESTIONS, false);
- }
-
- private static boolean readBigramPredictionEnabled(final SharedPreferences prefs,
二十:瀏覽器下載的文件, 默認保存在」Downloads「名字的文件夾
(vendor/mediatek/proprietary/packages/apps/Browser/ext/src/com/mediatek/browser/ext/DefaultBrowserSettingExt.java)
- diff --git a/mediatek/proprietary/packages/apps/Browser/ext/src/com/mediatek/browser/ext/DefaultBrowserSettingExt.java b/mediatek/proprietary/packages/apps/Browser/ext/src/com/mediatek/browser/ext/DefaultBrowserSettingExt.java
- index 475bbb8..02dc88c 100755
- --- a/mediatek/proprietary/packages/apps/Browser/ext/src/com/mediatek/browser/ext/DefaultBrowserSettingExt.java
- +++ b/mediatek/proprietary/packages/apps/Browser/ext/src/com/mediatek/browser/ext/DefaultBrowserSettingExt.java
- @@ -21,7 +21,7 @@ public class DefaultBrowserSettingExt implements IBrowserSettingExt {
- private static final String TAG = "DefaultBrowserSettingsExt";
-
- private static final String DEFAULT_DOWNLOAD_DIRECTORY = "/storage/sdcard0/MyFavorite";
- - private static final String DEFAULT_MY_FAVORITE_FOLDER = "/MyFavorite";
- + private static final String DEFAULT_MY_FAVORITE_FOLDER = "/Download";
-
- private static final String PREF_SEARCH_ENGINE = "search_engine";
- private static final String DEFAULT_SEARCH_ENGIN = "google";
二十一:UA string 需要加上項目名Gomoible GO1003 (根據具體的項目名稱修改),查看的網址爲:whatsmyuseragent.com
(vendor/mediatek/proprietary/packages/apps/Browser/src/com/android/browser/BrowserSettings.java)
- diff --git a/mediatek/proprietary/packages/apps/Browser/src/com/android/browser/BrowserSettings.java b/mediatek/proprietary/packages/apps/Browser/src/com/android/browser/BrowserSettings.java
- index 5079bc1..561329f 100755
- --- a/mediatek/proprietary/packages/apps/Browser/src/com/android/browser/BrowserSettings.java
- +++ b/mediatek/proprietary/packages/apps/Browser/src/com/android/browser/BrowserSettings.java
- @@ -363,7 +363,7 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
- sBrowserSettingExt = Extensions.getSettingPlugin(mContext);
- sBrowserSettingExt.setStandardFontFamily(settings, mPrefs);
-
- - String ua = mCustomUserAgents.get(settings);
- + String ua = "Mozilla/5.0 (Linux; Android 6.0; GOMOBILE GO1003 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/44.0.2403.119 Mobile Safari/537.36";
- if (ua != null) {
- settings.setUserAgentString(ua);
- } else {
二十二:
添加通道( 50,919,921,4370),通道號和名字都設爲 50,919,921,4370。(通道-channel(英文)-canal(西班牙語)),默認都是enable的,並且默認可以接受所有語言的。
(packages/providers/)
- diff --git a/TelephonyProvider/src/com/android/providers/telephony/CbProvider.java b/TelephonyProvider/src/com/android/providers/telephony/CbProvider.java
- index 3d7ac48..c32acf5 100755
- --- a/TelephonyProvider/src/com/android/providers/telephony/CbProvider.java
- +++ b/TelephonyProvider/src/com/android/providers/telephony/CbProvider.java
- @@ -134,8 +134,10 @@ public class CbProvider extends ContentProvider {
- // break;
- case URL_CHANNEL:
- qb.setTables(CbDatabaseHelper.CHANNEL_TABLE);
- + if (selection == null || !selection.contains("sub_id")) {
- qb.appendWhere("(sub_id = " + SmsProvider.getSubIdFromUri(url)
- + ")");
- + }
- break;
- case URL_CONVERSATION:
- // qb.setTables(CbDatabaseHelper.CONVERSATION_TABLE);
(vendor/
)
- diff --git a/mediatek/proprietary/packages/apps/Mms/AndroidManifest.xml b/mediatek/proprietary/packages/apps/Mms/AndroidManifest.xml
- index 1e224e1..cdb7bce 100755
- --- a/mediatek/proprietary/packages/apps/Mms/AndroidManifest.xml
- +++ b/mediatek/proprietary/packages/apps/Mms/AndroidManifest.xml
- @@ -88,6 +88,7 @@
- <!-- rcs -->
- <uses-permission android:name="com.cmcc.ccs.READ_CCS_MESSAGE"/>
- <uses-permission android:name="com.cmcc.ccs.WRITE_CCS_MESSAGE"/>
- + <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
-
- <application android:name="MmsApp"
- android:label="@string/app_label"
- @@ -111,6 +112,9 @@
- <service android:name="com.mediatek.cb.cbmsg.CBMessageReceiverService"
- android:exported="false" />
-
- + <service android:name="com.mediatek.cb.cbmsg.CellBroadcastAlertAudio"
- + android:exported="false" />
- +
- <service android:name="com.mediatek.omacp.OMACPReceiverService"
- android:exported="false" />
-
- @@ -534,6 +538,12 @@ add for MClock update sms database
- <intent-filter>
- <action android:name="android.provider.Telephony.SMS_CB_RECEIVED" />
- </intent-filter>
-
- + <intent-filter>
- + <action android:name="android.intent.action.SIM_STATE_CHANGED" />
- + </intent-filter>
- </receiver>
-
- <!-- Catch-all receiver for broadcasts that don't have associated security -->
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/ConversationListItem.java b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/ConversationListItem.java
- index a30251a..9b25f26 100644
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/ConversationListItem.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/ConversationListItem.java
- @@ -558,7 +558,7 @@ public class ConversationListItem extends RelativeLayout implements Contact.Upda
- .getString(R.string.cb_default_channel_name);
- }
- try {
- - from = name + "(" + channelId + ")";
- + from = name;
- } catch (NumberFormatException e) {
- MmsLog.e(TAG, "format recipient number error!");
- }
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageListActivity.java b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageListActivity.java
- index 3871434..57aa812 100755
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageListActivity.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageListActivity.java
- @@ -369,8 +369,7 @@ public class CBMessageListActivity extends Activity implements DraftCache.OnDraf
- .getString(R.string.cb_default_channel_name));
- } else {
- actionBar.setTitle(MmsApp.getApplication().getApplicationContext()
- - .getString(R.string.cb_default_channel_name)
- - + "(" + mConversation.getRecipients().get(0).getNumber() + ")");
- + .getString(R.string.cb_default_channel_name));
- }
-
- default:
- @@ -402,8 +401,7 @@ public class CBMessageListActivity extends Activity implements DraftCache.OnDraf
-
- ActionBar actionBar = getActionBar();
- actionBar.setTitle(MmsApp.getApplication().getApplicationContext().getString(
- - R.string.cb_default_channel_name)
- - + "(" + mConversation.getRecipients().get(0).getNumber() + ")");
- + R.string.cb_default_channel_name));
- actionBar.setDisplayHomeAsUpEnabled(true);
-
- // We used to refresh the DraftCache here, but
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageReceiver.java b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageReceiver.java
- index 7415026..816a1f5 100755
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageReceiver.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageReceiver.java
- @@ -64,6 +64,8 @@ import com.android.mms.MmsApp;
- import com.android.mms.util.MmsLog;
- import com.mediatek.mms.util.PermissionCheckUtil;
-
- +import com.android.internal.telephony.TelephonyIntents;
- +
- /**
- * M:
- * Handle incoming SMSes. Just dispatches the work off to a Service.
- @@ -98,7 +100,14 @@ public class CBMessageReceiver extends BroadcastReceiver {
- + intent.getAction() + ", result = " + getResultCode());
-
- intent.setClass(context, CBMessageReceiverService.class);
- +/*
- intent.putExtra("result", getResultCode());
- + */
- + android.util.Log.d(" CBMessageReceiver ", " CBMessageReceiver.onReceiveWithPrivilege 97 ");
- + if (!TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(intent.getAction())) {
- + intent.putExtra("result", getResultCode());
- + }
- +// End of
- beginStartingService(context, intent);
- }
-
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageReceiverService.java b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageReceiverService.java
- index d3251c7..1e883cc 100755
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageReceiverService.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessageReceiverService.java
- @@ -81,6 +81,24 @@ import com.mediatek.mms.ext.IOpCBMessageReceiverServiceExt;
- import com.mediatek.opmsg.util.OpMessageUtils;
-
- import android.telephony.SubscriptionManager;
- +import com.mediatek.mms.util.MmsDialogNotifyUtils;
- +/*
- + */
- +import android.provider.Telephony;
- +import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
- +import android.content.ContentValues;
- +import android.database.Cursor;
- +import android.util.Log;
- +import com.android.internal.telephony.IccCardConstants;
- +import com.android.internal.telephony.TelephonyIntents;
- +import android.telephony.SmsManager;
- +import android.provider.Telephony.Sms.Intents;
- +import android.app.AlertDialog;
- +import android.content.DialogInterface;
- +import android.view.WindowManager;
- +import java.text.SimpleDateFormat;
- +import java.util.Date;
- +// End of Vanzo:tanglei
-
- /**
- * M:
- @@ -97,6 +115,19 @@ public class CBMessageReceiverService extends Service {
-
- private static final Uri MESSAGE_URI = Telephony.SmsCb.CONTENT_URI;
- private static final int DEFAULT_SUB_ID = 1;
- +/*
- + */
- + private static final int MESSAGE_SET_STATE = 33;
- + private static final int MESSAGE_SET_CONFIG = 32;
- + private static final String KEYID = "_id";
- + private static final String NAME = "name";
- + private static final String NUMBER = "number";
- + private static final String ENABLE = "enable";
- + private static final String SUBID = "sub_id";
- + private static final Uri CHANNEL_URI = Uri.parse("content://cb/channel");
- + private static final int EVENT_RETRY_ADD_CHANNEL_TIME_OUT = 101;
- + private static boolean isAddingDefaultChannel = false;
- +// End of
-
- public Handler mToastHandler = new Handler() {
- @Override
- @@ -159,6 +190,7 @@ public class CBMessageReceiverService extends Service {
- public void handleMessage(Message msg) {
- int serviceId = msg.arg1;
- Intent intent = (Intent) msg.obj;
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.ServiceHandler.handleMessage 185 serviceId="+serviceId+" msg.what="+msg.what+" intent="+intent); // modify by mtk_debug 2015-3-19;
- if (intent != null) {
- String action = intent.getAction();
- // NEED Replace with CB ACTION
- @@ -166,12 +198,266 @@ public class CBMessageReceiverService extends Service {
- handleCBMessageReceived(intent);
- }
- }
- +
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.ServiceHandler.handleMessage 162 "); // modify by mtk_debug 2015-3-05;
- + if(TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(intent.getAction())){
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.ServiceHandler.handleMessage receiver a ACTION_SIM_STATE_CHANGED 164 "); // modify by mtk_debug 2015-3-05;
- + synchronized(this){
- + handleSIMStateChangedReceived(intent);
- + }
- + }
- // NOTE: We MUST not call stopSelf() directly, since we need to
- // make sure the wake lock acquired by AlertReceiver is released.
- - CBMessageReceiver.finishStartingService(CBMessageReceiverService.this, serviceId);
- + if(!isAddingDefaultChannel){
- + CBMessageReceiver.finishStartingService(CBMessageReceiverService.this, serviceId);
- + }
- }
- }
-
- +/*
- + */
- + private void handleSIMStateChangedReceived(Intent intent) {
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived 191 "); // modify by mtk_debug 2015-3-05;
- + int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.INVALID_SUBSCRIPTION_ID);
- + String stateExtra = intent.getStringExtra(IccCardConstants.INTENT_KEY_ICC_STATE);
- + // boolean stateExtra = intent.getBooleanExtra("ready",false);
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived 214 stateExtra="+stateExtra);
- + if(IccCardConstants.INTENT_VALUE_ICC_READY.equals(stateExtra)){
- + // if(stateExtra){
- + if(queryIfChannelInDatabase(subId,"919",919))
- + {
- + Log.d(TAG, " CBMessageReceiverService.handleSIMStateChangedReceived subid="+subId+" channel1 50 in database");
- + isAddingDefaultChannel=false;
- + }else{
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived subid="+subId+" channel1 50 not in database 699 "); // modify by mtk_debug 2015-3-02;
- + if(SmsManager.getSmsManagerForSubscriptionId(subId).activateCellBroadcastSms(true))/*這裏會先把CB打開*/
- + {
- + Log.d(TAG, " CBMessageReceiverService.handleSIMStateChangedReceived addCustomChanneltoList(subId,Channel1,50);");
- + addCustomChanneltoList(subId,"919",919);
- + isAddingDefaultChannel=false;
- +
- + //請注意:如果貴司做了開機默認關閉小區廣播的feature,請取消下面這句code的註釋
- + //SmsManager.getSmsManagerForSubscriptionId(subId).activateCellBroadcastSms(false); //用於關閉小區廣播開關
- +
- + }else{
- +
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived activateCellBroadcastSms fail 716 "); // modify by mtk_debug 2015-3-05;
- + //add retry
- + if (!mServiceHandler.hasMessages(EVENT_RETRY_ADD_CHANNEL_TIME_OUT)) {
- + Message msg = mServiceHandler.obtainMessage(EVENT_RETRY_ADD_CHANNEL_TIME_OUT,intent);
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived send retry message 235 "); // modify by mtk_debug 2015-3-19;
- + mServiceHandler.sendMessageDelayed(msg, 2000);
- + isAddingDefaultChannel=true;
- + }
- +
- +
- + }
- +
- + }
- + if(queryIfChannelInDatabase(subId,"50",50))
- + {
- + Log.d(TAG, " CBMessageReceiverService.handleSIMStateChangedReceived subid="+subId+" channel1 50 in database");
- + isAddingDefaultChannel=false;
- + }else{
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived subid="+subId+" channel1 50 not in database 699 "); // modify by mtk_debug 2015-3-02;
- + if(SmsManager.getSmsManagerForSubscriptionId(subId).activateCellBroadcastSms(true))/*這裏會先把CB打開*/
- + {
- + Log.d(TAG, " CBMessageReceiverService.handleSIMStateChangedReceived addCustomChanneltoList(subId,Channel1,50);");
- + addCustomChanneltoList(subId,"50",50);
- + isAddingDefaultChannel=false;
- +
- + //請注意:如果貴司做了開機默認關閉小區廣播的feature,請取消下面這句code的註釋
- + //SmsManager.getSmsManagerForSubscriptionId(subId).activateCellBroadcastSms(false); //用於關閉小區廣播開關
- +
- + }else{
- +
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived activateCellBroadcastSms fail 716 "); // modify by mtk_debug 2015-3-05;
- + //add retry
- + if (!mServiceHandler.hasMessages(EVENT_RETRY_ADD_CHANNEL_TIME_OUT)) {
- + Message msg = mServiceHandler.obtainMessage(EVENT_RETRY_ADD_CHANNEL_TIME_OUT,intent);
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived send retry message 235 "); // modify by mtk_debug 2015-3-19;
- + mServiceHandler.sendMessageDelayed(msg, 2000);
- + isAddingDefaultChannel=true;
- + }
- +
- +
- + }
- +
- + }
- + if(queryIfChannelInDatabase(subId,"4370",4370))
- + {
- + Log.d(TAG, " CBMessageReceiverService.handleSIMStateChangedReceived subid="+subId+" channel1 50 in database");
- + isAddingDefaultChannel=false;
- + }else{
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived subid="+subId+" channel1 50 not in database 699 "); // modify by mtk_debug 2015-3-02;
- + if(SmsManager.getSmsManagerForSubscriptionId(subId).activateCellBroadcastSms(true))/*這裏會先把CB打開*/
- + {
- + Log.d(TAG, " CBMessageReceiverService.handleSIMStateChangedReceived addCustomChanneltoList(subId,Channel1,50);");
- + addCustomChanneltoList(subId,"4370",4370);
- + isAddingDefaultChannel=false;
- +
- + //請注意:如果貴司做了開機默認關閉小區廣播的feature,請取消下面這句code的註釋
- + //SmsManager.getSmsManagerForSubscriptionId(subId).activateCellBroadcastSms(false); //用於關閉小區廣播開關
- +
- + }else{
- +
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived activateCellBroadcastSms fail 716 "); // modify by mtk_debug 2015-3-05;
- + //add retry
- + if (!mServiceHandler.hasMessages(EVENT_RETRY_ADD_CHANNEL_TIME_OUT)) {
- + Message msg = mServiceHandler.obtainMessage(EVENT_RETRY_ADD_CHANNEL_TIME_OUT,intent);
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived send retry message 235 "); // modify by mtk_debug 2015-3-19;
- + mServiceHandler.sendMessageDelayed(msg, 2000);
- + isAddingDefaultChannel=true;
- + }
- +
- +
- + }
- +
- + }
- + if(queryIfChannelInDatabase(subId,"921",921))
- + {
- + Log.d(TAG, " CBMessageReceiverService.handleSIMStateChangedReceived subid="+subId+" channel1 50 in database");
- + isAddingDefaultChannel=false;
- + }else{
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived subid="+subId+" channel1 50 not in database 699 "); // modify by mtk_debug 2015-3-02;
- + if(SmsManager.getSmsManagerForSubscriptionId(subId).activateCellBroadcastSms(true))/*這裏會先把CB打開*/
- + {
- + Log.d(TAG, " CBMessageReceiverService.handleSIMStateChangedReceived addCustomChanneltoList(subId,Channel1,50);");
- + addCustomChanneltoList(subId,"921",921);
- + isAddingDefaultChannel=false;
- +
- + //請注意:如果貴司做了開機默認關閉小區廣播的feature,請取消下面這句code的註釋
- + //SmsManager.getSmsManagerForSubscriptionId(subId).activateCellBroadcastSms(false); //用於關閉小區廣播開關
- +
- + }else{
- +
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived activateCellBroadcastSms fail 716 "); // modify by mtk_debug 2015-3-05;
- + //add retry
- + if (!mServiceHandler.hasMessages(EVENT_RETRY_ADD_CHANNEL_TIME_OUT)) {
- + Message msg = mServiceHandler.obtainMessage(EVENT_RETRY_ADD_CHANNEL_TIME_OUT,intent);
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.handleSIMStateChangedReceived send retry message 235 "); // modify by mtk_debug 2015-3-19;
- + mServiceHandler.sendMessageDelayed(msg, 2000);
- + isAddingDefaultChannel=true;
- + }
- +
- +
- + }
- +
- + }
- +
- + }
- +
- + }
- +
- + private void addCustomChanneltoList(int mSubId,String channelName,int channelNum){
- + Log.d(TAG, "addCustomChanneltoList: mSubId=" + mSubId
- + + ", channelName= " + channelName + ", channelNum= " + channelNum);
- +
- + SmsBroadcastConfigInfo[] objectList = new SmsBroadcastConfigInfo[1];
- + objectList[0] = new SmsBroadcastConfigInfo(channelNum,channelNum, -1, -1, true);
- +
- + Log.d(TAG, "addCustomChanneltoList: setCellBroadcastSmsConfig");
- + //SmsManagerEx.getDefault().setCellBroadcastSmsConfig(objectList, objectList, mSimId);
- + boolean isSetConfigSuccess = SmsManager.getSmsManagerForSubscriptionId(mSubId).setCellBroadcastSmsConfig(objectList, objectList);
- + if(isSetConfigSuccess){
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.addCustomChanneltoList set channel " +channelNum +" success 784 "); // modify by mtk_debug 2015-3-05;
- + addChannelToDatabase(mSubId,channelName,channelNum);
- + }else{
- + Log.d(" CBMessageReceiverService ", " CBMessageReceiverService.addCustomChanneltoList set channel "+ channelNum +" failed 786 "); // modify by mtk_debug 2015-3-05;
- + }
- +
- +
- + Log.d(TAG, " CBMessageReceiverService addCustomChanneltoList: function end");
- + }
- +
- +
- +
- + private boolean addChannelToDatabase(int mSubId,String channelName,int channelNum){
- + // ClearChannel();
- + Log.d(TAG, "addChannelToDatabase: mSubId=" + mSubId
- + + ", channelName= " + channelName + ", channelNum= " + channelNum);
- + String[] projection = new String[] { NUMBER, SUBID};
- + String SELECTIONNum = "(" + NUMBER + " = " + channelNum + ")";
- + String SELECTIONid = "(" + SUBID + " = " + mSubId + ")";
- + Cursor cursornum = null;
- + Cursor cursorid = null;
- +
- + Cursor cursorzz = this.getContentResolver().query(CHANNEL_URI,
- + projection,
- + NUMBER + " = ? AND " +
- + SUBID + " = ?",
- + new String[] {String.valueOf(channelNum), String.valueOf(mSubId)},
- + null);
- + Log.d(TAG, "addChannelToDatabase: cursor.getCount"+cursorzz.getCount());
- + if(cursorzz.getCount() == 0){//if ((cursornum.getCount() == 0)&&(cursorid.getCount() == 0)){
- + Log.d(" CBMessageReceiverService ", " SmsReceiverService.addChannelToDatabase add mSubId=" + mSubId
- + + ", channelName= " + channelName + ", channelNum= " + channelNum +"to database"); // modify by mtk_debug 2015-3-05;
- + ContentValues values = new ContentValues();
- + values.put(NAME,channelName);
- + values.put(NUMBER, channelNum);
- + values.put(ENABLE, true); //請注意:如果貴司希望預置的頻道默認爲disable狀態,把true改成false即可
- + values.put(SUBID, mSubId);
- + try {
- + //if(mSimId==PhoneConstants.SUB1){
- + this.getContentResolver().insert(CHANNEL_URI, values);
- + //}else if(mSimId==PhoneConstants.SUB2){
- + // this.getContentResolver().insert(CHANNEL_URI1, values);
- + //}
- + } catch (Exception e){
- + Log.d(" CBMessageReceiverService ", " SmsReceiverService.addChannelToDatabase exception 828 "); // modify by mtk_debug 2015-3-05;
- + //cursornum.close();
- + //cursorid.close();
- + cursorzz.close();
- + return false;
- + }
- + //cursornum.close();
- + // cursorid.close();
- + cursorzz.close();
- + return true;
- + }
- + else{
- + //cursornum.close();
- + //cursorid.close();
- + cursorzz.close();
- + return false;
- + }
- +
- + }
- +
- +
- + private boolean queryIfChannelInDatabase(int mSubId,String channelName,int channelNum){
- +
- + Log.d(TAG, "queryIfChannelInDatabase: mSubId=" + mSubId
- + + ", channelName= " + channelName + ", channelNum= " + channelNum);
- + String[] projection = new String[] { NUMBER, SUBID};
- + String SELECTIONNum = "(" + NUMBER + " = " + channelNum + ")";
- + String SELECTIONid = "(" + SUBID + " = " + mSubId + ")";
- + Cursor cursornum = null;
- + Cursor cursorid = null;
- +
- + Cursor cursorzz = this.getContentResolver().query(CHANNEL_URI,
- + projection,
- + NUMBER + " = ? AND " +
- + SUBID + " = ?",
- + new String[] {String.valueOf(channelNum),String.valueOf(mSubId)},
- + null);
- +
- + if(cursorzz != null&&cursorzz.getCount() > 0){
- + //if ((cursornum.getCount() != 0)&&(cursorid.getCount() != 0)){
- + Log.d(TAG, "queryIfChannelInDatabase: cursor.getCount"+cursorzz.getCount());
- + cursorzz.close();
- + return true;
- +
- +
- + }else{
- + cursorzz.close();
- + Log.d(TAG, "queryIfChannelInDatabase: return false");
- + return false;
- + }
- +
- + }
- +// End of Vanzo:tanglei
- +
- private void handleCBMessageReceived(Intent intent) {
- // TODO need replace with cb message.
- Bundle extras = intent.getExtras();
- @@ -200,7 +486,37 @@ public class CBMessageReceiverService extends Service {
- }
-
- if (messageUri != null) {
- - CBMessagingNotification.updateNewMessageIndicator(subId, this, true);
- + if (message.getServiceCategory() == 919 ||
- + message.getServiceCategory() == 50 ||
- + message.getServiceCategory() == 921) {
- + //alert repeat with audio and vibrate
- + CellBroadcastAlertWakeLock.acquireScreenCpuWakeLock(this);
- + Intent audioIntent = new Intent(this, CellBroadcastAlertAudio.class);
- + audioIntent.setAction(CellBroadcastAlertAudio.ACTION_START_ALERT_AUDIO);
- + audioIntent.putExtra(CellBroadcastAlertAudio.ALERT_AUDIO_DURATION_EXTRA, 10500);
- + audioIntent.putExtra(CellBroadcastAlertAudio.ALERT_AUDIO_VIBRATE_EXTRA, true);
- + startService(audioIntent);
- + SimpleDateFormat sdf = new SimpleDateFormat("hh:mm aa. | dd/MM/yyyy");
- + String time = sdf.format(new Date(System.currentTimeMillis())).toString();
- + final Context sContext = getApplicationContext();
- + AlertDialog alert = new AlertDialog.Builder(sContext)
- + .setTitle("Alerta de Emergencia")
- + .setMessage(message.getMessageBody() + "\n\n" + time)
- + .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
- + @Override
- + public void onClick(DialogInterface dialog, int which) {
- + sContext.stopService(new Intent(sContext, CellBroadcastAlertAudio.class));
- + dialog.dismiss();
- + }
- + })
- + .create();
- + alert.getWindow().setType(
- + WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
- + alert.setCancelable(false);
- + alert.show();
- + } else {
- + CBMessagingNotification.updateNewMessageIndicator(subId, this, true);
- + }
- }
- }
-
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessagingNotification.java b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessagingNotification.java
- index f9c161e..addf59d 100755
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessagingNotification.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CBMessagingNotification.java
- @@ -268,7 +268,6 @@ public class CBMessagingNotification {
- //String address = Conversation.getChannelNameFromId(context, channel_id);
- String address;
- address = CBMessage.getCBChannelName(subId, channelId);
- - address = address + "(" + channelId + ")";
- CBNotificationInfo info = getNewMessageNotificationInfo(
- address, body, context, R.drawable.stat_notify_sms,
- null, threadId, timeMillis, cursor.getCount(),
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CellBroadcastAlertAudio.java b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CellBroadcastAlertAudio.java
- new file mode 100644
- index 0000000..f868e44
- --- /dev/null
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CellBroadcastAlertAudio.java
- @@ -0,0 +1,435 @@
- +/*
- + * Copyright (C) 2011 The Android Open Source Project
- + *
- + * Licensed under the Apache License, Version 2.0 (the "License");
- + * you may not use this file except in compliance with the License.
- + * You may obtain a copy of the License at
- + *
- + * http://www.apache.org/licenses/LICENSE-2.0
- + *
- + * Unless required by applicable law or agreed to in writing, software
- + * distributed under the License is distributed on an "AS IS" BASIS,
- + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- + * See the License for the specific language governing permissions and
- + * limitations under the License.
- + */
- +
- +package com.mediatek.cb.cbmsg;
- +
- +import android.app.Service;
- +import android.content.BroadcastReceiver;
- +import android.content.Context;
- +import android.content.Intent;
- +import android.content.IntentFilter;
- +import android.content.SharedPreferences;
- +import android.content.res.AssetFileDescriptor;
- +import android.content.res.Resources;
- +import android.media.AudioManager;
- +import android.media.MediaPlayer;
- +import android.media.MediaPlayer.OnErrorListener;
- +import android.os.Handler;
- +import android.os.IBinder;
- +import android.os.Message;
- +import android.os.Vibrator;
- +import android.speech.tts.TextToSpeech;
- +import android.telephony.PhoneStateListener;
- +import android.telephony.TelephonyManager;
- +import android.util.Log;
- +import java.io.IOException;
- +import java.util.HashMap;
- +import java.util.ArrayList;
- +import java.util.Locale;
- +import com.android.mms.R;
- +
- +/**
- + * Manages alert audio and vibration and text-to-speech. Runs as a service so that
- + * it can continue to play if another activity overrides the CellBroadcastListActivity.
- + */
- +public class CellBroadcastAlertAudio extends Service {
- + private static final String TAG = "CellBroadcastAlertAudio";
- + private static final int PRESIDENT_ALERT_ID = 4370;
- + /** Action to start playing alert audio/vibration/speech. */
- + static final String ACTION_START_ALERT_AUDIO = "ACTION_START_ALERT_AUDIO";
- +
- + /** Extra for alert audio duration (from settings). */
- + public static final String ALERT_AUDIO_DURATION_EXTRA =
- + "com.mediatek.cellbroadcastreceiver.ALERT_AUDIO_DURATION";
- +
- + /** Extra for message body to speak (if speech enabled in settings). */
- + public static final String ALERT_AUDIO_MESSAGE_BODY =
- + "com.mediatek.cellbroadcastreceiver.ALERT_AUDIO_MESSAGE_BODY";
- +
- + /** Extra for text-to-speech language (if speech enabled in settings). */
- + public static final String ALERT_AUDIO_MESSAGE_LANGUAGE =
- + "com.mediatek.cellbroadcastreceiver.ALERT_AUDIO_MESSAGE_LANGUAGE";
- +
- + /** Extra for message ID . */
- + public static final String ALERT_AUDIO_MESSAGE_ID =
- + "com.mediatek.cellbroadcastreceiver.ALERT_AUDIO_MESSAGE_ID";
- +
- + /** Extra for alert audio vibration enabled (from settings). */
- + public static final String ALERT_AUDIO_VIBRATE_EXTRA =
- + "com.mediatek.cellbroadcastreceiver.ALERT_AUDIO_VIBRATE";
- +
- + /** Extra for alert audio ETWS behavior (always vibrate, even in silent mode). */
- + public static final String ALERT_AUDIO_ETWS_VIBRATE_EXTRA =
- + "com.mediatek.cellbroadcastreceiver.ALERT_AUDIO_ETWS_VIBRATE";
- +
- + private static final String TTS_UTTERANCE_ID =
- + "com.mediatek.cellbroadcastreceiver.UTTERANCE_ID";
- +
- + /** Pause duration between alert sound and alert speech. */
- + private static final int PAUSE_DURATION_BEFORE_SPEAKING_MSEC = 1000;
- +
- + //volume change action
- + private static final String VOLUME_CHANGED_ACTION = "android.media.VOLUME_CHANGED_ACTION";
- +
- + /** Vibration uses the same on/off pattern as the CMAS alert tone */
- + private static final long[] sVibratePattern = { 0, 2000, 500, 1000, 500, 1000, 500,
- + 2000, 500, 1000, 500, 1000};
- +
- + private static final int STATE_IDLE = 0;
- + private static final int STATE_ALERTING = 1;
- + private static final int STATE_PAUSING = 2;
- + private static final int STATE_SPEAKING = 3;
- +
- + // Internal messages
- + private static final int ALERT_SOUND_FINISHED = 1000;
- + private static final int ALERT_PAUSE_FINISHED = 1001;
- + /// M: add for repeat alert feature. @{
- + private static final String PREF_NAME = "com.mediatek.cellbroadcastreceiver_preferences";
- + private static final int REPEAT_ALERT_START = 1002;
- + private static final int[] sRepeatTimes = { 60000, 60000 * 3, 60000 * 5 };
- + private boolean mEnableRepeat = true;
- + private int mDuration;
- + private ArrayList<Integer> mRepeatPattern;
- + /// @}
- +
- + private int mState;
- +
- + private int mMessageId;
- + private String mMessageBody;
- + private String mMessageLanguage;
- + private boolean mEnableVibrate;
- + private boolean mEnableAudio;
- + private boolean mRegisteredVolumeReceiver = false;
- +
- + private Vibrator mVibrator;
- + private MediaPlayer mMediaPlayer;
- + private AudioManager mAudioManager;
- + private TelephonyManager mTelephonyManager;
- + private int mInitialCallState;
- +
- + private final Handler mHandler = new Handler() {
- + @Override
- + public void handleMessage(Message msg) {
- + switch (msg.what) {
- + case ALERT_SOUND_FINISHED:
- + /// @}
- + stop(); // stop alert sound
- + // if we can speak the message text
- + if (mMessageBody != null) {
- + mHandler.sendMessageDelayed(mHandler.obtainMessage(ALERT_PAUSE_FINISHED),
- + PAUSE_DURATION_BEFORE_SPEAKING_MSEC);
- + mState = STATE_PAUSING;
- + } else if (!mEnableRepeat || mRepeatPattern.isEmpty()) { ///M:
- + // add for repeat alert feature. do not stop service until end repeat.
- + stopSelf();
- + mState = STATE_IDLE;
- + }
- + break;
- +
- + case ALERT_PAUSE_FINISHED:
- + if (mMessageBody != null) {
- + mState = STATE_SPEAKING;
- + } else if (!mEnableRepeat || mRepeatPattern.isEmpty()) { ///M:
- + // add for repeat alert feature. do not stop service until end repeat.
- + Log.w(TAG, "TTS engine not ready or language not supported");
- + stopSelf();
- + mState = STATE_IDLE;
- + }
- +
- + break;
- +
- + ///M: add for repeat alert feature. @{
- + case REPEAT_ALERT_START:
- + schedulePlay();
- + break;
- + /// @}
- + default:
- + Log.e(TAG, "Handler received unknown message, what=" + msg.what);
- + }
- + }
- + };
- +
- + private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
- + @Override
- + public void onCallStateChanged(int state, String ignored) {
- + // Stop the alert sound and speech if the call state changes.
- + if (state != TelephonyManager.CALL_STATE_IDLE
- + && state != mInitialCallState) {
- + stopSelf();
- + }
- + }
- + };
- +
- + private BroadcastReceiver volumeChangeReceiver = new BroadcastReceiver() {
- +
- + @Override
- + public void onReceive(Context arg0, Intent arg1) {
- + Log.d(TAG, "receive volume change broadcast, stop sound and vibration alert");
- + //stop();
- + }
- +
- + };
- +
- +
- + @Override
- + public void onCreate() {
- + mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
- + mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
- + // Listen for incoming calls to kill the alarm.
- + mTelephonyManager =
- + (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
- + mTelephonyManager.listen(
- + mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE);
- + }
- +
- + @Override
- + public void onDestroy() {
- + //unregister volume register
- + if (mRegisteredVolumeReceiver) {
- + mRegisteredVolumeReceiver = false;
- + unregisterReceiver(volumeChangeReceiver);
- + }
- +
- + /// M: add for repeat alert feature. cancel the next schedule when destroy. @{
- + if (mEnableRepeat) {
- + cancelRepeat();
- + }
- + /// @}
- +
- + // stop audio, vibration and TTS
- + stop();
- + // Stop listening for incoming calls.
- + mTelephonyManager.listen(mPhoneStateListener, 0);
- + // release CPU wake lock acquired by CellBroadcastAlertService
- + CellBroadcastAlertWakeLock.releaseCpuLock();
- + }
- +
- + @Override
- + public IBinder onBind(Intent intent) {
- + return null;
- + }
- +
- + @Override
- + public int onStartCommand(Intent intent, int flags, int startId) {
- + // No intent, tell the system not to restart us.
- + if (intent == null) {
- + stopSelf();
- + return START_NOT_STICKY;
- + }
- +
- + ///M: add for repeat alert feature.
- + cancelRepeat();
- + initAlertSequence();
- +
- + // This extra should always be provided by CellBroadcastAlertService,
- + // but default to 10.5 seconds just to be safe (CMAS requirement).
- + int duration = intent.getIntExtra(ALERT_AUDIO_DURATION_EXTRA, 10500);
- + mMessageId = intent.getIntExtra(ALERT_AUDIO_MESSAGE_ID, 0);
- + // Get text to speak (if enabled by user)
- + mMessageBody = intent.getStringExtra(ALERT_AUDIO_MESSAGE_BODY);
- + mMessageLanguage = intent.getStringExtra(ALERT_AUDIO_MESSAGE_LANGUAGE);
- +
- + mEnableVibrate = intent.getBooleanExtra(ALERT_AUDIO_VIBRATE_EXTRA, true);
- + boolean forceVibrate = intent.getBooleanExtra(ALERT_AUDIO_ETWS_VIBRATE_EXTRA, false);
- +
- + mEnableAudio = true;
- + Log.d(TAG, "mEnableAudio:" + mEnableAudio + ", mEnableVibrate:" + mEnableVibrate);
- + ///M: add for repeat alert. @{
- + mDuration = duration;
- + schedulePlay();
- + /// @}
- + //register volume change receiver
- + if (!mRegisteredVolumeReceiver) {
- + IntentFilter intentFilter = new IntentFilter();
- + intentFilter.addAction(VOLUME_CHANGED_ACTION);
- + registerReceiver(volumeChangeReceiver, intentFilter);
- + mRegisteredVolumeReceiver = true;
- + }
- +
- + // Record the initial call state here so that the new alarm has the
- + // newest state.
- + mInitialCallState = mTelephonyManager.getCallState();
- +
- + return START_STICKY;
- + }
- +
- + // Volume suggested by media team for in-call alarms.
- + private static final float IN_CALL_VOLUME = 0.125f;
- +
- + /**
- + * Start playing the alert sound, and send delayed message when it's time to stop.
- + * @param duration the alert sound duration in milliseconds
- + */
- + private void play() {
- + // stop() checks to see if we are already playing.
- + stop();
- +
- +
- + // Start the vibration first.
- + if (mEnableVibrate || forceAlert()) {
- + mVibrator.vibrate(sVibratePattern, -1);
- + }
- +
- + if (mEnableAudio || forceAlert()) {
- + // future optimization: reuse media player object
- + mMediaPlayer = new MediaPlayer();
- + mMediaPlayer.setOnErrorListener(new OnErrorListener() {
- + public boolean onError(MediaPlayer mp, int what, int extra) {
- + Log.e(TAG, "Error occurred while playing audio.");
- + mp.stop();
- + mp.release();
- + mMediaPlayer = null;
- + return true;
- + }
- + });
- +
- + try {
- + // Check if we are in a call. If we are, play the alert
- + // sound at a low volume to not disrupt the call.
- + if (mTelephonyManager.getCallState()
- + != TelephonyManager.CALL_STATE_IDLE) {
- + Log.v(TAG, "in call: reducing volume");
- + mMediaPlayer.setVolume(IN_CALL_VOLUME, IN_CALL_VOLUME);
- + }
- + else {
- + float volume = 1.0f;
- +
- + Log.d(TAG , "Alert volume: " + volume);
- + mMediaPlayer.setVolume(volume, volume);
- + }
- +
- + // start playing alert audio (unless master volume is vibrate only or silent).
- + setDataSourceFromResource(getResources(), mMediaPlayer,
- + R.raw.attention_signal);
- +
- + int streamType = AudioManager.STREAM_NOTIFICATION;
- + streamType = AudioManager.STREAM_ALARM;
- + mAudioManager.setStreamVolume(streamType,
- + mAudioManager.getStreamMaxVolume(streamType),
- + AudioManager.FLAG_PLAY_SOUND);
- + mAudioManager.requestAudioFocus(null, streamType,
- + AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
- + startAlarm(mMediaPlayer);
- + } catch (IllegalStateException ex) {
- + Log.e(TAG, "Failed to play alert sound", ex);
- + } catch (IOException e) {
- + Log.e(TAG, "IOException");
- + }
- + }
- +
- + // stop alert after the specified duration
- + mHandler.sendMessageDelayed(mHandler.obtainMessage(ALERT_SOUND_FINISHED), mDuration);
- +
- + mState = STATE_ALERTING;
- + }
- +
- + // Do the common stuff when starting the alarm.
- + private void startAlarm(MediaPlayer player)
- + throws java.io.IOException, IllegalArgumentException, IllegalStateException {
- + int streamType = AudioManager.STREAM_NOTIFICATION;
- + streamType = AudioManager.STREAM_ALARM;
- + player.setAudioStreamType(streamType);
- + player.setLooping(true);
- + player.prepare();
- + player.start();
- + }
- +
- + private static void setDataSourceFromResource(Resources resources,
- + MediaPlayer player, int res) throws java.io.IOException {
- + AssetFileDescriptor afd = resources.openRawResourceFd(res);
- + if (afd != null) {
- + player.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(),
- + afd.getLength());
- + afd.close();
- + }
- + }
- +
- + /**
- + * Stops alert audio and speech.
- + */
- + public void stop() {
- +
- + mHandler.removeMessages(ALERT_SOUND_FINISHED);
- + mHandler.removeMessages(ALERT_PAUSE_FINISHED);
- +
- + if (mState == STATE_ALERTING) {
- + // Stop audio playing
- + if (mMediaPlayer != null) {
- + try {
- + mMediaPlayer.stop();
- + mMediaPlayer.release();
- + } catch (IllegalStateException e) {
- + // catch "Unable to retrieve AudioTrack pointer for stop()" exception
- + Log.e(TAG, "exception trying to stop media player");
- + }
- + mMediaPlayer = null;
- + }
- +
- + // Stop vibrator
- + mVibrator.cancel();
- + }
- + mAudioManager.abandonAudioFocus(null);
- + mState = STATE_IDLE;
- + }
- +
- + private static void log(String msg) {
- + Log.d(TAG, msg);
- + }
- +
- + /**
- + * M: add for repeat alert feature.
- + */
- + private void initAlertSequence() {
- + mEnableRepeat = true;
- + mRepeatPattern = new ArrayList<Integer>();
- + if (mEnableRepeat) {
- + for (int i : sRepeatTimes) {
- + mRepeatPattern.add(i);
- + }
- + }
- + }
- +
- + /**
- + * M: add for repeat alert feature.
- + * @param duration the duration of one alert time.
- + */
- + private void schedulePlay() {
- + //if (mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_SILENT) {
- + play();
- + //}
- + if (mEnableRepeat) {
- + mHandler.sendMessageDelayed(mHandler.obtainMessage(REPEAT_ALERT_START), mDuration + 500);
- + }
- + }
- +
- + /**
- + * M: add for repeat alert feature.
- + */
- + public void cancelRepeat() {
- + mHandler.removeMessages(REPEAT_ALERT_START);
- + }
- +
- + /**
- + * M: force alarm (except first alert) in silent mode.
- + * @return
- + */
- + private boolean forceAlert() {
- + boolean isSilentMode = mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT;
- + boolean isRepeating = mEnableRepeat && (mRepeatPattern.size() < sRepeatTimes.length);
- + return isSilentMode && isRepeating;
- + }
- +
- +}
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CellBroadcastAlertWakeLock.java b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CellBroadcastAlertWakeLock.java
- new file mode 100644
- index 0000000..ac296db
- --- /dev/null
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbmsg/CellBroadcastAlertWakeLock.java
- @@ -0,0 +1,52 @@
- +/*
- + * Copyright (C) 2012 The Android Open Source Project
- + *
- + * Licensed under the Apache License, Version 2.0 (the "License");
- + * you may not use this file except in compliance with the License.
- + * You may obtain a copy of the License at
- + *
- + * http://www.apache.org/licenses/LICENSE-2.0
- + *
- + * Unless required by applicable law or agreed to in writing, software
- + * distributed under the License is distributed on an "AS IS" BASIS,
- + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- + * See the License for the specific language governing permissions and
- + * limitations under the License.
- + */
- +
- +package com.mediatek.cb.cbmsg;
- +
- +import android.content.Context;
- +import android.os.PowerManager;
- +import android.util.Log;
- +
- +/**
- + * Hold a wakelock that can be acquired in the CellBroadcastAlertService and
- + * released in the CellBroadcastAlertFullScreen Activity.
- + */
- +class CellBroadcastAlertWakeLock {
- + private static final String TAG = "CellBroadcastAlertWakeLock";
- +
- + private static PowerManager.WakeLock sCpuWakeLock;
- +
- + private CellBroadcastAlertWakeLock() {}
- +
- + static void acquireScreenCpuWakeLock(Context context) {
- + if (sCpuWakeLock != null) {
- + return;
- + }
- + PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
- + sCpuWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK
- + | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, TAG);
- + sCpuWakeLock.acquire();
- + Log.d(TAG, "acquired screen + CPU wake lock");
- + }
- +
- + static void releaseCpuLock() {
- + if (sCpuWakeLock != null) {
- + sCpuWakeLock.release();
- + sCpuWakeLock = null;
- + Log.d(TAG, "released screen + CPU wake lock");
- + }
- + }
- +}
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbsettings/CellBroadcastSettings.java b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbsettings/CellBroadcastSettings.java
- index c6a152b..a15c329 100755
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbsettings/CellBroadcastSettings.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/cb/cbsettings/CellBroadcastSettings.java
- @@ -218,6 +218,13 @@ public class CellBroadcastSettings extends TimeConsumingPreferenceActivity
- } else {
- channel.setSummary(R.string.disable);
- }
- + if (title.equals("919(919)")
- + || title.equals("50(50)")
- + || title.equals("4370(4370)")
- + || title.equals("921(921)")) {
- + channel.setEnabled(false);
- + channel.setSelectable(false);
- + }
-
- channel.setOnPreferenceClickListener(new OnPreferenceClickListener() {
- public boolean onPreferenceClick(Preference arg0) {
- @@ -560,6 +567,7 @@ public class CellBroadcastSettings extends TimeConsumingPreferenceActivity
- }
- String jStr = String.valueOf(j);
- CellBroadcastChannel channel = getChannelObjectFromKey(jStr);
- +/* Vanzo:tanglei on: Thu, 08 Sep 2016 10:34:04 +0800
- if (channel != null) {
- channel.setChannelState(state);
- } else {
- @@ -573,6 +581,8 @@ public class CellBroadcastSettings extends TimeConsumingPreferenceActivity
- mChannelArray.add(newChannel);
- mChannelMap.put(jStr, newChannel);