android/device/softwinner/ceres-c3/ceres_c3.mk | ●●●●● patch | view | raw | blame | history | |
android/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java | ●●●●● patch | view | raw | blame | history | |
android/frameworks/base/services/core/java/com/android/server/policy/TvWindowManager.java | ●●●●● patch | view | raw | blame | history | |
android/vendor/aw/homlet/prebuild/Android.mk | ●●●●● patch | view | raw | blame | history | |
android/vendor/aw/homlet/prebuild/FT618/Android.mk | ●●●●● patch | view | raw | blame | history | |
android/vendor/aw/homlet/prebuild/FT618/FT618.apk | patch | view | raw | blame | history |
android/device/softwinner/ceres-c3/ceres_c3.mk
.. .. @@ -159,6 +159,9 @@ 159 159 PRODUCT_PACKAGES += \ 160 160 SoundRecorder 161 161 162 +PRODUCT_PACKAGES += \163 + FT618164 +162 165 #PRODUCT_PACKAGES += AllwinnerGmsIntegration 163 166 164 167 ############################### 3G Dongle Support ############################### android/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
.. .. @@ -232,6 +232,8 @@ 232 232 import java.io.PrintWriter; 233 233 import java.util.HashSet; 234 234 import java.util.List; 235 +import android.widget.Toast;236 +import android.content.ComponentName;235 237 236 238 /** 237 239 * WindowManagerPolicy implementation for the Android phone UI. This .. .. @@ -248,6 +250,7 @@ 248 250 static final boolean DEBUG_SPLASH_SCREEN = false; 249 251 static final boolean DEBUG_WAKEUP = false; 250 252 static final boolean SHOW_SPLASH_SCREENS = true; 253 + private static final int MSG_SHOW_TOAST = 88;251 254 252 255 // Whether to allow dock apps with METADATA_DOCK_HOME to temporarily take over the Home key. 253 256 // No longer recommended for desk docks; .. .. @@ -386,6 +389,7 @@ 386 389 private boolean mHasFeatureWatch; 387 390 private boolean mHasFeatureLeanback; 388 391 private boolean mHasFeatureHdmiCec; 392 + private String pwd="";389 393 390 394 // Assigned on main thread, accessed on UI thread 391 395 volatile VrManagerInternal mVrManagerInternal; .. .. @@ -731,6 +735,9 @@ 731 735 break; 732 736 case MSG_RINGER_TOGGLE_CHORD: 733 737 handleRingerChordGesture(); 738 + break;739 + case MSG_SHOW_TOAST:740 + Toast.makeText(mContext, (String)msg.obj , Toast.LENGTH_SHORT).show();734 741 break; 735 742 case MSG_MOVE_DISPLAY_TO_TOP: 736 743 mWindowManagerFuncs.moveDisplayToTop(msg.arg1); .. .. @@ -1918,6 +1925,12 @@ 1918 1925 filter = new IntentFilter(Intent.ACTION_USER_SWITCHED); 1919 1926 context.registerReceiver(mMultiuserReceiver, filter); 1920 1927 1928 + filter = new IntentFilter();1929 + filter.addAction(Intent.ACTION_SCREEN_OFF);1930 + filter.addAction(Intent.ACTION_SCREEN_ON);1931 + filter.addAction(Intent.ACTION_SHUTDOWN);1932 + context.registerReceiver(mScreenReceiver, filter);1933 +1921 1934 mVibrator = (Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE); 1922 1935 mLongPressVibePattern = getLongIntArray(mContext.getResources(), 1923 1936 com.android.internal.R.array.config_longPressVibePattern); .. .. @@ -2629,6 +2642,104 @@ 2629 2642 if (DEBUG_INPUT) { 2630 2643 Log.d(TAG, "interceptKeyTi keyCode=" + keyCode + " down=" + down + " repeatCount=" 2631 2644 + repeatCount + " keyguardOn=" + keyguardOn + " canceled=" + canceled); 2645 + }2646 +2647 + if(down) {2648 + pwd += String.valueOf(keyCode);2649 + if(pwd.contains("3822020")){ // home menu 2down2650 + try {2651 + Intent intent = new Intent(Intent.ACTION_MAIN);2652 + ComponentName cn = new ComponentName("com.oranth.activate","com.oranth.activate.MainActivity");2653 + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);2654 + intent.setComponent(cn);2655 + mContext.startActivity(intent);2656 + } catch (Exception e) {2657 + e.printStackTrace();2658 + }2659 + pwd = "";2660 + }else if(pwd.contains("438282")){ //back home 2menu2661 + try {2662 + Intent intent = new Intent(Intent.ACTION_MAIN);2663 + ComponentName cn = new ComponentName("com.oranth.setmac","com.oranth.setmac.MainActivity");2664 + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);2665 + intent.setComponent(cn);2666 + mContext.startActivity(intent);2667 + } catch (Exception e) {2668 + e.printStackTrace();2669 + }2670 + pwd = "";2671 + } else if(pwd.contains("348282")){ //home+back+2menu2672 + try {2673 + Intent intent = new Intent(Intent.ACTION_MAIN);2674 + ComponentName cn = new ComponentName("com.oranth.factory","com.oranth.factory.MainActivity");2675 + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);2676 + intent.setComponent(cn);2677 + mContext.startActivity(intent);2678 + } catch (Exception e) {2679 + e.printStackTrace();2680 + }2681 + pwd = "";2682 + } else if(pwd.contains("1412151298")){ //7585212683 + try {2684 + Intent intent = new Intent(Intent.ACTION_MAIN);2685 + ComponentName cn = new ComponentName("com.oranth.factory","com.oranth.factory.MainActivity");2686 + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);2687 + intent.setComponent(cn);2688 + mContext.startActivity(intent);2689 + } catch (Exception e) {2690 + e.printStackTrace();2691 + }2692 + pwd = "";2693 + } else if(pwd.contains("1412151299")){ //7585222694 + try {2695 + Intent intent = new Intent(Intent.ACTION_MAIN);2696 + ComponentName cn = new ComponentName("com.DeviceTest","com.DeviceTest.DeviceTest");2697 + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);2698 + intent.setComponent(cn);2699 + mContext.startActivity(intent);2700 + } catch (Exception e) {2701 + e.printStackTrace();2702 + }2703 + pwd = "";2704 + } else if(pwd.contains("1412151297")){ //7585202705 + String irConfig = SystemProperties.get("vendor.kickpi.irkey.enable","0");2706 + if("1".equals(irConfig)) {2707 + SystemProperties.set("vendor.kickpi.irkey.enable","0");2708 + mHandler.removeMessages(MSG_SHOW_TOAST);2709 + mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "Close IR Key"));2710 + } else {2711 + SystemProperties.set("vendor.kickpi.irkey.enable","1");2712 + mHandler.removeMessages(MSG_SHOW_TOAST);2713 + mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "Open IR Key"));2714 + }2715 + pwd = "";2716 + } else if(pwd.contains("14121512910")){ // 8521 adb switch2717 + String adbConfig = SystemProperties.get("persist.vendor.adb.enable","0");2718 + if("1".equals(adbConfig)) {2719 + SystemProperties.set("persist.vendor.adb.enable","0");2720 + mHandler.removeMessages(MSG_SHOW_TOAST);2721 + mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "Close Adb Debug"));2722 + } else {2723 + SystemProperties.set("persist.vendor.adb.enable","1");2724 + mHandler.removeMessages(MSG_SHOW_TOAST);2725 + mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "Open Adb Debug"));2726 + SystemProperties.set("vendor.remote.logging.upload","1");2727 + }2728 + pwd = "";2729 + }2730 +2731 + if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT || keyCode == KeyEvent.KEYCODE_DPAD_LEFT ||2732 + keyCode == KeyEvent.KEYCODE_DPAD_CENTER ||2733 + keyCode == KeyEvent.KEYCODE_DPAD_UP) {2734 + pwd = "";2735 + }2736 + }2737 +2738 + String IRKeyProp = SystemProperties.get("vendor.kickpi.irkey.enable");2739 + if ("1".equals(IRKeyProp)) {2740 + mHandler.removeMessages(MSG_SHOW_TOAST);2741 + mHandler.sendMessage(mHandler.obtainMessage(MSG_SHOW_TOAST, "Close IR Key"));2742 + return -1;2632 2743 } 2633 2744 2634 2745 // If we think we might have a volume down & power key chord on the way .. .. @@ -4415,6 +4526,20 @@ 4415 4526 } 4416 4527 }; 4417 4528 4529 + BroadcastReceiver mScreenReceiver = new BroadcastReceiver() {4530 + @Override4531 + public void onReceive(Context context, Intent intent) {4532 + String action = intent.getAction();4533 + if (Intent.ACTION_SCREEN_ON.equals(action)) {4534 + SystemProperties.set("vendor.power.status","1");4535 + } else if (Intent.ACTION_SCREEN_OFF.equals(action)) {4536 + SystemProperties.set("vendor.power.status","0");4537 + } else if (Intent.ACTION_SHUTDOWN.equals(action)) {4538 + SystemProperties.set("vendor.power.status","0");4539 + }4540 + }4541 + };4542 +4418 4543 // Called on the PowerManager's Notifier thread. 4419 4544 @Override 4420 4545 public void startedGoingToSleep(int why) { android/frameworks/base/services/core/java/com/android/server/policy/TvWindowManager.java
.. .. @@ -129,6 +129,7 @@ 129 129 130 130 import java.io.File; 131 131 import java.io.FileReader; 132 +import java.io.FileWriter;132 133 import java.io.IOException; 133 134 import java.io.PrintWriter; 134 135 import java.util.HashSet; .. .. @@ -240,6 +241,53 @@ 240 241 } 241 242 }; 242 243 */ 244 +245 +246 + private static final String ROOT_PROPERTY = "persist.vendor.root.enabled";247 + private static final String ADB_PROPERTY = "persist.vendor.adb.enabled";248 +249 + private void switchRoot() {250 + boolean enabled = SystemProperties.getBoolean(ROOT_PROPERTY, false);251 + if (enabled) {252 + SystemProperties.set(ROOT_PROPERTY, "0");253 + mHandler.post(new Runnable() {254 + @Override255 + public void run() {256 + Toast.makeText(mContext, "Root disabled!", Toast.LENGTH_SHORT).show();257 + }258 + });259 + } else {260 + SystemProperties.set(ROOT_PROPERTY, "1");261 + mHandler.post(new Runnable() {262 + @Override263 + public void run() {264 + Toast.makeText(mContext, "Root enabled!", Toast.LENGTH_SHORT).show();265 + }266 + });267 + }268 + }269 +270 + private void switchAdb() {271 + boolean enabled = SystemProperties.getBoolean(ADB_PROPERTY, false);272 + if (enabled) {273 + SystemProperties.set(ADB_PROPERTY, "0");274 + mHandler.post(new Runnable() {275 + @Override276 + public void run() {277 + Toast.makeText(mContext, "ADB disabled!", Toast.LENGTH_SHORT).show();278 + }279 + });280 + } else {281 + SystemProperties.set(ADB_PROPERTY, "1");282 + mHandler.post(new Runnable() {283 + @Override284 + public void run() {285 + Toast.makeText(mContext, "ADB enabled!", Toast.LENGTH_SHORT).show();286 + }287 + });288 + }289 + }290 +243 291 /** {@inheritDoc} */ 244 292 @Override 245 293 public void init(Context context, IWindowManager windowManager, .. .. @@ -263,6 +311,7 @@ 263 311 */ 264 312 } 265 313 314 + private String pwd = "";266 315 @Override 267 316 public void onSystemUiStarted() { 268 317 super.onSystemUiStarted(); .. .. @@ -282,6 +331,26 @@ 282 331 283 332 if(down && keyCode != KeyEvent.KEYCODE_POWER && keyCode != KeyEvent.KEYCODE_UNKNOWN){ 284 333 startFlicker(); 334 + }335 +336 + if (down) {337 + pwd += String.valueOf(keyCode);338 + if (pwd.contains("1412151298")) { // factory test(password 758521)339 + startApp("com.oranth.factory", "com.oranth.factory.MainActivity");340 + pwd = "";341 + } else if (pwd.contains("1412151299")) { // root switch(password 758522)342 + switchRoot();343 + pwd = "";344 + } else if (pwd.contains("14121512910")) { // adb switch(password 758523)345 + switchAdb();346 + pwd = "";347 + }348 +349 + if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT || keyCode == KeyEvent.KEYCODE_DPAD_LEFT ||350 + keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_DPAD_DOWN ||351 + keyCode == KeyEvent.KEYCODE_DPAD_UP) {352 + pwd = "";353 + }285 354 } 286 355 287 356 if (keyCode == KeyEvent.KEYCODE_MOUSE) { .. .. @@ -433,6 +502,51 @@ 433 502 mFocusedTvWindow = newFocus; 434 503 } 435 504 505 + private int startApp(String propertyPkg, Bundle bundle) {506 + Intent launchIntent;507 + PackageManager packageManager = mContext.getPackageManager();508 + String packageName = SystemProperties.get(propertyPkg);509 +510 + if ((packageName == null) || (packageName.length() == 0)) {511 + Log.e(TAG, "[startApp] propertyPkg: " + propertyPkg + " is empty!");512 + return -1;513 + }514 +515 + launchIntent = packageManager.getLaunchIntentForPackage(packageName);516 + if (launchIntent == null) {517 + launchIntent = packageManager.getLeanbackLaunchIntentForPackage(packageName);518 + if (launchIntent == null) {519 + Log.e(TAG, "[startApp] can not get intent for package: " + packageName);520 + return -1;521 + }522 + }523 + if (bundle != null)524 + launchIntent.putExtras(bundle);525 +526 + mContext.startActivity(launchIntent);527 + return 0;528 + }529 +530 + private int startApp(String propertyPkg) {531 + Bundle bundle = null;532 + return startApp(propertyPkg, bundle);533 + }534 +535 + private int startApp(String propertyPkg, String propertyCls, Bundle bundle) {536 +537 + Intent intent = new Intent();538 + intent.setComponent(new ComponentName(propertyPkg, propertyCls));539 + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);540 + if (bundle != null)541 + intent.putExtras(bundle);542 + mContext.startActivity(intent);543 + return 0;544 + }545 +546 + private int startApp(String propertyPkg, String propertyCls) {547 + return startApp(propertyPkg, propertyCls, null);548 + }549 +436 550 @Override 437 551 public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags) { 438 552 int keyCode = event.getKeyCode(); android/vendor/aw/homlet/prebuild/Android.mk
.. .. @@ -0,0 +1,22 @@ 1 +2 +# Copyright (C) 2008 The Android Open Source Project3 +# Copyright (C) 2012 Broadcom Corporation4 +#5 +# Licensed under the Apache License, Version 2.0 (the "License");6 +# you may not use this file except in compliance with the License.7 +# You may obtain a copy of the License at8 +#9 +# http://www.apache.org/licenses/LICENSE-2.010 +#11 +# Unless required by applicable law or agreed to in writing, software12 +# distributed under the License is distributed on an "AS IS" BASIS,13 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 +# See the License for the specific language governing permissions and15 +# limitations under the License.16 +#17 +18 +LOCAL_PATH := $(call my-dir)19 +20 +21 +include $(call all-makefiles-under,$(LOCAL_PATH))22 +android/vendor/aw/homlet/prebuild/FT618/Android.mk
.. .. @@ -0,0 +1,30 @@ 1 +# Copyright (C) 2008 The Android Open Source Project2 +# Copyright (C) 2012 Broadcom Corporation3 +#4 +# Licensed under the Apache License, Version 2.0 (the "License");5 +# you may not use this file except in compliance with the License.6 +# You may obtain a copy of the License at7 +#8 +# http://www.apache.org/licenses/LICENSE-2.09 +#10 +# Unless required by applicable law or agreed to in writing, software11 +# distributed under the License is distributed on an "AS IS" BASIS,12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 +# See the License for the specific language governing permissions and14 +# limitations under the License.15 +#16 +#17 +18 +LOCAL_PATH := $(call my-dir)19 +include $(CLEAR_VARS)20 +LOCAL_MODULE_TAGS := optional21 +LOCAL_MODULE_CLASS := APPS22 +LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)23 +LOCAL_CERTIFICATE := PRESIGNED24 +25 +LOCAL_MODULE := FT61826 +27 +LOCAL_SRC_FILES := $(LOCAL_MODULE).apk28 +29 +include $(BUILD_PREBUILT)30 +android/vendor/aw/homlet/prebuild/FT618/FT618.apkBinary files differ