• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

修订版99685b3b393ad8980ebb18867f27dae4e5974e1e (tree)
时间2009-11-11 18:16:55
作者Swan_Wang <swandle@gmai...>
CommiterChih-Wei Huang

Log Message

Add a tip dialog for the Home/Menu/Back touch features.

更改概述

差异

--- a/services/java/com/android/server/status/TouchFeature.java
+++ b/services/java/com/android/server/status/TouchFeature.java
@@ -18,6 +18,9 @@ package com.android.server.status;
1818
1919 import android.app.StatusBarManager;
2020 import android.content.Context;
21+import android.content.BroadcastReceiver;
22+import android.content.IntentFilter;
23+import android.content.Intent;
2124 import android.os.Binder;
2225 import android.os.Handler;
2326 import android.os.IBinder;
@@ -43,11 +46,28 @@ public class TouchFeature {
4346 private Context mContext;
4447 private StatusBarService mService;
4548 private final Display mDisplay;
49+ private BootReceiver mBootReceiver;
50+ private IntentFilter mIntentFilter;
51+
52+ private class BootReceiver extends BroadcastReceiver {
53+ @Override
54+ public void onReceive(Context context, Intent intent) {
55+ if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
56+ Toast.makeText(context,
57+ "Click the right corner of the status bar to enable or disable\nHome/Menu/Back touch features",
58+ Toast.LENGTH_LONG).show();
59+ return;
60+ }
61+ }
62+ }
4663
4764 protected TouchFeature(Context context){
4865 mContext = context;
4966 mToken = new Binder();
5067 mHandler = new Handler();
68+ mIntentFilter = new IntentFilter(Intent.ACTION_BOOT_COMPLETED);
69+ mBootReceiver = new BootReceiver();
70+ mContext.registerReceiver(mBootReceiver, mIntentFilter);
5171 mDisplay = ((WindowManager)context.getSystemService(
5272 Context.WINDOW_SERVICE)).getDefaultDisplay();
5373 mScreenWidth = mDisplay.getWidth();
@@ -55,9 +75,9 @@ public class TouchFeature {
5575
5676 // ================================================================================
5777 // Add to do key "menu" "home" "back" function
58- // Touch the right corner of the screen on the statusBar to enable/disable the function
59- // Menu: Click/Touch the statusBar
60- // Home: Touch the statusBar from left to right
78+ // Touch the right corner of the statusBar to enable/disable the function
79+ // Home: Click/Touch the statusBar
80+ // Menu: Touch the statusBar from left to right
6181 // Back: Touch the statusBar from right to left
6282 // ================================================================================
6383 protected void adjust(StatusBarService service, MotionEvent event){