Skip to content

Commit c8a3e0d

Browse files
Yao ChenRoboErikG
authored andcommitted
Assign bindService() result to a boolean directly. One less if-else
Bug: 17637058 Change-Id: If2f4db2ebf95f1912a752794a1ab482cf30ab014
1 parent f8c4f9e commit c8a3e0d

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

media/java/android/media/browse/MediaBrowser.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ public void connect() {
143143

144144
boolean bound = false;
145145
try {
146-
if (mContext.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE)) {
147-
bound = true;
148-
}
146+
bound = mContext.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE);
149147
} catch (Exception ex) {
150148
Log.e(TAG, "Failed binding to service " + mServiceComponent);
151149
}

0 commit comments

Comments
 (0)