編輯:關於Android編程
{ app.launcher.start, AID_SYSTEM, 0}, + { app.phonesky.show, AID_SYSTEM, 0}, //Add By zj { cdma., AID_RADIO, 0 }, //Add by gfzhu VIA
private static final String SHOW_PHONESKY = show_phonesky; private CheckBoxPreference mShowPhonesky; mShowPhonesky = findAndInitCheckboxPref(SHOW_PHONESKY);
(BatteryManager.BATTERY_PLUGGED_AC | BatteryManager.BATTERY_PLUGGED_USB) : 0); + } else if (preference == mShowPhonesky) { // ZJ Add + if(mShowPhonesky.isChecked()) + { + SystemProperties.set(app.phonesky.show,1); + }else{ + SystemProperties.set(app.phonesky.show,0); + } } else if (preference == mBtHciSnoopLog) {
android:targetClass=com.android.settings.SetFullBackupPassword /> +④添加對應語言的string字符: Show Google Play Store
⑤設置中新增一個監聽,初始化Checkbox的邏輯: packages/apps/Settings/src/com/android/settings/BootReceiver.java 內容如下:package com.android.settings; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.SystemClock; import android.util.Log; import android.os.SystemProperties; public class BootReceiver extends BroadcastReceiver{ @Override public void onReceive(Context arg0, Intent arg1) { // TODO Auto-generated method stub String action = arg1.getAction(); if(action.equals(Intent.ACTION_BOOT_COMPLETED)) { SharedPreferences shared = arg0.getSharedPreferences(com.android.settings_preferences, Context.MODE_PRIVATE); boolean show_phonesky = shared.getBoolean(show_phonesky, false); if(show_phonesky){ SystemProperties.set(app.phonesky.show,1); }else{ SystemProperties.set(app.phonesky.show,0); } } } }
⑥在Settings的AndroidManifest文件中添加BroadcastReceiver的權限和聲明:
3.在init.rc中添加對應的服務和觸發條件: 路徑:mediatek/config/esky27_tb_ccn_mlc_kk/init.rc+# ZJ Add START +#Hide or Show Google Play Dynamicly +#disabled:服務不會自動運行,必須顯式地通過服務器來啟動。 +#oneshot:當此服務退出時不會自動重啟。 +service hidePhonesky /system/bin/hidePhonesky + disabled + oneshot +service showPhonesky /system/bin/showPhonesky + disabled + oneshot +#on property:sys.boot_completed=1 +# start renamePhonesky +on property:app.phonesky.show=1 + start showPhonesky +on property:app.phonesky.show=0 + start hidePhonesky +# ZJ Add END
4.隱藏和顯示應用的腳本: 隱藏應用:vendor/ThirdParty/App/dte/hidePhonesky 內容:
#!/system/bin/sh #!/system/bin/busybox mount -o remount,rw /system; mv /system/priv-app/Phonesky.apk /system/priv-app/Phonesky.bak
顯示應用:vendor/ThirdParty/App/dte/showPhonesky
內容:
#!/system/bin/sh #!/system/bin/busybox mount -o remount,rw /system; mv /system/priv-app/Phonesky.bak /system/priv-app/Phonesky.apk
5.拷貝腳本到system/bin目錄下: 參考以下格式添加到對應的mk文件:+#添加重命名GooglePlay腳本 +PRODUCT_COPY_FILES += + vendor/ThirdParty/App/dte/hidePhonesky:system/bin/hidePhonesky + vendor/ThirdParty/App/dte/showPhonesky:system/bin/showPhonesky + vendor/ThirdParty/App/dte/Phonesky.bak:system/priv-app/Phonesky.bak
一、對Canvas進行操作對Canvas的一系列操作,是指對Canvas進行旋轉、平移、縮放等操作。這些操作可以讓Canvas對象使用起來更加便捷。二、Canvas平移/
先看一下項目的結構 可以看出每個功能模塊包含 XXActivity,XXView (Interface),XXPresenter(interfac
// 表示事件是否攔截, 返回false表示不攔截 @Override public boolean onInterceptTouchEvent(Motion
當我們拿到一台Android的智能手機,從打開開關,到我們可以使用其中的app時,這個啟動過程到底是怎麼樣的? 系統上電 當給Android系統上電,CPU復位之後,