Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
android_packages_apps_Updater
Commits
ed9b55bf
Commit
ed9b55bf
authored
Apr 13, 2022
by
Alexandre Roux
Browse files
Merge branch 'v1-q-186-display-preversion-when-available' into 'v1-q'
display preversion when available See merge request
!63
parents
7c632baf
f3a79b80
Changes
5
Hide whitespace changes
Inline
Side-by-side
AndroidManifest.xml
View file @
ed9b55bf
...
...
@@ -28,7 +28,7 @@ to be updated. This will be fixed later
android:requestLegacyExternalStorage=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
android:usesCleartextTraffic=
"
fals
e"
>
android:usesCleartextTraffic=
"
tru
e"
>
<activity
android:name=
".UpdatesActivity"
...
...
src/org/lineageos/updater/UpdatesListAdapter.java
View file @
ed9b55bf
...
...
@@ -269,7 +269,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
String
buildDate
=
StringGenerator
.
getDateLocalizedUTC
(
mActivity
,
DateFormat
.
LONG
,
update
.
getTimestamp
());
String
buildVersion
=
mActivity
.
getString
(
R
.
string
.
list_build_version
,
update
.
getVersion
());
update
.
getVersion
()
+
(!
update
.
getPreversion
().
isEmpty
()
?
"-"
+
update
.
getPreversion
()
:
""
)
);
if
(!
update
.
getAndroidVersion
().
equals
(
Build
.
VERSION
.
RELEASE
)){
viewHolder
.
mUpgradeType
.
setVisibility
(
TextView
.
VISIBLE
);
...
...
@@ -472,7 +472,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
String
buildDate
=
StringGenerator
.
getDateLocalizedUTC
(
mActivity
,
DateFormat
.
MEDIUM
,
update
.
getTimestamp
());
String
buildInfoText
=
mActivity
.
getString
(
R
.
string
.
list_build_version_date
,
update
.
getVersion
(),
buildDate
);
update
.
getVersion
()
+
(!
update
.
getPreversion
().
isEmpty
()
?
"-"
+
update
.
getPreversion
()
:
""
)
,
buildDate
);
if
(
update
.
getAndroidVersion
().
equals
(
Build
.
VERSION
.
RELEASE
)){
title
=
R
.
string
.
apply_update_dialog_title
;
...
...
src/org/lineageos/updater/misc/Utils.java
View file @
ed9b55bf
...
...
@@ -97,6 +97,11 @@ public class Utils {
update
.
setFileSize
(
object
.
getLong
(
"size"
));
update
.
setDownloadUrl
(
object
.
getString
(
"url"
));
update
.
setVersion
(
object
.
getString
(
"version"
));
if
(
object
.
has
(
"pre_version"
))
{
update
.
setPreversion
(
object
.
getString
(
"pre_version"
));
}
else
{
update
.
setPreversion
(
""
);
}
update
.
setDisplayVersion
(
object
.
getString
(
"display_version"
));
update
.
setAndroidVersion
(
object
.
getString
(
"android_version"
));
return
update
;
...
...
src/org/lineageos/updater/model/UpdateBase.java
View file @
ed9b55bf
...
...
@@ -23,6 +23,7 @@ public class UpdateBase implements UpdateBaseInfo {
private
long
mTimestamp
;
private
String
mType
;
private
String
mVersion
;
private
String
mPreversion
;
private
String
mAndroidVersion
;
private
String
mDisplayVersion
;
private
long
mFileSize
;
...
...
@@ -37,6 +38,7 @@ public class UpdateBase implements UpdateBaseInfo {
mTimestamp
=
update
.
getTimestamp
();
mType
=
update
.
getType
();
mVersion
=
update
.
getVersion
();
mPreversion
=
update
.
getPreversion
();
mDisplayVersion
=
update
.
getDisplayVersion
();
mAndroidVersion
=
update
.
getAndroidVersion
();
mFileSize
=
update
.
getFileSize
();
...
...
@@ -87,6 +89,15 @@ public class UpdateBase implements UpdateBaseInfo {
mVersion
=
version
;
}
@Override
public
String
getPreversion
()
{
return
mPreversion
;
}
public
void
setPreversion
(
String
preversion
)
{
mPreversion
=
preversion
;
}
@Override
public
String
getDisplayVersion
()
{
return
mDisplayVersion
;
...
...
src/org/lineageos/updater/model/UpdateBaseInfo.java
View file @
ed9b55bf
...
...
@@ -26,6 +26,8 @@ public interface UpdateBaseInfo {
String
getVersion
();
String
getPreversion
();
String
getDisplayVersion
();
String
getAndroidVersion
();
...
...
Write
Preview
Supports
Markdown
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