Merge "Cleaning checklyst issues." into rvc-dev
diff --git a/car-lib/src/android/car/content/pm/CarPackageManager.java b/car-lib/src/android/car/content/pm/CarPackageManager.java
index 5d5936b..98c5822 100644
--- a/car-lib/src/android/car/content/pm/CarPackageManager.java
+++ b/car-lib/src/android/car/content/pm/CarPackageManager.java
@@ -108,8 +108,8 @@
@SystemApi
public void setAppBlockingPolicy(
String packageName, CarAppBlockingPolicy policy, @SetPolicyFlags int flags) {
- if ((flags & FLAG_SET_POLICY_WAIT_FOR_CHANGE) != 0 &&
- Looper.getMainLooper().isCurrentThread()) {
+ if ((flags & FLAG_SET_POLICY_WAIT_FOR_CHANGE) != 0
+ && Looper.getMainLooper().isCurrentThread()) {
throw new IllegalStateException(
"FLAG_SET_POLICY_WAIT_FOR_CHANGE cannot be used in main thread");
}
diff --git a/car-lib/src/android/car/diagnostic/CarDiagnosticManager.java b/car-lib/src/android/car/diagnostic/CarDiagnosticManager.java
index 8c2f8e3..9799707 100644
--- a/car-lib/src/android/car/diagnostic/CarDiagnosticManager.java
+++ b/car-lib/src/android/car/diagnostic/CarDiagnosticManager.java
@@ -54,7 +54,7 @@
public @interface FrameType {}
/** @hide */
- public static final @FrameType int FRAME_TYPES[] = {
+ public static final @FrameType int[] FRAME_TYPES = {
FRAME_TYPE_LIVE,
FRAME_TYPE_FREEZE
};
@@ -95,7 +95,7 @@
@Override
public void onCarDisconnected() {
- synchronized(mActiveListeners) {
+ synchronized (mActiveListeners) {
mActiveListeners.clear();
}
}
@@ -107,7 +107,7 @@
*
* @param carDiagnosticEvent
*/
- void onDiagnosticEvent(final CarDiagnosticEvent carDiagnosticEvent);
+ void onDiagnosticEvent(CarDiagnosticEvent carDiagnosticEvent);
}
// OnDiagnosticEventListener registration
@@ -134,7 +134,7 @@
public boolean registerListener(
OnDiagnosticEventListener listener, @FrameType int frameType, int rate) {
assertFrameType(frameType);
- synchronized(mActiveListeners) {
+ synchronized (mActiveListeners) {
boolean needsServerUpdate = false;
CarDiagnosticListeners listeners = mActiveListeners.get(frameType);
if (listeners == null) {
@@ -159,8 +159,8 @@
* @param listener
*/
public void unregisterListener(OnDiagnosticEventListener listener) {
- synchronized(mActiveListeners) {
- for(@FrameType int frameType : FRAME_TYPES) {
+ synchronized (mActiveListeners) {
+ for (@FrameType int frameType : FRAME_TYPES) {
doUnregisterListenerLocked(listener, frameType);
}
}
@@ -177,7 +177,7 @@
if (listeners.isEmpty()) {
try {
mService.unregisterDiagnosticListener(frameType,
- mListenerToService);
+ mListenerToService);
} catch (RemoteException e) {
handleRemoteExceptionFromCarService(e);
// continue for local clean-up
@@ -340,12 +340,12 @@
extends Stub {
private final WeakReference<CarDiagnosticManager> mManager;
- public CarDiagnosticEventListenerToService(CarDiagnosticManager manager) {
+ CarDiagnosticEventListenerToService(CarDiagnosticManager manager) {
mManager = new WeakReference<>(manager);
}
private void handleOnDiagnosticEvents(CarDiagnosticManager manager,
- List<CarDiagnosticEvent> events) {
+ List<CarDiagnosticEvent> events) {
manager.mHandlerCallback.sendEvents(events);
}
@@ -372,8 +372,8 @@
}
mLastUpdateTime = updateTime;
final boolean hasVendorExtensionPermission = mVendorExtensionPermission.checkGranted();
- final CarDiagnosticEvent eventToDispatch = hasVendorExtensionPermission ?
- event :
+ final CarDiagnosticEvent eventToDispatch = hasVendorExtensionPermission
+ ? event :
event.withVendorSensorsRemoved();
List<OnDiagnosticEventListener> listeners;
synchronized (mActiveListeners) {
diff --git a/car-lib/src/android/car/hardware/property/CarPropertyEvent.java b/car-lib/src/android/car/hardware/property/CarPropertyEvent.java
index c423c2f..4d5498d 100644
--- a/car-lib/src/android/car/hardware/property/CarPropertyEvent.java
+++ b/car-lib/src/android/car/hardware/property/CarPropertyEvent.java
@@ -42,12 +42,16 @@
/**
* @return EventType field
*/
- public int getEventType() { return mEventType; }
+ public int getEventType() {
+ return mEventType;
+ }
/**
* Returns {@link CarPropertyValue} associated with this event.
*/
- public CarPropertyValue<?> getCarPropertyValue() { return mCarPropertyValue; }
+ public CarPropertyValue<?> getCarPropertyValue() {
+ return mCarPropertyValue;
+ }
@Override
public int describeContents() {
@@ -61,16 +65,19 @@
dest.writeParcelable(mCarPropertyValue, flags);
}
- public static final Parcelable.Creator<CarPropertyEvent> CREATOR
- = new Parcelable.Creator<CarPropertyEvent>() {
+ public static final Parcelable.Creator<CarPropertyEvent> CREATOR =
+ new Parcelable.Creator<CarPropertyEvent>() {
+
+ @Override
public CarPropertyEvent createFromParcel(Parcel in) {
return new CarPropertyEvent(in);
}
+ @Override
public CarPropertyEvent[] newArray(int size) {
return new CarPropertyEvent[size];
}
- };
+ };
/**
* Constructor for {@link CarPropertyEvent}.
diff --git a/car-lib/src/android/car/settings/CarSettings.java b/car-lib/src/android/car/settings/CarSettings.java
index e9af8eb..ef78ff6 100644
--- a/car-lib/src/android/car/settings/CarSettings.java
+++ b/car-lib/src/android/car/settings/CarSettings.java
@@ -1,17 +1,17 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package android.car.settings;