summaryrefslogtreecommitdiffstats
path: root/pxp-monitor
diff options
context:
space:
mode:
authorSubramanian Srinivasan <subrsrin@codeaurora.org>2013-12-16 15:25:39 -0800
committerSubramanian Srinivasan <subrsrin@codeaurora.org>2013-12-17 12:27:20 -0800
commit64fedaaad19ac627d0de8a1697d7cba48f0579f7 (patch)
treef264d7bdec18cb19c08ec72fa5ed9343a913cde4 /pxp-monitor
parent9a41f62ea7933ad2ed1e663ef731780741aa39c8 (diff)
downloadandroid_packages_apps_BluetoothExt-64fedaaad19ac627d0de8a1697d7cba48f0579f7.tar.gz
android_packages_apps_BluetoothExt-64fedaaad19ac627d0de8a1697d7cba48f0579f7.tar.bz2
android_packages_apps_BluetoothExt-64fedaaad19ac627d0de8a1697d7cba48f0579f7.zip
Supports Proximity profile using Low Power PXP APIs
Provides support for proximity profile implementation using Low Power Proximity APIs. Change-Id: Ibc80e498bb20c221333c161db7b8b08a24c28acb CRs-fixed: 590419
Diffstat (limited to 'pxp-monitor')
-rw-r--r--pxp-monitor/AndroidManifest.xml2
-rw-r--r--pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/PathLossFragment.java102
2 files changed, 49 insertions, 55 deletions
diff --git a/pxp-monitor/AndroidManifest.xml b/pxp-monitor/AndroidManifest.xml
index c984c0a..244abe6 100644
--- a/pxp-monitor/AndroidManifest.xml
+++ b/pxp-monitor/AndroidManifest.xml
@@ -60,7 +60,7 @@
</activity>
<activity android:name=".DeviceActivity" />
<activity android:name=".ScanDevicesActivity" />
- <activity android:name=".PariedDevicesActivity" />
+ <activity android:name=".PairedDevicesActivity" />
<activity android:name=".ConnectedDevicesActivity" />
<activity android:name=".AlertsHistory" />
diff --git a/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/PathLossFragment.java b/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/PathLossFragment.java
index dc2f7ba..aaafd5f 100644
--- a/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/PathLossFragment.java
+++ b/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/PathLossFragment.java
@@ -86,44 +86,41 @@ public class PathLossFragment extends Fragment implements View.OnClickListener {
CharSequence text = null;
- if (actionId == EditorInfo.IME_ACTION_DONE) {
- int threshold = Integer.parseInt(mMinValue.getText().toString());
+ int threshold = Integer.parseInt(mMinValue.getText().toString());
- if (threshold > THRESHOLD_MAX) {
+ if (threshold > THRESHOLD_MAX) {
- text = "Threshold is to big. Changing to "
- + Integer.toString(THRESHOLD_MAX);
+ text = "Threshold is too big. Changing to "
+ + Integer.toString(THRESHOLD_MAX);
- threshold = THRESHOLD_MAX;
- mMinValue.setText(String.valueOf(threshold));
+ threshold = THRESHOLD_MAX;
+ mMinValue.setText(String.valueOf(threshold));
- } else if (threshold < THRESHOLD_MIN) {
+ } else if (threshold < THRESHOLD_MIN) {
- text = "Threshold is to small. Changing to "
- + Integer.toString(THRESHOLD_MIN);
+ text = "Threshold is too small. Changing to "
+ + Integer.toString(THRESHOLD_MIN);
- threshold = THRESHOLD_MIN;
- mMinValue.setText(String.valueOf(threshold));
- }
+ threshold = THRESHOLD_MIN;
+ mMinValue.setText(String.valueOf(threshold));
+ }
- if (text != null) {
- Context context = getActivity();
+ if (text != null) {
+ Context context = getActivity();
- Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
- toast.setGravity(Gravity.CENTER, 0, 0);
- toast.show();
- }
+ Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
+ toast.setGravity(Gravity.CENTER, 0, 0);
+ toast.show();
+ }
- mActivity.mPxpServiceProxy.setMinPathLossThreshold(mActivity.mLeDevice,
- threshold);
+ mActivity.mPxpServiceProxy.setMinPathLossThreshold(mActivity.mLeDevice,
+ threshold);
- final InputMethodManager imm = (InputMethodManager) getActivity()
- .getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.hideSoftInputFromWindow(getView().getWindowToken(), 0);
+ final InputMethodManager imm = (InputMethodManager) getActivity()
+ .getSystemService(Context.INPUT_METHOD_SERVICE);
+ imm.hideSoftInputFromWindow(getView().getWindowToken(), 0);
- return true;
- }
- return false;
+ return true;
}
});
@@ -133,44 +130,41 @@ public class PathLossFragment extends Fragment implements View.OnClickListener {
CharSequence text = null;
- if (actionId == EditorInfo.IME_ACTION_DONE) {
- int threshold = Integer.parseInt(mMaxValue.getText().toString());
+ int threshold = Integer.parseInt(mMaxValue.getText().toString());
- if (threshold > THRESHOLD_MAX) {
+ if (threshold > THRESHOLD_MAX) {
- text = "Threshold is to big. Changing to "
- + Integer.toString(THRESHOLD_MAX);
+ text = "Threshold is too big. Changing to "
+ + Integer.toString(THRESHOLD_MAX);
- threshold = THRESHOLD_MAX;
- mMaxValue.setText(String.valueOf(threshold));
+ threshold = THRESHOLD_MAX;
+ mMaxValue.setText(String.valueOf(threshold));
- } else if (threshold < THRESHOLD_MIN) {
+ } else if (threshold < THRESHOLD_MIN) {
- text = "Threshold is to small. Changing to "
- + Integer.toString(THRESHOLD_MIN);
+ text = "Threshold is too small. Changing to "
+ + Integer.toString(THRESHOLD_MIN);
- threshold = THRESHOLD_MIN;
- mMaxValue.setText(String.valueOf(threshold));
- }
+ threshold = THRESHOLD_MIN;
+ mMaxValue.setText(String.valueOf(threshold));
+ }
- if (text != null) {
- Context context = getActivity();
+ if (text != null) {
+ Context context = getActivity();
- Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
- toast.setGravity(Gravity.CENTER, 0, 0);
- toast.show();
- }
+ Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
+ toast.setGravity(Gravity.CENTER, 0, 0);
+ toast.show();
+ }
- mActivity.mPxpServiceProxy.setMaxPathLossThreshold(mActivity.mLeDevice,
- threshold);
+ mActivity.mPxpServiceProxy.setMaxPathLossThreshold(mActivity.mLeDevice,
+ threshold);
- final InputMethodManager imm = (InputMethodManager) getActivity()
- .getSystemService(Context.INPUT_METHOD_SERVICE);
- imm.hideSoftInputFromWindow(getView().getWindowToken(), 0);
+ final InputMethodManager imm = (InputMethodManager) getActivity()
+ .getSystemService(Context.INPUT_METHOD_SERVICE);
+ imm.hideSoftInputFromWindow(getView().getWindowToken(), 0);
- return true;
- }
- return false;
+ return true;
}
});