Skip to content

Commit 0cc7d4a

Browse files
committed
1.8.1 SDK. No longer allowed to set customer whitelist usernames.
1 parent 987545d commit 0cc7d4a

File tree

11 files changed

+12
-25
lines changed

11 files changed

+12
-25
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Android/Java SDK Changelog
22

3+
## 1.8.1beta (2015-07-23)
4+
Changes
5+
- Removed ability to create your own whitelist username (as will be removed in the bridge in the future).</br></br>
6+
<b>Important!!</b>&nbsp;If you are using the QuickStart app as your base code and updating the Java SDK, please check out the small
7+
but important changes (to setting the username) in PHHomeActivity.java , HueSharedPreferences.java and PHPushlinkActivity.java
8+
39
## 1.8beta (2015-06-30)
410
Changes
5-
- Delete devices added(sensors and lights)
11+
- Delete devices added (sensors and lights)
612
- New Clip Increment Feature (new increment* attributes in PHLightState)
713
- New bridge fields added (e.g .ModelId, Type in PHGroup, Manufacturername, UniqueId in PHLight, Bridge Id)
814
- New light Models added for Color Conversions (e.g .HueGo).

JavaDesktopApp/libs/huelocalsdk.jar

-358 Bytes
Binary file not shown.
95 Bytes
Binary file not shown.

JavaDesktopApp/src/com/philips/lighting/Controller.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,21 @@ public void onAuthenticationRequired(PHAccessPoint accessPoint) {
7070
}
7171

7272
@Override
73-
public void onBridgeConnected(PHBridge bridge) {
73+
public void onBridgeConnected(PHBridge bridge, String username) {
7474
phHueSDK.setSelectedBridge(bridge);
7575
phHueSDK.enableHeartbeat(bridge, PHHueSDK.HB_INTERVAL);
7676
desktopView.getFindingBridgeProgressBar().setVisible(false);
77-
String username = HueProperties.getUsername();
7877
String lastIpAddress = bridge.getResourceCache().getBridgeConfiguration().getIpAddress();
79-
System.out.println("On connected: IP " + lastIpAddress);
8078
HueProperties.storeUsername(username);
8179
HueProperties.storeLastIPAddress(lastIpAddress);
8280
HueProperties.saveProperties();
83-
8481
// Update the GUI.
8582
desktopView.getLastConnectedIP().setText(lastIpAddress);
8683
desktopView.getLastUserName().setText(username);
87-
8884
// Close the PushLink dialog (if it is showing).
8985
if (pushLinkDialog!=null && pushLinkDialog.isShowing()) {
9086
pushLinkDialog.setVisible(false);
9187
}
92-
9388
// Enable the Buttons/Controls to change the hue bulbs.s
9489
desktopView.getRandomLightsButton().setEnabled(true);
9590
desktopView.getSetLightsButton().setEnabled(true);

JavaDesktopApp/src/com/philips/lighting/data/HueProperties.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ public static void storeUsername(String username) {
4545
* Returns the stored Whitelist username. If it doesn't exist we generate a 16 character random string and store this in the properties file.
4646
*/
4747
public static String getUsername() {
48-
String username = props.getProperty(USER_NAME);
49-
50-
if (username==null || username.equals("")) { // If we don't have a username then we generate a unique 16 character one.
51-
username = PHBridgeInternal.generateUniqueKey();
52-
storeUsername(username);
53-
}
48+
String username = props.getProperty(USER_NAME);
5449
return username;
5550
}
5651

JavaDesktopApp/src/com/philips/lighting/gui/AccessPointList.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,8 @@ public AccessPointList(final List<PHAccessPoint> accessPointsList, final Control
5353
public void mouseClicked(MouseEvent e) {
5454
int mouseClickedIndex = listbox.getSelectedIndex();
5555

56-
String username = HueProperties.getUsername();
57-
HueProperties.storeUsername(username);
5856
controller.showProgressBar();
5957
PHHueSDK phHueSDK = PHHueSDK.getInstance();
60-
accessPointsList.get(mouseClickedIndex).setUsername(username);
6158
phHueSDK.connect(accessPointsList.get(mouseClickedIndex));
6259
setVisible(false);
6360
}

QuickStartApp/libs/huelocalsdk.jar

-358 Bytes
Binary file not shown.
95 Bytes
Binary file not shown.

QuickStartApp/src/com/philips/lighting/data/HueSharedPreferences.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ private HueSharedPreferences(Context appContext) {
3535

3636
public String getUsername() {
3737
String username = mSharedPreferences.getString(LAST_CONNECTED_USERNAME, "");
38-
if (username==null || username.equals("")) {
39-
username = PHBridgeInternal.generateUniqueKey();
40-
setUsername(username); // Persist the username in the shared prefs
41-
}
4238
return username;
4339
}
4440

QuickStartApp/src/com/philips/lighting/quickstart/PHHomeActivity.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ public void onCacheUpdated(List<Integer> arg0, PHBridge bridge) {
128128
}
129129

130130
@Override
131-
public void onBridgeConnected(PHBridge b) {
131+
public void onBridgeConnected(PHBridge b, String username) {
132132
phHueSDK.setSelectedBridge(b);
133133
phHueSDK.enableHeartbeat(b, PHHueSDK.HB_INTERVAL);
134134
phHueSDK.getLastHeartbeat().put(b.getResourceCache().getBridgeConfiguration() .getIpAddress(), System.currentTimeMillis());
135135
prefs.setLastConnectedIPAddress(b.getResourceCache().getBridgeConfiguration().getIpAddress());
136-
prefs.setUsername(prefs.getUsername());
136+
prefs.setUsername(username);
137137
PHWizardAlertDialog.getInstance().closeProgressDialog();
138138
startMainActivity();
139139
}
@@ -250,9 +250,7 @@ public void onDestroy() {
250250
@Override
251251
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
252252

253-
HueSharedPreferences prefs = HueSharedPreferences.getInstance(getApplicationContext());
254253
PHAccessPoint accessPoint = (PHAccessPoint) adapter.getItem(position);
255-
accessPoint.setUsername(prefs.getUsername());
256254

257255
PHBridge connectedBridge = phHueSDK.getSelectedBridge();
258256

0 commit comments

Comments
 (0)