summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Wagantall <mwagantall@cyngn.com>2016-02-02 11:18:37 -0800
committerMatt Wagantall <mwagantall@cyngn.com>2016-02-02 11:42:20 -0800
commitbb99ef5a41324d75eb43464c7716ccd10e70bd02 (patch)
tree6bf58c65e72623eec997b863a6010c74b51e96ae
parenta949d95a82b87ff05e44f19a503e71cb8ef421f6 (diff)
downloadandroid_hardware_lineage_lineagehw-bb99ef5a41324d75eb43464c7716ccd10e70bd02.tar.gz
android_hardware_lineage_lineagehw-bb99ef5a41324d75eb43464c7716ccd10e70bd02.tar.bz2
android_hardware_lineage_lineagehw-bb99ef5a41324d75eb43464c7716ccd10e70bd02.zip
hardware: Add UniqueDeviceId support
It's sometimes useful to know what physical device you're using. CMHW SerialNumber and an "ro.serialno" property already exists, but are not guaranteed to be unique. Different OEM may use overlapping numbering schemes, and sometimes placeholder like "012345ABCDE" are used. Attempt to work around these shortcomings by defining a new UniqueDeviceId class that provides a globally unique device ID that is both deterministic for a given device and designed not to overlap with IDs of any other devices. Change-Id: I55abe9232799f2c8088954118807565ed725d43a
-rw-r--r--src/org/cyanogenmod/hardware/UniqueDeviceId.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/org/cyanogenmod/hardware/UniqueDeviceId.java b/src/org/cyanogenmod/hardware/UniqueDeviceId.java
new file mode 100644
index 0000000..bff5ea6
--- /dev/null
+++ b/src/org/cyanogenmod/hardware/UniqueDeviceId.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2016 The CyanogenMod 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
+ *
+ * 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.
+ */
+
+package org.cyanogenmod.hardware;
+
+/**
+ * Generate a unique but deterministic ID for this hardware, based on unchangeable
+ * hardware serial numbers.
+ */
+public class UniqueDeviceId {
+
+ /**
+ * Whether device supports reporting a unique device id.
+ *
+ * @return boolean Supported devices must return always true
+ */
+ public static boolean isSupported() { return false; }
+
+ /**
+ * This method retreives a unique ID for the device.
+ *
+ * @return String The unique device ID
+ */
+ public static String getUniqueDeviceId() { return null; }
+}