Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
IOTClient
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lola
IOTClient
Commits
f6b9b6b9
Commit
f6b9b6b9
authored
Apr 29, 2019
by
DESKTOP-NFGF3PG\zxa01
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update file structure
parent
48d59d25
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1965 additions
and
0 deletions
+1965
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/auth/GatewayAuthResponse.java
...zxa01/iotclient/common/pojo/auth/GatewayAuthResponse.java
+59
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/auth/User.java
...va/com/example/zxa01/iotclient/common/pojo/auth/User.java
+96
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/device/Device.java
...om/example/zxa01/iotclient/common/pojo/device/Device.java
+206
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/device/Icon.java
.../com/example/zxa01/iotclient/common/pojo/device/Icon.java
+69
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/device/Manufacturer.java
...mple/zxa01/iotclient/common/pojo/device/Manufacturer.java
+123
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/device/Model.java
...com/example/zxa01/iotclient/common/pojo/device/Model.java
+123
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/PrivacyChoice.java
...le/zxa01/iotclient/common/pojo/privacy/PrivacyChoice.java
+54
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/PrivacyContent.java
...e/zxa01/iotclient/common/pojo/privacy/PrivacyContent.java
+68
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/PrivacyPolicy.java
...le/zxa01/iotclient/common/pojo/privacy/PrivacyPolicy.java
+159
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/PrivacyPolicyReport.java
...01/iotclient/common/pojo/privacy/PrivacyPolicyReport.java
+75
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Access.java
...ample/zxa01/iotclient/common/pojo/privacy/p3p/Access.java
+33
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Collector.java
...le/zxa01/iotclient/common/pojo/privacy/p3p/Collector.java
+106
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Datum.java
...xample/zxa01/iotclient/common/pojo/privacy/p3p/Datum.java
+100
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Dispute.java
...mple/zxa01/iotclient/common/pojo/privacy/p3p/Dispute.java
+96
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Purpose.java
...mple/zxa01/iotclient/common/pojo/privacy/p3p/Purpose.java
+98
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Recipient.java
...le/zxa01/iotclient/common/pojo/privacy/p3p/Recipient.java
+96
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Remedy.java
...ample/zxa01/iotclient/common/pojo/privacy/p3p/Remedy.java
+64
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Retention.java
...le/zxa01/iotclient/common/pojo/privacy/p3p/Retention.java
+33
-0
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Statement.java
...le/zxa01/iotclient/common/pojo/privacy/p3p/Statement.java
+151
-0
app/src/main/java/com/example/zxa01/iotclient/component/privacy/PrivacyViewModel.java
...e/zxa01/iotclient/component/privacy/PrivacyViewModel.java
+114
-0
app/src/main/res/layout/recycler_view_setting.xml
app/src/main/res/layout/recycler_view_setting.xml
+42
-0
No files found.
app/src/main/java/com/example/zxa01/iotclient/common/pojo/auth/GatewayAuthResponse.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.auth
;
public
class
GatewayAuthResponse
{
private
String
sequence
;
private
String
encryptedData
;
private
String
gatewayId
;
private
String
publicKey
;
public
GatewayAuthResponse
()
{
}
public
String
getSequence
()
{
return
sequence
;
}
public
GatewayAuthResponse
setSequence
(
String
sequence
)
{
this
.
sequence
=
sequence
;
return
this
;
}
public
String
getEncryptedData
()
{
return
encryptedData
;
}
public
GatewayAuthResponse
setEncryptedData
(
String
encryptedData
)
{
this
.
encryptedData
=
encryptedData
;
return
this
;
}
public
String
getGatewayId
()
{
return
gatewayId
;
}
public
GatewayAuthResponse
setGatewayId
(
String
gatewayId
)
{
this
.
gatewayId
=
gatewayId
;
return
this
;
}
public
String
getPublicKey
()
{
return
publicKey
;
}
public
GatewayAuthResponse
setPublicKey
(
String
publicKey
)
{
this
.
publicKey
=
publicKey
;
return
this
;
}
@Override
public
String
toString
()
{
return
"GatewayAuthResponse{"
+
"sequence='"
+
sequence
+
'\''
+
", encryptedData='"
+
encryptedData
+
'\''
+
", gatewayId='"
+
gatewayId
+
'\''
+
", publicKey='"
+
publicKey
+
'\''
+
'}'
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/auth/User.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.auth
;
import
java.math.BigInteger
;
public
class
User
{
private
int
id
;
private
String
account
;
private
String
password
;
private
BigInteger
publicKey
;
private
BigInteger
privateKey
;
private
String
address
;
public
User
()
{
}
public
int
getId
()
{
return
id
;
}
public
User
setId
(
int
id
)
{
this
.
id
=
id
;
return
this
;
}
public
String
getAccount
()
{
return
account
;
}
public
User
setAccount
(
String
account
)
{
this
.
account
=
account
;
return
this
;
}
public
String
getPassword
()
{
return
password
;
}
public
User
setPassword
(
String
password
)
{
this
.
password
=
password
;
return
this
;
}
public
BigInteger
getPublicKey
()
{
return
publicKey
;
}
public
User
setPublicKey
(
BigInteger
publicKey
)
{
this
.
publicKey
=
publicKey
;
return
this
;
}
public
BigInteger
getPrivateKey
()
{
return
privateKey
;
}
public
User
setPrivateKey
(
BigInteger
privateKey
)
{
this
.
privateKey
=
privateKey
;
return
this
;
}
public
String
getAddress
()
{
return
address
;
}
public
User
setAddress
(
String
address
)
{
this
.
address
=
address
;
return
this
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
User
user
=
(
User
)
o
;
return
account
!=
null
?
account
.
equals
(
user
.
account
)
:
user
.
account
==
null
;
}
@Override
public
String
toString
()
{
return
"User{"
+
"id="
+
id
+
", account='"
+
account
+
'\''
+
", publicKey="
+
publicKey
+
", address='"
+
address
+
'\''
+
'}'
;
}
@Override
public
int
hashCode
()
{
return
account
!=
null
?
account
.
hashCode
()
:
0
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/device/Device.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.device
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
java.util.LinkedList
;
import
java.util.List
;
public
class
Device
implements
Parcelable
{
private
String
UDN
;
private
String
name
;
private
Type
type
;
private
Manufacturer
manufacturer
;
private
Model
model
;
private
String
UPC
;
private
String
location
;
private
List
<
Icon
>
icons
=
new
LinkedList
<>();
private
Status
status
;
public
enum
Status
{
Connected
,
Connecting
,
Disconnected
,
Disconnecting
}
public
Device
()
{
}
public
Device
(
Device
device
)
{
if
(
device
.
icons
!=
null
)
{
for
(
Icon
icon
:
device
.
icons
)
{
icons
.
add
(
new
Icon
(
icon
));
}
}
this
.
setUDN
(
device
.
UDN
)
.
setName
(
device
.
name
)
.
setType
(
device
.
type
)
.
setManufacturer
(
device
.
manufacturer
!=
null
?
new
Manufacturer
(
device
.
manufacturer
)
:
null
)
.
setModel
(
device
.
model
!=
null
?
new
Model
(
device
.
model
)
:
null
)
.
setUPC
(
device
.
UPC
)
.
setLocation
(
device
.
location
)
.
setStatus
(
device
.
status
);
}
private
Device
(
Parcel
in
)
{
UDN
=
in
.
readString
();
name
=
in
.
readString
();
type
=
Type
.
valueOf
(
in
.
readString
());
manufacturer
=
in
.
readParcelable
(
Manufacturer
.
class
.
getClassLoader
());
model
=
in
.
readParcelable
(
Model
.
class
.
getClassLoader
());
UPC
=
in
.
readString
();
location
=
in
.
readString
();
icons
=
in
.
createTypedArrayList
(
Icon
.
CREATOR
);
status
=
Status
.
valueOf
(
in
.
readString
());
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeString
(
UDN
);
dest
.
writeString
(
name
);
dest
.
writeString
(
type
.
name
());
dest
.
writeParcelable
(
manufacturer
,
flags
);
dest
.
writeParcelable
(
model
,
flags
);
dest
.
writeString
(
UPC
);
dest
.
writeString
(
location
);
dest
.
writeTypedList
(
icons
);
dest
.
writeString
(
status
.
name
());
}
@Override
public
int
describeContents
()
{
return
0
;
}
public
static
final
Creator
<
Device
>
CREATOR
=
new
Creator
<
Device
>()
{
@Override
public
Device
createFromParcel
(
Parcel
in
)
{
return
new
Device
(
in
);
}
@Override
public
Device
[]
newArray
(
int
size
)
{
return
new
Device
[
size
];
}
};
public
String
getUDN
()
{
return
UDN
;
}
public
Device
setUDN
(
String
UDN
)
{
this
.
UDN
=
UDN
;
return
this
;
}
public
Type
getType
()
{
return
type
;
}
public
Device
setType
(
Type
type
)
{
this
.
type
=
type
;
return
this
;
}
public
String
getName
()
{
return
name
;
}
public
Device
setName
(
String
name
)
{
this
.
name
=
name
;
return
this
;
}
public
Manufacturer
getManufacturer
()
{
return
manufacturer
;
}
public
Device
setManufacturer
(
Manufacturer
manufacturer
)
{
this
.
manufacturer
=
manufacturer
;
return
this
;
}
public
Model
getModel
()
{
return
model
;
}
public
Device
setModel
(
Model
model
)
{
this
.
model
=
model
;
return
this
;
}
public
String
getUPC
()
{
return
UPC
;
}
public
Device
setUPC
(
String
UPC
)
{
this
.
UPC
=
UPC
;
return
this
;
}
public
List
<
Icon
>
getIcons
()
{
return
icons
;
}
public
Device
setIcons
(
List
<
Icon
>
icons
)
{
this
.
icons
=
icons
;
return
this
;
}
public
Device
addIcon
(
Icon
icon
)
{
if
(
null
!=
this
.
icons
)
this
.
icons
.
add
(
icon
);
return
this
;
}
public
String
getLocation
()
{
return
location
;
}
public
Device
setLocation
(
String
location
)
{
this
.
location
=
location
;
return
this
;
}
public
Status
getStatus
()
{
return
status
;
}
public
Device
setStatus
(
Status
status
)
{
this
.
status
=
status
;
return
this
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Device
device
=
(
Device
)
o
;
return
UDN
!=
null
?
UDN
.
equals
(
device
.
UDN
)
:
device
.
UDN
==
null
;
}
@Override
public
int
hashCode
()
{
return
UDN
!=
null
?
UDN
.
hashCode
()
:
0
;
}
public
enum
Type
{
Sensor
,
Actuator
,
Mixed
,
Other
}
@Override
public
String
toString
()
{
return
"Device{"
+
"UDN='"
+
UDN
+
'\''
+
", name='"
+
name
+
'\''
+
", type="
+
type
+
", manufacturer="
+
manufacturer
+
", model="
+
model
+
", UPC='"
+
UPC
+
'\''
+
", location='"
+
location
+
'\''
+
", icons="
+
icons
+
", status="
+
status
+
'}'
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/device/Icon.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.device
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
java.util.Arrays
;
public
class
Icon
implements
Parcelable
{
private
byte
[]
bytes
;
public
Icon
()
{
}
public
Icon
(
Icon
icon
)
{
this
.
setBytes
(
icon
.
bytes
);
}
private
Icon
(
Parcel
in
)
{
bytes
=
in
.
createByteArray
();
}
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeByteArray
(
bytes
);
}
public
static
final
Creator
<
Icon
>
CREATOR
=
new
Creator
<
Icon
>()
{
@Override
public
Icon
createFromParcel
(
Parcel
in
)
{
return
new
Icon
(
in
);
}
@Override
public
Icon
[]
newArray
(
int
size
)
{
return
new
Icon
[
size
];
}
};
public
byte
[]
getBytes
()
{
return
bytes
;
}
public
Icon
setBytes
(
byte
[]
bytes
)
{
this
.
bytes
=
bytes
;
return
this
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Icon
icon
=
(
Icon
)
o
;
return
Arrays
.
equals
(
bytes
,
icon
.
bytes
);
}
@Override
public
int
hashCode
()
{
return
Arrays
.
hashCode
(
bytes
);
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/device/Manufacturer.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.device
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
public
class
Manufacturer
implements
Parcelable
,
Cloneable
{
private
long
id
;
private
String
name
;
private
String
url
;
private
String
serialNumber
;
public
Manufacturer
()
{
}
public
Manufacturer
(
Manufacturer
manufacturer
)
{
this
.
setId
(
manufacturer
.
id
)
.
setName
(
manufacturer
.
name
)
.
setSerialNumber
(
manufacturer
.
serialNumber
)
.
setUrl
(
manufacturer
.
url
);
}
private
Manufacturer
(
Parcel
in
)
{
id
=
in
.
readLong
();
name
=
in
.
readString
();
url
=
in
.
readString
();
serialNumber
=
in
.
readString
();
}
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeLong
(
id
);
dest
.
writeString
(
name
);
dest
.
writeString
(
url
);
dest
.
writeString
(
serialNumber
);
}
public
static
final
Creator
<
Manufacturer
>
CREATOR
=
new
Creator
<
Manufacturer
>()
{
@Override
public
Manufacturer
createFromParcel
(
Parcel
in
)
{
return
new
Manufacturer
(
in
);
}
@Override
public
Manufacturer
[]
newArray
(
int
size
)
{
return
new
Manufacturer
[
size
];
}
};
public
long
getId
()
{
return
id
;
}
public
Manufacturer
setId
(
long
id
)
{
this
.
id
=
id
;
return
this
;
}
public
String
getName
()
{
return
name
;
}
public
Manufacturer
setName
(
String
name
)
{
this
.
name
=
name
;
return
this
;
}
public
String
getUrl
()
{
return
url
;
}
public
Manufacturer
setUrl
(
String
url
)
{
this
.
url
=
url
;
return
this
;
}
public
String
getSerialNumber
()
{
return
serialNumber
;
}
public
Manufacturer
setSerialNumber
(
String
serialNumber
)
{
this
.
serialNumber
=
serialNumber
;
return
this
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Manufacturer
that
=
(
Manufacturer
)
o
;
if
(
id
!=
that
.
id
)
return
false
;
if
(
name
!=
null
?
!
name
.
equals
(
that
.
name
)
:
that
.
name
!=
null
)
return
false
;
if
(
url
!=
null
?
!
url
.
equals
(
that
.
url
)
:
that
.
url
!=
null
)
return
false
;
return
serialNumber
!=
null
?
serialNumber
.
equals
(
that
.
serialNumber
)
:
that
.
serialNumber
==
null
;
}
@Override
public
int
hashCode
()
{
int
result
=
(
int
)
(
id
^
(
id
>>>
32
));
result
=
31
*
result
+
(
name
!=
null
?
name
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
url
!=
null
?
url
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
serialNumber
!=
null
?
serialNumber
.
hashCode
()
:
0
);
return
result
;
}
@Override
public
String
toString
()
{
return
"Manufacturer{"
+
"id="
+
id
+
", name='"
+
name
+
'\''
+
", url='"
+
url
+
'\''
+
", serialNumber='"
+
serialNumber
+
'\''
+
'}'
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/device/Model.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.device
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
public
class
Model
implements
Parcelable
{
private
long
id
;
private
String
name
;
private
String
url
;
private
String
description
;
public
Model
()
{
}
public
Model
(
Model
model
)
{
this
.
setId
(
model
.
id
)
.
setName
(
model
.
name
)
.
setDescription
(
model
.
description
)
.
setUrl
(
model
.
url
);
}
private
Model
(
Parcel
in
)
{
id
=
in
.
readLong
();
name
=
in
.
readString
();
url
=
in
.
readString
();
description
=
in
.
readString
();
}
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeLong
(
id
);
dest
.
writeString
(
name
);
dest
.
writeString
(
url
);
dest
.
writeString
(
description
);
}
public
static
final
Creator
<
Model
>
CREATOR
=
new
Creator
<
Model
>()
{
@Override
public
Model
createFromParcel
(
Parcel
in
)
{
return
new
Model
(
in
);
}
@Override
public
Model
[]
newArray
(
int
size
)
{
return
new
Model
[
size
];
}
};
public
long
getId
()
{
return
id
;
}
public
Model
setId
(
long
id
)
{
this
.
id
=
id
;
return
this
;
}
public
String
getName
()
{
return
name
;
}
public
Model
setName
(
String
name
)
{
this
.
name
=
name
;
return
this
;
}
public
String
getUrl
()
{
return
url
;
}
public
Model
setUrl
(
String
url
)
{
this
.
url
=
url
;
return
this
;
}
public
String
getDescription
()
{
return
description
;
}
public
Model
setDescription
(
String
description
)
{
this
.
description
=
description
;
return
this
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Model
model
=
(
Model
)
o
;
if
(
id
!=
model
.
id
)
return
false
;
if
(
name
!=
null
?
!
name
.
equals
(
model
.
name
)
:
model
.
name
!=
null
)
return
false
;
if
(
url
!=
null
?
!
url
.
equals
(
model
.
url
)
:
model
.
url
!=
null
)
return
false
;
return
description
!=
null
?
description
.
equals
(
model
.
description
)
:
model
.
description
==
null
;
}
@Override
public
int
hashCode
()
{
int
result
=
(
int
)
(
id
^
(
id
>>>
32
));
result
=
31
*
result
+
(
name
!=
null
?
name
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
url
!=
null
?
url
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
return
result
;
}
@Override
public
String
toString
()
{
return
"Model{"
+
"id="
+
id
+
", name='"
+
name
+
'\''
+
", url='"
+
url
+
'\''
+
", description='"
+
description
+
'\''
+
'}'
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/PrivacyChoice.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy
;
public
class
PrivacyChoice
{
private
PrivacyContent
privacyContent
;
private
boolean
isAccepted
;
public
PrivacyChoice
()
{
}
public
PrivacyContent
getPrivacyContent
()
{
return
privacyContent
;
}
public
PrivacyChoice
setPrivacyContent
(
PrivacyContent
privacyContent
)
{
this
.
privacyContent
=
privacyContent
;
return
this
;
}
public
boolean
isAccepted
()
{
return
isAccepted
;
}
public
PrivacyChoice
setAccepted
(
boolean
accepted
)
{
isAccepted
=
accepted
;
return
this
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
PrivacyChoice
choice
=
(
PrivacyChoice
)
o
;
if
(
isAccepted
!=
choice
.
isAccepted
)
return
false
;
return
privacyContent
!=
null
?
privacyContent
.
equals
(
choice
.
privacyContent
)
:
choice
.
privacyContent
==
null
;
}
@Override
public
int
hashCode
()
{
int
result
=
privacyContent
!=
null
?
privacyContent
.
hashCode
()
:
0
;
result
=
31
*
result
+
(
isAccepted
?
1
:
0
);
return
result
;
}
@Override
public
String
toString
()
{
return
"PrivacyChoice{"
+
"privacyContent="
+
privacyContent
+
", isAccepted="
+
isAccepted
+
'}'
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/PrivacyContent.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy
;
import
com.example.zxa01.iotclient.common.pojo.auth.User
;
import
com.example.zxa01.iotclient.common.pojo.device.Device
;
import
java.util.Objects
;
public
class
PrivacyContent
{
private
User
user
;
private
Device
device
;
private
PrivacyPolicy
policy
;
public
PrivacyContent
()
{
}
public
User
getUser
()
{
return
user
;
}
public
PrivacyContent
setUser
(
User
user
)
{
this
.
user
=
user
;
return
this
;
}
public
Device
getDevice
()
{
return
device
;
}
public
PrivacyContent
setDevice
(
Device
device
)
{
this
.
device
=
device
;
return
this
;
}
public
PrivacyPolicy
getPolicy
()
{
return
policy
;
}
public
PrivacyContent
setPolicy
(
PrivacyPolicy
policy
)
{
this
.
policy
=
policy
;
return
this
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
PrivacyContent
that
=
(
PrivacyContent
)
o
;
return
Objects
.
equals
(
user
,
that
.
user
)
&&
Objects
.
equals
(
device
,
that
.
device
)
&&
Objects
.
equals
(
policy
,
that
.
policy
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
user
,
device
,
policy
);
}
@Override
public
String
toString
()
{
return
"PrivacyContent{"
+
"user="
+
user
+
", device="
+
device
+
", policy="
+
policy
+
'}'
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/PrivacyPolicy.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy
;
import
com.example.zxa01.iotclient.common.pojo.privacy.p3p.*
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
java.util.LinkedList
;
import
java.util.List
;
public
class
PrivacyPolicy
implements
Parcelable
{
private
String
id
;
private
String
description
;
private
Collector
collector
;
private
Dispute
dispute
;
private
Access
access
;
private
List
<
Remedy
>
remedies
=
new
LinkedList
<>();
private
List
<
Statement
>
statements
=
new
LinkedList
<>();
public
PrivacyPolicy
()
{
}
private
PrivacyPolicy
(
Parcel
in
)
{
id
=
in
.
readString
();
description
=
in
.
readString
();
collector
=
in
.
readParcelable
(
Collector
.
class
.
getClassLoader
());
dispute
=
in
.
readParcelable
(
Dispute
.
class
.
getClassLoader
());
access
=
in
.
readParcelable
(
Access
.
class
.
getClassLoader
());
remedies
=
in
.
createTypedArrayList
(
Remedy
.
CREATOR
);
statements
=
in
.
createTypedArrayList
(
Statement
.
CREATOR
);
}
public
static
final
Creator
<
PrivacyPolicy
>
CREATOR
=
new
Creator
<
PrivacyPolicy
>()
{
@Override
public
PrivacyPolicy
createFromParcel
(
Parcel
in
)
{
return
new
PrivacyPolicy
(
in
);
}
@Override
public
PrivacyPolicy
[]
newArray
(
int
size
)
{
return
new
PrivacyPolicy
[
size
];
}
};
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeString
(
id
);
dest
.
writeString
(
description
);
dest
.
writeParcelable
(
collector
,
flags
);
dest
.
writeParcelable
(
dispute
,
flags
);
dest
.
writeParcelable
(
access
,
flags
);
dest
.
writeTypedList
(
remedies
);
dest
.
writeTypedList
(
statements
);
}
public
String
getId
()
{
return
id
;
}
public
PrivacyPolicy
setId
(
String
id
)
{
this
.
id
=
id
;
return
this
;
}
public
String
getDescription
()
{
return
description
;
}
public
PrivacyPolicy
setDescription
(
String
description
)
{
this
.
description
=
description
;
return
this
;
}
public
Collector
getCollector
()
{
return
collector
;
}
public
PrivacyPolicy
setCollector
(
Collector
collector
)
{
this
.
collector
=
collector
;
return
this
;
}
public
Dispute
getDispute
()
{
return
dispute
;
}
public
PrivacyPolicy
setDispute
(
Dispute
dispute
)
{
this
.
dispute
=
dispute
;
return
this
;
}
public
Access
getAccess
()
{
return
access
;
}
public
PrivacyPolicy
setAccess
(
Access
access
)
{
this
.
access
=
access
;
return
this
;
}
public
List
<
Remedy
>
getRemedies
()
{
return
remedies
;
}
public
PrivacyPolicy
setRemedies
(
List
<
Remedy
>
remedies
)
{
this
.
remedies
=
remedies
;
return
this
;
}
public
PrivacyPolicy
addRemedy
(
Remedy
remedy
)
{
if
(
null
!=
this
.
remedies
)
this
.
remedies
.
add
(
remedy
);
return
this
;
}
public
List
<
Statement
>
getStatements
()
{
return
statements
;
}
public
PrivacyPolicy
setStatements
(
List
<
Statement
>
statements
)
{
this
.
statements
=
statements
;
return
this
;
}
public
PrivacyPolicy
addStatement
(
Statement
statement
)
{
if
(
null
!=
this
.
statements
)
this
.
statements
.
add
(
statement
);
return
this
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
PrivacyPolicy
that
=
(
PrivacyPolicy
)
o
;
return
id
!=
null
?
id
.
equals
(
that
.
id
)
:
that
.
id
==
null
;
}
@Override
public
int
hashCode
()
{
return
id
!=
null
?
id
.
hashCode
()
:
0
;
}
@Override
public
String
toString
()
{
return
"PrivacyPolicy{"
+
"id="
+
id
+
", description='"
+
description
+
'\''
+
", collector="
+
collector
+
", dispute="
+
dispute
+
", access="
+
access
+
", remedies="
+
remedies
+
", statements="
+
statements
+
'}'
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/PrivacyPolicyReport.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy
;
import
com.example.zxa01.iotclient.common.pojo.device.Device
;
import
java.util.LinkedList
;
import
java.util.List
;
public
class
PrivacyPolicyReport
{
private
String
id
;
private
String
version
;
private
String
description
;
private
Device
device
;
private
List
<
PrivacyPolicy
>
policies
=
new
LinkedList
<>();
public
String
getId
()
{
return
id
;
}
public
PrivacyPolicyReport
setId
(
String
id
)
{
this
.
id
=
id
;
return
this
;
}
public
String
getVersion
()
{
return
version
;
}
public
PrivacyPolicyReport
setVersion
(
String
version
)
{
this
.
version
=
version
;
return
this
;
}
public
String
getDescription
()
{
return
description
;
}
public
PrivacyPolicyReport
setDescription
(
String
description
)
{
this
.
description
=
description
;
return
this
;
}
public
Device
getDevice
()
{
return
device
;
}
public
PrivacyPolicyReport
setDevice
(
Device
device
)
{
this
.
device
=
device
;
return
this
;
}
public
List
<
PrivacyPolicy
>
getPolicies
()
{
return
policies
;
}
public
PrivacyPolicyReport
setPolicies
(
List
<
PrivacyPolicy
>
policies
)
{
this
.
policies
=
policies
;
return
this
;
}
public
PrivacyPolicyReport
addPrivacyPolicy
(
PrivacyPolicy
policy
)
{
if
(
null
!=
policies
)
this
.
policies
.
add
(
policy
);
return
this
;
}
@Override
public
String
toString
()
{
return
"PrivacyPolicyReport{"
+
"id='"
+
id
+
'\''
+
", version='"
+
version
+
'\''
+
", description='"
+
description
+
'\''
+
", device="
+
device
+
", policies="
+
policies
+
'}'
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Access.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy.p3p
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
public
enum
Access
implements
Parcelable
{
NON_IDENT
,
ALL
,
CONTACT_AND_OTHER
,
IDENT_CONTACT
,
OTHER_IDENT
,
NONE
;
Access
()
{
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeString
(
name
());
}
@Override
public
int
describeContents
()
{
return
0
;
}
public
static
final
Creator
<
Access
>
CREATOR
=
new
Creator
<
Access
>()
{
@Override
public
Access
createFromParcel
(
Parcel
in
)
{
return
Access
.
valueOf
(
in
.
readString
());
}
@Override
public
Access
[]
newArray
(
int
size
)
{
return
new
Access
[
size
];
}
};
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Collector.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy.p3p
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
public
class
Collector
implements
Parcelable
{
private
long
id
;
private
String
name
;
private
String
phone
;
private
String
email
;
public
Collector
()
{
}
protected
Collector
(
Parcel
in
)
{
id
=
in
.
readLong
();
name
=
in
.
readString
();
phone
=
in
.
readString
();
email
=
in
.
readString
();
}
public
static
final
Creator
<
Collector
>
CREATOR
=
new
Creator
<
Collector
>()
{
@Override
public
Collector
createFromParcel
(
Parcel
in
)
{
return
new
Collector
(
in
);
}
@Override
public
Collector
[]
newArray
(
int
size
)
{
return
new
Collector
[
size
];
}
};
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeLong
(
id
);
dest
.
writeString
(
name
);
dest
.
writeString
(
phone
);
dest
.
writeString
(
email
);
}
public
long
getId
()
{
return
id
;
}
public
Collector
setId
(
long
id
)
{
this
.
id
=
id
;
return
this
;
}
public
String
getName
()
{
return
name
;
}
public
Collector
setName
(
String
name
)
{
this
.
name
=
name
;
return
this
;
}
public
String
getPhone
()
{
return
phone
;
}
public
Collector
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
return
this
;
}
public
String
getEmail
()
{
return
email
;
}
public
Collector
setEmail
(
String
email
)
{
this
.
email
=
email
;
return
this
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Collector
collector
=
(
Collector
)
o
;
if
(
id
!=
collector
.
id
)
return
false
;
if
(
name
!=
null
?
!
name
.
equals
(
collector
.
name
)
:
collector
.
name
!=
null
)
return
false
;
if
(
phone
!=
null
?
!
phone
.
equals
(
collector
.
phone
)
:
collector
.
phone
!=
null
)
return
false
;
return
email
!=
null
?
email
.
equals
(
collector
.
email
)
:
collector
.
email
==
null
;
}
@Override
public
int
hashCode
()
{
int
result
=
(
int
)
(
id
^
(
id
>>>
32
));
result
=
31
*
result
+
(
name
!=
null
?
name
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
phone
!=
null
?
phone
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
email
!=
null
?
email
.
hashCode
()
:
0
);
return
result
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Datum.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy.p3p
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
public
class
Datum
implements
Parcelable
{
private
long
id
;
private
Type
type
;
private
String
description
;
public
Datum
()
{
}
private
Datum
(
Parcel
in
)
{
id
=
in
.
readLong
();
description
=
in
.
readString
();
type
=
Type
.
valueOf
(
in
.
readString
());
}
public
static
final
Creator
<
Datum
>
CREATOR
=
new
Creator
<
Datum
>()
{
@Override
public
Datum
createFromParcel
(
Parcel
in
)
{
return
new
Datum
(
in
);
}
@Override
public
Datum
[]
newArray
(
int
size
)
{
return
new
Datum
[
size
];
}
};
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeLong
(
id
);
dest
.
writeString
(
description
);
dest
.
writeString
(
type
.
name
());
}
public
long
getId
()
{
return
id
;
}
public
Datum
setId
(
long
id
)
{
this
.
id
=
id
;
return
this
;
}
public
Type
getType
()
{
return
type
;
}
public
Datum
setType
(
Type
type
)
{
this
.
type
=
type
;
return
this
;
}
public
String
getDescription
()
{
return
description
;
}
public
Datum
setDescription
(
String
description
)
{
this
.
description
=
description
;
return
this
;
}
public
enum
Type
{
PHYSICAL
,
ONLINE
,
UNIQUEID
,
PURCHASE
,
FINANCIAL
,
COMPUTER
,
NAVIGATION
,
INTERACTIVE
,
DEMOGRAPHIC
,
CONTENT
,
STATE
,
POLITICAL
,
HEALTH
,
PREFERENCE
,
LOCATION
,
GOVERNMENT
,
OTHER_CATEGORY
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Datum
datum
=
(
Datum
)
o
;
if
(
id
!=
datum
.
id
)
return
false
;
if
(
type
!=
datum
.
type
)
return
false
;
return
description
!=
null
?
description
.
equals
(
datum
.
description
)
:
datum
.
description
==
null
;
}
@Override
public
int
hashCode
()
{
int
result
=
(
int
)
(
id
^
(
id
>>>
32
));
result
=
31
*
result
+
(
type
!=
null
?
type
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
return
result
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Dispute.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy.p3p
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
public
class
Dispute
implements
Parcelable
{
private
long
id
;
private
String
relatedOrganization
;
private
Type
type
;
public
Dispute
()
{
}
protected
Dispute
(
Parcel
in
)
{
id
=
in
.
readLong
();
relatedOrganization
=
in
.
readString
();
type
=
Type
.
valueOf
(
in
.
readString
());
}
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeLong
(
id
);
dest
.
writeString
(
relatedOrganization
);
dest
.
writeString
(
type
.
name
());
}
public
static
final
Creator
<
Dispute
>
CREATOR
=
new
Creator
<
Dispute
>()
{
@Override
public
Dispute
createFromParcel
(
Parcel
in
)
{
return
new
Dispute
(
in
);
}
@Override
public
Dispute
[]
newArray
(
int
size
)
{
return
new
Dispute
[
size
];
}
};
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
String
getRelatedOrganization
()
{
return
relatedOrganization
;
}
public
Dispute
setRelatedOrganization
(
String
relatedOrganization
)
{
this
.
relatedOrganization
=
relatedOrganization
;
return
this
;
}
public
Type
getType
()
{
return
type
;
}
public
Dispute
setType
(
Type
type
)
{
this
.
type
=
type
;
return
this
;
}
public
enum
Type
{
SERVICE
,
INDEPENDENT
,
COURT
,
LAW
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Dispute
dispute
=
(
Dispute
)
o
;
if
(
id
!=
dispute
.
id
)
return
false
;
if
(
relatedOrganization
!=
null
?
!
relatedOrganization
.
equals
(
dispute
.
relatedOrganization
)
:
dispute
.
relatedOrganization
!=
null
)
return
false
;
return
type
==
dispute
.
type
;
}
@Override
public
int
hashCode
()
{
int
result
=
(
int
)
(
id
^
(
id
>>>
32
));
result
=
31
*
result
+
(
relatedOrganization
!=
null
?
relatedOrganization
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
type
!=
null
?
type
.
hashCode
()
:
0
);
return
result
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Purpose.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy.p3p
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
public
class
Purpose
implements
Parcelable
{
private
long
id
;
private
Type
type
;
private
String
description
;
public
Purpose
()
{
}
protected
Purpose
(
Parcel
in
)
{
id
=
in
.
readLong
();
description
=
in
.
readString
();
type
=
Type
.
valueOf
(
in
.
readString
());
}
public
static
final
Creator
<
Purpose
>
CREATOR
=
new
Creator
<
Purpose
>()
{
@Override
public
Purpose
createFromParcel
(
Parcel
in
)
{
return
new
Purpose
(
in
);
}
@Override
public
Purpose
[]
newArray
(
int
size
)
{
return
new
Purpose
[
size
];
}
};
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeLong
(
id
);
dest
.
writeString
(
description
);
dest
.
writeString
(
type
.
name
());
}
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
Type
getType
()
{
return
type
;
}
public
Purpose
setType
(
Type
type
)
{
this
.
type
=
type
;
return
this
;
}
public
String
getDescription
()
{
return
description
;
}
public
Purpose
setDescription
(
String
description
)
{
this
.
description
=
description
;
return
this
;
}
public
enum
Type
{
CURRENT
,
ADMIN
,
DEVELOP
,
TAILORING
,
PSEUDO_ANALYSIS
,
PSEUDO_DECISION
,
INDIVIDUAL_ANALYSIS
,
INDIVIDUAL_DECISION
,
CONTACT
,
HISTORICAL
,
TELEMARKETING
,
OTHER_PURPOSE
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Purpose
purpose
=
(
Purpose
)
o
;
if
(
id
!=
purpose
.
id
)
return
false
;
if
(
type
!=
purpose
.
type
)
return
false
;
return
description
!=
null
?
description
.
equals
(
purpose
.
description
)
:
purpose
.
description
==
null
;
}
@Override
public
int
hashCode
()
{
int
result
=
(
int
)
(
id
^
(
id
>>>
32
));
result
=
31
*
result
+
(
type
!=
null
?
type
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
return
result
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Recipient.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy.p3p
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
public
class
Recipient
implements
Parcelable
{
private
long
id
;
private
String
entity
;
private
Type
type
;
public
Recipient
()
{
}
private
Recipient
(
Parcel
in
)
{
id
=
in
.
readLong
();
entity
=
in
.
readString
();
type
=
Type
.
valueOf
(
in
.
readString
());
}
public
static
final
Creator
<
Recipient
>
CREATOR
=
new
Creator
<
Recipient
>()
{
@Override
public
Recipient
createFromParcel
(
Parcel
in
)
{
return
new
Recipient
(
in
);
}
@Override
public
Recipient
[]
newArray
(
int
size
)
{
return
new
Recipient
[
size
];
}
};
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeLong
(
id
);
dest
.
writeString
(
entity
);
dest
.
writeString
(
type
.
name
());
}
public
long
getId
()
{
return
id
;
}
public
Recipient
setId
(
long
id
)
{
this
.
id
=
id
;
return
this
;
}
public
Type
getType
()
{
return
type
;
}
public
Recipient
setType
(
Type
type
)
{
this
.
type
=
type
;
return
this
;
}
public
String
getEntity
()
{
return
entity
;
}
public
Recipient
setEntity
(
String
entity
)
{
this
.
entity
=
entity
;
return
this
;
}
public
enum
Type
{
OURS
,
DELIVERY
,
SAME
,
UNRELATED
,
PUBLIC
,
OTHER_RECIPIENT
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Recipient
recipient
=
(
Recipient
)
o
;
if
(
id
!=
recipient
.
id
)
return
false
;
if
(
type
!=
recipient
.
type
)
return
false
;
return
entity
!=
null
?
entity
.
equals
(
recipient
.
entity
)
:
recipient
.
entity
==
null
;
}
@Override
public
int
hashCode
()
{
int
result
=
(
int
)
(
id
^
(
id
>>>
32
));
result
=
31
*
result
+
(
type
!=
null
?
type
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
entity
!=
null
?
entity
.
hashCode
()
:
0
);
return
result
;
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Remedy.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy.p3p
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
public
class
Remedy
implements
Parcelable
{
private
long
id
;
private
Type
type
;
public
Remedy
()
{
}
private
Remedy
(
Parcel
in
)
{
id
=
in
.
readLong
();
type
=
Type
.
valueOf
(
in
.
readString
());
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeLong
(
id
);
dest
.
writeString
(
type
.
name
());
}
@Override
public
int
describeContents
()
{
return
0
;
}
public
static
final
Creator
<
Remedy
>
CREATOR
=
new
Creator
<
Remedy
>()
{
@Override
public
Remedy
createFromParcel
(
Parcel
in
)
{
return
new
Remedy
(
in
);
}
@Override
public
Remedy
[]
newArray
(
int
size
)
{
return
new
Remedy
[
size
];
}
};
public
long
getId
()
{
return
id
;
}
public
Remedy
setId
(
long
id
)
{
this
.
id
=
id
;
return
this
;
}
public
Type
getType
()
{
return
type
;
}
public
Remedy
setType
(
Type
type
)
{
this
.
type
=
type
;
return
this
;
}
public
enum
Type
{
CORRECT
,
MONEY
,
LAW
}
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Retention.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy.p3p
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
public
enum
Retention
implements
Parcelable
{
NO_RETENTION
,
STATED_PURPOSE
,
LEGAL_REQUIREMENT
,
INDEFINITELY
,
BUSINESS_PRACTICES
;
Retention
()
{
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeString
(
name
());
}
@Override
public
int
describeContents
()
{
return
0
;
}
public
static
final
Creator
<
Retention
>
CREATOR
=
new
Creator
<
Retention
>()
{
@Override
public
Retention
createFromParcel
(
Parcel
in
)
{
return
Retention
.
valueOf
(
in
.
readString
());
}
@Override
public
Retention
[]
newArray
(
int
size
)
{
return
new
Retention
[
size
];
}
};
}
app/src/main/java/com/example/zxa01/iotclient/common/pojo/privacy/p3p/Statement.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.common.pojo.privacy.p3p
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
java.util.LinkedList
;
import
java.util.List
;
public
class
Statement
implements
Parcelable
{
private
long
id
;
private
String
consequence
;
private
List
<
Purpose
>
purposes
=
new
LinkedList
<>();
private
List
<
Datum
>
data
=
new
LinkedList
<>();
private
List
<
Recipient
>
recipients
=
new
LinkedList
<>();
private
Retention
retention
;
public
Statement
()
{
}
private
Statement
(
Parcel
in
)
{
id
=
in
.
readLong
();
consequence
=
in
.
readString
();
purposes
=
in
.
createTypedArrayList
(
Purpose
.
CREATOR
);
data
=
in
.
createTypedArrayList
(
Datum
.
CREATOR
);
recipients
=
in
.
createTypedArrayList
(
Recipient
.
CREATOR
);
retention
=
in
.
readParcelable
(
Retention
.
class
.
getClassLoader
());
}
public
static
final
Creator
<
Statement
>
CREATOR
=
new
Creator
<
Statement
>()
{
@Override
public
Statement
createFromParcel
(
Parcel
in
)
{
return
new
Statement
(
in
);
}
@Override
public
Statement
[]
newArray
(
int
size
)
{
return
new
Statement
[
size
];
}
};
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeLong
(
id
);
dest
.
writeString
(
consequence
);
dest
.
writeTypedList
(
purposes
);
dest
.
writeTypedList
(
data
);
dest
.
writeTypedList
(
recipients
);
dest
.
writeParcelable
(
retention
,
flags
);
}
public
long
getId
()
{
return
id
;
}
public
Statement
setId
(
long
id
)
{
this
.
id
=
id
;
return
this
;
}
public
String
getConsequence
()
{
return
consequence
;
}
public
Statement
setConsequence
(
String
consequence
)
{
this
.
consequence
=
consequence
;
return
this
;
}
public
List
<
Purpose
>
getPurposes
()
{
return
purposes
;
}
public
Statement
setPurposes
(
List
<
Purpose
>
purposes
)
{
this
.
purposes
=
purposes
;
return
this
;
}
public
Statement
addPurpose
(
Purpose
purpose
)
{
if
(
null
!=
this
.
purposes
)
this
.
purposes
.
add
(
purpose
);
return
this
;
}
public
List
<
Datum
>
getData
()
{
return
data
;
}
public
Statement
setData
(
List
<
Datum
>
data
)
{
this
.
data
=
data
;
return
this
;
}
public
Statement
addDatum
(
Datum
datum
)
{
if
(
null
!=
this
.
data
)
this
.
data
.
add
(
datum
);
return
this
;
}
public
List
<
Recipient
>
getRecipients
()
{
return
recipients
;
}
public
Statement
setRecipients
(
List
<
Recipient
>
recipients
)
{
this
.
recipients
=
recipients
;
return
this
;
}
public
Statement
addRecipient
(
Recipient
recipient
)
{
if
(
null
!=
this
.
recipients
)
this
.
recipients
.
add
(
recipient
);
return
this
;
}
public
Retention
getRetention
()
{
return
retention
;
}
public
Statement
setRetention
(
Retention
retention
)
{
this
.
retention
=
retention
;
return
this
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
Statement
statement
=
(
Statement
)
o
;
if
(
consequence
!=
null
?
!
consequence
.
equals
(
statement
.
consequence
)
:
statement
.
consequence
!=
null
)
return
false
;
if
(
purposes
!=
null
?
!
purposes
.
equals
(
statement
.
purposes
)
:
statement
.
purposes
!=
null
)
return
false
;
if
(
data
!=
null
?
!
data
.
equals
(
statement
.
data
)
:
statement
.
data
!=
null
)
return
false
;
if
(
recipients
!=
null
?
!
recipients
.
equals
(
statement
.
recipients
)
:
statement
.
recipients
!=
null
)
return
false
;
return
retention
==
statement
.
retention
;
}
@Override
public
int
hashCode
()
{
int
result
=
consequence
!=
null
?
consequence
.
hashCode
()
:
0
;
result
=
31
*
result
+
(
purposes
!=
null
?
purposes
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
data
!=
null
?
data
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
recipients
!=
null
?
recipients
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
retention
!=
null
?
retention
.
hashCode
()
:
0
);
return
result
;
}
}
app/src/main/java/com/example/zxa01/iotclient/component/privacy/PrivacyViewModel.java
0 → 100644
View file @
f6b9b6b9
package
com.example.zxa01.iotclient.component.privacy
;
import
com.example.zxa01.iotclient.R
;
import
com.example.zxa01.iotclient.common.pojo.privacy.PrivacyPolicy
;
import
com.example.zxa01.iotclient.common.pojo.privacy.PrivacyPolicyReport
;
import
android.arch.lifecycle.MutableLiveData
;
import
android.arch.lifecycle.ViewModel
;
import
android.content.Context
;
import
android.databinding.ObservableBoolean
;
import
android.databinding.ObservableField
;
import
android.support.v7.app.AlertDialog
;
import
android.view.View
;
import
android.widget.Switch
;
import
java.util.List
;
public
class
PrivacyViewModel
extends
ViewModel
{
public
ObservableBoolean
isLoading
=
new
ObservableBoolean
(
true
);
public
ObservableBoolean
isUpload
=
new
ObservableBoolean
(
true
);
public
ObservableField
<
PrivacyPolicyReport
>
privacyPolicyReport
=
new
ObservableField
<>(
new
PrivacyPolicyReport
());
private
PrivacyModel
privacyModel
=
new
PrivacyModel
();
private
PrivacyAdapter
adapter
=
new
PrivacyAdapter
(
R
.
layout
.
recycler_view_privacy
,
this
);
private
Context
context
;
private
AlertDialog
dialog
;
public
PrivacyViewModel
(
Context
context
)
{
this
.
context
=
context
;
this
.
drawDialog
();
}
/**
* model
*/
public
void
fetchPrivacyPolicyReport
()
{
privacyModel
.
fetchPrivacyPolicyReport
();
}
public
MutableLiveData
<
PrivacyPolicyReport
>
observePrivacyPolicyReportMLD
()
{
return
privacyModel
.
getPrivacyPolicyReportMLD
();
}
public
void
setPrivacyPolicyReport
(
PrivacyPolicyReport
privacyPolicyReport
)
{
if
(
privacyPolicyReport
.
getId
()
!=
null
)
{
this
.
isLoading
.
set
(
false
);
this
.
privacyPolicyReport
.
set
(
privacyPolicyReport
);
this
.
setAdapter
(
privacyPolicyReport
.
getPolicies
());
}
}
public
void
updateP3P
()
{
// TODO accpet privacy
}
/**
* child model
*/
public
PrivacyPolicy
getPrivacyAt
(
Integer
index
)
{
if
(
privacyModel
.
getPrivacyPolicyReportMLD
().
getValue
()
!=
null
&&
index
!=
null
&&
privacyModel
.
getPrivacyPolicyReportMLD
().
getValue
().
getPolicies
().
size
()
>
index
)
{
return
privacyModel
.
getPrivacyPolicyReportMLD
().
getValue
().
getPolicies
().
get
(
index
);
}
return
null
;
}
public
void
onChangeClick
(
Integer
index
,
View
view
)
{
if
(
privacyModel
.
getPrivacyPolicyReportMLD
().
getValue
()
!=
null
&&
index
!=
null
&&
privacyModel
.
getPrivacyPolicyReportMLD
().
getValue
().
getPolicies
().
size
()
>
index
)
{
// TODO change pp
privacyModel
.
updatePrivacyPolicyChoice
(
privacyModel
.
getPrivacyPolicyReportMLD
().
getValue
().
getPolicies
().
get
(
index
).
getId
(),
((
Switch
)
view
).
isChecked
());
}
}
public
MutableLiveData
<
Boolean
>
observeIsLoadingMLD
()
{
return
privacyModel
.
getIsUploadMLD
();
}
public
void
setIsUpload
(
Boolean
isUpload
)
{
this
.
isUpload
.
set
(
isUpload
);
if
(
isUpload
)
{
dialog
.
show
();
}
else
{
dialog
.
hide
();
}
}
private
void
drawDialog
()
{
dialog
=
new
AlertDialog
.
Builder
(
context
)
.
setMessage
(
R
.
string
.
privacy_loading_message
)
.
setTitle
(
R
.
string
.
privacy_loading_title
)
.
create
();
}
/**
* adapter
*/
public
PrivacyAdapter
getAdapter
()
{
return
adapter
;
}
public
void
setAdapter
(
List
<
PrivacyPolicy
>
privacyPolicies
)
{
adapter
.
setPrivacyPolicyList
(
privacyPolicies
);
adapter
.
notifyDataSetChanged
();
}
}
app/src/main/res/layout/recycler_view_setting.xml
0 → 100644
View file @
f6b9b6b9
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
>
<data>
<variable
name=
"position"
type=
"java.lang.Integer"
/>
<variable
name=
"viewModel"
type=
"com.example.zxa01.iotclient.component.home.setting.SettingViewModel"
/>
</data>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/border_bottom"
android:onClick=
"@{()->viewModel.onSettingClick(position)}"
android:orientation=
"vertical"
android:padding=
"@dimen/margin"
>
<TextView
android:id=
"@+id/text_setting_key"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
'@{viewModel.getSettingAt(position).key}'
android:textColor=
"@color/colorLight"
android:textSize=
"18sp"
android:textStyle=
"bold"
tools:text=
"@tools:sample/lorem"
/>
<TextView
android:id=
"@+id/text_setting_value"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
'@{viewModel.getSettingAt(position).value}'
tools:text=
"@tools:sample/lorem"
/>
</LinearLayout>
</layout>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment